ROS Explorer: File Index

  • Main Page
  • Namespaces
  • Classes
  • Files
  • Directories
  • Related Pages
  • File List
  • File Members

ROS Explorer File List

Here is a list of all files with brief descriptions:
desktop.cpp [code]
desktop.h [code]
desktopbar.cpp [code]
desktopbar.h [code]
dragdropimpl.cpp [code]
dragdropimpl.h [code]
entries.cpp [code]
entries.h [code]
explorer.cpp [code]
explorer.h [code]
externals.h [code]
fatfs.cpp [code]
fatfs.h [code]
favorites.cpp [code]
favorites.h [code]
filechild.cpp [code]
filechild.h [code]
globals.h [code]
i386-stub-win32.c [code]
mainframe.cpp [code]
mainframe.h [code]
ntobjfs.cpp [code]
ntobjfs.h [code]
pane.cpp [code]
pane.h [code]
precomp.cpp [code]
precomp.h [code]
quicklaunch.cpp [code]
quicklaunch.h [code]
regfs.cpp [code]
regfs.h [code]
resource.h [code]
searchprogram.cpp [code]
searchprogram.h [code]
settings.cpp [code]
settings.h [code]
shellbrowser.cpp [code]
shellbrowser.h [code]
shellbrowserimpl.cpp [code]
shellbrowserimpl.h [code]
shellclasses.cpp [code]
shellclasses.h [code]
shellfs.cpp [code]
shellfs.h [code]
shelltests.cpp [code]
splitpath.c [code]
startmenu.cpp [code]
startmenu.h [code]
taskbar.cpp [code]
taskbar.h [code]
traynotify.cpp [code]
traynotify.h [code]
treedroptarget.h [code]
unixfs.cpp [code]
unixfs.h [code]
utility.cpp [code]
utility.h [code]
webchild.cpp [code]
webchild.h [code]
window.cpp [code]
window.h [code]
winfs.cpp [code]
winfs.h [code]
xmlstorage.cpp [code]
xmlstorage.h [code]
ROS Explorer Source Code Documentation
generated on 21.11.2004 by doxygen

ROS Explorer Homepage


ROS Explorer: desktop.cpp File Reference

  • Files
  • Directories
  • Related Pages
  • File List
  • File Members
desktop

desktop.cpp File Reference

#include <precomp.h>
#include "../resource.h"
#include "../taskbar/desktopbar.h"
#include "../taskbar/taskbar.h"

Include dependency graph for desktop.cpp:

Go to the source code of this file.

Defines

#define | ARRANGE_BORDER_DOWN 8
#define | ARRANGE_BORDER_HV 9
#define | ARRANGE_ROUNDABOUT 10

Typedefs

typedef pair< int, int > | IconPos
typedef map< IconPos, int > | IconMap

Functions

BOOL | IsAnyDesktopRunning ()

Variables

static | HWND

Define Documentation

#define ARRANGE_BORDER_DOWN 8

Definition at line 657 of file desktop.cpp.

Referenced by DesktopShellView::PositionIcons().

#define ARRANGE_BORDER_HV 9

Definition at line 658 of file desktop.cpp.

Referenced by DesktopShellView::PositionIcons().

#define ARRANGE_ROUNDABOUT 10

Definition at line 659 of file desktop.cpp.

Referenced by DesktopShellView::PositionIcons().

Typedef Documentation

typedef map<IconPos, int> IconMap

Definition at line 707 of file desktop.cpp.

typedef pair<int,int> IconPos

Definition at line 706 of file desktop.cpp.

Function Documentation

BOOL IsAnyDesktopRunning ( )

Definition at line 246 of file desktop.cpp.

References HWND.

Referenced by _tWinMain().

00247 {
00248         HINSTANCE hUser32 = GetModuleHandle(TEXT("user32"));
00249
00250         SetShellWindow = (BOOL(WINAPI*)(HWND)) GetProcAddress(hUser32, "SetShellWindow");
00251         SetShellWindowEx = (BOOL(WINAPI*)(HWND,HWND)) GetProcAddress(hUser32, "SetShellWindowEx");
00252
00253         return GetShellWindow() != 0;
00254 }

Variable Documentation

HWND

Definition at line 38 of file desktop.cpp.

Referenced by _tWinMain(), MDIMainFrame::activate_child_window(), MDIMainFrame::activate_drive_window(), TaskBar::ActivateApp(), CenterWindow(), FavoritesMenu::Command(), MDIMainFrame::Command(), QuickLaunchBar::Create(), SDIMainFrame::Create(), MDIMainFrame::Create(), MainFrameBase::Create(), DesktopWindow::Create(), Pane::create_header(), Window::create_mdi_child(), PropertySheetDialog::DoModal(), TaskBar::EnumWndProc(), ExplorerAboutDlg::ExplorerAboutDlg(), Pane::get_frame(), ShellBrowser::GetControlWindow(), PropertySheetDialog::GetCurrentPage(), MDIMainFrame::go_to(), ResizeManager::HandleSize(), DesktopBar::Init(), DesktopWindow::Init(), IsAnyDesktopRunning(), main(), Window::MDICBTHookProc(), MainFrameBase::OpenShellFolders(), Window::PostParent(), MainFrameBase::ProcessMessage(), Window::PropSheetCBTHookProc(), QuickLaunchBar::QuickLaunchBar(), StartMenu::ResizeButtons(), ShellBrowser::SendControlMsg(), Window::SendParent(), SpecialFolderFSPath::SpecialFolderFSPath(), Desktops::SwitchToDesktop(), StartMenuRoot::TrackStartmenu(), OwnerDrawParent< Dialog >::WndProc(), CtlColorParent< OwnerDrawParent< Dialog > >::WndProc(), FlatButton::WndProc(), TaskBar::WndProc(), and StartButton::WndProc().


ROS Explorer: desktop.cpp Source File

  • File List
  • File Members
desktop

desktop.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // desktop.cpp
00024  //
00025  // Martin Fuchs, 09.08.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "../resource.h"
00032
00033 #include "../taskbar/desktopbar.h"
00034 #include "../taskbar/taskbar.h" // for PM_GET_LAST_ACTIVE
00035
00036
00037 static BOOL (WINAPI*SetShellWindow)(HWND);
00038 static BOOL (WINAPI*SetShellWindowEx)(HWND, HWND);
00039
00040
00041 #ifdef _USE_HDESK
00042
00043 Desktop::Desktop(HDESK hdesktop/*, HWINSTA hwinsta*/)
00044  :      _hdesktop(hdesktop)
00045 //      _hwinsta(hwinsta)
00046 {
00047 }
00048
00049 Desktop::~Desktop()
00050 {
00051         if (_hdesktop)
00052                 CloseDesktop(_hdesktop);
00053
00054 //      if (_hwinsta)
00055 //              CloseWindowStation(_hwinsta);
00056
00057         if (_pThread.get()) {
00058                 _pThread->Stop();
00059                 _pThread.release();
00060         }
00061 }
00062
00063 #endif
00064
00065
00066 Desktops::Desktops()
00067  :      _current_desktop(0)
00068 {
00069 }
00070
00071 Desktops::~Desktops()
00072 {
00073          // show all hidden windows
00074         for(iterator it_dsk=begin(); it_dsk!=end(); ++it_dsk)
00075                 for(WindowSet::iterator it=it_dsk->_windows.begin(); it!=it_dsk->_windows.end(); ++it)
00076                         ShowWindowAsync(*it, SW_SHOW);
00077 }
00078
00079 void Desktops::init()
00080 {
00081         resize(DESKTOP_COUNT);
00082
00083 #ifdef _USE_HDESK
00084         DesktopPtr& desktop = (*this)[0];
00085
00086         desktop = DesktopPtr(new Desktop(OpenInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP)));
00087 #endif
00088 }
00089
00090 #ifdef _USE_HDESK
00091
00092 void Desktops::SwitchToDesktop(int idx)
00093 {
00094         if (_current_desktop == idx)
00095                 return;
00096
00097         DesktopPtr& desktop = (*this)[idx];
00098
00099         DesktopThread* pThread = NULL;
00100
00101         if (desktop.get()) {
00102                 if (desktop->_hdesktop)
00103                         if (!SwitchDesktop(desktop->_hdesktop))
00104                                 return;
00105         } else {
00106                 FmtString desktop_name(TEXT("Desktop %d"), idx);
00107
00108                 SECURITY_ATTRIBUTES saAttr = {sizeof(SECURITY_ATTRIBUTES), 0, TRUE};
00109 /*
00110                 HWINSTA hwinsta = CreateWindowStation(TEXT("ExplorerWinStation"), 0, GENERIC_ALL, &saAttr);
00111
00112                 if (!SetProcessWindowStation(hwinsta))
00113                         return;
00114 */
00115                 HDESK hdesktop = CreateDesktop(desktop_name, NULL, NULL, 0, GENERIC_ALL, &saAttr);
00116                 if (!hdesktop)
00117                         return;
00118
00119                 desktop = DesktopPtr(new Desktop(hdesktop/*, hwinsta*/));
00120
00121                 pThread = new DesktopThread(*desktop);
00122         }
00123
00124         _current_desktop = idx;
00125
00126         if (pThread) {
00127                 desktop->_pThread = DesktopThreadPtr(pThread);
00128                 pThread->Start();
00129         }
00130 }
00131
00132 int DesktopThread::Run()
00133 {
00134         if (!SetThreadDesktop(_desktop._hdesktop))
00135                 return -1;
00136
00137         HDESK hDesk_old = OpenInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP);
00138
00139         if (!SwitchDesktop(_desktop._hdesktop))
00140                 return -1;
00141
00142         if (!_desktop._hwndDesktop)
00143                 _desktop._hwndDesktop = DesktopWindow::Create();
00144
00145         int ret = Window::MessageLoop();
00146
00147         SwitchDesktop(hDesk_old);
00148
00149         return ret;
00150 }
00151
00152 #else // _USE_HDESK
00153
00154 static BOOL CALLBACK SwitchDesktopEnumFct(HWND hwnd, LPARAM lparam)
00155 {
00156         WindowSet& windows = *(WindowSet*)lparam;
00157
00158         if (hwnd!=g_Globals._hwndDesktopBar && hwnd!=g_Globals._hwndDesktop)
00159                 if (IsWindowVisible(hwnd))
00160                         windows.insert(hwnd);
00161
00162         return TRUE;
00163 }
00164
00165 void Desktops::SwitchToDesktop(int idx)
00166 {
00167         if (_current_desktop == idx)
00168                 return;
00169
00170         Desktop& old_desktop = (*this)[_current_desktop];
00171         WindowSet& windows = old_desktop._windows;
00172         Desktop& desktop = (*this)[idx];
00173
00174         windows.clear();
00175
00176          // collect window handles of all other desktops
00177         WindowSet other_wnds;
00178         for(const_iterator it1=begin(); it1!=end(); ++it1)
00179                 for(WindowSet::const_iterator it2=it1->_windows.begin(); it2!=it1->_windows.end(); ++it2)
00180                         other_wnds.insert(*it2);
00181
00182          // save currently visible application windows
00183         EnumWindows(SwitchDesktopEnumFct, (LPARAM)&windows);
00184
00185         old_desktop._hwndForeground = (HWND)SendMessage(g_Globals._hwndDesktopBar, PM_GET_LAST_ACTIVE, 0, 0);
00186
00187          // hide all windows of the previous desktop
00188         for(WindowSet::iterator it=windows.begin(); it!=windows.end(); ++it)
00189                 ShowWindowAsync(*it, SW_HIDE);
00190
00191          // show all windows of the new desktop
00192         for(WindowSet::iterator it=desktop._windows.begin(); it!=desktop._windows.end(); ++it)
00193                 ShowWindowAsync(*it, SW_SHOW);
00194
00195         if (desktop._hwndForeground)
00196                 SetForegroundWindow(desktop._hwndForeground);
00197
00198          // remove the window handles of the other desktops from what we found on the previous desktop
00199         for(WindowSet::const_iterator it=other_wnds.begin(); it!=other_wnds.end(); ++it)
00200                 windows.erase(*it);
00201
00202          // We don't need to store the window handles of what's now visible the now current desktop.
00203         desktop._windows.clear();
00204
00205         _current_desktop = idx;
00206 }
00207
00208 #endif // _USE_HDESK
00209
00210
00211 static BOOL CALLBACK MinimizeDesktopEnumFct(HWND hwnd, LPARAM lparam)
00212 {
00213         list<MinimizeStruct>& minimized = *(list<MinimizeStruct>*)lparam;
00214
00215         if (hwnd!=g_Globals._hwndDesktopBar && hwnd!=g_Globals._hwndDesktop)
00216                 if (IsWindowVisible(hwnd) && !IsIconic(hwnd)) {
00217                         RECT rect;
00218
00219                         if (GetWindowRect(hwnd,&rect))
00220                                 if (rect.right>0 && rect.bottom>0 &&
00221                                         rect.right>rect.left && rect.bottom>rect.top) {
00222                                 minimized.push_back(MinimizeStruct(hwnd, GetWindowStyle(hwnd)));
00223                                 ShowWindowAsync(hwnd, SW_MINIMIZE);
00224                         }
00225                 }
00226
00227         return TRUE;
00228 }
00229
00231 void Desktops::ToggleMinimize()
00232 {
00233         list<MinimizeStruct>& minimized = (*this)[_current_desktop]._minimized;
00234
00235         if (minimized.empty()) {
00236                 EnumWindows(MinimizeDesktopEnumFct, (LPARAM)&minimized);
00237         } else {
00238                 for(list<MinimizeStruct>::const_iterator it=minimized.begin(); it!=minimized.end(); ++it)
00239                         ShowWindowAsync(it->first, it->second&WS_MAXIMIZE? SW_MAXIMIZE: SW_RESTORE);
00240
00241                 minimized.clear();
00242         }
00243 }
00244
00245
00246 BOOL IsAnyDesktopRunning()
00247 {
00248         HINSTANCE hUser32 = GetModuleHandle(TEXT("user32"));
00249
00250         SetShellWindow = (BOOL(WINAPI*)(HWND)) GetProcAddress(hUser32, "SetShellWindow");
00251         SetShellWindowEx = (BOOL(WINAPI*)(HWND,HWND)) GetProcAddress(hUser32, "SetShellWindowEx");
00252
00253         return GetShellWindow() != 0;
00254 }
00255
00256
00257 BackgroundWindow::BackgroundWindow(HWND hwnd)
00258  :      super(hwnd)
00259 {
00260          // set background brush for the short moment of displaying the
00261          // background color while moving foreground windows
00262         SetClassLong(hwnd, GCL_HBRBACKGROUND, COLOR_BACKGROUND+1);
00263
00264         _display_version = RegGetDWORDValue(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), TEXT("PaintDesktopVersion"), 1);
00265 }
00266
00267 LRESULT BackgroundWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00268 {
00269         switch(nmsg) {
00270           case WM_ERASEBKGND:
00271                 DrawDesktopBkgnd((HDC)wparam);
00272                 return TRUE;
00273
00274           case WM_MBUTTONDBLCLK:
00275                 /* Imagelist icons are missing if MainFrame::Create() is called directly from here!
00276                 explorer_show_frame(SW_SHOWNORMAL); */
00277                 PostMessage(g_Globals._hwndDesktop, nmsg, wparam, lparam);
00278                 break;
00279
00280           case PM_DISPLAY_VERSION:
00281                 if (lparam || wparam) {
00282                         DWORD or_mask = wparam;
00283                         DWORD reset_mask = LOWORD(lparam);
00284                         DWORD xor_mask = HIWORD(lparam);
00285                         _display_version = ((_display_version&~reset_mask) | or_mask) ^ xor_mask;
00286                         RegSetDWORDValue(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), TEXT("PaintDesktopVersion"), _display_version);
00288                         InvalidateRect(_hwnd, NULL, TRUE);
00289                 }
00290                 return _display_version;
00291
00292           default:
00293                 return super::WndProc(nmsg, wparam, lparam);
00294         }
00295
00296         return 0;
00297 }
00298
00299 void BackgroundWindow::DrawDesktopBkgnd(HDC hdc)
00300 {
00301         PaintDesktop(hdc);
00302
00303 /* special solid background
00304         HBRUSH bkgndBrush = CreateSolidBrush(RGB(0,32,160));    // dark blue
00305         FillRect(hdc, &rect, bkgndBrush);
00306         DeleteBrush(bkgndBrush);
00307 */
00308 }
00309
00310
00311 DesktopWindow::DesktopWindow(HWND hwnd)
00312  :      super(hwnd)
00313 {
00314         _pShellView = NULL;
00315 }
00316
00317 DesktopWindow::~DesktopWindow()
00318 {
00319         if (_pShellView)
00320                 _pShellView->Release();
00321 }
00322
00323
00324 HWND DesktopWindow::Create()
00325 {
00326         static IconWindowClass wcDesktop(TEXT("Progman"), IDI_REACTOS, CS_DBLCLKS);
00327         /* (disabled because of small ugly temporary artefacts when hiding start menu)
00328         wcDesktop.hbrBackground = (HBRUSH)(COLOR_BACKGROUND+1); */
00329
00330         int width = GetSystemMetrics(SM_CXSCREEN);
00331         int height = GetSystemMetrics(SM_CYSCREEN);
00332
00333         HWND hwndDesktop = Window::Create(WINDOW_CREATOR(DesktopWindow),
00334                                         WS_EX_TOOLWINDOW, wcDesktop, TEXT("Program Manager"), WS_POPUP|WS_VISIBLE,      //|WS_CLIPCHILDREN for SDI frames
00335                                         0, 0, width, height, 0);
00336
00337          // work around to display desktop bar in Wine
00338         ShowWindow(GET_WINDOW(DesktopWindow, hwndDesktop)->_desktopBar, SW_SHOW);
00339
00340          // work around for Windows NT, Win 98, ...
00341          // Without this the desktop has mysteriously only a size of 800x600 pixels.
00342         MoveWindow(hwndDesktop, 0, 0, width, height, TRUE);
00343
00344         return hwndDesktop;
00345 }
00346
00347
00348 LRESULT DesktopWindow::Init(LPCREATESTRUCT pcs)
00349 {
00350         if (super::Init(pcs))
00351                 return 1;
00352
00353         HRESULT hr = GetDesktopFolder()->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView);
00354 /* also possible:
00355         SFV_CREATE sfv_create;
00356
00357         sfv_create.cbSize = sizeof(SFV_CREATE);
00358         sfv_create.pshf = GetDesktopFolder();
00359         sfv_create.psvOuter = NULL;
00360         sfv_create.psfvcb = NULL;
00361
00362         HRESULT hr = SHCreateShellFolderView(&sfv_create, &_pShellView);
00363 */
00364         HWND hWndView = 0;
00365
00366         if (SUCCEEDED(hr)) {
00367                 FOLDERSETTINGS fs;
00368
00369                 fs.ViewMode = FVM_ICON;
00370                 fs.fFlags = FWF_DESKTOP|FWF_NOCLIENTEDGE|FWF_NOSCROLL|FWF_BESTFITWINDOW|FWF_SNAPTOGRID; //|FWF_AUTOARRANGE;
00371
00372                 ClientRect rect(_hwnd);
00373
00374                 hr = _pShellView->CreateViewWindow(NULL, &fs, this, &rect, &hWndView);
00375
00377
00378                 if (SUCCEEDED(hr)) {
00379                         g_Globals._hwndShellView = hWndView;
00380
00381                          // subclass shellview window
00382                         new DesktopShellView(hWndView, _pShellView);
00383
00384                         _pShellView->UIActivate(SVUIA_ACTIVATE_FOCUS);
00385
00386                 /*
00387                         IShellView2* pShellView2;
00388
00389                         hr = _pShellView->QueryInterface(IID_IShellView2, (void**)&pShellView2);
00390
00391                         SV2CVW2_PARAMS params;
00392                         params.cbSize = sizeof(SV2CVW2_PARAMS);
00393                         params.psvPrev = _pShellView;
00394                         params.pfs = &fs;
00395                         params.psbOwner = this;
00396                         params.prcView = &rect;
00397                         params.pvid = params.pvid;//@@
00398
00399                         hr = pShellView2->CreateViewWindow2(&params);
00400                         params.pvid;
00401                 */
00402
00403                 /*
00404                         IFolderView* pFolderView;
00405
00406                         hr = _pShellView->QueryInterface(IID_IFolderView, (void**)&pFolderView);
00407
00408                         if (SUCCEEDED(hr)) {
00409                                 hr = pFolderView->GetAutoArrange();
00410                                 hr = pFolderView->SetCurrentViewMode(FVM_DETAILS);
00411                         }
00412                 */
00413                 }
00414         }
00415
00416         if (hWndView && SetShellWindowEx)
00417                 SetShellWindowEx(_hwnd, hWndView);
00418         else if (SetShellWindow)
00419                 SetShellWindow(_hwnd);
00420
00421          // create the explorer bar
00422         _desktopBar = DesktopBar::Create();
00423         g_Globals._hwndDesktopBar = _desktopBar;
00424
00425         return 0;
00426 }
00427
00428
00429 LRESULT DesktopWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00430 {
00431         switch(nmsg) {
00432           case WM_LBUTTONDBLCLK:
00433           case WM_RBUTTONDBLCLK:
00434           case WM_MBUTTONDBLCLK:
00435                 explorer_show_frame(SW_SHOWNORMAL);
00436                 break;
00437
00438           case WM_GETISHELLBROWSER:
00439                 return (LRESULT)static_cast<IShellBrowser*>(this);
00440
00441           case WM_DESTROY:
00442
00444
00445                 if (SetShellWindow)
00446                         SetShellWindow(0);
00447                 break;
00448
00449           case WM_CLOSE:
00450                 ShowExitWindowsDialog(_hwnd);
00451                 break;
00452
00453           case WM_SYSCOMMAND:
00454                 if (wparam == SC_TASKLIST) {
00455                         if (_desktopBar)
00456                                 SendMessage(_desktopBar, nmsg, wparam, lparam);
00457                 }
00458                 goto def;
00459
00460           default: def:
00461                 return super::WndProc(nmsg, wparam, lparam);
00462         }
00463
00464         return 0;
00465 }
00466
00467
00468 HRESULT DesktopWindow::OnDefaultCommand(LPIDA pida)
00469 {
00470 #ifndef ROSSHELL        // in shell-only-mode fall through and let shell32 handle the command
00471         if (MainFrameBase::OpenShellFolders(pida, 0))
00472                 return S_OK;
00473 #endif
00474
00475         return E_NOTIMPL;
00476 }
00477
00478
00479 DesktopShellView::DesktopShellView(HWND hwnd, IShellView* pShellView)
00480  :      super(hwnd),
00481         _pShellView(pShellView)
00482 {
00483         _hwndListView = ::GetNextWindow(hwnd, GW_CHILD);
00484
00485         SetWindowStyle(_hwndListView, GetWindowStyle(_hwndListView)&~LVS_ALIGNMASK);//|LVS_ALIGNTOP|LVS_AUTOARRANGE);
00486
00487          // work around for Windows NT, Win 98, ...
00488          // Without this the desktop has mysteriously only a size of 800x600 pixels.
00489         ClientRect rect(hwnd);
00490         MoveWindow(_hwndListView, 0, 0, rect.right, rect.bottom, TRUE);
00491
00492          // subclass background window
00493         new BackgroundWindow(_hwndListView);
00494
00495         _icon_algo = 1; // default icon arrangement
00496
00497         PositionIcons();
00498         InitDragDrop();
00499 }
00500
00501 bool DesktopShellView::InitDragDrop()
00502 {
00503         CONTEXT("DesktopShellView::InitDragDrop()");
00504
00505         _pDropTarget = new DesktopDropTarget(_hwnd);
00506
00507         if (!_pDropTarget)
00508                 return false;
00509
00510         _pDropTarget->AddRef();
00511
00512         if (FAILED(RegisterDragDrop(_hwnd, _pDropTarget))) {
00513                 _pDropTarget->Release();
00514                 _pDropTarget = NULL;
00515                 return false;
00516         }
00517         else
00518                 _pDropTarget->Release();
00519
00520         FORMATETC ftetc;
00521
00522         ftetc.dwAspect = DVASPECT_CONTENT;
00523         ftetc.lindex = -1;
00524         ftetc.tymed = TYMED_HGLOBAL;
00525         ftetc.cfFormat = CF_HDROP;
00526
00527         _pDropTarget->AddSuportedFormat(ftetc);
00528
00529         return true;
00530 }
00531
00532 LRESULT DesktopShellView::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00533 {
00534         switch(nmsg) {
00535           case WM_CONTEXTMENU:
00536                 if (!DoContextMenu(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)))
00537                         DoDesktopContextMenu(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
00538                 break;
00539
00540           case PM_SET_ICON_ALGORITHM:
00541                 _icon_algo = wparam;
00542                 PositionIcons();
00543                 break;
00544
00545           case PM_GET_ICON_ALGORITHM:
00546                 return _icon_algo;
00547
00548           case PM_DISPLAY_VERSION:
00549                 return SendMessage(_hwndListView, nmsg, wparam, lparam);
00550
00551           default:
00552                 return super::WndProc(nmsg, wparam, lparam);
00553         }
00554
00555         return 0;
00556 }
00557
00558 int DesktopShellView::Command(int id, int code)
00559 {
00560         return super::Command(id, code);
00561 }
00562
00563 int DesktopShellView::Notify(int id, NMHDR* pnmh)
00564 {
00565         return super::Notify(id, pnmh);
00566 }
00567
00568 bool DesktopShellView::DoContextMenu(int x, int y)
00569 {
00570         IDataObject* selection;
00571
00572         HRESULT hr = _pShellView->GetItemObject(SVGIO_SELECTION, IID_IDataObject, (void**)&selection);
00573         if (FAILED(hr))
00574                 return false;
00575
00576         PIDList pidList;
00577
00578         hr = pidList.GetData(selection);
00579         if (FAILED(hr)) {
00580                 selection->Release();
00581                 //CHECKERROR(hr);
00582                 return false;
00583         }
00584
00585         LPIDA pida = pidList;
00586         if (!pida->cidl) {
00587                 selection->Release();
00588                 return false;
00589         }
00590
00591         LPCITEMIDLIST parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
00592
00593         LPCITEMIDLIST* apidl = (LPCITEMIDLIST*) alloca(pida->cidl*sizeof(LPCITEMIDLIST));
00594
00595         for(int i=pida->cidl; i>0; --i)
00596                 apidl[i-1] = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i]);
00597
00598         hr = ShellFolderContextMenu(ShellFolder(parent_pidl), _hwnd, pida->cidl, apidl, x, y, _cm_ifs);
00599
00600         selection->Release();
00601
00602         CHECKERROR(hr);
00603
00604         return true;
00605 }
00606
00607 HRESULT DesktopShellView::DoDesktopContextMenu(int x, int y)
00608 {
00609         IContextMenu* pcm;
00610
00611         HRESULT hr = DesktopFolder()->GetUIObjectOf(_hwnd, 0, NULL, IID_IContextMenu, NULL, (LPVOID*)&pcm);
00612
00613         if (SUCCEEDED(hr)) {
00614                 pcm = _cm_ifs.query_interfaces(pcm);
00615
00616                 HMENU hmenu = CreatePopupMenu();
00617
00618                 if (hmenu) {
00619                         hr = pcm->QueryContextMenu(hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST-1, CMF_NORMAL|CMF_EXPLORE);
00620
00621                         if (SUCCEEDED(hr)) {
00622                                 AppendMenu(hmenu, MF_SEPARATOR, 0, NULL);
00623                                 AppendMenu(hmenu, 0, FCIDM_SHVIEWLAST-1, ResString(IDS_ABOUT_EXPLORER));
00624
00625                                 UINT idCmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN|TPM_RETURNCMD|TPM_RIGHTBUTTON, x, y, 0, _hwnd, NULL);
00626
00627                                 _cm_ifs.reset();
00628
00629                                 if (idCmd == FCIDM_SHVIEWLAST-1) {
00630                                         explorer_about(_hwnd);
00631                                 } else if (idCmd) {
00632                                   CMINVOKECOMMANDINFO cmi;
00633
00634                                   cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
00635                                   cmi.fMask = 0;
00636                                   cmi.hwnd = _hwnd;
00637                                   cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - FCIDM_SHVIEWFIRST);
00638                                   cmi.lpParameters = NULL;
00639                                   cmi.lpDirectory = NULL;
00640                                   cmi.nShow = SW_SHOWNORMAL;
00641                                   cmi.dwHotKey = 0;
00642                                   cmi.hIcon = 0;
00643
00644                                   hr = pcm->InvokeCommand(&cmi);
00645                                 }
00646                         } else
00647                                 _cm_ifs.reset();
00648                 }
00649
00650                 pcm->Release();
00651         }
00652
00653         return hr;
00654 }
00655
00656
00657 #define ARRANGE_BORDER_DOWN      8
00658 #define ARRANGE_BORDER_HV        9
00659 #define ARRANGE_ROUNDABOUT      10
00660
00661 static const POINTS s_align_start[] = {
00662         {0, 0}, // left/top
00663         {0, 0},
00664         {1, 0}, // right/top
00665         {1, 0},
00666         {0, 1}, // left/bottom
00667         {0, 1},
00668         {1, 1}, // right/bottom
00669         {1, 1},
00670
00671         {0, 0}, // left/top
00672         {0, 0},
00673         {0, 0}
00674 };
00675
00676 static const POINTS s_align_dir1[] = {
00677         { 0, +1},       // down
00678         {+1,  0},       // right
00679         {-1,  0},       // left
00680         { 0, +1},       // down
00681         { 0, -1},       // up
00682         {+1,  0},       // right
00683         {-1,  0},       // left
00684         { 0, -1},       // up
00685
00686         { 0, +1},       // down
00687         {+1,  0},       // right
00688         {+1,  0}        // right
00689 };
00690
00691 static const POINTS s_align_dir2[] = {
00692         {+1,  0},       // right
00693         { 0, +1},       // down
00694         { 0, +1},       // down
00695         {-1,  0},       // left
00696         {+1,  0},       // right
00697         { 0, -1},       // up
00698         { 0, -1},       // up
00699         {-1,  0},       // left
00700
00701         {+1,  0},       // right
00702         { 0, +1},       // down
00703         { 0, +1}        // down
00704 };
00705
00706 typedef pair<int,int> IconPos;
00707 typedef map<IconPos, int> IconMap;
00708
00709 void DesktopShellView::PositionIcons(int dir)
00710 {
00711         DWORD spacing = ListView_GetItemSpacing(_hwndListView, FALSE);
00712
00713         RECT work_area;
00714         SystemParametersInfo(SPI_GETWORKAREA, 0, &work_area, 0);
00715
00716         const POINTS& dir1 = s_align_dir1[_icon_algo];
00717         const POINTS& dir2 = s_align_dir2[_icon_algo];
00718         const POINTS& start_pos = s_align_start[_icon_algo];
00719
00720         int dir_x1 = dir1.x;
00721         int dir_y1 = dir1.y;
00722         int dir_x2 = dir2.x;
00723         int dir_y2 = dir2.y;
00724
00725         int cx = LOWORD(spacing);
00726         int cy = HIWORD(spacing);
00727
00728         int dx1 = dir_x1 * cx;
00729         int dy1 = dir_y1 * cy;
00730         int dx2 = dir_x2 * cx;
00731         int dy2 = dir_y2 * cy;
00732
00733         int xoffset = (cx-32)/2;
00734         int yoffset = 4/*(cy-32)/2*/;
00735
00736         int start_x = start_pos.x * (work_area.right - cx) + xoffset;
00737         int start_y = start_pos.y * (work_area.bottom - cy) + yoffset;
00738
00739         int x = start_x;
00740         int y = start_y;
00741
00742         int all = ListView_GetItemCount(_hwndListView);
00743         int i1, i2;
00744
00745         if (dir > 0) {
00746                 i1 = 0;
00747                 i2 = all;
00748         } else {
00749                 i1 = all-1;
00750                 i2 = -1;
00751         }
00752
00753         IconMap pos_idx;
00754         int cnt = 0;
00755         int xhv = start_x;
00756         int yhv = start_y;
00757
00758         for(int idx=i1; idx!=i2; idx+=dir) {
00759                 pos_idx[IconPos(y, x)] = idx;
00760
00761                 if (_icon_algo == ARRANGE_BORDER_DOWN) {
00762                         if (++cnt & 1)
00763                                 x = work_area.right - x - cx + 2*xoffset;
00764                         else {
00765                                 y += dy1;
00766
00767                                 if (y + cy - 2 * yoffset > work_area.bottom) {
00768                                         y = start_y;
00769                                         start_x += dx2;
00770                                         x = start_x;
00771                                 }
00772                         }
00773
00774                         continue;
00775                 }
00776                 else if (_icon_algo == ARRANGE_BORDER_HV) {
00777                         if (++cnt & 1)
00778                                 x = work_area.right - x - cx + 2*xoffset;
00779                         else if (cnt & 2) {
00780                                 yhv += cy;
00781                                 y = yhv;
00782                                 x = start_x;
00783
00784                                 if (y + cy - 2 * yoffset > work_area.bottom) {
00785                                         start_x += cx;
00786                                         xhv = start_x;
00787                                         x = xhv;
00788                                         start_y += cy;
00789                                         yhv = start_y;
00790                                         y = yhv;
00791                                 }
00792                         } else {
00793                                 xhv += cx;
00794                                 x = xhv;
00795                                 y = start_y;
00796
00797                                 if (x + cx - 2 * xoffset > work_area.right) {
00798                                         start_x += cx;
00799                                         xhv = start_x;
00800                                         x = xhv;
00801                                         start_y += cy;
00802                                         yhv = start_y;
00803                                         y = yhv;
00804                                 }
00805                         }
00806
00807                         continue;
00808                 }
00809                 else if (_icon_algo == ARRANGE_ROUNDABOUT) {
00810
00812
00813                 }
00814
00815                 x += dx1;
00816                 y += dy1;
00817
00818                 if (x<0 || x+cx-2*xoffset>work_area.right) {
00819                         x = start_x;
00820                         y += dy2;
00821                 } else if (y<0 || y+cy-2*yoffset>work_area.bottom) {
00822                         y = start_y;
00823                         x += dx2;
00824                 }
00825         }
00826
00827          // use a little trick to get the icons where we want them to be...
00828
00829         for(IconMap::const_iterator it=pos_idx.end(); --it!=pos_idx.begin(); ) {
00830                 const IconPos& pos = it->first;
00831
00832                 ListView_SetItemPosition32(_hwndListView, it->second, pos.second, pos.first);
00833         }
00834
00835         for(IconMap::const_iterator it=pos_idx.begin(); it!=pos_idx.end(); ++it) {
00836                 const IconPos& pos = it->first;
00837
00838                 ListView_SetItemPosition32(_hwndListView, it->second, pos.second, pos.first);
00839         }
00840 }


ROS Explorer: desktop.h File Reference

  • File List
  • File Members
desktop

desktop.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | BackgroundWindow
subclassed Background window behind the visible desktop window More...
struct | DesktopWindow
Implementation of the Explorer desktop window. More...
class | DesktopDropTarget
OLE drop target for the desktop window. More...
struct | DesktopShellView
subclassed ShellView window More...

Defines

#define | PM_SET_ICON_ALGORITHM (WM_APP+0x19)
#define | PM_GET_ICON_ALGORITHM (WM_APP+0x1A)
#define | PM_DISPLAY_VERSION (WM_APP+0x24)

Define Documentation

#define PM_DISPLAY_VERSION (WM_APP+0x24)

Definition at line 31 of file desktop.h.

Referenced by DesktopSettingsDlg::Command(), DesktopSettingsDlg::DesktopSettingsDlg(), DesktopSettingsDlg::Notify(), DesktopShellView::WndProc(), and BackgroundWindow::WndProc().

#define PM_GET_ICON_ALGORITHM (WM_APP+0x1A)

Definition at line 30 of file desktop.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg(), and DesktopShellView::WndProc().

#define PM_SET_ICON_ALGORITHM (WM_APP+0x19)

Definition at line 29 of file desktop.h.

Referenced by DesktopSettingsDlg::Command(), DesktopSettingsDlg::Notify(), and DesktopShellView::WndProc().


ROS Explorer: desktop.h Source File

  • File List
  • File Members
desktop

desktop.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // desktop.h
00024  //
00025  // Martin Fuchs, 09.08.2003
00026  //
00027
00028
00029 #define PM_SET_ICON_ALGORITHM   (WM_APP+0x19)
00030 #define PM_GET_ICON_ALGORITHM   (WM_APP+0x1A)
00031 #define PM_DISPLAY_VERSION              (WM_APP+0x24)
00032
00033
00035 struct BackgroundWindow : public SubclassedWindow
00036 {
00037         typedef SubclassedWindow super;
00038
00039         BackgroundWindow(HWND hwnd);
00040
00041 protected:
00042         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00043
00044         void    DrawDesktopBkgnd(HDC hdc);
00045
00046         int             _display_version;
00047 };
00048
00049
00051 struct DesktopWindow : public Window, public IShellBrowserImpl
00052 {
00053         typedef Window super;
00054
00055         DesktopWindow(HWND hwnd);
00056         ~DesktopWindow();
00057
00058         static HWND Create();
00059
00060         virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND* lphwnd)
00061         {
00062                 *lphwnd = _hwnd;
00063                 return S_OK;
00064         }
00065
00066         virtual HRESULT STDMETHODCALLTYPE QueryActiveShellView(IShellView** ppshv)
00067         {
00068                 _pShellView->AddRef();
00069                 *ppshv = _pShellView;
00070                 return S_OK;
00071         }
00072
00073         virtual HRESULT STDMETHODCALLTYPE GetControlWindow(UINT id, HWND* lphwnd)
00074         {
00075                 return E_NOTIMPL;
00076         }
00077
00078         virtual HRESULT STDMETHODCALLTYPE SendControlMsg(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* pret)
00079         {
00080                 return E_NOTIMPL;
00081         }
00082
00083 protected:
00084         LRESULT Init(LPCREATESTRUCT pcs);
00085         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00086
00087         IShellView*     _pShellView;
00088         WindowHandle _desktopBar;
00089
00090         virtual HRESULT OnDefaultCommand(LPIDA pida);
00091 };
00092
00093
00095 class DesktopDropTarget : public IDropTargetImpl
00096 {
00097         typedef IDropTargetImpl super;
00098
00099 public:
00100         DesktopDropTarget(HWND hTargetWnd) : super(hTargetWnd) {}
00101
00102         virtual bool OnDrop(FORMATETC* pFmtEtc, STGMEDIUM& medium, DWORD *pdwEffect)
00103         {
00104                 if (pFmtEtc->cfFormat==CF_HDROP && medium.tymed==TYMED_HGLOBAL) {
00105                         HDROP hDrop = (HDROP)GlobalLock(medium.hGlobal);
00106
00107                         if (hDrop) {
00108                                 TCHAR szFileName[MAX_PATH];
00109
00110                                 UINT cFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
00111
00112                                 for(UINT i=0; i<cFiles; ++i) {
00113                                         DragQueryFile(hDrop, i, szFileName, sizeof(szFileName));
00114
00115                                         if (DROPEFFECT_COPY & *pdwEffect) {
00116                                                  // copy the file or dir
00117
00119
00120                                         } else if (DROPEFFECT_MOVE & *pdwEffect) {
00121                                                  // move the file or dir
00122
00124
00125                                         }
00126                                 }
00127                                 //DragFinish(hDrop); // base class calls ReleaseStgMedium
00128                         }
00129
00130                         GlobalUnlock(medium.hGlobal);
00131                 }
00132
00133                 //@@TreeView_SelectDropTarget(m_hTargetWnd, NULL);
00134
00135                 return true; //let base free the medium
00136         }
00137
00138         virtual HRESULT STDMETHODCALLTYPE DragOver(
00139         /* [in] */ DWORD grfKeyState,
00140         /* [in] */ POINTL pt,
00141         /* [out][in] */ DWORD __RPC_FAR *pdwEffect)
00142         {
00143                 TVHITTESTINFO hit;
00144                 hit.pt = (POINT&)pt;
00145                 ScreenToClient(m_hTargetWnd, &hit.pt);
00146                 hit.flags = TVHT_ONITEM;
00147
00148                 /*@@
00149                 HTREEITEM hItem = TreeView_HitTest(m_hTargetWnd,&hit);
00150
00151                 if (hItem != NULL)
00152                         TreeView_SelectDropTarget(m_hTargetWnd, hItem);
00153                 */
00154
00155                 return super::DragOver(grfKeyState, pt, pdwEffect);
00156         }
00157
00158         virtual HRESULT STDMETHODCALLTYPE DragLeave(void)
00159         {
00160                 //@@ TreeView_SelectDropTarget(m_hTargetWnd, NULL);
00161
00162                 return super::DragLeave();
00163         }
00164 };
00165
00166
00168 struct DesktopShellView : public ExtContextMenuHandlerT<SubclassedWindow>
00169 {
00170         typedef ExtContextMenuHandlerT<SubclassedWindow> super;
00171
00172         DesktopShellView(HWND hwnd, IShellView* pShellView);
00173
00174         bool    InitDragDrop();
00175
00176 protected:
00177         IShellView* _pShellView;
00178
00179         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00180         int             Command(int id, int code);
00181         int             Notify(int id, NMHDR* pnmh);
00182
00183         bool    DoContextMenu(int x, int y);
00184         HRESULT DoDesktopContextMenu(int x, int y);
00185         void    PositionIcons(int dir=1);
00186
00187         DesktopDropTarget* _pDropTarget;
00188         HWND    _hwndListView;
00189         int             _icon_algo;
00190 };


ROS Explorer: desktopbar.cpp File Reference

  • File List
  • File Members
taskbar

desktopbar.cpp File Reference

#include <precomp.h>
#include "../resource.h"
#include "desktopbar.h"
#include "taskbar.h"
#include "startmenu.h"
#include "traynotify.h"
#include "quicklaunch.h"
#include "../dialogs/settings.h"

Include dependency graph for desktopbar.cpp:

Go to the source code of this file.

Classes

struct | TrayNotifyCDS
copy data structure for tray notifications More...

Defines

#define | RBBS_HIDETITLE 0x400

Define Documentation

#define RBBS_HIDETITLE 0x400


ROS Explorer: desktopbar.cpp Source File

  • File List
  • File Members
taskbar

desktopbar.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // desktopbar.cpp
00024  //
00025  // Martin Fuchs, 22.08.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "../resource.h"
00032
00033 #include "desktopbar.h"
00034 #include "taskbar.h"
00035 #include "startmenu.h"
00036 #include "traynotify.h"
00037 #include "quicklaunch.h"
00038
00039 #include "../dialogs/settings.h"
00040
00041
00042 DesktopBar::DesktopBar(HWND hwnd)
00043  :      super(hwnd),
00044 #ifdef _ROS_
00045         _trayIcon(hwnd, ID_TRAY_VOLUME)
00046 #else
00047         WM_TASKBARCREATED(RegisterWindowMessage(WINMSG_TASKBARCREATED))
00048 #endif
00049 {
00050         SetWindowIcon(hwnd, IDI_REACTOS);
00051
00052         SystemParametersInfo(SPI_GETWORKAREA, 0, &_work_area_org, 0);
00053 }
00054
00055 DesktopBar::~DesktopBar()
00056 {
00057          // restore work area to the previous size
00058         SystemParametersInfo(SPI_SETWORKAREA, 0, &_work_area_org, 0);
00059         PostMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETWORKAREA, 0);
00060
00061          // exit application after destroying desktop window
00062         PostQuitMessage(0);
00063 }
00064
00065
00066 HWND DesktopBar::Create()
00067 {
00068         static BtnWindowClass wcDesktopBar(CLASSNAME_EXPLORERBAR);
00069
00070         RECT rect;
00071
00072         rect.left = -2; // hide left border
00073 #ifdef TASKBAR_AT_TOP
00074         rect.top = -2;  // hide top border
00075 #else
00076         rect.top = GetSystemMetrics(SM_CYSCREEN) - DESKTOPBARBAR_HEIGHT;
00077 #endif
00078         rect.right = GetSystemMetrics(SM_CXSCREEN) + 2;
00079         rect.bottom = rect.top + DESKTOPBARBAR_HEIGHT + 2;
00080
00081         return Window::Create(WINDOW_CREATOR(DesktopBar), WS_EX_PALETTEWINDOW,
00082                                                         wcDesktopBar, TITLE_EXPLORERBAR,
00083                                                         WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN|WS_VISIBLE,
00084                                                         rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, 0);
00085 }
00086
00087
00088 LRESULT DesktopBar::Init(LPCREATESTRUCT pcs)
00089 {
00090         if (super::Init(pcs))
00091                 return 1;
00092
00093          // create start button
00094         ResString start_str(IDS_START);
00095         WindowCanvas canvas(_hwnd);
00096         RECT rect = {0, 0};
00097         DrawText(canvas, start_str, -1, &rect, DT_SINGLELINE|DT_CALCRECT);
00098         int start_btn_width = rect.right+16+8;
00099
00100         _taskbar_pos = start_btn_width + 6;
00101
00102          // create "Start" button
00103         HWND hwndStart = Button(_hwnd, start_str, 1, 1, start_btn_width, REBARBAND_HEIGHT, IDC_START, WS_VISIBLE|WS_CHILD|BS_OWNERDRAW);
00104         new StartButton(hwndStart);
00105          // disable double clicks
00106         SetClassLong(hwndStart, GCL_STYLE, GetClassLong(hwndStart, GCL_STYLE) & ~CS_DBLCLKS);
00107
00108          // create task bar
00109         _hwndTaskBar = TaskBar::Create(_hwnd);
00110
00111 #ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003)
00112         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOTRAYITEMSDISPLAY))
00113 #endif
00114                  // create tray notification area
00115                 _hwndNotify = NotifyArea::Create(_hwnd);
00116
00117
00118          // notify all top level windows about the successfully created desktop bar
00119          //@@ Use SendMessage() instead of PostMessage() to avoid problems with delayed created shell service objects?
00120         PostMessage(HWND_BROADCAST, WM_TASKBARCREATED, 0, 0);
00121
00122
00123         _hwndQuickLaunch = QuickLaunchBar::Create(_hwnd);
00124
00125          // create rebar window to manage task and quick launch bar
00126 #ifndef _NO_REBAR
00127         _hwndrebar = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL,
00128                                         WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
00129                                         RBS_VARHEIGHT|RBS_AUTOSIZE|RBS_DBLCLKTOGGLE|    //|RBS_REGISTERDROP
00130                                         CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_TOP,
00131                                         0, 0, 0, 0, _hwnd, 0, g_Globals._hInstance, 0);
00132
00133         REBARBANDINFO rbBand;
00134
00135         rbBand.cbSize = sizeof(REBARBANDINFO);
00136         rbBand.fMask  = RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE|RBBIM_ID|RBBIM_IDEALSIZE;
00137 #ifndef RBBS_HIDETITLE // missing in MinGW headers as of 25.02.2004
00138 #define RBBS_HIDETITLE  0x400
00139 #endif
00140         rbBand.cyChild = REBARBAND_HEIGHT;
00141         rbBand.cyMaxChild = (ULONG)-1;
00142         rbBand.cyMinChild = REBARBAND_HEIGHT;
00143         rbBand.cyIntegral = REBARBAND_HEIGHT + 3;       //@@ OK?
00144         rbBand.cxMinChild = rbBand.cyIntegral * 3;
00145         rbBand.fStyle = RBBS_VARIABLEHEIGHT|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE;
00146
00147         rbBand.lpText = TEXT("Quicklaunch");
00148         rbBand.hwndChild = _hwndQuickLaunch;
00149         rbBand.cx = 250;
00150         rbBand.wID = IDW_QUICKLAUNCHBAR;
00151         SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
00152
00153         rbBand.lpText = TEXT("Taskbar");
00154         rbBand.hwndChild = _hwndTaskBar;
00155         rbBand.cx = 200;        //pcs->cx-_taskbar_pos-quicklaunch_width-(notifyarea_width+1);
00156         rbBand.wID = IDW_TASKTOOLBAR;
00157         SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
00158 #endif
00159
00160
00161         RegisterHotkeys();
00162
00163          // prepare Startmenu, but hide it for now
00164         _startMenuRoot = GET_WINDOW(StartMenuRoot, StartMenuRoot::Create(_hwnd, true)); //@@ _large_icons
00165
00166         return 0;
00167 }
00168
00169
00170 StartButton::StartButton(HWND hwnd)
00171  :      PictureButton(hwnd, SmallIcon(IDI_STARTMENU), GetSysColorBrush(COLOR_BTNFACE))
00172 {
00173 }
00174
00175 LRESULT StartButton::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00176 {
00177         switch(nmsg) {
00178            // one click activation: handle button-down message, don't wait for button-up
00179           case WM_LBUTTONDOWN:
00180                 if (!Button_GetState(_hwnd)) {
00181                         Button_SetState(_hwnd, TRUE);
00182
00183                         SetCapture(_hwnd);
00184
00185                         SendMessage(GetParent(_hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(_hwnd),0), 0);
00186                 }
00187
00188                 Button_SetState(_hwnd, FALSE);
00189                 break;
00190
00191            // re-target mouse move messages while moving the mouse cursor through the start menu
00192           case WM_MOUSEMOVE:
00193                 if (GetCapture() == _hwnd) {
00194                         POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)};
00195
00196                         ClientToScreen(_hwnd, &pt);
00197                         HWND hwnd = WindowFromPoint(pt);
00198
00199                         if (hwnd && hwnd!=_hwnd) {
00200                                 ScreenToClient(hwnd, &pt);
00201                                 SendMessage(hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(pt.x, pt.y));
00202                         }
00203                 }
00204                 break;
00205
00206           case WM_LBUTTONUP:
00207                 if (GetCapture() == _hwnd) {
00208                         ReleaseCapture();
00209
00210                         POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)};
00211
00212                         ClientToScreen(_hwnd, &pt);
00213                         HWND hwnd = WindowFromPoint(pt);
00214
00215                         if (hwnd && hwnd!=_hwnd) {
00216                                 ScreenToClient(hwnd, &pt);
00217                                 PostMessage(hwnd, WM_LBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y));
00218                                 PostMessage(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(pt.x, pt.y));
00219                         }
00220                 }
00221                 break;
00222
00223           case WM_CANCELMODE:
00224                 ReleaseCapture();
00225                 break;
00226
00227           default:
00228                 return super::WndProc(nmsg, wparam, lparam);
00229         }
00230
00231         return 0;
00232 }
00233
00234
00235 void DesktopBar::RegisterHotkeys()
00236 {
00237          // register hotkey WIN+E opening explorer
00238         RegisterHotKey(_hwnd, 0, MOD_WIN, 'E');
00239
00241 }
00242
00243 void DesktopBar::ProcessHotKey(int id_hotkey)
00244 {
00245         switch(id_hotkey) {
00246           case 0:       explorer_show_frame(SW_SHOWNORMAL);
00247                 break;
00248
00250         }
00251 }
00252
00253
00254 LRESULT DesktopBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00255 {
00256         switch(nmsg) {
00257           case WM_NCHITTEST: {
00258                 LRESULT res = super::WndProc(nmsg, wparam, lparam);
00259
00260                 if (res>=HTSIZEFIRST && res<=HTSIZELAST) {
00261 #ifdef TASKBAR_AT_TOP
00262                         if (res == HTBOTTOM)    // enable vertical resizing at the lower border
00263 #else
00264                         if (res == HTTOP)               // enable vertical resizing at the upper border
00265 #endif
00266                                 return res;
00267                         else
00268                                 return HTCLIENT;        // disable any other resizing
00269                 }
00270                 return res;}
00271
00272           case WM_SYSCOMMAND:
00273                 if ((wparam&0xFFF0) == SC_SIZE) {
00274 #ifdef TASKBAR_AT_TOP
00275                         if (wparam == SC_SIZE+6)// enable vertical resizing at the lower border
00276 #else
00277                         if (wparam == SC_SIZE+3)// enable vertical resizing at the upper border
00278 #endif
00279                                 goto def;
00280                         else
00281                                 return 0;                       // disable any other resizing
00282                 } else if (wparam == SC_TASKLIST)
00283                         ShowStartMenu();
00284                 goto def;
00285
00286           case WM_SIZE:
00287                 Resize(LOWORD(lparam), HIWORD(lparam));
00288                 break;
00289
00290           case WM_SIZING:
00291                 ControlResize(wparam, lparam);
00292                 break;
00293
00294           case PM_RESIZE_CHILDREN: {
00295                 ClientRect size(_hwnd);
00296                 Resize(size.right, size.bottom);
00297                 break;}
00298
00299           case WM_CLOSE:
00300                 ShowExitWindowsDialog(_hwnd);
00301                 break;
00302
00303           case WM_HOTKEY:
00304                 ProcessHotKey(wparam);
00305                 break;
00306
00307           case WM_COPYDATA:
00308                 return ProcessCopyData((COPYDATASTRUCT*)lparam);
00309
00310           case WM_CONTEXTMENU: {
00311                 PopupMenu menu(IDM_DESKTOPBAR);
00312                 SetMenuDefaultItem(menu, 0, MF_BYPOSITION);
00313                 menu.TrackPopupMenu(_hwnd, MAKEPOINTS(lparam));
00314                 break;}
00315
00316           case PM_GET_LAST_ACTIVE:
00317                 if (_hwndTaskBar)
00318                         return SendMessage(_hwndTaskBar, nmsg, wparam, lparam);
00319                 break;
00320
00321           case PM_REFRESH_CONFIG:
00322                 SendMessage(_hwndNotify, PM_REFRESH_CONFIG, 0, 0);
00323                 break;
00324
00325           case WM_TIMER:
00326                 if (wparam == ID_TRAY_VOLUME) {
00327                         KillTimer(_hwnd, wparam);
00328                         launch_file(_hwnd, TEXT("sndvol32.exe"), SW_SHOWNORMAL, TEXT("-t"));    // launch volume control in small mode
00329                 }
00330                 break;
00331
00332           case PM_GET_NOTIFYAREA:
00333                 return (LRESULT)(HWND)_hwndNotify;
00334
00335           default: def:
00336                 return super::WndProc(nmsg, wparam, lparam);
00337         }
00338
00339         return 0;
00340 }
00341
00342 int DesktopBar::Notify(int id, NMHDR* pnmh)
00343 {
00344         if (pnmh->code == RBN_CHILDSIZE) {
00345                 /* align the task bands to the top, so it's in row with the Start button */
00346                 NMREBARCHILDSIZE* childSize = (NMREBARCHILDSIZE*)pnmh;
00347
00348                 if (childSize->wID == IDW_TASKTOOLBAR) {
00349                         int cy = childSize->rcChild.top - childSize->rcBand.top;
00350
00351                         if (cy) {
00352                                 childSize->rcChild.bottom -= cy;
00353                                 childSize->rcChild.top -= cy;
00354                         }
00355                 }
00356         }
00357
00358         return 0;
00359 }
00360
00361 void DesktopBar::Resize(int cx, int cy)
00362 {
00364         int quicklaunch_width = SendMessage(_hwndQuickLaunch, PM_GET_WIDTH, 0, 0);
00365         int notifyarea_width = SendMessage(_hwndNotify, PM_GET_WIDTH, 0, 0);
00366
00367         HDWP hdwp = BeginDeferWindowPos(3);
00368
00369         if (_hwndrebar)
00370                 DeferWindowPos(hdwp, _hwndrebar, 0, _taskbar_pos, 1, cx-_taskbar_pos-(notifyarea_width+1), cy-2, SWP_NOZORDER|SWP_NOACTIVATE);
00371         else {
00372                 if (_hwndQuickLaunch)
00373                         DeferWindowPos(hdwp, _hwndQuickLaunch, 0, _taskbar_pos, 1, quicklaunch_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE);
00374
00375                 if (_hwndTaskBar)
00376                         DeferWindowPos(hdwp, _hwndTaskBar, 0, _taskbar_pos+quicklaunch_width, 0, cx-_taskbar_pos-quicklaunch_width-(notifyarea_width+1), cy, SWP_NOZORDER|SWP_NOACTIVATE);
00377         }
00378
00379         if (_hwndNotify)
00380                 DeferWindowPos(hdwp, _hwndNotify, 0, cx-(notifyarea_width+1), 1, notifyarea_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE);
00381
00382         EndDeferWindowPos(hdwp);
00383
00384         WindowRect rect(_hwnd);
00385         RECT work_area = {0, 0, GetSystemMetrics(SM_CXSCREEN), rect.top};
00386         SystemParametersInfo(SPI_SETWORKAREA, 0, &work_area, 0);        // don't use SPIF_SENDCHANGE because then we have to wait for any message being delivered
00387         PostMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETWORKAREA, 0);
00388 }
00389
00390
00391 int DesktopBar::Command(int id, int code)
00392 {
00393         switch(id) {
00394           case IDC_START:
00395                 ShowStartMenu();
00396                 break;
00397
00398           case ID_ABOUT_EXPLORER:
00399                 explorer_about(_hwnd);
00400                 break;
00401
00402           case ID_DESKTOPBAR_SETTINGS:
00403                 ExplorerPropertySheet(_hwnd);
00404                 break;
00405
00406           case ID_MINIMIZE_ALL:
00407                 g_Globals._desktops.ToggleMinimize();
00408                 break;
00409
00410           case ID_EXPLORE:
00411                 explorer_show_frame(SW_SHOWNORMAL);
00412                 break;
00413
00414           case ID_TASKMGR:
00415                 launch_file(_hwnd, TEXT("taskmgr.exe"), SW_SHOWNORMAL);
00416                 break;
00417
00418           case ID_SWITCH_DESKTOP_1:
00419           case ID_SWITCH_DESKTOP_1+1:
00420           case ID_SWITCH_DESKTOP_1+2:
00421           case ID_SWITCH_DESKTOP_1+3: {
00422                 int desktop_idx = id - ID_SWITCH_DESKTOP_1;
00423
00424                 g_Globals._desktops.SwitchToDesktop(desktop_idx);
00425
00426                 if (_hwndQuickLaunch)
00427                         PostMessage(_hwndQuickLaunch, PM_UPDATE_DESKTOP, desktop_idx, 0);
00428                 break;}
00429
00430 #ifdef _ROS_
00431           case ID_TRAY_VOLUME:
00432                 launch_file(_hwnd, TEXT("sndvol32.exe"), SW_SHOWNORMAL);        // launch volume control application
00433                 break;
00434
00435           case ID_VOLUME_PROPERTIES:
00436                 launch_cpanel(_hwnd, TEXT("mmsys.cpl"));
00437                 break;
00438 #endif
00439
00440           default:
00441                 if (_hwndQuickLaunch)
00442                         return SendMessage(_hwndQuickLaunch, WM_COMMAND, MAKEWPARAM(id,code), 0);
00443                 else
00444                         return 1;
00445         }
00446
00447         return 0;
00448 }
00449
00450
00451 void DesktopBar::ShowStartMenu()
00452 {
00453         if (_startMenuRoot)
00454                 _startMenuRoot->TrackStartmenu();
00455 }
00456
00457
00459 struct TrayNotifyCDS {
00460         DWORD   cookie;
00461         DWORD   notify_code;
00462         NOTIFYICONDATA nicon_data;
00463 };
00464
00465 LRESULT DesktopBar::ProcessCopyData(COPYDATASTRUCT* pcd)
00466 {
00467          // Is this a tray notification message?
00468         if (pcd->dwData == 1) {
00469                 TrayNotifyCDS* ptr = (TrayNotifyCDS*) pcd->lpData;
00470
00471                 NotifyArea* notify_area = GET_WINDOW(NotifyArea, _hwndNotify);
00472
00473                 if (notify_area)
00474                         return notify_area->ProcessTrayNotification(ptr->notify_code, &ptr->nicon_data);
00475         }
00476
00477         return FALSE;
00478 }
00479
00480
00481 void DesktopBar::ControlResize(WPARAM wparam, LPARAM lparam)
00482 {
00483         PRECT dragRect = (PRECT) lparam;
00484         //int screenWidth = GetSystemMetrics(SM_CXSCREEN);
00485         int screenHeight = GetSystemMetrics(SM_CYSCREEN);
00486
00488
00489         switch(wparam) {
00490           case WMSZ_BOTTOM: //@todo Taskbar is at the top of the screen
00491                 break;
00492
00493           case WMSZ_TOP:        // Taskbar is at the bottom of the screen
00494                 dragRect->top = screenHeight - (((screenHeight - dragRect->top) + DESKTOPBARBAR_HEIGHT/2) / DESKTOPBARBAR_HEIGHT) * DESKTOPBARBAR_HEIGHT;
00495                 if (dragRect->top < screenHeight / 2)
00496                         dragRect->top = screenHeight - (screenHeight/2 / DESKTOPBARBAR_HEIGHT * DESKTOPBARBAR_HEIGHT);
00497                 else if (dragRect->top > screenHeight - 5)
00498                         dragRect->top = screenHeight - 5;
00499                 break;
00500
00501           case WMSZ_RIGHT:      //@todo Taskbar is at the left of the screen
00502                 break;
00503
00504           case WMSZ_LEFT:       //@todo Taskbar is at the right of the screen
00505                 break;
00506         }
00507 }
00508
00509
00510 #ifdef _ROS_
00511
00512 void DesktopBar::AddTrayIcons()
00513 {
00514         _trayIcon.Add(SmallIcon(IDI_SPEAKER), ResString(IDS_VOLUME));
00515 }
00516
00517 void DesktopBar::TrayClick(UINT id, int btn)
00518 {
00519         switch(id) {
00520           case ID_TRAY_VOLUME:
00521                 if (btn == TRAYBUTTON_LEFT)
00522                         SetTimer(_hwnd, ID_TRAY_VOLUME, 500, NULL); // wait a bit to correctly handle double clicks
00523                 else {
00524                         PopupMenu menu(IDM_VOLUME);
00525                         SetMenuDefaultItem(menu, 0, MF_BYPOSITION);
00526                         menu.TrackPopupMenuAtPos(_hwnd, GetMessagePos());
00527                 }
00528                 break;
00529         }
00530 }
00531
00532 void DesktopBar::TrayDblClick(UINT id, int btn)
00533 {
00534         switch(id) {
00535           case ID_TRAY_VOLUME:
00536                 KillTimer(_hwnd, ID_TRAY_VOLUME);       // finish one-click timer
00537                 launch_file(_hwnd, TEXT("sndvol32.exe"), SW_SHOWNORMAL);        // launch volume control application
00538                 break;
00539         }
00540 }
00541
00542 #endif


ROS Explorer: desktopbar.h File Reference

  • File List
  • File Members
taskbar

desktopbar.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | DesktopBar
desktop bar window, also known as "system tray" More...
struct | StartButton
special "Start" button with one click activation More...

Defines

#define | CLASSNAME_EXPLORERBAR TEXT("Shell_TrayWnd")
#define | TITLE_EXPLORERBAR TEXT("")
#define | DESKTOPBARBAR_HEIGHT (GetSystemMetrics(SM_CYSIZE) + 5 * GetSystemMetrics(SM_CYEDGE))
#define | REBARBAND_HEIGHT (GetSystemMetrics(SM_CYSIZE) + 2 * GetSystemMetrics(SM_CYEDGE))
#define | IDC_START 0x1000
#define | IDC_LOGOFF 0x1001
#define | IDC_SHUTDOWN 0x1002
#define | IDC_LAUNCH 0x1003
#define | IDC_START_HELP 0x1004
#define | IDC_SEARCH_FILES 0x1005
#define | IDC_SEARCH_COMPUTER 0x1006
#define | IDC_SETTINGS 0x1007
#define | IDC_ADMIN 0x1008
#define | IDC_DOCUMENTS 0x1009
#define | IDC_RECENT 0x100A
#define | IDC_FAVORITES 0x100B
#define | IDC_PROGRAMS 0x100C
#define | IDC_EXPLORE 0x100D
#define | IDC_NETWORK 0x100E
#define | IDC_CONNECTIONS 0x100F
#define | IDC_DRIVES 0x1010
#define | IDC_CONTROL_PANEL 0x1011
#define | IDC_SETTINGS_MENU 0x1012
#define | IDC_PRINTERS 0x1013
#define | IDC_PRINTERS_MENU 0x1014
#define | IDC_BROWSE 0x1015
#define | IDC_SEARCH_PROGRAM 0x1016
#define | IDC_SEARCH 0x1017
#define | IDC_TERMINATE 0x1018
#define | IDC_FIRST_MENU 0x3000

Define Documentation

#define CLASSNAME_EXPLORERBAR TEXT("Shell_TrayWnd")

Definition at line 29 of file desktopbar.h.

Referenced by DesktopBar::Create().

#define DESKTOPBARBAR_HEIGHT (GetSystemMetrics(SM_CYSIZE) + 5 * GetSystemMetrics(SM_CYEDGE))

Definition at line 33 of file desktopbar.h.

Referenced by DesktopBar::ControlResize(), and DesktopBar::Create().

#define IDC_ADMIN 0x1008

Definition at line 45 of file desktopbar.h.

Referenced by SettingsMenu::AddEntries(), and StartMenuHandler::Command().

#define IDC_BROWSE 0x1015

Definition at line 58 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDC_CONNECTIONS 0x100F

Definition at line 52 of file desktopbar.h.

Referenced by SettingsMenu::AddEntries(), and StartMenuHandler::Command().

#define IDC_CONTROL_PANEL 0x1011

Definition at line 54 of file desktopbar.h.

Referenced by SettingsMenu::AddEntries(), and StartMenuHandler::Command().

#define IDC_DOCUMENTS 0x1009

Definition at line 46 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDC_DRIVES 0x1010

Definition at line 53 of file desktopbar.h.

Referenced by BrowseMenu::AddEntries(), and StartMenuHandler::Command().

#define IDC_EXPLORE 0x100D

Definition at line 50 of file desktopbar.h.

Referenced by StartMenuRoot::AddEntries(), and StartMenuHandler::Command().

#define IDC_FAVORITES 0x100B

Definition at line 48 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDC_FIRST_MENU 0x3000

Definition at line 63 of file desktopbar.h.

Referenced by StartMenu::StartMenu().

#define IDC_LAUNCH 0x1003

Definition at line 40 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDC_LOGOFF 0x1001

Definition at line 38 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDC_NETWORK 0x100E

Definition at line 51 of file desktopbar.h.

Referenced by BrowseMenu::AddEntries(), and StartMenuHandler::Command().

#define IDC_PRINTERS 0x1013

Definition at line 56 of file desktopbar.h.

Referenced by SettingsMenu::AddEntries(), and StartMenuHandler::Command().

#define IDC_PRINTERS_MENU 0x1014

Definition at line 57 of file desktopbar.h.

#define IDC_PROGRAMS 0x100C

Definition at line 49 of file desktopbar.h.

Referenced by StartMenuRoot::Init().

#define IDC_RECENT 0x100A

Definition at line 47 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDC_SEARCH 0x1017

Definition at line 60 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDC_SEARCH_COMPUTER 0x1006

Definition at line 43 of file desktopbar.h.

Referenced by SearchMenu::AddEntries(), and StartMenuHandler::Command().

#define IDC_SEARCH_FILES 0x1005

Definition at line 42 of file desktopbar.h.

Referenced by SearchMenu::AddEntries(), and StartMenuHandler::Command().

#define IDC_SEARCH_PROGRAM 0x1016

Definition at line 59 of file desktopbar.h.

Referenced by SearchMenu::AddEntries(), and StartMenuHandler::Command().

#define IDC_SETTINGS 0x1007

Definition at line 44 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDC_SETTINGS_MENU 0x1012

Definition at line 55 of file desktopbar.h.

Referenced by SettingsMenu::AddEntries(), and StartMenuHandler::Command().

#define IDC_SHUTDOWN 0x1002

Definition at line 39 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDC_START 0x1000

Definition at line 37 of file desktopbar.h.

Referenced by DesktopBar::Init().

#define IDC_START_HELP 0x1004

Definition at line 41 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDC_TERMINATE 0x1018

Definition at line 61 of file desktopbar.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define REBARBAND_HEIGHT (GetSystemMetrics(SM_CYSIZE) + 2 * GetSystemMetrics(SM_CYEDGE))

Definition at line 34 of file desktopbar.h.

Referenced by DesktopBar::Init().

#define TITLE_EXPLORERBAR TEXT("")

Definition at line 30 of file desktopbar.h.

Referenced by DesktopBar::Create().


ROS Explorer: desktopbar.h Source File

  • File List
  • File Members
taskbar

desktopbar.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer and Desktop clone
00022  //
00023  // desktopbar.h
00024  //
00025  // Martin Fuchs, 22.08.2003
00026  //
00027
00028
00029 #define CLASSNAME_EXPLORERBAR   TEXT("Shell_TrayWnd")
00030 #define TITLE_EXPLORERBAR               TEXT("")        // use an empty window title, so windows taskmanager does not show the window in its application list
00031
00032
00033 #define DESKTOPBARBAR_HEIGHT    (GetSystemMetrics(SM_CYSIZE) + 5 * GetSystemMetrics(SM_CYEDGE))
00034 #define REBARBAND_HEIGHT                (GetSystemMetrics(SM_CYSIZE) + 2 * GetSystemMetrics(SM_CYEDGE))
00035
00036
00037 #define IDC_START                               0x1000
00038 #define IDC_LOGOFF                              0x1001
00039 #define IDC_SHUTDOWN                    0x1002
00040 #define IDC_LAUNCH                              0x1003
00041 #define IDC_START_HELP                  0x1004
00042 #define IDC_SEARCH_FILES                0x1005
00043 #define IDC_SEARCH_COMPUTER             0x1006
00044 #define IDC_SETTINGS                    0x1007
00045 #define IDC_ADMIN                               0x1008
00046 #define IDC_DOCUMENTS                   0x1009
00047 #define IDC_RECENT                              0x100A
00048 #define IDC_FAVORITES                   0x100B
00049 #define IDC_PROGRAMS                    0x100C
00050 #define IDC_EXPLORE                             0x100D
00051 #define IDC_NETWORK                             0x100E
00052 #define IDC_CONNECTIONS                 0x100F
00053 #define IDC_DRIVES                              0x1010
00054 #define IDC_CONTROL_PANEL               0x1011
00055 #define IDC_SETTINGS_MENU               0x1012
00056 #define IDC_PRINTERS                    0x1013
00057 #define IDC_PRINTERS_MENU               0x1014
00058 #define IDC_BROWSE                              0x1015
00059 #define IDC_SEARCH_PROGRAM              0x1016
00060 #define IDC_SEARCH                              0x1017
00061 #define IDC_TERMINATE                   0x1018
00062
00063 #define IDC_FIRST_MENU                  0x3000
00064
00065
00067 struct DesktopBar : public
00068 #ifdef _ROS_
00069         TrayIconControllerTemplate<
00070                                 OwnerDrawParent<Window> >
00071 #else
00072         OwnerDrawParent<Window>
00073 #endif
00074 {
00075 #ifdef _ROS_
00076         typedef TrayIconControllerTemplate<
00077                                 OwnerDrawParent<Window> > super;
00078 #else
00079         typedef OwnerDrawParent<Window> super;
00080 #endif
00081
00082         DesktopBar(HWND hwnd);
00083         ~DesktopBar();
00084
00085         static HWND Create();
00086
00087 protected:
00088         RECT    _work_area_org;
00089         int             _taskbar_pos;
00090
00091         LRESULT Init(LPCREATESTRUCT pcs);
00092         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00093         int             Notify(int id, NMHDR* pnmh);
00094         int             Command(int id, int code);
00095
00096         void    Resize(int cx, int cy);
00097         void    ControlResize(WPARAM wparam, LPARAM lparam);
00098         void    RegisterHotkeys();
00099         void    ProcessHotKey(int id_hotkey);
00100         void    ShowStartMenu();
00101         LRESULT ProcessCopyData(COPYDATASTRUCT* pcd);
00102
00103         WindowHandle _hwndTaskBar;
00104         WindowHandle _hwndNotify;
00105         WindowHandle _hwndQuickLaunch;
00106         WindowHandle _hwndrebar;
00107
00108         struct StartMenuRoot* _startMenuRoot;
00109
00110 #ifdef _ROS_
00111         TrayIcon        _trayIcon;
00112
00113         void    AddTrayIcons();
00114         virtual void TrayClick(UINT id, int btn);
00115         virtual void TrayDblClick(UINT id, int btn);
00116 #else
00117         const UINT WM_TASKBARCREATED;
00118 #endif
00119 };
00120
00121
00123 struct StartButton : public PictureButton
00124 {
00125         typedef PictureButton super;
00126
00127         StartButton(HWND hwnd);
00128
00129 protected:
00130         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00131 };


ROS Explorer: dragdropimpl.cpp File Reference

  • File List
  • File Members
utility

dragdropimpl.cpp File Reference

#include <precomp.h>

Include dependency graph for dragdropimpl.cpp:

Go to the source code of this file.


ROS Explorer: dragdropimpl.cpp Source File

  • File List
  • File Members
utility

dragdropimpl.cpp

Go to the documentation of this file.
00001 #include <precomp.h>
00002
00003 /**************************************************************************
00004    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00005    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00006    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00007    PARTICULAR PURPOSE.
00008    Author: Leon Finker  11/2000
00009    Modifications: replaced ATL by STL, Martin Fuchs 7/2003
00010 **************************************************************************/
00011
00012 // dragdropimp.cpp: implementation of the IDataObjectImpl class.
00014
00015 //#include <shlobj.h>
00016 //#include <assert.h>
00017
00018 //#include "dragdropimpl.h"
00019
00021 // IDataObjectImpl Class
00023
00024 IDataObjectImpl::IDataObjectImpl(IDropSourceImpl* pDropSource)
00025  :      super(IID_IDataObject),
00026         m_pDropSource(pDropSource),
00027         m_cRefCount(0)
00028 {
00029 }
00030
00031 IDataObjectImpl::~IDataObjectImpl()
00032 {
00033         for(StorageArray::iterator it=_storage.begin(); it!=_storage.end(); ++it)
00034                 ReleaseStgMedium(it->_medium);
00035 }
00036
00037 STDMETHODIMP IDataObjectImpl::GetData(
00038         /* [unique][in] */ FORMATETC __RPC_FAR *pformatetcIn,
00039         /* [out] */ STGMEDIUM __RPC_FAR *pmedium)
00040 {
00041         if (pformatetcIn == NULL || pmedium == NULL)
00042                 return E_INVALIDARG;
00043
00044         pmedium->hGlobal = NULL;
00045
00046         for(StorageArray::iterator it=_storage.begin(); it!=_storage.end(); ++it)
00047         {
00048                 if (pformatetcIn->tymed & it->_format->tymed &&
00049                    pformatetcIn->dwAspect == it->_format->dwAspect &&
00050                    pformatetcIn->cfFormat == it->_format->cfFormat)
00051                 {
00052                         CopyMedium(pmedium, it->_medium, it->_format);
00053                         return S_OK;
00054                 }
00055         }
00056
00057         return DV_E_FORMATETC;
00058 }
00059
00060 STDMETHODIMP IDataObjectImpl::GetDataHere(
00061         /* [unique][in] */ FORMATETC __RPC_FAR *pformatetc,
00062         /* [out][in] */ STGMEDIUM __RPC_FAR *pmedium)
00063 {
00064         return E_NOTIMPL;
00065 }
00066
00067 STDMETHODIMP IDataObjectImpl::QueryGetData(
00068    /* [unique][in] */ FORMATETC __RPC_FAR *pformatetc)
00069 {
00070         if (pformatetc == NULL)
00071                 return E_INVALIDARG;
00072
00073         //support others if needed DVASPECT_THUMBNAIL  //DVASPECT_ICON   //DVASPECT_DOCPRINT
00074         if (!(DVASPECT_CONTENT & pformatetc->dwAspect))
00075                 return (DV_E_DVASPECT);
00076
00077         HRESULT  hr = DV_E_TYMED;
00078
00079         for(StorageArray::iterator it=_storage.begin(); it!=_storage.end(); ++it)
00080         {
00081            if (pformatetc->tymed & it->_format->tymed)
00082            {
00083                   if (pformatetc->cfFormat == it->_format->cfFormat)
00084                          return S_OK;
00085                   else
00086                          hr = DV_E_CLIPFORMAT;
00087            }
00088            else
00089                   hr = DV_E_TYMED;
00090         }
00091
00092         return hr;
00093 }
00094
00095 STDMETHODIMP IDataObjectImpl::GetCanonicalFormatEtc(
00096         /* [unique][in] */ FORMATETC __RPC_FAR *pformatectIn,
00097         /* [out] */ FORMATETC __RPC_FAR *pformatetcOut)
00098 {
00099         if (pformatetcOut == NULL)
00100                 return E_INVALIDARG;
00101
00102         return DATA_S_SAMEFORMATETC;
00103 }
00104
00105 STDMETHODIMP IDataObjectImpl::SetData(
00106         /* [unique][in] */ FORMATETC __RPC_FAR *pformatetc,
00107         /* [unique][in] */ STGMEDIUM __RPC_FAR *pmedium,
00108         /* [in] */ BOOL fRelease)
00109 {
00110         if (pformatetc == NULL || pmedium == NULL)
00111           return E_INVALIDARG;
00112
00113         assert(pformatetc->tymed == pmedium->tymed);
00114         FORMATETC* fetc=new FORMATETC;
00115         STGMEDIUM* pStgMed = new STGMEDIUM;
00116
00117         if (fetc == NULL || pStgMed == NULL)
00118                 return E_OUTOFMEMORY;
00119
00120         ZeroMemory(fetc, sizeof(FORMATETC));
00121         ZeroMemory(pStgMed, sizeof(STGMEDIUM));
00122
00123         *fetc = *pformatetc;
00124
00125         if (fRelease)
00126           *pStgMed = *pmedium;
00127         else
00128                 CopyMedium(pStgMed, pmedium, pformatetc);
00129
00130         DataStorage storage;
00131
00132         storage._format = fetc;
00133         storage._medium = pStgMed;
00134
00135         _storage.push_back(storage);
00136
00137         return S_OK;
00138 }
00139
00140 void IDataObjectImpl::CopyMedium(STGMEDIUM* pMedDest, STGMEDIUM* pMedSrc, FORMATETC* pFmtSrc)
00141 {
00142         switch(pMedSrc->tymed)
00143         {
00144         case TYMED_HGLOBAL:
00145                 pMedDest->hGlobal = (HGLOBAL)OleDuplicateData(pMedSrc->hGlobal, pFmtSrc->cfFormat, 0);
00146                 break;
00147         case TYMED_GDI:
00148                 pMedDest->hBitmap = (HBITMAP)OleDuplicateData(pMedSrc->hBitmap, pFmtSrc->cfFormat, 0);
00149                 break;
00150         case TYMED_MFPICT:
00151                 pMedDest->hMetaFilePict = (HMETAFILEPICT)OleDuplicateData(pMedSrc->hMetaFilePict, pFmtSrc->cfFormat, 0);
00152                 break;
00153         case TYMED_ENHMF:
00154                 pMedDest->hEnhMetaFile = (HENHMETAFILE)OleDuplicateData(pMedSrc->hEnhMetaFile, pFmtSrc->cfFormat, 0);
00155                 break;
00156         case TYMED_FILE:
00157                 pMedDest->lpszFileName = (LPOLESTR)OleDuplicateData(pMedSrc->lpszFileName, pFmtSrc->cfFormat, 0);
00158                 break;
00159         case TYMED_ISTREAM:
00160                 pMedDest->pstm = pMedSrc->pstm;
00161                 pMedSrc->pstm->AddRef();
00162                 break;
00163         case TYMED_ISTORAGE:
00164                 pMedDest->pstg = pMedSrc->pstg;
00165                 pMedSrc->pstg->AddRef();
00166                 break;
00167         case TYMED_NULL:
00168         default:
00169                 break;
00170         }
00171         pMedDest->tymed = pMedSrc->tymed;
00172         pMedDest->pUnkForRelease = pMedSrc->pUnkForRelease;
00173 }
00174
00175 STDMETHODIMP IDataObjectImpl::EnumFormatEtc(
00176    /* [in] */ DWORD dwDirection,
00177    /* [out] */ IEnumFORMATETC __RPC_FAR *__RPC_FAR *ppenumFormatEtc)
00178 {
00179         if (ppenumFormatEtc == NULL)
00180           return E_POINTER;
00181
00182         *ppenumFormatEtc=NULL;
00183         switch (dwDirection)
00184         {
00185           case DATADIR_GET:
00186                  *ppenumFormatEtc = new EnumFormatEtcImpl(_storage);
00187
00188                  if (!*ppenumFormatEtc)
00189                          return E_OUTOFMEMORY;
00190
00191                  (*ppenumFormatEtc)->AddRef();
00192                  break;
00193
00194           case DATADIR_SET:
00195           default:
00196                  return E_NOTIMPL;
00197                  break;
00198         }
00199
00200    return S_OK;
00201 }
00202
00203 STDMETHODIMP IDataObjectImpl::DAdvise(
00204    /* [in] */ FORMATETC __RPC_FAR *pformatetc,
00205    /* [in] */ DWORD advf,
00206    /* [unique][in] */ IAdviseSink __RPC_FAR *pAdvSink,
00207    /* [out] */ DWORD __RPC_FAR *pdwConnection)
00208 {
00209         return OLE_E_ADVISENOTSUPPORTED;
00210 }
00211
00212 STDMETHODIMP IDataObjectImpl::DUnadvise(
00213    /* [in] */ DWORD dwConnection)
00214 {
00215         return E_NOTIMPL;
00216 }
00217
00218 HRESULT STDMETHODCALLTYPE IDataObjectImpl::EnumDAdvise(
00219    /* [out] */ IEnumSTATDATA __RPC_FAR *__RPC_FAR *ppenumAdvise)
00220 {
00221         return OLE_E_ADVISENOTSUPPORTED;
00222 }
00223
00225 // IDropSourceImpl Class
00227
00228 STDMETHODIMP IDropSourceImpl::QueryContinueDrag(
00229         /* [in] */ BOOL fEscapePressed,
00230         /* [in] */ DWORD grfKeyState)
00231 {
00232    if (fEscapePressed)
00233           return DRAGDROP_S_CANCEL;
00234    if (!(grfKeyState & (MK_LBUTTON|MK_RBUTTON)))
00235    {
00236           m_bDropped = true;
00237           return DRAGDROP_S_DROP;
00238    }
00239
00240    return S_OK;
00241
00242 }
00243
00244 STDMETHODIMP IDropSourceImpl::GiveFeedback(
00245         /* [in] */ DWORD dwEffect)
00246 {
00247         return DRAGDROP_S_USEDEFAULTCURSORS;
00248 }
00249
00251 // EnumFormatEtcImpl Class
00253
00254 EnumFormatEtcImpl::EnumFormatEtcImpl(const FormatArray& ArrFE)
00255  :      super(IID_IEnumFORMATETC),
00256         m_cRefCount(0),
00257         m_iCur(0)
00258 {
00259    for(FormatArray::const_iterator it=ArrFE.begin(); it!=ArrFE.end(); ++it)
00260                 m_pFmtEtc.push_back(*it);
00261 }
00262
00263 EnumFormatEtcImpl::EnumFormatEtcImpl(const StorageArray& ArrFE)
00264  :      super(IID_IEnumFORMATETC),
00265         m_cRefCount(0),
00266         m_iCur(0)
00267 {
00268    for(StorageArray::const_iterator it=ArrFE.begin(); it!=ArrFE.end(); ++it)
00269                 m_pFmtEtc.push_back(*it->_format);
00270 }
00271
00272 STDMETHODIMP EnumFormatEtcImpl::Next(ULONG celt,LPFORMATETC lpFormatEtc, ULONG* pceltFetched)
00273 {
00274    if (pceltFetched != NULL)
00275            *pceltFetched=0;
00276
00277    ULONG cReturn = celt;
00278
00279    if (celt <= 0 || lpFormatEtc == NULL || m_iCur >= m_pFmtEtc.size())
00280           return S_FALSE;
00281
00282    if (pceltFetched == NULL && celt != 1) // pceltFetched can be NULL only for 1 item request
00283           return S_FALSE;
00284
00285         while (m_iCur < m_pFmtEtc.size() && cReturn > 0)
00286         {
00287                 *lpFormatEtc++ = m_pFmtEtc[m_iCur++];
00288                 --cReturn;
00289         }
00290         if (pceltFetched != NULL)
00291                 *pceltFetched = celt - cReturn;
00292
00293         return (cReturn == 0) ? S_OK : S_FALSE;
00294 }
00295
00296 STDMETHODIMP EnumFormatEtcImpl::Skip(ULONG celt)
00297 {
00298         if ((m_iCur + int(celt)) >= m_pFmtEtc.size())
00299                 return S_FALSE;
00300
00301         m_iCur += celt;
00302         return S_OK;
00303 }
00304
00305 STDMETHODIMP EnumFormatEtcImpl::Reset(void)
00306 {
00307    m_iCur = 0;
00308    return S_OK;
00309 }
00310
00311 STDMETHODIMP EnumFormatEtcImpl::Clone(IEnumFORMATETC** ppCloneEnumFormatEtc)
00312 {
00313   if (ppCloneEnumFormatEtc == NULL)
00314         return E_POINTER;
00315
00316   EnumFormatEtcImpl* newEnum = new EnumFormatEtcImpl(m_pFmtEtc);
00317
00318   if (!newEnum)
00319         return E_OUTOFMEMORY;
00320
00321   newEnum->AddRef();
00322   newEnum->m_iCur = m_iCur;
00323   *ppCloneEnumFormatEtc = newEnum;
00324
00325   return S_OK;
00326 }
00327
00329 // IDropTargetImpl Class
00331 IDropTargetImpl::IDropTargetImpl(HWND hTargetWnd)
00332  :      m_cRefCount(0),
00333         m_bAllowDrop(false),
00334         m_pDropTargetHelper(NULL),
00335         m_pSupportedFrmt(NULL),
00336         m_hTargetWnd(hTargetWnd)
00337 {
00338         assert(m_hTargetWnd != NULL);
00339
00340         if (FAILED(CoCreateInstance(CLSID_DragDropHelper, NULL, CLSCTX_INPROC_SERVER,
00341                                          IID_IDropTargetHelper,(LPVOID*)&m_pDropTargetHelper)))
00342                 m_pDropTargetHelper = NULL;
00343 }
00344
00345 IDropTargetImpl::~IDropTargetImpl()
00346 {
00347         if (m_pDropTargetHelper != NULL)
00348         {
00349                 m_pDropTargetHelper->Release();
00350                 m_pDropTargetHelper = NULL;
00351         }
00352 }
00353
00354 HRESULT STDMETHODCALLTYPE IDropTargetImpl::QueryInterface( /* [in] */ REFIID riid,
00355                                                 /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject)
00356 {
00357         *ppvObject = NULL;
00358         if (IID_IUnknown==riid || IID_IDropTarget==riid)
00359                 *ppvObject=this;
00360
00361         if (*ppvObject != NULL)
00362         {
00363                 ((LPUNKNOWN)*ppvObject)->AddRef();
00364                 return S_OK;
00365         }
00366
00367         return E_NOINTERFACE;
00368 }
00369
00370 ULONG STDMETHODCALLTYPE IDropTargetImpl::Release()
00371 {
00372    long nTemp = --m_cRefCount;
00373
00374    assert(nTemp >= 0);
00375
00376    if (nTemp == 0)
00377           delete this;
00378
00379    return nTemp;
00380 }
00381
00382 bool IDropTargetImpl::QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect)
00383 {
00384         DWORD dwOKEffects = *pdwEffect;
00385
00386         if (!m_bAllowDrop)
00387         {
00388            *pdwEffect = DROPEFFECT_NONE;
00389            return false;
00390         }
00391
00392         //CTRL+SHIFT  -- DROPEFFECT_LINK
00393         //CTRL            -- DROPEFFECT_COPY
00394         //SHIFT           -- DROPEFFECT_MOVE
00395         //no modifier -- DROPEFFECT_MOVE or whatever is allowed by src
00396         *pdwEffect = (grfKeyState & MK_CONTROL) ?
00397                                  ( (grfKeyState & MK_SHIFT) ? DROPEFFECT_LINK : DROPEFFECT_COPY ):
00398                                  ( (grfKeyState & MK_SHIFT) ? DROPEFFECT_MOVE : DROPEFFECT_NONE );
00399         if (*pdwEffect == 0)
00400         {
00401            // No modifier keys used by user while dragging.
00402            if (DROPEFFECT_COPY & dwOKEffects)
00403                   *pdwEffect = DROPEFFECT_COPY;
00404            else if (DROPEFFECT_MOVE & dwOKEffects)
00405                   *pdwEffect = DROPEFFECT_MOVE;
00406            else if (DROPEFFECT_LINK & dwOKEffects)
00407                   *pdwEffect = DROPEFFECT_LINK;
00408            else
00409            {
00410                   *pdwEffect = DROPEFFECT_NONE;
00411            }
00412         }
00413         else
00414         {
00415            // Check if the drag source application allows the drop effect desired by user.
00416            // The drag source specifies this in DoDragDrop
00417            if (!(*pdwEffect & dwOKEffects))
00418                   *pdwEffect = DROPEFFECT_NONE;
00419         }
00420
00421         return (DROPEFFECT_NONE == *pdwEffect)?false:true;
00422 }
00423
00424 HRESULT STDMETHODCALLTYPE IDropTargetImpl::DragEnter(
00425         /* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
00426         /* [in] */ DWORD grfKeyState,
00427         /* [in] */ POINTL pt,
00428         /* [out][in] */ DWORD __RPC_FAR *pdwEffect)
00429 {
00430         if (pDataObj == NULL)
00431                 return E_INVALIDARG;
00432
00433         if (m_pDropTargetHelper)
00434                 m_pDropTargetHelper->DragEnter(m_hTargetWnd, pDataObj, (LPPOINT)&pt, *pdwEffect);
00435
00436         //IEnumFORMATETC* pEnum;
00437         //pDataObj->EnumFormatEtc(DATADIR_GET,&pEnum);
00438         //FORMATETC ftm;
00439         //for()
00440         //pEnum->Next(1,&ftm,0);
00441         //pEnum->Release();
00442         m_pSupportedFrmt = NULL;
00443
00444         for(FormatArray::iterator it=m_formatetc.begin(); it!=m_formatetc.end(); ++it)
00445         {
00446                 m_bAllowDrop = (pDataObj->QueryGetData(&*it) == S_OK)? true: false;
00447
00448                 if (m_bAllowDrop)
00449                 {
00450                         m_pSupportedFrmt = &*it;
00451                         break;
00452                 }
00453         }
00454
00455         QueryDrop(grfKeyState, pdwEffect);
00456
00457         return S_OK;
00458 }
00459
00460 HRESULT STDMETHODCALLTYPE IDropTargetImpl::DragOver(
00461                 /* [in] */ DWORD grfKeyState,
00462                 /* [in] */ POINTL pt,
00463                 /* [out][in] */ DWORD __RPC_FAR *pdwEffect)
00464 {
00465         if (m_pDropTargetHelper)
00466                 m_pDropTargetHelper->DragOver((LPPOINT)&pt, *pdwEffect);
00467
00468         QueryDrop(grfKeyState, pdwEffect);
00469
00470         return S_OK;
00471 }
00472
00473 HRESULT STDMETHODCALLTYPE IDropTargetImpl::DragLeave()
00474 {
00475         if (m_pDropTargetHelper)
00476                 m_pDropTargetHelper->DragLeave();
00477
00478         m_bAllowDrop = false;
00479         m_pSupportedFrmt = NULL;
00480
00481         return S_OK;
00482 }
00483
00484 HRESULT STDMETHODCALLTYPE IDropTargetImpl::Drop(
00485         /* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
00486         /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt,
00487         /* [out][in] */ DWORD __RPC_FAR *pdwEffect)
00488 {
00489         if (pDataObj == NULL)
00490                 return E_INVALIDARG;
00491
00492         if (m_pDropTargetHelper)
00493                 m_pDropTargetHelper->Drop(pDataObj, (LPPOINT)&pt, *pdwEffect);
00494
00495         if (QueryDrop(grfKeyState, pdwEffect))
00496         {
00497                 if (m_bAllowDrop && m_pSupportedFrmt != NULL)
00498                 {
00499                         STGMEDIUM medium;
00500
00501                         if (pDataObj->GetData(m_pSupportedFrmt, &medium) == S_OK)
00502                         {
00503                                 if (OnDrop(m_pSupportedFrmt, medium, pdwEffect)) //does derive class wants us to free medium?
00504                                         ReleaseStgMedium(&medium);
00505                         }
00506                 }
00507         }
00508
00509         m_bAllowDrop = false;
00510         *pdwEffect = DROPEFFECT_NONE;
00511         m_pSupportedFrmt = NULL;
00512
00513         return S_OK;
00514 }


ROS Explorer: dragdropimpl.h File Reference

  • File List
  • File Members
utility

dragdropimpl.h File Reference

#include <vector>

Include dependency graph for dragdropimpl.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | DataStorage
structure containing information for one format of EnumFormatEtcImpl More...
class | EnumFormatEtcImpl
implementation of IEnumFORMATETC interface More...
class | IDropSourceImpl
implementation of IDropSource interface More...
class | IDataObjectImpl
implementation of IDataObject interface More...
class | IDropTargetImpl
implementation of IDropTarget interface More...
class | DragSourceHelper
implementation of IDragSourceHelper interface More...

Typedefs

typedef vector< FORMATETC > | FormatArray
typedef vector< DataStorage > | StorageArray

Typedef Documentation

typedef vector<FORMATETC> FormatArray

Definition at line 15 of file dragdropimpl.h.

typedef vector<DataStorage> StorageArray

Definition at line 23 of file dragdropimpl.h.


ROS Explorer: dragdropimpl.h Source File

  • File List
  • File Members
utility

dragdropimpl.h

Go to the documentation of this file.
00001 // IDataObjectImpl.h: interface for the CIDataObjectImpl class.
00002 /**************************************************************************
00003    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00004    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00005    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00006    PARTICULAR PURPOSE.
00007    Author: Leon Finker  11/2000
00008    Modifications: replaced ATL by STL, Martin Fuchs 7/2003
00009 **************************************************************************/
00010
00011 #include <vector>
00012 using std::vector;
00013
00014
00015 typedef vector<FORMATETC> FormatArray;
00016
00018 struct DataStorage {
00019         FORMATETC*      _format;
00020         STGMEDIUM*      _medium;
00021 };
00022
00023 typedef vector<DataStorage> StorageArray;
00024
00025
00027 class EnumFormatEtcImpl
00028  :      public IComSrvBase<IEnumFORMATETC, EnumFormatEtcImpl>, public SimpleComObject
00029 {
00030         typedef IComSrvBase<IEnumFORMATETC, EnumFormatEtcImpl> super;
00031
00032 private:
00033          ULONG                  m_cRefCount;
00034          FormatArray    m_pFmtEtc;
00035          size_t                 m_iCur;
00036
00037 public:
00038          EnumFormatEtcImpl(const FormatArray& ArrFE);
00039          EnumFormatEtcImpl(const StorageArray& ArrFE);
00040          virtual ~EnumFormatEtcImpl() {}
00041
00042          //IEnumFORMATETC members
00043          virtual HRESULT STDMETHODCALLTYPE Next(ULONG, LPFORMATETC, ULONG*);
00044          virtual HRESULT STDMETHODCALLTYPE Skip(ULONG);
00045          virtual HRESULT STDMETHODCALLTYPE Reset(void);
00046          virtual HRESULT STDMETHODCALLTYPE Clone(IEnumFORMATETC**);
00047 };
00048
00050 class IDropSourceImpl
00051  :      public IComSrvBase<IDropSource, IDropSourceImpl>, public SimpleComObject
00052 {
00053         typedef IComSrvBase<IDropSource, IDropSourceImpl> super;
00054
00055         long m_cRefCount;
00056
00057 public:
00058         bool m_bDropped;
00059
00060         IDropSourceImpl()
00061          :      super(IID_IDropSource),
00062                 m_cRefCount(0),
00063                 m_bDropped(false)
00064         {
00065         }
00066
00067         virtual ~IDropSourceImpl() {}
00068
00069         //IDropSource
00070         virtual HRESULT STDMETHODCALLTYPE QueryContinueDrag(
00071                 /* [in] */ BOOL fEscapePressed,
00072                 /* [in] */ DWORD grfKeyState);
00073
00074         virtual HRESULT STDMETHODCALLTYPE GiveFeedback(
00075                 /* [in] */ DWORD dwEffect);
00076 };
00077
00079 class IDataObjectImpl
00080  :      public IComSrvBase<IDataObject, IDataObjectImpl>, public SimpleComObject
00081         //public IAsyncOperation
00082 {
00083         typedef IComSrvBase<IDataObject, IDataObjectImpl> super;
00084
00085         IDropSourceImpl* m_pDropSource;
00086         long m_cRefCount;
00087
00088         StorageArray    _storage;
00089
00090 public:
00091         IDataObjectImpl(IDropSourceImpl* pDropSource);
00092         virtual ~IDataObjectImpl();
00093
00094         void CopyMedium(STGMEDIUM* pMedDest, STGMEDIUM* pMedSrc, FORMATETC* pFmtSrc);
00095
00096         //IDataObject
00097         virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetData(
00098                 /* [unique][in] */ FORMATETC __RPC_FAR *pformatetcIn,
00099                 /* [out] */ STGMEDIUM __RPC_FAR *pmedium);
00100
00101         virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetDataHere(
00102                 /* [unique][in] */ FORMATETC __RPC_FAR *pformatetc,
00103                 /* [out][in] */ STGMEDIUM __RPC_FAR *pmedium);
00104
00105         virtual HRESULT STDMETHODCALLTYPE QueryGetData(
00106                 /* [unique][in] */ FORMATETC __RPC_FAR *pformatetc);
00107
00108         virtual HRESULT STDMETHODCALLTYPE GetCanonicalFormatEtc(
00109                 /* [unique][in] */ FORMATETC __RPC_FAR *pformatectIn,
00110                 /* [out] */ FORMATETC __RPC_FAR *pformatetcOut);
00111
00112         virtual /* [local] */ HRESULT STDMETHODCALLTYPE SetData(
00113                 /* [unique][in] */ FORMATETC __RPC_FAR *pformatetc,
00114                 /* [unique][in] */ STGMEDIUM __RPC_FAR *pmedium,
00115                 /* [in] */ BOOL fRelease);
00116
00117         virtual HRESULT STDMETHODCALLTYPE EnumFormatEtc(
00118                 /* [in] */ DWORD dwDirection,
00119                 /* [out] */ IEnumFORMATETC __RPC_FAR *__RPC_FAR *ppenumFormatEtc);
00120
00121         virtual HRESULT STDMETHODCALLTYPE DAdvise(
00122                 /* [in] */ FORMATETC __RPC_FAR *pformatetc,
00123                 /* [in] */ DWORD advf,
00124                 /* [unique][in] */ IAdviseSink __RPC_FAR *pAdvSink,
00125                 /* [out] */ DWORD __RPC_FAR *pdwConnection);
00126
00127         virtual HRESULT STDMETHODCALLTYPE DUnadvise(
00128                 /* [in] */ DWORD dwConnection);
00129
00130         virtual HRESULT STDMETHODCALLTYPE EnumDAdvise(
00131                 /* [out] */ IEnumSTATDATA __RPC_FAR *__RPC_FAR *ppenumAdvise);
00132
00133         //IAsyncOperation
00134         //virtual HRESULT STDMETHODCALLTYPE SetAsyncMode(
00135         //        /* [in] */ BOOL fDoOpAsync)
00136         //{
00137         //      return E_NOTIMPL;
00138         //}
00139         //
00140         //virtual HRESULT STDMETHODCALLTYPE GetAsyncMode(
00141         //        /* [out] */ BOOL __RPC_FAR *pfIsOpAsync)
00142         //{
00143         //      return E_NOTIMPL;
00144         //}
00145         //
00146         //virtual HRESULT STDMETHODCALLTYPE StartOperation(
00147         //        /* [optional][unique][in] */ IBindCtx __RPC_FAR *pbcReserved)
00148         //{
00149         //      return E_NOTIMPL;
00150         //}
00151         //
00152         //virtual HRESULT STDMETHODCALLTYPE InOperation(
00153         //        /* [out] */ BOOL __RPC_FAR *pfInAsyncOp)
00154         //{
00155         //      return E_NOTIMPL;
00156         //}
00157         //
00158         //virtual HRESULT STDMETHODCALLTYPE EndOperation(
00159         //        /* [in] */ HRESULT hResult,
00160         //        /* [unique][in] */ IBindCtx __RPC_FAR *pbcReserved,
00161         //        /* [in] */ DWORD dwEffects)
00162         //{
00163         //      return E_NOTIMPL;
00164         //}*/
00165 };
00166
00168 class IDropTargetImpl : public IDropTarget
00169 {
00170         DWORD m_cRefCount;
00171         bool m_bAllowDrop;
00172         IDropTargetHelper* m_pDropTargetHelper;
00173
00174         FormatArray m_formatetc;
00175         FORMATETC* m_pSupportedFrmt;
00176
00177 protected:
00178         HWND m_hTargetWnd;
00179
00180 public:
00181         IDropTargetImpl(HWND m_hTargetWnd);
00182         virtual ~IDropTargetImpl();
00183
00184         void AddSuportedFormat(FORMATETC& ftetc) {m_formatetc.push_back(ftetc);}
00185
00186         //return values: true - release the medium. false - don't release the medium
00187         virtual bool OnDrop(FORMATETC* pFmtEtc, STGMEDIUM& medium, DWORD *pdwEffect) = 0;
00188
00189         virtual HRESULT STDMETHODCALLTYPE QueryInterface(
00190                 /* [in] */ REFIID riid,
00191                 /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
00192         virtual ULONG STDMETHODCALLTYPE AddRef() {return ++m_cRefCount;}
00193         virtual ULONG STDMETHODCALLTYPE Release();
00194
00195         bool QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect);
00196         virtual HRESULT STDMETHODCALLTYPE DragEnter(
00197                 /* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
00198                 /* [in] */ DWORD grfKeyState,
00199                 /* [in] */ POINTL pt,
00200                 /* [out][in] */ DWORD __RPC_FAR *pdwEffect);
00201         virtual HRESULT STDMETHODCALLTYPE DragOver(
00202                 /* [in] */ DWORD grfKeyState,
00203                 /* [in] */ POINTL pt,
00204                 /* [out][in] */ DWORD __RPC_FAR *pdwEffect);
00205         virtual HRESULT STDMETHODCALLTYPE DragLeave();
00206         virtual HRESULT STDMETHODCALLTYPE Drop(
00207                 /* [unique][in] */ IDataObject __RPC_FAR *pDataObj,
00208                 /* [in] */ DWORD grfKeyState,
00209                 /* [in] */ POINTL pt,
00210                 /* [out][in] */ DWORD __RPC_FAR *pdwEffect);
00211 };
00212
00214 class DragSourceHelper
00215 {
00216         IDragSourceHelper* pDragSourceHelper;
00217
00218 public:
00219         DragSourceHelper()
00220         {
00221                 if (FAILED(CoCreateInstance(CLSID_DragDropHelper,
00222                                                 NULL,
00223                                                 CLSCTX_INPROC_SERVER,
00224                                                 IID_IDragSourceHelper,
00225                                                 (void**)&pDragSourceHelper)))
00226                         pDragSourceHelper = NULL;
00227         }
00228
00229         virtual ~DragSourceHelper()
00230         {
00231                 if (pDragSourceHelper != NULL)
00232                 {
00233                         pDragSourceHelper->Release();
00234                         pDragSourceHelper=NULL;
00235                 }
00236         }
00237
00238         // IDragSourceHelper
00239         HRESULT InitializeFromBitmap(HBITMAP hBitmap,
00240                 POINT& pt,      // cursor position in client coords of the window
00241                 RECT& rc,       // selected item's bounding rect
00242                 IDataObject* pDataObject,
00243                 COLORREF crColorKey=GetSysColor(COLOR_WINDOW)// color of the window used for transparent effect.
00244                 )
00245         {
00246                 if (pDragSourceHelper == NULL)
00247                         return E_FAIL;
00248
00249                         SHDRAGIMAGE di;
00250                         BITMAP          bm;
00251                         GetObject(hBitmap, sizeof(bm), &bm);
00252                         di.sizeDragImage.cx = bm.bmWidth;
00253                         di.sizeDragImage.cy = bm.bmHeight;
00254                         di.hbmpDragImage = hBitmap;
00255                         di.crColorKey = crColorKey;
00256                         di.ptOffset.x = pt.x - rc.left;
00257                         di.ptOffset.y = pt.y - rc.top;
00258                 return pDragSourceHelper->InitializeFromBitmap(&di, pDataObject);
00259         }
00260
00261         HRESULT InitializeFromWindow(HWND hwnd, POINT& pt,IDataObject* pDataObject)
00262         {
00263                 if (pDragSourceHelper == NULL)
00264                         return E_FAIL;
00265                 return pDragSourceHelper->InitializeFromWindow(hwnd, &pt, pDataObject);
00266         }
00267 };


ROS Explorer: entries.cpp File Reference

  • File List
  • File Members
shell

entries.cpp File Reference

#include <precomp.h>

Include dependency graph for entries.cpp:

Go to the source code of this file.

Defines

#define USE_MY_SHBINDTOPARENT

Define Documentation

#define USE_MY_SHBINDTOPARENT

Definition at line 489 of file entries.cpp.


ROS Explorer: entries.cpp Source File

  • File List
  • File Members
shell

entries.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // entries.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 //#include "entries.h"
00032
00033
00034  // allocate and initialise a directory entry
00035 Entry::Entry(ENTRY_TYPE etype)
00036  :      _etype(etype)
00037 {
00038         _up = NULL;
00039         _next = NULL;
00040         _down = NULL;
00041         _expanded = false;
00042         _scanned = false;
00043         _bhfi_valid = false;
00044         _level = 0;
00045         _icon_id = ICID_UNKNOWN;
00046         _display_name = _data.cFileName;
00047         _type_name = NULL;
00048         _content = NULL;
00049 }
00050
00051 Entry::Entry(Entry* parent, ENTRY_TYPE etype)
00052  :      _up(parent),
00053         _etype(etype)
00054 {
00055         _next = NULL;
00056         _down = NULL;
00057         _expanded = false;
00058         _scanned = false;
00059         _bhfi_valid = false;
00060         _level = 0;
00061         _icon_id = ICID_UNKNOWN;
00062         _display_name = _data.cFileName;
00063         _type_name = NULL;
00064         _content = NULL;
00065 }
00066
00067 Entry::Entry(const Entry& other)
00068 {
00069         _next = NULL;
00070         _down = NULL;
00071         _up = NULL;
00072
00073         assert(!other._next);
00074         assert(!other._down);
00075         assert(!other._up);
00076
00077         _expanded = other._expanded;
00078         _scanned = other._scanned;
00079         _level = other._level;
00080
00081         _data = other._data;
00082
00083         _shell_attribs = other._shell_attribs;
00084         _display_name = other._display_name==other._data.cFileName? _data.cFileName: _tcsdup(other._display_name);
00085         _type_name = other._type_name? _tcsdup(other._type_name): NULL;
00086         _content = other._content? _tcsdup(other._content): NULL;
00087
00088         _etype = other._etype;
00089         _icon_id = other._icon_id;
00090
00091         _bhfi = other._bhfi;
00092         _bhfi_valid = other._bhfi_valid;
00093 }
00094
00095  // free a directory entry
00096 Entry::~Entry()
00097 {
00098         if (_icon_id > ICID_NONE)
00099                 g_Globals._icon_cache.free_icon(_icon_id);
00100
00101         if (_display_name != _data.cFileName)
00102                 free(_display_name);
00103
00104         if (_type_name)
00105                 free(_type_name);
00106
00107         if (_content)
00108                 free(_content);
00109 }
00110
00111
00112  // read directory tree and expand to the given location
00113 Entry* Entry::read_tree(const void* path, SORT_ORDER sortOrder, int scan_flags)
00114 {
00115         CONTEXT("Entry::read_tree()");
00116
00117         WaitCursor wait;
00118
00119         Entry* entry = this;
00120
00121         for(const void*p=path; p && entry; ) {
00122                 entry->smart_scan(sortOrder, scan_flags);
00123
00124                 if (entry->_down)
00125                         entry->_expanded = true;
00126
00127                 Entry* found = entry->find_entry(p);
00128                 p = entry->get_next_path_component(p);
00129
00130                 entry = found;
00131         }
00132
00133         return entry;
00134 }
00135
00136
00137 void Entry::read_directory_base(SORT_ORDER sortOrder, int scan_flags)
00138 {
00139         CONTEXT("Entry::read_directory_base()");
00140
00141          // call into subclass
00142         read_directory(scan_flags);
00143
00144 #ifndef ROSSHELL
00145         if (g_Globals._prescan_nodes) { //@todo _prescan_nodes should not be used for reading the start menu.
00146                 for(Entry*entry=_down; entry; entry=entry->_next)
00147                         if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00148                                 entry->read_directory(scan_flags);
00149                                 entry->sort_directory(sortOrder);
00150                         }
00151         }
00152 #endif
00153
00154         sort_directory(sortOrder);
00155 }
00156
00157
00158 Root::Root()
00159 {
00160         memset(this, 0, sizeof(Root));
00161 }
00162
00163 Root::~Root()
00164 {
00165         if (_entry)
00166                 _entry->free_subentries();
00167 }
00168
00169
00170  // directories first...
00171 static int compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA* fd2)
00172 {
00173         int order1 = fd1->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
00174         int order2 = fd2->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
00175
00176         /* Handle "." and ".." as special case and move them at the very first beginning. */
00177         if (order1 && order2) {
00178                 order1 = fd1->cFileName[0]!='.'? 1: fd1->cFileName[1]=='.'? 2: fd1->cFileName[1]=='\0'? 3: 1;
00179                 order2 = fd2->cFileName[0]!='.'? 1: fd2->cFileName[1]=='.'? 2: fd2->cFileName[1]=='\0'? 3: 1;
00180         }
00181
00182         return order2==order1? 0: order2<order1? -1: 1;
00183 }
00184
00185
00186 static int compareNothing(const void* arg1, const void* arg2)
00187 {
00188         return -1;
00189 }
00190
00191 static int compareName(const void* arg1, const void* arg2)
00192 {
00193         const WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
00194         const WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
00195
00196         int cmp = compareType(fd1, fd2);
00197         if (cmp)
00198                 return cmp;
00199
00200         return lstrcmpi(fd1->cFileName, fd2->cFileName);
00201 }
00202
00203 static int compareExt(const void* arg1, const void* arg2)
00204 {
00205         const WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
00206         const WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
00207         const TCHAR *name1, *name2, *ext1, *ext2;
00208
00209         int cmp = compareType(fd1, fd2);
00210         if (cmp)
00211                 return cmp;
00212
00213         name1 = fd1->cFileName;
00214         name2 = fd2->cFileName;
00215
00216         ext1 = _tcsrchr(name1, TEXT('.'));
00217         ext2 = _tcsrchr(name2, TEXT('.'));
00218
00219         if (ext1)
00220                 ++ext1;
00221         else
00222                 ext1 = TEXT("");
00223
00224         if (ext2)
00225                 ++ext2;
00226         else
00227                 ext2 = TEXT("");
00228
00229         cmp = lstrcmpi(ext1, ext2);
00230         if (cmp)
00231                 return cmp;
00232
00233         return lstrcmpi(name1, name2);
00234 }
00235
00236 static int compareSize(const void* arg1, const void* arg2)
00237 {
00238         WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
00239         WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
00240
00241         int cmp = compareType(fd1, fd2);
00242         if (cmp)
00243                 return cmp;
00244
00245         cmp = fd2->nFileSizeHigh - fd1->nFileSizeHigh;
00246
00247         if (cmp < 0)
00248                 return -1;
00249         else if (cmp > 0)
00250                 return 1;
00251
00252         cmp = fd2->nFileSizeLow - fd1->nFileSizeLow;
00253
00254         return cmp<0? -1: cmp>0? 1: 0;
00255 }
00256
00257 static int compareDate(const void* arg1, const void* arg2)
00258 {
00259         WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
00260         WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
00261
00262         int cmp = compareType(fd1, fd2);
00263         if (cmp)
00264                 return cmp;
00265
00266         return CompareFileTime(&fd2->ftLastWriteTime, &fd1->ftLastWriteTime);
00267 }
00268
00269
00270 static int (*sortFunctions[])(const void* arg1, const void* arg2) = {
00271         compareNothing, // SORT_NONE
00272         compareName,    // SORT_NAME
00273         compareExt,     // SORT_EXT
00274         compareSize,    // SORT_SIZE
00275         compareDate     // SORT_DATE
00276 };
00277
00278
00279 void Entry::sort_directory(SORT_ORDER sortOrder)
00280 {
00281         if (sortOrder != SORT_NONE) {
00282                 Entry* entry = _down;
00283                 Entry** array, **p;
00284                 int len;
00285
00286                 len = 0;
00287                 for(entry=_down; entry; entry=entry->_next)
00288                         ++len;
00289
00290                 if (len) {
00291                         array = (Entry**) alloca(len*sizeof(Entry*));
00292
00293                         p = array;
00294                         for(entry=_down; entry; entry=entry->_next)
00295                                 *p++ = entry;
00296
00297                          // call qsort with the appropriate compare function
00298                         qsort(array, len, sizeof(array[0]), sortFunctions[sortOrder]);
00299
00300                         _down = array[0];
00301
00302                         for(p=array; --len; p++)
00303                                 (*p)->_next = p[1];
00304
00305                         (*p)->_next = 0;
00306                 }
00307         }
00308 }
00309
00310
00311 void Entry::smart_scan(SORT_ORDER sortOrder, int scan_flags)
00312 {
00313         CONTEXT("Entry::smart_scan()");
00314
00315         if (!_scanned) {
00316                 free_subentries();
00317                 read_directory_base(sortOrder, scan_flags);
00318         }
00319 }
00320
00321
00322
00323 int Entry::extract_icon(ICONCACHE_FLAGS flags)
00324 {
00325         TCHAR path[MAX_PATH];
00326
00327         ICON_ID icon_id = ICID_NONE;
00328
00329         if (get_path(path, COUNTOF(path)) && _tcsncmp(path,TEXT("::{"),3))
00330                 icon_id = g_Globals._icon_cache.extract(path, flags);
00331
00332         if (icon_id == ICID_NONE) {
00333                 if (!(flags & (ICF_OPEN|ICF_OVERLAYS))) {
00334                         IExtractIcon* pExtract;
00335                         if (SUCCEEDED(GetUIObjectOf(0, IID_IExtractIcon, (LPVOID*)&pExtract))) {
00336                                 unsigned gil_flags;
00337                                 int idx;
00338
00339                                 if (SUCCEEDED(pExtract->GetIconLocation(GIL_FORSHELL, path, COUNTOF(path), &idx, &gil_flags))) {
00340                                         if (gil_flags & GIL_NOTFILENAME)
00341                                                 icon_id = g_Globals._icon_cache.extract(pExtract, path, idx, flags);
00342                                         else {
00343                                                 if (idx == -1)
00344                                                         idx = 0;        // special case for some control panel applications ("System")
00345
00346                                                 icon_id = g_Globals._icon_cache.extract(path, idx, flags);
00347                                         }
00348
00349                                 /* using create_absolute_pidl() [see below] results in more correct icons for some control panel applets (NVidia display driver).
00350                                         if (icon_id == ICID_NONE) {
00351                                                 SHFILEINFO sfi;
00352
00353                                                 if (SHGetFileInfo(path, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_SMALLICON))
00354                                                         icon_id = g_Globals._icon_cache.add(sfi.hIcon)._id;
00355                                         } */
00356                                 /*
00357                                         if (icon_id == ICID_NONE) {
00358                                                 LPBYTE b = (LPBYTE) alloca(0x10000);
00359                                                 SHFILEINFO sfi;
00360
00361                                                 FILE* file = fopen(path, "rb");
00362                                                 if (file) {
00363                                                         int l = fread(b, 1, 0x10000, file);
00364                                                         fclose(file);
00365
00366                                                         if (l)
00367                                                                 icon_id = g_Globals._icon_cache.add(CreateIconFromResourceEx(b, l, TRUE, 0x00030000, 16, 16, LR_DEFAULTCOLOR));
00368                                                 }
00369                                         } */
00370                                 }
00371                         }
00372                 }
00373
00374                 if (icon_id == ICID_NONE) {
00375                         SHFILEINFO sfi;
00376
00377                         const ShellPath& pidl_abs = create_absolute_pidl();
00378                         LPCITEMIDLIST pidl = pidl_abs;
00379
00380                         int shgfi_flags = SHGFI_SYSICONINDEX|SHGFI_PIDL;
00381
00382                         if (!(flags & ICF_LARGE))
00383                                 shgfi_flags |= SHGFI_SMALLICON;
00384
00385                         if (flags & ICF_OPEN)
00386                                 shgfi_flags |= SHGFI_OPENICON;
00387
00388                         // ICF_OVERLAYS is not supported in this case.
00389
00390                         HIMAGELIST himlSys = (HIMAGELIST) SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), shgfi_flags);
00391                         if (himlSys)
00392                                 icon_id = g_Globals._icon_cache.add(sfi.iIcon);
00393                         /*
00394                         if (SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_ICON|(g_Globals._large_icons? SHGFI_SMALLICON: 0)))
00395                                 icon_id = g_Globals._icon_cache.add(sfi.hIcon)._id;
00396                         */
00397                 }
00398         }
00399
00400         return icon_id;
00401 }
00402
00403 int Entry::safe_extract_icon(ICONCACHE_FLAGS flags)
00404 {
00405         try {
00406                 return extract_icon(flags);
00407         } catch(COMException&) {
00408                 // ignore unexpected exceptions while extracting icons
00409         }
00410
00411         return ICID_NONE;
00412 }
00413
00414
00415 BOOL Entry::launch_entry(HWND hwnd, UINT nCmdShow)
00416 {
00417         TCHAR cmd[MAX_PATH];
00418
00419         if (!get_path(cmd, COUNTOF(cmd)))
00420                 return FALSE;
00421
00422          // add path to the recent file list
00423         SHAddToRecentDocs(SHARD_PATH, cmd);
00424
00425           // start program, open document...
00426         return launch_file(hwnd, cmd, nCmdShow);
00427 }
00428
00429
00430  // local replacement implementation for SHBindToParent()
00431  // (derived from http://www.geocities.com/SiliconValley/2060/articles/shell-helpers.html)
00432 static HRESULT my_SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, VOID** ppv, LPCITEMIDLIST* ppidlLast)
00433 {
00434         HRESULT hr;
00435
00436         if (!ppv)
00437                 return E_POINTER;
00438
00439         // There must be at least one item ID.
00440         if (!pidl || !pidl->mkid.cb)
00441                 return E_INVALIDARG;
00442
00443          // Get the desktop folder as root.
00444         ShellFolder desktop;
00445 /*      IShellFolderPtr desktop;
00446         hr = SHGetDesktopFolder(&desktop);
00447         if (FAILED(hr))
00448                 return hr; */
00449
00450         // Walk to the penultimate item ID.
00451         LPCITEMIDLIST marker = pidl;
00452         for (;;)
00453         {
00454                 LPCITEMIDLIST next = reinterpret_cast<LPCITEMIDLIST>(
00455                         marker->mkid.abID - sizeof(marker->mkid.cb) + marker->mkid.cb);
00456                 if (!next->mkid.cb)
00457                         break;
00458                 marker = next;
00459         }
00460
00461         if (marker == pidl)
00462         {
00463                 // There was only a single item ID, so bind to the root folder.
00464                 hr = desktop->QueryInterface(riid, ppv);
00465         }
00466         else
00467         {
00468                 // Copy the ID list, truncating the last item.
00469                 int length = marker->mkid.abID - pidl->mkid.abID;
00470                 if (LPITEMIDLIST parent_id = reinterpret_cast<LPITEMIDLIST>(
00471                         malloc(length + sizeof(pidl->mkid.cb))))
00472                 {
00473                         LPBYTE raw_data = reinterpret_cast<LPBYTE>(parent_id);
00474                         memcpy(raw_data, pidl, length);
00475                         memset(raw_data + length, 0, sizeof(pidl->mkid.cb));
00476                         hr = desktop->BindToObject(parent_id, 0, riid, ppv);
00477                         free(parent_id);
00478                 }
00479                 else
00480                         return E_OUTOFMEMORY;
00481         }
00482
00483         // Return a pointer to the last item ID.
00484         if (ppidlLast)
00485                 *ppidlLast = marker;
00486
00487         return hr;
00488 }
00489 #define USE_MY_SHBINDTOPARENT
00490
00491 HRESULT Entry::do_context_menu(HWND hwnd, const POINT& pos, CtxMenuInterfaces& cm_ifs)
00492 {
00493         ShellPath shell_path = create_absolute_pidl();
00494         LPCITEMIDLIST pidl_abs = shell_path;
00495
00496         if (!pidl_abs)
00497                 return S_FALSE; // no action for registry entries, etc.
00498
00499 #ifdef USE_MY_SHBINDTOPARENT
00500         IShellFolder* parentFolder;
00501         LPCITEMIDLIST pidlLast;
00502
00503          // get and use the parent folder to display correct context menu in all cases -> correct "Properties" dialog for directories, ...
00504         HRESULT hr = my_SHBindToParent(pidl_abs, IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast);
00505
00506         if (SUCCEEDED(hr)) {
00507                 hr = ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pos.x, pos.y, cm_ifs);
00508
00509                 parentFolder->Release();
00510         }
00511
00512         return hr;
00513 #else
00514         static DynamicFct<HRESULT(WINAPI*)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*)> SHBindToParent(TEXT("SHELL32"), "SHBindToParent");
00515
00516         if (SHBindToParent) {
00517                 IShellFolder* parentFolder;
00518                 LPCITEMIDLIST pidlLast;
00519
00520                  // get and use the parent folder to display correct context menu in all cases -> correct "Properties" dialog for directories, ...
00521                 HRESULT hr = (*SHBindToParent)(pidl_abs, IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast);
00522
00523                 if (SUCCEEDED(hr)) {
00524                         hr = ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pos.x, pos.y, cm_ifs);
00525
00526                         parentFolder->Release();
00527                 }
00528
00529                 return hr;
00530         } else {
00547                 return ShellFolderContextMenu(GetDesktopFolder(), hwnd, 1, &pidl_abs, pos.x, pos.y, cm_ifs);
00548         }
00549 #endif
00550 }
00551
00552
00553 HRESULT Entry::GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut)
00554 {
00555         TCHAR path[MAX_PATH];
00556 /*
00557         if (!get_path(path, COUNTOF(path)))
00558                 return E_FAIL;
00559
00560         ShellPath shell_path(path);
00561
00562         IShellFolder* pFolder;
00563         LPCITEMIDLIST pidl_last = NULL;
00564
00565         static DynamicFct<HRESULT(WINAPI*)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*)> SHBindToParent(TEXT("SHELL32"), "SHBindToParent");
00566
00567         if (!SHBindToParent)
00568                 return E_NOTIMPL;
00569
00570         HRESULT hr = (*SHBindToParent)(shell_path, IID_IShellFolder, (LPVOID*)&pFolder, &pidl_last);
00571         if (FAILED(hr))
00572                 return hr;
00573
00574         ShellFolder shell_folder(pFolder);
00575
00576         shell_folder->Release();
00577
00578         return shell_folder->GetUIObjectOf(hWnd, 1, &pidl_last, riid, NULL, ppvOut);
00579 */
00580         if (!_up)
00581                 return E_INVALIDARG;
00582
00583         if (!_up->get_path(path, COUNTOF(path)))
00584                 return E_FAIL;
00585
00586         ShellPath shell_path(path);
00587         ShellFolder shell_folder(shell_path);
00588
00589 #ifdef UNICODE
00590         LPWSTR wname = _data.cFileName;
00591 #else
00592         WCHAR wname[MAX_PATH];
00593         MultiByteToWideChar(CP_ACP, 0, _data.cFileName, -1, wname, COUNTOF(wname));
00594 #endif
00595
00596         LPITEMIDLIST pidl_last = NULL;
00597         HRESULT hr = shell_folder->ParseDisplayName(hWnd, NULL, wname, NULL, &pidl_last, NULL);
00598
00599         if (FAILED(hr))
00600                 return hr;
00601
00602         hr = shell_folder->GetUIObjectOf(hWnd, 1, (LPCITEMIDLIST*)&pidl_last, riid, NULL, ppvOut);
00603
00604         ShellMalloc()->Free((void*)pidl_last);
00605
00606         return hr;
00607 }
00608
00609  // get full path of specified directory entry
00610 bool Entry::get_path_base ( PTSTR path, size_t path_count, ENTRY_TYPE etype ) const
00611 {
00612         int level = 0;
00613         size_t len = 0;
00614         size_t l = 0;
00615         LPCTSTR name = NULL;
00616         TCHAR buffer[MAX_PATH];
00617
00618         if (!path || path_count==0)
00619                 return false;
00620
00621         const Entry* entry;
00622         if ( path_count > 1 )
00623         {
00624                 for(entry=this; entry; level++) {
00625                         l = 0;
00626
00627                         if (entry->_etype == etype) {
00628                                 name = entry->_data.cFileName;
00629
00630                                 for(LPCTSTR s=name; *s && *s!=TEXT('/') && *s!=TEXT('\\'); s++)
00631                                         ++l;
00632
00633                                 if (!entry->_up)
00634                                         break;
00635                         } else {
00636                                 if (entry->get_path(buffer, COUNTOF(buffer))) {
00637                                         l = _tcslen(buffer);
00638                                         name = buffer;
00639
00640                                         /* special handling of drive names */
00641                                         if (l>0 && buffer[l-1]=='\\' && path[0]=='\\')
00642                                                 --l;
00643
00644                                         if ( len+l >= path_count )
00645                                         {
00646                                                 if ( l + 1 > path_count )
00647                                                         len = 0;
00648                                                 else
00649                                                         len = path_count - l - 1;
00650                                         }
00651                                         memmove(path+l, path, len*sizeof(TCHAR));
00652                                         if ( l+1 >= path_count )
00653                                                 l = path_count - 1;
00654                                         memcpy(path, name, l*sizeof(TCHAR));
00655                                         len += l;
00656                                 }
00657
00658                                 entry = NULL;
00659                                 break;
00660                         }
00661
00662                         if (l > 0) {
00663                                 if ( len+l+1 >= path_count )
00664                                 {
00665                                         /* compare to 2 here because of terminator plus the '\\' we prepend */
00666                                         if ( l + 2 > path_count )
00667                                                 len = 0;
00668                                         else
00669                                                 len = path_count - l - 2;
00670                                 }
00671                                 memmove(path+l+1, path, len*sizeof(TCHAR));
00672                                 /* compare to 2 here because of terminator plus the '\\' we prepend */
00673                                 if ( l+2 >= path_count )
00674                                         l = path_count - 2;
00675                                 memcpy(path+1, name, l*sizeof(TCHAR));
00676                                 len += l+1;
00677
00678                                 if ( etype == ET_WINDOWS && entry->_up && !(entry->_up->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))     // a NTFS stream?
00679                                         path[0] = TEXT(':');
00680                                 else
00681                                         path[0] = TEXT('\\');
00682                         }
00683
00684                         entry = entry->_up;
00685                 }
00686
00687                 if (entry) {
00688                         if ( len+l >= path_count )
00689                         {
00690                                 if ( l + 1 > path_count )
00691                                         len = 0;
00692                                 else
00693                                         len = path_count - l - 1;
00694                         }
00695                         memmove(path+l, path, len*sizeof(TCHAR));
00696                         if ( l+1 >= path_count )
00697                                 l = path_count - 1;
00698                         memcpy(path, name, l*sizeof(TCHAR));
00699                         len += l;
00700                 }
00701
00702                 if ( !level && (len+1 < path_count) )
00703                         path[len++] = TEXT('\\');
00704         }
00705
00706         path[len] = TEXT('\0');
00707
00708         return true;
00709 }
00710
00711  // recursively free all child entries
00712 void Entry::free_subentries()
00713 {
00714         Entry *entry, *next=_down;
00715
00716         if (next) {
00717                 _down = 0;
00718
00719                 do {
00720                         entry = next;
00721                         next = entry->_next;
00722
00723                         entry->free_subentries();
00724                         delete entry;
00725                 } while(next);
00726         }
00727 }
00728
00729
00730 Entry* Root::read_tree(LPCTSTR path, int scan_flags)
00731 {
00732         Entry* entry;
00733
00734         if (path && *path)
00735                 entry = _entry->read_tree(path, _sort_order);
00736         else {
00737                 entry = _entry->read_tree(NULL, _sort_order);
00738
00739                 _entry->smart_scan();
00740
00741                 if (_entry->_down)
00742                         _entry->_expanded = true;
00743         }
00744
00745         return entry;
00746 }
00747
00748
00749 Entry* Root::read_tree(LPCITEMIDLIST pidl, int scan_flags)
00750 {
00751         return _entry->read_tree(pidl, _sort_order);
00752 }


ROS Explorer: entries.h File Reference

  • File List
  • File Members
shell

entries.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | Entry
base of all file and directory entries More...
struct | Directory
base for all directory entries More...
struct | Root
root entry for file system trees More...

Defines

#define | ATTRIBUTE_LONGNAME 0x08000000
#define | ATTRIBUTE_VOLNAME 0x10000000
#define | ATTRIBUTE_ERASED 0x20000000
#define | ATTRIBUTE_SYMBOLIC_LINK 0x40000000
#define | ATTRIBUTE_EXECUTABLE 0x80000000
#define | SHGFI_ADDOVERLAYS 0x000000020

Enumerations

enum ENTRY_TYPE {
ET_UNKNOWN, ET_WINDOWS, ET_SHELL, ET_NTOBJS,
ET_REGISTRY, ET_FAT, ET_WEB
}
enum SORT_ORDER {
SORT_NONE, SORT_NAME, SORT_EXT, SORT_SIZE,
SORT_DATE
}
enum | SCAN_FLAGS { SCAN_DO_ACCESS = 2, SCAN_ALL = 3, SCAN_FILESYSTEM = 4 }
enum ICONCACHE_FLAGS {
ICF_NORMAL = 0, ICF_LARGE = 1, ICF_OPEN = 2, ICF_OVERLAYS = 4,
ICF_HICON = 8, ICF_SYSCACHE = 16
}

Define Documentation

#define ATTRIBUTE_ERASED 0x20000000

Definition at line 62 of file entries.h.

#define ATTRIBUTE_EXECUTABLE 0x80000000

Definition at line 64 of file entries.h.

Referenced by Pane::draw_item(), and FileTypeManager::set_type().

#define ATTRIBUTE_LONGNAME 0x08000000

Definition at line 60 of file entries.h.

#define ATTRIBUTE_SYMBOLIC_LINK 0x40000000

Definition at line 63 of file entries.h.

Referenced by Pane::draw_item(), ShellDirectory::read_directory(), and NtObjDirectory::read_directory().

#define ATTRIBUTE_VOLNAME 0x10000000

Definition at line 61 of file entries.h.

#define SHGFI_ADDOVERLAYS 0x000000020

Definition at line 77 of file entries.h.

Referenced by IconCache::extract().

Enumeration Type Documentation

enum ENTRY_TYPE

Enumerator:
ET_UNKNOWN
ET_WINDOWS
ET_SHELL
ET_NTOBJS
ET_REGISTRY
ET_FAT
ET_WEB

Definition at line 29 of file entries.h.

00029                 {
00030         ET_UNKNOWN,
00031         ET_WINDOWS,
00032 #ifdef __WINE__
00033         ET_UNIX,
00034 #endif
00035         ET_SHELL,
00036         ET_NTOBJS,
00037         ET_REGISTRY,
00038         ET_FAT,
00039         ET_WEB
00040 };

enum ICONCACHE_FLAGS

Enumerator:
ICF_NORMAL
ICF_LARGE
ICF_OPEN
ICF_OVERLAYS
ICF_HICON
ICF_SYSCACHE

Definition at line 67 of file entries.h.

00067                      {
00068         ICF_NORMAL       =  0,
00069         ICF_LARGE        =  1,
00070         ICF_OPEN         =  2,
00071         ICF_OVERLAYS =  4,
00072         ICF_HICON        =  8,
00073         ICF_SYSCACHE = 16
00074 };

enum SCAN_FLAGS

Enumerator:
SCAN_DO_ACCESS
SCAN_ALL
SCAN_FILESYSTEM

Definition at line 50 of file entries.h.

00050                 {
00051 //      SCAN_EXTRACT_ICONS      = 1,
00052         SCAN_DO_ACCESS          = 2,
00053
00054         SCAN_ALL                        = 3,
00055
00056         SCAN_FILESYSTEM         = 4
00057 };

enum SORT_ORDER

Enumerator:
SORT_NONE
SORT_NAME
SORT_EXT
SORT_SIZE
SORT_DATE

Definition at line 42 of file entries.h.

00042                 {
00043         SORT_NONE,
00044         SORT_NAME,
00045         SORT_EXT,
00046         SORT_SIZE,
00047         SORT_DATE
00048 };


ROS Explorer: entries.h Source File

  • File List
  • File Members
shell

entries.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // entries.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 enum ENTRY_TYPE {
00030         ET_UNKNOWN,
00031         ET_WINDOWS,
00032 #ifdef __WINE__
00033         ET_UNIX,
00034 #endif
00035         ET_SHELL,
00036         ET_NTOBJS,
00037         ET_REGISTRY,
00038         ET_FAT,
00039         ET_WEB
00040 };
00041
00042 enum SORT_ORDER {
00043         SORT_NONE,
00044         SORT_NAME,
00045         SORT_EXT,
00046         SORT_SIZE,
00047         SORT_DATE
00048 };
00049
00050 enum SCAN_FLAGS {
00051 //      SCAN_EXTRACT_ICONS      = 1,
00052         SCAN_DO_ACCESS          = 2,
00053
00054         SCAN_ALL                        = 3,
00055
00056         SCAN_FILESYSTEM         = 4
00057 };
00058
00059 #ifndef ATTRIBUTE_SYMBOLIC_LINK
00060 #define ATTRIBUTE_LONGNAME                      0x08000000
00061 #define ATTRIBUTE_VOLNAME                       0x10000000
00062 #define ATTRIBUTE_ERASED                        0x20000000
00063 #define ATTRIBUTE_SYMBOLIC_LINK         0x40000000
00064 #define ATTRIBUTE_EXECUTABLE            0x80000000
00065 #endif
00066
00067 enum ICONCACHE_FLAGS {
00068         ICF_NORMAL       =  0,
00069         ICF_LARGE        =  1,
00070         ICF_OPEN         =  2,
00071         ICF_OVERLAYS =  4,
00072         ICF_HICON        =  8,
00073         ICF_SYSCACHE = 16
00074 };
00075
00076 #ifndef SHGFI_ADDOVERLAYS // missing in MinGW (as of 28.12.2005)
00077 #define SHGFI_ADDOVERLAYS 0x000000020
00078 #endif
00079
00080
00082 struct Entry
00083 {
00084 protected:
00085         Entry(ENTRY_TYPE etype);
00086         Entry(Entry* parent, ENTRY_TYPE etype);
00087         Entry(const Entry&);
00088
00089 public:
00090         virtual ~Entry();
00091
00092         Entry*          _next;
00093         Entry*          _down;
00094         Entry*          _up;
00095
00096         bool            _expanded;
00097         bool            _scanned;
00098         int             _level;
00099
00100         WIN32_FIND_DATA _data;
00101
00102         SFGAOF          _shell_attribs;
00103         LPTSTR          _display_name;
00104         LPTSTR          _type_name;
00105         LPTSTR          _content;
00106
00107         ENTRY_TYPE      _etype;
00108         int /*ICON_ID*/ _icon_id;
00109
00110         BY_HANDLE_FILE_INFORMATION _bhfi;
00111         bool            _bhfi_valid;
00112
00113         void    free_subentries();
00114
00115         void    read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL);
00116         Entry*  read_tree(const void* path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL);
00117         void    sort_directory(SORT_ORDER sortOrder);
00118         void    smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL);
00119         int             extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL);
00120         int             safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL);
00121
00122         virtual void            read_directory(int scan_flags=SCAN_ALL) {}
00123         virtual const void*     get_next_path_component(const void*) const {return NULL;}
00124         virtual Entry*          find_entry(const void*) {return NULL;}
00125         virtual bool            get_path(PTSTR path, size_t path_count) const = 0;
00126         virtual ShellPath       create_absolute_pidl() const {return (LPCITEMIDLIST)NULL;}
00127         virtual HRESULT         GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut);
00128         virtual BOOL            launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL);
00129         virtual HRESULT         do_context_menu(HWND hwnd, const POINT& pos, CtxMenuInterfaces& cm_ifs);
00130
00131 protected:
00132         bool    get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const;
00133 };
00134
00135
00137 struct Directory {
00138 protected:
00139         Directory() : _path(NULL) {}
00140         virtual ~Directory() {}
00141
00142         void*   _path;
00143 };
00144
00145
00147 struct Root {
00148         Root();
00149         ~Root();
00150
00151         Entry*  _entry;
00152         TCHAR   _path[MAX_PATH];
00153         TCHAR   _volname[_MAX_FNAME];
00154         TCHAR   _fs[_MAX_DIR];
00155         DWORD   _drive_type;
00156         DWORD   _fs_flags;
00157         SORT_ORDER _sort_order;
00158
00159         Entry*  read_tree(LPCTSTR path, int scan_flags=SCAN_ALL);
00160         Entry*  read_tree(LPCITEMIDLIST pidl, int scan_flags=SCAN_ALL);
00161 };


ROS Explorer: explorer.cpp File Reference

  • File List
  • File Members

explorer.cpp File Reference

#include <precomp.h>
#include "resource.h"
#include <locale.h>
#include <io.h>
#include <fcntl.h>
#include "dialogs/settings.h"
#include "services/shellservices.h"

Include dependency graph for explorer.cpp:

Go to the source code of this file.

Classes

struct | ExplorerAboutDlg
"About Explorer" Dialog More...

Functions

int | initialize_gdb_stub ()
void | _log_ (LPCTSTR txt)
HBITMAP | create_bitmap_from_icon (HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
create a bitmap from an icon
HBITMAP | create_small_bitmap_from_icon (HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
int | ImageList_AddAlphaIcon (HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
add icon with alpha channel to imagelist using the specified background color
void | SetWindowIcon (HWND hwnd, UINT nid)
set big and small icons out of the resources for a window
void | explorer_show_frame (int cmdShow, LPTSTR lpCmdLine)
void | explorer_about (HWND hwndParent)
int | explorer_main (HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdShow)
int WINAPI | _tWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd)

Variables

DynamicLoadLibFct< void(__stdcall
*)(BOOL)> 		g_SHDOCVW_ShellDDEInit (TEXT("SHDOCVW"), 118)
ExplorerGlobals g_Globals

Function Documentation

void _log_ ( LPCTSTR txt )

Definition at line 143 of file explorer.cpp.

References ExplorerGlobals::_log.

00144 {
00145         FmtString msg(TEXT("%s\n"), txt);
00146
00147         if (g_Globals._log)
00148                 _fputts(msg, g_Globals._log);
00149
00150         OutputDebugString(msg);
00151 }

int WINAPI _tWinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPTSTR | lpCmdLine,
 |  | int | nShowCmd
 | ) |

Todo:
save previous shell application in config file
Todo:
save previous shell application in config file
TODO launching autostart programs can be moved into a background thread.

Definition at line 919 of file explorer.cpp.

References ExplorerGlobals::_desktop_mode, ExplorerGlobals::_desktops, ExplorerGlobals::_hwndDesktop, ExplorerGlobals::_log, CONTEXT, COUNTOF, DesktopWindow::Create(), explorer_main(), g_SHDOCVW_ShellDDEInit, HWND, Desktops::init(), ExplorerGlobals::init(), initialize_gdb_stub(), IsAnyDesktopRunning(), LOG, ExplorerGlobals::read_persistent(), Thread::Start(), Thread::Stop(), and ExplorerGlobals::write_persistent().

00920 {
00921         CONTEXT("WinMain()");
00922
00923         BOOL any_desktop_running = IsAnyDesktopRunning();
00924
00925         BOOL startup_desktop;
00926
00927          // strip extended options from the front of the command line
00928         String ext_options;
00929
00930         while(*lpCmdLine == '-') {
00931                 while(*lpCmdLine && !_istspace((unsigned)*lpCmdLine))
00932                         ext_options += *lpCmdLine++;
00933
00934                 while(_istspace((unsigned)*lpCmdLine))
00935                         ++lpCmdLine;
00936         }
00937
00938          // command line option "-install" to replace previous shell application with ROS Explorer
00939         if (_tcsstr(ext_options,TEXT("-install"))) {
00940                  // install ROS Explorer into the registry
00941                 TCHAR path[MAX_PATH];
00942
00943                 int l = GetModuleFileName(0, path, COUNTOF(path));
00944                 if (l) {
00945                         HKEY hkey;
00946
00947                         if (!RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hkey)) {
00948
00950
00951                                 RegSetValueEx(hkey, TEXT("Shell"), 0, REG_SZ, (LPBYTE)path, l*sizeof(TCHAR));
00952                                 RegCloseKey(hkey);
00953                         }
00954
00955                         if (!RegOpenKey(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hkey)) {
00956
00958
00959                                 RegSetValueEx(hkey, TEXT("Shell"), 0, REG_SZ, (LPBYTE)TEXT(""), l*sizeof(TCHAR));
00960                                 RegCloseKey(hkey);
00961                         }
00962                 }
00963
00964                 HWND shellWindow = GetShellWindow();
00965
00966                 if (shellWindow) {
00967                         DWORD pid;
00968
00969                          // terminate shell process for NT like systems
00970                         GetWindowThreadProcessId(shellWindow, &pid);
00971                         HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
00972
00973                          // On Win 9x it's sufficient to destroy the shell window.
00974                         DestroyWindow(shellWindow);
00975
00976                         if (TerminateProcess(hProcess, 0))
00977                                 WaitForSingleObject(hProcess, INFINITE);
00978
00979                         CloseHandle(hProcess);
00980                 }
00981
00982                 startup_desktop = TRUE;
00983         } else {
00984                  // create desktop window and task bar only, if there is no other shell and we are
00985                  // the first explorer instance
00986                  // MS Explorer looks additionally into the registry entry HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\shell,
00987                  // to decide wether it is currently configured as shell application.
00988                 startup_desktop = !any_desktop_running;
00989         }
00990
00991
00992         bool autostart = !any_desktop_running;
00993
00994          // disable autostart if the SHIFT key is pressed
00995         if (GetAsyncKeyState(VK_SHIFT) < 0)
00996                 autostart = false;
00997
00998 #ifdef _DEBUG   //MF: disabled for debugging
00999         autostart = false;
01000 #endif
01001
01002          // If there is given the command line option "-desktop", create desktop window anyways
01003         if (_tcsstr(ext_options,TEXT("-desktop")))
01004                 startup_desktop = TRUE;
01005 #ifndef ROSSHELL
01006         else if (_tcsstr(ext_options,TEXT("-nodesktop")))
01007                 startup_desktop = FALSE;
01008
01009          // Don't display cabinet window in desktop mode
01010         if (startup_desktop && !_tcsstr(ext_options,TEXT("-explorer")))
01011                 nShowCmd = SW_HIDE;
01012 #endif
01013
01014         if (_tcsstr(ext_options,TEXT("-noautostart")))
01015                 autostart = false;
01016         else if (_tcsstr(ext_options,TEXT("-autostart")))
01017                 autostart = true;
01018
01019 #ifndef __WINE__
01020         if (_tcsstr(ext_options,TEXT("-console"))) {
01021                 AllocConsole();
01022
01023                 _dup2(_open_osfhandle((long)GetStdHandle(STD_INPUT_HANDLE), _O_RDONLY), 0);
01024                 _dup2(_open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), 0), 1);
01025                 _dup2(_open_osfhandle((long)GetStdHandle(STD_ERROR_HANDLE), 0), 2);
01026
01027                 g_Globals._log = _fdopen(1, "w");
01028                 setvbuf(g_Globals._log, 0, _IONBF, 0);
01029
01030                 LOG(TEXT("starting explorer debug log\n"));
01031         }
01032 #endif
01033
01034
01035         if (startup_desktop) {
01036                  // hide the XP login screen (Credit to Nicolas Escuder)
01037                  // another undocumented event: "Global\\msgina: ReturnToWelcome"
01038                 if (!SetShellReadyEvent(TEXT("msgina: ShellReadyEvent")))
01039                         SetShellReadyEvent(TEXT("Global\\msgina: ShellReadyEvent"));
01040         }
01041 #ifdef ROSSHELL
01042         else
01043                 return 0;       // no shell to launch, so exit immediatelly
01044 #endif
01045
01046
01047         if (!any_desktop_running) {
01048                  // launch the shell DDE server
01049                 if (g_SHDOCVW_ShellDDEInit)
01050                         (*g_SHDOCVW_ShellDDEInit)(TRUE);
01051         }
01052
01053
01054         bool use_gdb_stub = false;      // !IsDebuggerPresent();
01055
01056         if (_tcsstr(ext_options,TEXT("-debug")))
01057                 use_gdb_stub = true;
01058
01059         if (_tcsstr(ext_options,TEXT("-break"))) {
01060                 LOG(TEXT("debugger breakpoint"));
01061 #ifdef _MSC_VER
01062                 __asm int 3
01063 #else
01064                 asm("int3");
01065 #endif
01066         }
01067
01068          // activate GDB remote debugging stub if no other debugger is running
01069         if (use_gdb_stub) {
01070                 LOG(TEXT("waiting for debugger connection...\n"));
01071
01072                 initialize_gdb_stub();
01073         }
01074
01075         g_Globals.init(hInstance);
01076
01077          // initialize COM and OLE before creating the desktop window
01078         OleInit usingCOM;
01079
01080          // init common controls library
01081         CommonControlInit usingCmnCtrl;
01082
01083         g_Globals.read_persistent();
01084
01085         if (startup_desktop) {
01086                 WaitCursor wait;
01087
01088                 g_Globals._desktops.init();
01089
01090                 g_Globals._hwndDesktop = DesktopWindow::Create();
01091 #ifdef _USE_HDESK
01092                 g_Globals._desktops.get_current_Desktop()->_hwndDesktop = g_Globals._hwndDesktop;
01093 #endif
01094         }
01095
01096         Thread* pSSOThread = NULL;
01097
01098         if (startup_desktop) {
01099                  // launch SSO thread to allow message processing independent from the explorer main thread
01100                 pSSOThread = new SSOThread;
01101                 pSSOThread->Start();
01102         }
01103
01105         if (autostart) {
01106                 char* argv[] = {"", "s"};       // call startup routine in SESSION_START mode
01107                 startup(2, argv);
01108         }
01109
01110 #ifndef ROSSHELL
01111         if (g_Globals._hwndDesktop)
01112                 g_Globals._desktop_mode = true;
01113 #endif
01114
01115
01116         int ret = explorer_main(hInstance, lpCmdLine, nShowCmd);
01117
01118
01119          // write configuration file
01120         g_Globals.write_persistent();
01121
01122         if (pSSOThread) {
01123                 pSSOThread->Stop();
01124                 delete pSSOThread;
01125         }
01126
01127         if (!any_desktop_running) {
01128                  // shutdown the shell DDE server
01129                 if (g_SHDOCVW_ShellDDEInit)
01130                         (*g_SHDOCVW_ShellDDEInit)(FALSE);
01131         }
01132
01133         return ret;
01134 }

Here is the call graph for this function:

HBITMAP create_bitmap_from_icon | ( | HICON | hIcon,
 |  | HBRUSH | hbrush_bkgnd,
 |  | HDC | hdc_wnd
 | ) |

create a bitmap from an icon

Definition at line 325 of file explorer.cpp.

Referenced by Icon::create_bitmap(), TaskBar::EnumWndProc(), and ImageList_AddAlphaIcon().

00326 {
00327         int cx = GetSystemMetrics(SM_CXSMICON); //ICON_SIZE_X;
00328         int cy = GetSystemMetrics(SM_CYSMICON); //ICON_SIZE_Y;
00329         HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
00330
00331         MemCanvas canvas;
00332         BitmapSelection sel(canvas, hbmp);
00333
00334         RECT rect = {0, 0, cx, cy};
00335         FillRect(canvas, &rect, hbrush_bkgnd);
00336
00337         DrawIconEx(canvas, 0, 0, hIcon, cx, cy, 0, hbrush_bkgnd, DI_NORMAL);
00338
00339         return hbmp;
00340 }

HBITMAP create_small_bitmap_from_icon | ( | HICON | hIcon,
 |  | HBRUSH | hbrush_bkgnd,
 |  | HDC | hdc_wnd
 | ) |

Definition at line 342 of file explorer.cpp.

00343 {
00344         int cx = GetSystemMetrics(SM_CXSMICON);
00345         int cy = GetSystemMetrics(SM_CYSMICON);
00346         HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
00347
00348         MemCanvas canvas;
00349         BitmapSelection sel(canvas, hbmp);
00350
00351         RECT rect = {0, 0, cx, cy};
00352         FillRect(canvas, &rect, hbrush_bkgnd);
00353
00354         DrawIconEx(canvas, 0, 0, hIcon, cx, cy, 0, hbrush_bkgnd, DI_NORMAL);
00355
00356         return hbmp;
00357 }

void explorer_about ( HWND hwndParent )

Definition at line 817 of file explorer.cpp.

References Dialog::DoModal(), IDD_ABOUT_EXPLORER, and WINDOW_CREATOR.

Referenced by MainFrameBase::Command(), DesktopBar::Command(), and DesktopShellView::DoDesktopContextMenu().

00818 {
00819         Dialog::DoModal(IDD_ABOUT_EXPLORER, WINDOW_CREATOR(ExplorerAboutDlg), hwndParent);
00820 }

Here is the call graph for this function:

int explorer_main | ( | HINSTANCE | hInstance,
 |  | LPTSTR | lpCmdLine,
 |  | int | cmdShow
 | ) |

Definition at line 844 of file explorer.cpp.

References CONTEXT, and HandleException().

Referenced by _tWinMain().

00845 {
00846         CONTEXT("explorer_main");
00847
00848          // initialize Common Controls library
00849         CommonControlInit usingCmnCtrl;
00850
00851         try {
00852                 InitInstance(hInstance);
00853         } catch(COMException& e) {
00854                 HandleException(e, GetDesktopWindow());
00855                 return -1;
00856         }
00857
00858 #ifndef ROSSHELL
00859         if (cmdShow != SW_HIDE) {
00860 /*      // don't maximize if being called from the ROS desktop
00861                 if (cmdShow == SW_SHOWNORMAL)
00863                         cmdShow = SW_MAXIMIZE;
00864 */
00865
00866                 explorer_show_frame(cmdShow, lpCmdLine);
00867         }
00868 #endif
00869
00870         return Window::MessageLoop();
00871 }

Here is the call graph for this function:

void explorer_show_frame | ( | int | cmdShow,
 |  | LPTSTR | lpCmdLine
 | ) |

Definition at line 603 of file explorer.cpp.

References ExplorerCmd::_cmdShow, ExplorerGlobals::_hMainWnd, ExplorerGlobals::_hwndDesktop, ExplorerCmd::_mdi, ExplorerGlobals::_prescan_nodes, MainFrameBase::Create(), Dialog::DoModal(), ExplorerGlobals::get_cfg(), IDD_MDI_SDI, ExplorerCmd::ParseCmdLine(), and WINDOW_CREATOR.

Referenced by StartMenuHandler::Command(), DesktopBar::Command(), ExplorerCmd::IsValidPath(), DesktopBar::ProcessHotKey(), and DesktopWindow::WndProc().

00604 {
00605         ExplorerCmd cmd;
00606
00607         if (g_Globals._hMainWnd) {
00608                 if (IsIconic(g_Globals._hMainWnd))
00609                         ShowWindow(g_Globals._hMainWnd, SW_RESTORE);
00610                 else
00611                         SetForegroundWindow(g_Globals._hMainWnd);
00612
00613                 return;
00614         }
00615
00616         g_Globals._prescan_nodes = false;
00617
00618         XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
00619         XS_String mdiStr = XMLString(explorer_options, "mdi");
00620
00621          // If there isn't yet the "mdi" setting in the configuration, display MDI/SDI dialog.
00622         if (mdiStr.empty())
00623                 Dialog::DoModal(IDD_MDI_SDI, WINDOW_CREATOR(MdiSdiDlg), g_Globals._hwndDesktop);
00624
00625          // Now read the MDI attribute again and interpret it as boolean value.
00626         cmd._mdi = XMLBool(explorer_options, "mdi", true);
00627
00628         cmd._cmdShow = cmdShow;
00629
00630          // parse command line options, which may overwrite the MDI flag
00631         if (lpCmdLine)
00632                 cmd.ParseCmdLine(lpCmdLine);
00633
00634          // create main window
00635         MainFrameBase::Create(cmd);
00636 }

Here is the call graph for this function:

int ImageList_AddAlphaIcon | ( | HIMAGELIST | himl,
 |  | HICON | hIcon,
 |  | HBRUSH | hbrush_bkgnd,
 |  | HDC | hdc_wnd
 | ) |

add icon with alpha channel to imagelist using the specified background color

Definition at line 359 of file explorer.cpp.

References create_bitmap_from_icon().

Referenced by Icon::add_to_imagelist(), MainFrameBase::FillBookmarks(), and TrayNotifyDlg::TrayNotifyDlg().

00360 {
00361         HBITMAP hbmp = create_bitmap_from_icon(hIcon, hbrush_bkgnd, hdc_wnd);
00362
00363         int ret = ImageList_Add(himl, hbmp, 0);
00364
00365         DeleteObject(hbmp);
00366
00367         return ret;
00368 }

Here is the call graph for this function:

int initialize_gdb_stub ( )

Referenced by _tWinMain().

void SetWindowIcon | ( | HWND | hwnd,
 |  | UINT | nid
 | ) |

set big and small icons out of the resources for a window

Definition at line 585 of file explorer.cpp.

References Window_SetIcon.

Referenced by DesktopBar::DesktopBar(), ExplorerAboutDlg::ExplorerAboutDlg(), FindProgramDlg::FindProgramDlg(), and TrayNotifyDlg::TrayNotifyDlg().

00586 {
00587         HICON hIcon = ResIcon(nid);
00588         (void)Window_SetIcon(hwnd, ICON_BIG, hIcon);
00589
00590         HICON hIconSmall = SmallIcon(nid);
00591         (void)Window_SetIcon(hwnd, ICON_SMALL, hIconSmall);
00592 }

Variable Documentation

ExplorerGlobals g_Globals

Definition at line 53 of file explorer.cpp.

Referenced by StartMenu::AddButton(), FavoritesMenu::AddEntries(), SearchMenu::AddEntries(), BrowseMenu::AddEntries(), SettingsMenu::AddEntries(), QuickLaunchBar::AddShortcuts(), StartMenuHandler::Command(), MdiSdiDlg::Command(), TaskbarSettingsDlg::Command(), DesktopSettingsDlg::Command(), MainFrameBase::Command(), DesktopBar::Command(), ChildWindow::create(), Window::Create(), SDIMainFrame::Create(), MDIMainFrame::Create(), MainFrameBase::Create(), FileChildWindow::create(), Pane::create_header(), DesktopSettingsDlg::DesktopSettingsDlg(), Dialog::DoModal(), Pane::draw_item(), Entry::extract_icon(), BookmarkList::fill_tree(), ShellDirectory::fill_w32fdata_shell(), MainFrameBase::FillBookmarks(), FindProgramDlg::FindProgramDlg(), ShellBrowser::get_image_idx(), StartMenuRoot::Init(), Pane::init(), DesktopBar::Init(), DesktopWindow::Init(), ShellBrowser::InsertSubitems(), ShellBrowser::invalidate_cache(), MainFrameBase::MainFrameBase(), MDIMainFrame::MDIMainFrame(), MdiSdiDlg::MdiSdiDlg(), TaskbarSettingsDlg::Notify(), DesktopSettingsDlg::Notify(), FindProgramDlg::Notify(), MainFrameBase::OpenShellFolders(), MainFrameBase::ProcessMessage(), PropertySheetDialog::PropertySheetDialog(), PropSheetPage::PropSheetPage(), Favorites::read(), NotifyArea::read_config(), WinDirectory::read_directory(), ShellDirectory::read_directory(), Entry::read_directory_base(), TrayNotifyDlg::RefreshProperties(), StartMenuRoot::StartMenuRoot(), Desktops::SwitchToDesktop(), TaskbarSettingsDlg::TaskbarSettingsDlg(), TrayNotifyDlg::TrayNotifyDlg(), WindowClass::WindowClass(), BackgroundWindow::WndProc(), NotifyArea::write_config(), Entry::~Entry(), and MainFrameBase::~MainFrameBase().

DynamicLoadLibFct<void(__stdcall*)(BOOL)> g_SHDOCVW_ShellDDEInit(TEXT("SHDOCVW"), 118)

Definition at line 50 of file explorer.cpp.

Referenced by _tWinMain().


ROS Explorer: explorer.cpp Source File

  • File List
  • File Members

explorer.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // explorer.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027  // Credits: Thanks to Leon Finker for his explorer cabinet window example
00028  //
00029
00030
00031 #include <precomp.h>    // <precomp.h> instead of "precomp.h" because the ROS build system needs this to find the precompiled header file (*.gch) in the output directory tree
00032
00033 #include "resource.h"
00034
00035 #include <locale.h>     // for setlocale()
00036
00037 #ifndef __WINE__
00038 #include <io.h>         // for dup2()
00039 #include <fcntl.h>      // for _O_RDONLY
00040 #endif
00041
00042 #include "dialogs/settings.h"   // for MdiSdiDlg
00043
00044 #include "services/shellservices.h"
00045
00046
00047 extern "C" int initialize_gdb_stub();   // start up GDB stub
00048
00049
00050 DynamicLoadLibFct<void(__stdcall*)(BOOL)> g_SHDOCVW_ShellDDEInit(TEXT("SHDOCVW"), 118);
00051
00052
00053 ExplorerGlobals g_Globals;
00054
00055
00056 ExplorerGlobals::ExplorerGlobals()
00057 {
00058         _hInstance = 0;
00059         _cfStrFName = 0;
00060
00061 #ifndef ROSSHELL
00062         _hframeClass = 0;
00063         _hMainWnd = 0;
00064         _desktop_mode = false;
00065         _prescan_nodes = false;
00066 #endif
00067
00068         _log = NULL;
00069 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
00070         _SHRestricted = 0;
00071 #endif
00072         _hwndDesktopBar = 0;
00073         _hwndShellView = 0;
00074         _hwndDesktop = 0;
00075 }
00076
00077
00078 void ExplorerGlobals::init(HINSTANCE hInstance)
00079 {
00080         _hInstance = hInstance;
00081
00082 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
00083         _SHRestricted = (DWORD(STDAPICALLTYPE*)(RESTRICTIONS)) GetProcAddress(GetModuleHandle(TEXT("SHELL32")), "SHRestricted");
00084 #endif
00085
00086         _icon_cache.init();
00087 }
00088
00089
00090 void ExplorerGlobals::read_persistent()
00091 {
00092          // read configuration file
00093         _cfg_dir.printf(TEXT("%s\\ReactOS"), (LPCTSTR)SpecialFolderFSPath(CSIDL_APPDATA,0));
00094         _cfg_path.printf(TEXT("%s\\ros-explorer-cfg.xml"), _cfg_dir.c_str());
00095
00096         if (!_cfg.read(_cfg_path)) {
00097                 if (_cfg._last_error != XML_ERROR_NO_ELEMENTS)
00098                         MessageBox(g_Globals._hwndDesktop, String(_cfg._last_error_msg.c_str()),
00099                                                 TEXT("ROS Explorer - reading user settings"), MB_OK);
00100
00101                 _cfg.read(TEXT("explorer-cfg-template.xml"));
00102         }
00103
00104          // read bookmarks
00105         _favorites_path.printf(TEXT("%s\\ros-explorer-bookmarks.xml"), _cfg_dir.c_str());
00106
00107         if (!_favorites.read(_favorites_path)) {
00108                 _favorites.import_IE_favorites(0);
00109                 _favorites.write(_favorites_path);
00110         }
00111 }
00112
00113 void ExplorerGlobals::write_persistent()
00114 {
00115          // write configuration file
00116         RecursiveCreateDirectory(_cfg_dir);
00117
00118         _cfg.write(_cfg_path);
00119         _favorites.write(_favorites_path);
00120 }
00121
00122
00123 XMLPos ExplorerGlobals::get_cfg()
00124 {
00125         XMLPos cfg_pos(&_cfg);
00126
00127         cfg_pos.smart_create("explorer-cfg");
00128
00129         return cfg_pos;
00130 }
00131
00132 XMLPos ExplorerGlobals::get_cfg(const char* path)
00133 {
00134         XMLPos cfg_pos(&_cfg);
00135
00136         cfg_pos.smart_create("explorer-cfg");
00137         cfg_pos.create_relative(path);
00138
00139         return cfg_pos;
00140 }
00141
00142
00143 void _log_(LPCTSTR txt)
00144 {
00145         FmtString msg(TEXT("%s\n"), txt);
00146
00147         if (g_Globals._log)
00148                 _fputts(msg, g_Globals._log);
00149
00150         OutputDebugString(msg);
00151 }
00152
00153
00154 bool FileTypeManager::is_exe_file(LPCTSTR ext)
00155 {
00156         static const LPCTSTR s_executable_extensions[] = {
00157                 TEXT("COM"),
00158                 TEXT("EXE"),
00159                 TEXT("BAT"),
00160                 TEXT("CMD"),
00161                 TEXT("CMM"),
00162                 TEXT("BTM"),
00163                 TEXT("AWK"),
00164                 0
00165         };
00166
00167         TCHAR ext_buffer[_MAX_EXT];
00168         const LPCTSTR* p;
00169         LPCTSTR s;
00170         LPTSTR d;
00171
00172         for(s=ext+1,d=ext_buffer; (*d=toupper(*s)); s++)
00173                 ++d;
00174
00175         for(p=s_executable_extensions; *p; p++)
00176                 if (!lstrcmp(ext_buffer, *p))
00177                         return true;
00178
00179         return false;
00180 }
00181
00182
00183 const FileTypeInfo& FileTypeManager::operator[](String ext)
00184 {
00185         ext.toLower();
00186
00187         iterator found = find(ext);
00188         if (found != end())
00189                 return found->second;
00190
00191         FileTypeInfo& ftype = super::operator[](ext);
00192
00193         ftype._neverShowExt = false;
00194
00195         HKEY hkey;
00196         TCHAR value[MAX_PATH], display_name[MAX_PATH];
00197         LONG valuelen = sizeof(value);
00198
00199         if (!RegQueryValue(HKEY_CLASSES_ROOT, ext, value, &valuelen)) {
00200                 ftype._classname = value;
00201
00202                 valuelen = sizeof(display_name);
00203                 if (!RegQueryValue(HKEY_CLASSES_ROOT, ftype._classname, display_name, &valuelen))
00204                         ftype._displayname = display_name;
00205
00206                 if (!RegOpenKey(HKEY_CLASSES_ROOT, ftype._classname, &hkey)) {
00207                         if (!RegQueryValueEx(hkey, TEXT("NeverShowExt"), 0, NULL, NULL, NULL))
00208                                 ftype._neverShowExt = true;
00209
00210                         RegCloseKey(hkey);
00211                 }
00212         }
00213
00214         return ftype;
00215 }
00216
00217 LPCTSTR FileTypeManager::set_type(Entry* entry, bool dont_hide_ext)
00218 {
00219         LPCTSTR ext = _tcsrchr(entry->_data.cFileName, TEXT('.'));
00220
00221         if (ext) {
00222                 const FileTypeInfo& type = (*this)[ext];
00223
00224                 if (!type._displayname.empty())
00225                         entry->_type_name = _tcsdup(type._displayname);
00226
00227                  // hide some file extensions
00228                 if (type._neverShowExt && !dont_hide_ext) {
00229                         int len = ext - entry->_data.cFileName;
00230                         entry->_display_name = (LPTSTR) malloc((len+1)*sizeof(TCHAR));
00231                         lstrcpyn(entry->_display_name, entry->_data.cFileName, len + 1);
00232                 }
00233
00234                 if (is_exe_file(ext))
00235                         entry->_data.dwFileAttributes |= ATTRIBUTE_EXECUTABLE;
00236         }
00237
00238         return ext;
00239 }
00240
00241
00242 Icon::Icon()
00243  :      _id(ICID_UNKNOWN),
00244         _itype(IT_STATIC),
00245         _hicon(0)
00246 {
00247 }
00248
00249 Icon::Icon(ICON_ID id, UINT nid)        //, int cx, int cy
00250  :      _id(id),
00251         _itype(IT_STATIC),
00252         _hicon(ResIcon(nid))    // ResIconEx(nid, cx, cy)
00253 {
00254 }
00255
00256 Icon::Icon(ICON_TYPE itype, int id, HICON hIcon)
00257  :      _id((ICON_ID)id),
00258         _itype(itype),
00259         _hicon(hIcon)
00260 {
00261 }
00262
00263 Icon::Icon(ICON_TYPE itype, int id, int sys_idx)
00264  :      _id((ICON_ID)id),
00265         _itype(itype),
00266         _sys_idx(sys_idx)
00267 {
00268 }
00269
00270 void Icon::draw(HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const
00271 {
00272         if (_itype == IT_SYSCACHE)
00273                 ImageList_DrawEx(g_Globals._icon_cache.get_sys_imagelist(), _sys_idx, hdc, x, y, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL);
00274         else
00275                 DrawIconEx(hdc, x, y, _hicon, cx, cy, 0, bk_brush, DI_NORMAL);
00276 }
00277
00278 HBITMAP Icon::create_bitmap(COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const
00279 {
00280         if (_itype == IT_SYSCACHE) {
00281                 HIMAGELIST himl = g_Globals._icon_cache.get_sys_imagelist();
00282
00283                 int cx, cy;
00284                 ImageList_GetIconSize(himl, &cx, &cy);
00285
00286                 HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
00287                 HDC hdc = CreateCompatibleDC(hdc_wnd);
00288                 HBITMAP hbmp_old = SelectBitmap(hdc, hbmp);
00289                 ImageList_DrawEx(himl, _sys_idx, hdc, 0, 0, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL);
00290                 SelectBitmap(hdc, hbmp_old);
00291                 DeleteDC(hdc);
00292
00293                 return hbmp;
00294         } else
00295                 return create_bitmap_from_icon(_hicon, hbrBkgnd, hdc_wnd);
00296 }
00297
00298
00299 int Icon::add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color, HBRUSH bk_brush) const
00300 {
00301         int ret;
00302
00303         if (_itype == IT_SYSCACHE) {
00304                 HIMAGELIST himl = g_Globals._icon_cache.get_sys_imagelist();
00305
00306                 int cx, cy;
00307                 ImageList_GetIconSize(himl, &cx, &cy);
00308
00309                 HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
00310                 HDC hdc = CreateCompatibleDC(hdc_wnd);
00311                 HBITMAP hbmp_old = SelectBitmap(hdc, hbmp);
00312                 ImageList_DrawEx(himl, _sys_idx, hdc, 0, 0, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL);
00313                 SelectBitmap(hdc, hbmp_old);
00314                 DeleteDC(hdc);
00315
00316                 ret = ImageList_Add(himl, hbmp, 0);
00317
00318                 DeleteObject(hbmp);
00319         } else
00320                 ret = ImageList_AddAlphaIcon(himl, _hicon, bk_brush, hdc_wnd);
00321
00322         return ret;
00323 }
00324
00325 HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd/*, bool large_icons*/)
00326 {
00327         int cx = GetSystemMetrics(SM_CXSMICON); //ICON_SIZE_X;
00328         int cy = GetSystemMetrics(SM_CYSMICON); //ICON_SIZE_Y;
00329         HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
00330
00331         MemCanvas canvas;
00332         BitmapSelection sel(canvas, hbmp);
00333
00334         RECT rect = {0, 0, cx, cy};
00335         FillRect(canvas, &rect, hbrush_bkgnd);
00336
00337         DrawIconEx(canvas, 0, 0, hIcon, cx, cy, 0, hbrush_bkgnd, DI_NORMAL);
00338
00339         return hbmp;
00340 }
00341
00342 HBITMAP create_small_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
00343 {
00344         int cx = GetSystemMetrics(SM_CXSMICON);
00345         int cy = GetSystemMetrics(SM_CYSMICON);
00346         HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
00347
00348         MemCanvas canvas;
00349         BitmapSelection sel(canvas, hbmp);
00350
00351         RECT rect = {0, 0, cx, cy};
00352         FillRect(canvas, &rect, hbrush_bkgnd);
00353
00354         DrawIconEx(canvas, 0, 0, hIcon, cx, cy, 0, hbrush_bkgnd, DI_NORMAL);
00355
00356         return hbmp;
00357 }
00358
00359 int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
00360 {
00361         HBITMAP hbmp = create_bitmap_from_icon(hIcon, hbrush_bkgnd, hdc_wnd);
00362
00363         int ret = ImageList_Add(himl, hbmp, 0);
00364
00365         DeleteObject(hbmp);
00366
00367         return ret;
00368 }
00369
00370
00371 int IconCache::s_next_id = ICID_DYNAMIC;
00372
00373
00374 void IconCache::init()
00375 {
00376         _icons[ICID_NONE]               = Icon(IT_STATIC, ICID_NONE, (HICON)0);
00377
00378         _icons[ICID_FOLDER]             = Icon(ICID_FOLDER,             IDI_FOLDER);
00379         //_icons[ICID_DOCUMENT] = Icon(ICID_DOCUMENT,   IDI_DOCUMENT);
00380         _icons[ICID_EXPLORER]   = Icon(ICID_EXPLORER,   IDI_EXPLORER);
00381         _icons[ICID_APP]                = Icon(ICID_APP,                IDI_APPICON);
00382
00383         _icons[ICID_CONFIG]             = Icon(ICID_CONFIG,             IDI_CONFIG);
00384         _icons[ICID_DOCUMENTS]  = Icon(ICID_DOCUMENTS,  IDI_DOCUMENTS);
00385         _icons[ICID_FAVORITES]  = Icon(ICID_FAVORITES,  IDI_FAVORITES);
00386         _icons[ICID_INFO]               = Icon(ICID_INFO,               IDI_INFO);
00387         _icons[ICID_APPS]               = Icon(ICID_APPS,               IDI_APPS);
00388         _icons[ICID_SEARCH]             = Icon(ICID_SEARCH,             IDI_SEARCH);
00389         _icons[ICID_ACTION]             = Icon(ICID_ACTION,             IDI_ACTION);
00390         _icons[ICID_SEARCH_DOC] = Icon(ICID_SEARCH_DOC, IDI_SEARCH_DOC);
00391         _icons[ICID_PRINTER]    = Icon(ICID_PRINTER,    IDI_PRINTER);
00392         _icons[ICID_NETWORK]    = Icon(ICID_NETWORK,    IDI_NETWORK);
00393         _icons[ICID_COMPUTER]   = Icon(ICID_COMPUTER,   IDI_COMPUTER);
00394         _icons[ICID_LOGOFF]             = Icon(ICID_LOGOFF,             IDI_LOGOFF);
00395         _icons[ICID_BOOKMARK]   = Icon(ICID_BOOKMARK,   IDI_DOT_TRANS);
00396 }
00397
00398
00399 const Icon& IconCache::extract(LPCTSTR path, ICONCACHE_FLAGS flags)
00400 {
00401          // search for matching icon with unchanged flags in the cache
00402         CacheKey mapkey(path, flags);
00403         PathCacheMap::iterator found = _pathCache.find(mapkey);
00404
00405         if (found != _pathCache.end())
00406                 return _icons[found->second];
00407
00408          // search for matching icon with handle
00409         CacheKey mapkey_hicon(path, flags|ICF_HICON);
00410         if (flags != mapkey_hicon.second) {
00411                 found = _pathCache.find(mapkey_hicon);
00412
00413                 if (found != _pathCache.end())
00414                         return _icons[found->second];
00415         }
00416
00417          // search for matching icon in the system image list cache
00418         CacheKey mapkey_syscache(path, flags|ICF_SYSCACHE);
00419         if (flags != mapkey_syscache.second) {
00420                 found = _pathCache.find(mapkey_syscache);
00421
00422                 if (found != _pathCache.end())
00423                         return _icons[found->second];
00424         }
00425
00426         SHFILEINFO sfi;
00427
00428         int shgfi_flags = 0;
00429
00430         if (flags & ICF_OPEN)
00431                 shgfi_flags |= SHGFI_OPENICON;
00432
00433         if ((flags&(ICF_LARGE|ICF_OVERLAYS|ICF_HICON)) && !(flags&ICF_SYSCACHE)) {
00434                 shgfi_flags |= SHGFI_ICON;
00435
00436                 if (!(flags & ICF_LARGE))
00437                         shgfi_flags |= SHGFI_SMALLICON;
00438
00439                 if (flags & ICF_OVERLAYS)
00440                         shgfi_flags |= SHGFI_ADDOVERLAYS;
00441
00442                  // get small/big icons with/without overlays
00443                 if (SHGetFileInfo(path, 0, &sfi, sizeof(sfi), shgfi_flags)) {
00444                         const Icon& icon = add(sfi.hIcon, IT_CACHED);
00445
00447                         _pathCache[mapkey_hicon] = icon;
00448
00449                         return icon;
00450                 }
00451         } else {
00452                 assert(!(flags&ICF_OVERLAYS));
00453
00454                 shgfi_flags |= SHGFI_SYSICONINDEX|SHGFI_SMALLICON;
00455
00456                  // use system image list - the "search program dialog" needs it
00457                 HIMAGELIST himlSys_small = (HIMAGELIST) SHGetFileInfo(path, 0, &sfi, sizeof(sfi), shgfi_flags);
00458
00459                 if (himlSys_small) {
00460                         _himlSys_small = himlSys_small;
00461
00462                         const Icon& icon = add(sfi.iIcon/*, IT_SYSCACHE*/);
00463
00465                         _pathCache[mapkey_syscache] = icon;
00466
00467                         return icon;
00468                 }
00469         }
00470
00471         return _icons[ICID_NONE];
00472 }
00473
00474 const Icon& IconCache::extract(LPCTSTR path, int idx, ICONCACHE_FLAGS flags)
00475 {
00476         IdxCacheKey key(path, make_pair(idx, (flags|ICF_HICON)&~ICF_SYSCACHE));
00477
00478         key.first.toLower();
00479
00480         IdxCacheMap::iterator found = _idxCache.find(key);
00481
00482         if (found != _idxCache.end())
00483                 return _icons[found->second];
00484
00485         HICON hIcon;
00486
00487         if ((int)ExtractIconEx(path, idx, NULL, &hIcon, 1) > 0) {
00488                 const Icon& icon = add(hIcon, IT_CACHED);
00489
00490                 _idxCache[key] = icon;
00491
00492                 return icon;
00493         } else {
00494
00496
00497                 return _icons[ICID_NONE];
00498         }
00499 }
00500
00501 const Icon& IconCache::extract(IExtractIcon* pExtract, LPCTSTR path, int idx, ICONCACHE_FLAGS flags)
00502 {
00503         HICON hIconLarge = 0;
00504         HICON hIcon;
00505
00506         bool large_icons = flags & ICF_LARGE;
00507         HRESULT hr = pExtract->Extract(path, idx, &hIconLarge, &hIcon, MAKELONG(GetSystemMetrics(SM_CXICON), ICON_SIZE_X));
00508
00509         if (hr == NOERROR) {    //@@ oder SUCCEEDED(hr) ?
00510                 if (large_icons) {      //@@ OK?
00511                         if (hIcon)
00512                                 DestroyIcon(hIcon);
00513
00514                         hIcon = hIconLarge;
00515                 } else {
00516                         if (hIconLarge)
00517                                 DestroyIcon(hIconLarge);
00518                 }
00519
00520                 if (hIcon)
00521                         return add(hIcon);      //@@ When do we want not to free this icons?
00522         }
00523
00524         return _icons[ICID_NONE];
00525 }
00526
00527 const Icon& IconCache::add(HICON hIcon, ICON_TYPE type)
00528 {
00529         int id = ++s_next_id;
00530
00531         return _icons[id] = Icon(type, id, hIcon);
00532 }
00533
00534 const Icon&     IconCache::add(int sys_idx/*, ICON_TYPE type=IT_SYSCACHE*/)
00535 {
00536         int id = ++s_next_id;
00537
00538         return _icons[id] = SysCacheIcon(id, sys_idx);
00539 }
00540
00541 const Icon& IconCache::get_icon(int id)
00542 {
00543         return _icons[id];
00544 }
00545
00546 void IconCache::free_icon(int icon_id)
00547 {
00548         IconMap::iterator found = _icons.find(icon_id);
00549
00550         if (found != _icons.end()) {
00551                 Icon& icon = found->second;
00552
00553                 if (icon.destroy())
00554                         _icons.erase(found);
00555         }
00556 }
00557
00558
00559 ResString::ResString(UINT nid)
00560 {
00561         TCHAR buffer[BUFFER_LEN];
00562
00563         int len = LoadString(g_Globals._hInstance, nid, buffer, sizeof(buffer)/sizeof(TCHAR));
00564
00565         super::assign(buffer, len);
00566 }
00567
00568
00569 ResIcon::ResIcon(UINT nid)
00570 {
00571         _hicon = LoadIcon(g_Globals._hInstance, MAKEINTRESOURCE(nid));
00572 }
00573
00574 SmallIcon::SmallIcon(UINT nid)
00575 {
00576         _hicon = (HICON)LoadImage(g_Globals._hInstance, MAKEINTRESOURCE(nid), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
00577 }
00578
00579 ResIconEx::ResIconEx(UINT nid, int w, int h)
00580 {
00581         _hicon = (HICON)LoadImage(g_Globals._hInstance, MAKEINTRESOURCE(nid), IMAGE_ICON, w, h, LR_SHARED);
00582 }
00583
00584
00585 void SetWindowIcon(HWND hwnd, UINT nid)
00586 {
00587         HICON hIcon = ResIcon(nid);
00588         (void)Window_SetIcon(hwnd, ICON_BIG, hIcon);
00589
00590         HICON hIconSmall = SmallIcon(nid);
00591         (void)Window_SetIcon(hwnd, ICON_SMALL, hIconSmall);
00592 }
00593
00594
00595 ResBitmap::ResBitmap(UINT nid)
00596 {
00597         _hBmp = LoadBitmap(g_Globals._hInstance, MAKEINTRESOURCE(nid));
00598 }
00599
00600
00601 #ifndef ROSSHELL
00602
00603 void explorer_show_frame(int cmdShow, LPTSTR lpCmdLine)
00604 {
00605         ExplorerCmd cmd;
00606
00607         if (g_Globals._hMainWnd) {
00608                 if (IsIconic(g_Globals._hMainWnd))
00609                         ShowWindow(g_Globals._hMainWnd, SW_RESTORE);
00610                 else
00611                         SetForegroundWindow(g_Globals._hMainWnd);
00612
00613                 return;
00614         }
00615
00616         g_Globals._prescan_nodes = false;
00617
00618         XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
00619         XS_String mdiStr = XMLString(explorer_options, "mdi");
00620
00621          // If there isn't yet the "mdi" setting in the configuration, display MDI/SDI dialog.
00622         if (mdiStr.empty())
00623                 Dialog::DoModal(IDD_MDI_SDI, WINDOW_CREATOR(MdiSdiDlg), g_Globals._hwndDesktop);
00624
00625          // Now read the MDI attribute again and interpret it as boolean value.
00626         cmd._mdi = XMLBool(explorer_options, "mdi", true);
00627
00628         cmd._cmdShow = cmdShow;
00629
00630          // parse command line options, which may overwrite the MDI flag
00631         if (lpCmdLine)
00632                 cmd.ParseCmdLine(lpCmdLine);
00633
00634          // create main window
00635         MainFrameBase::Create(cmd);
00636 }
00637
00638 bool ExplorerCmd::ParseCmdLine(LPCTSTR lpCmdLine)
00639 {
00640         bool ok = true;
00641
00642         LPCTSTR b = lpCmdLine;
00643         LPCTSTR p = b;
00644
00645         while(*b) {
00646                  // remove leading space
00647                 while(_istspace((unsigned)*b))
00648                         ++b;
00649
00650                 p = b;
00651
00652                 bool quote = false;
00653
00654                  // options are separated by ','
00655                 for(; *p; ++p) {
00656                         if (*p == '"')  // Quote characters may appear at any position in the command line.
00657                                 quote = !quote;
00658                         else if (*p==',' && !quote)
00659                                 break;
00660                 }
00661
00662                 if (p > b) {
00663                         int l = p - b;
00664
00665                          // remove trailing space
00666                         while(l>0 && _istspace((unsigned)b[l-1]))
00667                                 --l;
00668
00669                         if (!EvaluateOption(String(b, l)))
00670                                 ok = false;
00671
00672                         if (*p)
00673                                 ++p;
00674
00675                         b = p;
00676                 }
00677         }
00678
00679         return ok;
00680 }
00681
00682 bool ExplorerCmd::EvaluateOption(LPCTSTR option)
00683 {
00684         String opt_str;
00685
00686          // Remove quote characters, as they are evaluated at this point.
00687         for(; *option; ++option)
00688                 if (*option != '"')
00689                         opt_str += *option;
00690
00691         option = opt_str;
00692
00693         if (option[0] == '/') {
00694                 ++option;
00695
00696                  // option /e for windows in explorer mode
00697                 if (!_tcsicmp(option, TEXT("e")))
00698                         _flags |= OWM_EXPLORE;
00699                  // option /root for rooted explorer windows
00700                 else if (!_tcsicmp(option, TEXT("root")))
00701                         _flags |= OWM_ROOTED;
00702                  // non-standard options: /mdi, /sdi
00703                 else if (!_tcsicmp(option, TEXT("mdi")))
00704                         _mdi = true;
00705                 else if (!_tcsicmp(option, TEXT("sdi")))
00706                         _mdi = false;
00707                 else
00708                         return false;
00709         } else {
00710                 if (!_path.empty())
00711                         return false;
00712
00713                 _path = opt_str;
00714         }
00715
00716         return true;
00717 }
00718
00719 bool ExplorerCmd::IsValidPath() const
00720 {
00721         if (!_path.empty()) {
00722                 DWORD attribs = GetFileAttributes(_path);
00723
00724                 if (attribs!=INVALID_FILE_ATTRIBUTES && (attribs&FILE_ATTRIBUTE_DIRECTORY))
00725                         return true;    // file system path
00726                 else if (*_path==':' && _path.at(1)==':')
00727                         return true;    // text encoded IDL
00728         }
00729
00730         return false;
00731 }
00732
00733 #else
00734
00735 void explorer_show_frame(int cmdShow, LPTSTR lpCmdLine)
00736 {
00737         if (!lpCmdLine)
00738                 lpCmdLine = TEXT("explorer.exe");
00739
00740         launch_file(GetDesktopWindow(), lpCmdLine, cmdShow);
00741 }
00742
00743 #endif
00744
00745
00746 PopupMenu::PopupMenu(UINT nid)
00747 {
00748         HMENU hMenu = LoadMenu(g_Globals._hInstance, MAKEINTRESOURCE(nid));
00749         _hmenu = GetSubMenu(hMenu, 0);
00750 }
00751
00752
00754 struct ExplorerAboutDlg : public
00755                         CtlColorParent<
00756                                 OwnerDrawParent<Dialog>
00757                         >
00758 {
00759         typedef CtlColorParent<
00760                                 OwnerDrawParent<Dialog>
00761                         > super;
00762
00763         ExplorerAboutDlg(HWND hwnd)
00764          :      super(hwnd)
00765         {
00766                 SetWindowIcon(hwnd, IDI_REACTOS);
00767
00768                 new FlatButton(hwnd, IDOK);
00769
00770                 _hfont = CreateFont(20, 0, 0, 0, FW_BOLD, TRUE, 0, 0, 0, 0, 0, 0, 0, TEXT("Sans Serif"));
00771                 new ColorStatic(hwnd, IDC_ROS_EXPLORER, RGB(32,32,128), 0, _hfont);
00772
00773                 new HyperlinkCtrl(hwnd, IDC_WWW);
00774
00775                 FmtString ver_txt(ResString(IDS_EXPLORER_VERSION_STR), (LPCTSTR)ResString(IDS_VERSION_STR));
00776                 SetWindowText(GetDlgItem(hwnd, IDC_VERSION_TXT), ver_txt);
00777
00778                 HWND hwnd_winver = GetDlgItem(hwnd, IDC_WIN_VERSION);
00779                 SetWindowText(hwnd_winver, get_windows_version_str());
00780                 SetWindowFont(hwnd_winver, GetStockFont(DEFAULT_GUI_FONT), FALSE);
00781
00782                 CenterWindow(hwnd);
00783         }
00784
00785         ~ExplorerAboutDlg()
00786         {
00787                 DeleteObject(_hfont);
00788         }
00789
00790         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00791         {
00792                 switch(nmsg) {
00793                   case WM_PAINT:
00794                         Paint();
00795                         break;
00796
00797                   default:
00798                         return super::WndProc(nmsg, wparam, lparam);
00799                 }
00800
00801                 return 0;
00802         }
00803
00804         void Paint()
00805         {
00806                 PaintCanvas canvas(_hwnd);
00807
00808                 HICON hicon = (HICON) LoadImage(g_Globals._hInstance, MAKEINTRESOURCE(IDI_REACTOS_BIG), IMAGE_ICON, 0, 0, LR_SHARED);
00809
00810                 DrawIconEx(canvas, 20, 10, hicon, 0, 0, 0, 0, DI_NORMAL);
00811         }
00812
00813 protected:
00814         HFONT   _hfont;
00815 };
00816
00817 void explorer_about(HWND hwndParent)
00818 {
00819         Dialog::DoModal(IDD_ABOUT_EXPLORER, WINDOW_CREATOR(ExplorerAboutDlg), hwndParent);
00820 }
00821
00822
00823 static void InitInstance(HINSTANCE hInstance)
00824 {
00825         CONTEXT("InitInstance");
00826
00827         setlocale(LC_COLLATE, "");      // set collating rules to local settings for compareName
00828
00829 #ifndef ROSSHELL
00830          // register frame window class
00831         g_Globals._hframeClass = IconWindowClass(CLASSNAME_FRAME,IDI_EXPLORER);
00832
00833          // register child window class
00834         WindowClass(CLASSNAME_CHILDWND, CS_CLASSDC|CS_DBLCLKS|CS_VREDRAW).Register();
00835
00836          // register tree window class
00837         WindowClass(CLASSNAME_WINEFILETREE, CS_CLASSDC|CS_DBLCLKS|CS_VREDRAW).Register();
00838 #endif
00839
00840         g_Globals._cfStrFName = RegisterClipboardFormat(CFSTR_FILENAME);
00841 }
00842
00843
00844 int explorer_main(HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdShow)
00845 {
00846         CONTEXT("explorer_main");
00847
00848          // initialize Common Controls library
00849         CommonControlInit usingCmnCtrl;
00850
00851         try {
00852                 InitInstance(hInstance);
00853         } catch(COMException& e) {
00854                 HandleException(e, GetDesktopWindow());
00855                 return -1;
00856         }
00857
00858 #ifndef ROSSHELL
00859         if (cmdShow != SW_HIDE) {
00860 /*      // don't maximize if being called from the ROS desktop
00861                 if (cmdShow == SW_SHOWNORMAL)
00863                         cmdShow = SW_MAXIMIZE;
00864 */
00865
00866                 explorer_show_frame(cmdShow, lpCmdLine);
00867         }
00868 #endif
00869
00870         return Window::MessageLoop();
00871 }
00872
00873
00874  // MinGW does not provide a Unicode startup routine, so we have to implement an own.
00875 #if defined(__MINGW32__) && defined(UNICODE)
00876
00877 #define _tWinMain wWinMain
00878 int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int);
00879
00880 int main(int argc, char* argv[])
00881 {
00882         CONTEXT("main");
00883
00884         STARTUPINFO startupinfo;
00885         int nShowCmd = SW_SHOWNORMAL;
00886
00887         GetStartupInfo(&startupinfo);
00888
00889         if (startupinfo.dwFlags & STARTF_USESHOWWINDOW)
00890                 nShowCmd = startupinfo.wShowWindow;
00891
00892         LPWSTR cmdline = GetCommandLineW();
00893
00894         while(*cmdline && !_istspace((unsigned)*cmdline))
00895                 ++cmdline;
00896
00897         while(_istspace((unsigned)*cmdline))
00898                 ++cmdline;
00899
00900         return wWinMain(GetModuleHandle(NULL), 0, cmdline, nShowCmd);
00901 }
00902
00903 #endif  // __MINGW && UNICODE
00904
00905
00906 static bool SetShellReadyEvent(LPCTSTR evtName)
00907 {
00908         HANDLE hEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE, evtName);
00909         if (!hEvent)
00910                 return false;
00911
00912         SetEvent(hEvent);
00913         CloseHandle(hEvent);
00914
00915         return true;
00916 }
00917
00918
00919 int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd)
00920 {
00921         CONTEXT("WinMain()");
00922
00923         BOOL any_desktop_running = IsAnyDesktopRunning();
00924
00925         BOOL startup_desktop;
00926
00927          // strip extended options from the front of the command line
00928         String ext_options;
00929
00930         while(*lpCmdLine == '-') {
00931                 while(*lpCmdLine && !_istspace((unsigned)*lpCmdLine))
00932                         ext_options += *lpCmdLine++;
00933
00934                 while(_istspace((unsigned)*lpCmdLine))
00935                         ++lpCmdLine;
00936         }
00937
00938          // command line option "-install" to replace previous shell application with ROS Explorer
00939         if (_tcsstr(ext_options,TEXT("-install"))) {
00940                  // install ROS Explorer into the registry
00941                 TCHAR path[MAX_PATH];
00942
00943                 int l = GetModuleFileName(0, path, COUNTOF(path));
00944                 if (l) {
00945                         HKEY hkey;
00946
00947                         if (!RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hkey)) {
00948
00950
00951                                 RegSetValueEx(hkey, TEXT("Shell"), 0, REG_SZ, (LPBYTE)path, l*sizeof(TCHAR));
00952                                 RegCloseKey(hkey);
00953                         }
00954
00955                         if (!RegOpenKey(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hkey)) {
00956
00958
00959                                 RegSetValueEx(hkey, TEXT("Shell"), 0, REG_SZ, (LPBYTE)TEXT(""), l*sizeof(TCHAR));
00960                                 RegCloseKey(hkey);
00961                         }
00962                 }
00963
00964                 HWND shellWindow = GetShellWindow();
00965
00966                 if (shellWindow) {
00967                         DWORD pid;
00968
00969                          // terminate shell process for NT like systems
00970                         GetWindowThreadProcessId(shellWindow, &pid);
00971                         HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
00972
00973                          // On Win 9x it's sufficient to destroy the shell window.
00974                         DestroyWindow(shellWindow);
00975
00976                         if (TerminateProcess(hProcess, 0))
00977                                 WaitForSingleObject(hProcess, INFINITE);
00978
00979                         CloseHandle(hProcess);
00980                 }
00981
00982                 startup_desktop = TRUE;
00983         } else {
00984                  // create desktop window and task bar only, if there is no other shell and we are
00985                  // the first explorer instance
00986                  // MS Explorer looks additionally into the registry entry HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\shell,
00987                  // to decide wether it is currently configured as shell application.
00988                 startup_desktop = !any_desktop_running;
00989         }
00990
00991
00992         bool autostart = !any_desktop_running;
00993
00994          // disable autostart if the SHIFT key is pressed
00995         if (GetAsyncKeyState(VK_SHIFT) < 0)
00996                 autostart = false;
00997
00998 #ifdef _DEBUG   //MF: disabled for debugging
00999         autostart = false;
01000 #endif
01001
01002          // If there is given the command line option "-desktop", create desktop window anyways
01003         if (_tcsstr(ext_options,TEXT("-desktop")))
01004                 startup_desktop = TRUE;
01005 #ifndef ROSSHELL
01006         else if (_tcsstr(ext_options,TEXT("-nodesktop")))
01007                 startup_desktop = FALSE;
01008
01009          // Don't display cabinet window in desktop mode
01010         if (startup_desktop && !_tcsstr(ext_options,TEXT("-explorer")))
01011                 nShowCmd = SW_HIDE;
01012 #endif
01013
01014         if (_tcsstr(ext_options,TEXT("-noautostart")))
01015                 autostart = false;
01016         else if (_tcsstr(ext_options,TEXT("-autostart")))
01017                 autostart = true;
01018
01019 #ifndef __WINE__
01020         if (_tcsstr(ext_options,TEXT("-console"))) {
01021                 AllocConsole();
01022
01023                 _dup2(_open_osfhandle((long)GetStdHandle(STD_INPUT_HANDLE), _O_RDONLY), 0);
01024                 _dup2(_open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), 0), 1);
01025                 _dup2(_open_osfhandle((long)GetStdHandle(STD_ERROR_HANDLE), 0), 2);
01026
01027                 g_Globals._log = _fdopen(1, "w");
01028                 setvbuf(g_Globals._log, 0, _IONBF, 0);
01029
01030                 LOG(TEXT("starting explorer debug log\n"));
01031         }
01032 #endif
01033
01034
01035         if (startup_desktop) {
01036                  // hide the XP login screen (Credit to Nicolas Escuder)
01037                  // another undocumented event: "Global\\msgina: ReturnToWelcome"
01038                 if (!SetShellReadyEvent(TEXT("msgina: ShellReadyEvent")))
01039                         SetShellReadyEvent(TEXT("Global\\msgina: ShellReadyEvent"));
01040         }
01041 #ifdef ROSSHELL
01042         else
01043                 return 0;       // no shell to launch, so exit immediatelly
01044 #endif
01045
01046
01047         if (!any_desktop_running) {
01048                  // launch the shell DDE server
01049                 if (g_SHDOCVW_ShellDDEInit)
01050                         (*g_SHDOCVW_ShellDDEInit)(TRUE);
01051         }
01052
01053
01054         bool use_gdb_stub = false;      // !IsDebuggerPresent();
01055
01056         if (_tcsstr(ext_options,TEXT("-debug")))
01057                 use_gdb_stub = true;
01058
01059         if (_tcsstr(ext_options,TEXT("-break"))) {
01060                 LOG(TEXT("debugger breakpoint"));
01061 #ifdef _MSC_VER
01062                 __asm int 3
01063 #else
01064                 asm("int3");
01065 #endif
01066         }
01067
01068          // activate GDB remote debugging stub if no other debugger is running
01069         if (use_gdb_stub) {
01070                 LOG(TEXT("waiting for debugger connection...\n"));
01071
01072                 initialize_gdb_stub();
01073         }
01074
01075         g_Globals.init(hInstance);
01076
01077          // initialize COM and OLE before creating the desktop window
01078         OleInit usingCOM;
01079
01080          // init common controls library
01081         CommonControlInit usingCmnCtrl;
01082
01083         g_Globals.read_persistent();
01084
01085         if (startup_desktop) {
01086                 WaitCursor wait;
01087
01088                 g_Globals._desktops.init();
01089
01090                 g_Globals._hwndDesktop = DesktopWindow::Create();
01091 #ifdef _USE_HDESK
01092                 g_Globals._desktops.get_current_Desktop()->_hwndDesktop = g_Globals._hwndDesktop;
01093 #endif
01094         }
01095
01096         Thread* pSSOThread = NULL;
01097
01098         if (startup_desktop) {
01099                  // launch SSO thread to allow message processing independent from the explorer main thread
01100                 pSSOThread = new SSOThread;
01101                 pSSOThread->Start();
01102         }
01103
01105         if (autostart) {
01106                 char* argv[] = {"", "s"};       // call startup routine in SESSION_START mode
01107                 startup(2, argv);
01108         }
01109
01110 #ifndef ROSSHELL
01111         if (g_Globals._hwndDesktop)
01112                 g_Globals._desktop_mode = true;
01113 #endif
01114
01115
01116         int ret = explorer_main(hInstance, lpCmdLine, nShowCmd);
01117
01118
01119          // write configuration file
01120         g_Globals.write_persistent();
01121
01122         if (pSSOThread) {
01123                 pSSOThread->Stop();
01124                 delete pSSOThread;
01125         }
01126
01127         if (!any_desktop_running) {
01128                  // shutdown the shell DDE server
01129                 if (g_SHDOCVW_ShellDDEInit)
01130                         (*g_SHDOCVW_ShellDDEInit)(FALSE);
01131         }
01132
01133         return ret;
01134 }


ROS Explorer: explorer.h File Reference

  • File List
  • File Members

explorer.h File Reference

#include "utility/shellclasses.h"
#include "shell/entries.h"
#include "shell/winfs.h"
#include "shell/shellfs.h"
#include "shell/unixfs.h"
#include "utility/window.h"
#include "shell/pane.h"
#include "shell/filechild.h"
#include "shell/shellbrowser.h"
#include "shell/mainframe.h"

Include dependency graph for explorer.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | ExplorerCmd
Explorer command line parser. More...

Defines

#define | IDW_STATUSBAR 0x100
#define | IDW_TOOLBAR 0x101
#define | IDW_EXTRABAR 0x102
#define | IDW_DRIVEBAR 0x103
#define | IDW_ADDRESSBAR 0x104
#define | IDW_COMMANDBAR 0x105
#define | IDW_SIDEBAR 0x106
#define | IDW_FIRST_CHILD 0xC000
#define | PM_GET_FILEWND_PTR (WM_APP+0x05)
#define | PM_GET_SHELLBROWSER_PTR (WM_APP+0x06)
#define | PM_GET_CONTROLWINDOW (WM_APP+0x16)
#define | PM_RESIZE_CHILDREN (WM_APP+0x17)
#define | PM_GET_WIDTH (WM_APP+0x18)
#define | PM_REFRESH (WM_APP+0x1B)
#define | PM_REFRESH_CONFIG (WM_APP+0x1C)
#define | CLASSNAME_FRAME TEXT("CabinetWClass")
#define | CLASSNAME_CHILDWND TEXT("WFS_Child")
#define | CLASSNAME_WINEFILETREE TEXT("WFS_Tree")

Define Documentation

#define CLASSNAME_CHILDWND TEXT("WFS_Child")

Definition at line 67 of file explorer.h.

Referenced by WebChildWindow::create(), and MDIShellBrowserChild::create().

#define CLASSNAME_FRAME TEXT("CabinetWClass")

Definition at line 65 of file explorer.h.

#define CLASSNAME_WINEFILETREE TEXT("WFS_Tree")

Definition at line 68 of file explorer.h.

Referenced by FileChildWindow::create().

#define IDW_ADDRESSBAR 0x104

Definition at line 47 of file explorer.h.

Referenced by MainFrameBase::Command(), and MainFrameBase::MainFrameBase().

#define IDW_COMMANDBAR 0x105

Definition at line 48 of file explorer.h.

Referenced by SDIMainFrame::Command(), MainFrameBase::Command(), and MainFrameBase::MainFrameBase().

#define IDW_DRIVEBAR 0x103

Definition at line 46 of file explorer.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define IDW_EXTRABAR 0x102

Definition at line 45 of file explorer.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define IDW_FIRST_CHILD 0xC000

Definition at line 50 of file explorer.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define IDW_SIDEBAR 0x106

Definition at line 49 of file explorer.h.

Referenced by MainFrameBase::MainFrameBase().

#define IDW_STATUSBAR 0x100

Definition at line 43 of file explorer.h.

Referenced by MainFrameBase::MainFrameBase().

#define IDW_TOOLBAR 0x101

Definition at line 44 of file explorer.h.

Referenced by MainFrameBase::MainFrameBase().

#define PM_GET_CONTROLWINDOW (WM_APP+0x16)

Definition at line 56 of file explorer.h.

Referenced by ShellBrowser::GetControlWindow(), and ShellBrowser::SendControlMsg().

#define PM_GET_FILEWND_PTR (WM_APP+0x05)

Definition at line 53 of file explorer.h.

Referenced by MDIMainFrame::activate_child_window(), MDIMainFrame::activate_drive_window(), and Pane::WndProc().

#define PM_GET_SHELLBROWSER_PTR (WM_APP+0x06)

Definition at line 54 of file explorer.h.

Referenced by MDIMainFrame::activate_child_window().

#define PM_GET_WIDTH (WM_APP+0x18)

Definition at line 59 of file explorer.h.

Referenced by DesktopBar::Resize(), NotifyArea::WndProc(), and QuickLaunchBar::WndProc().

#define PM_REFRESH (WM_APP+0x1B)

Definition at line 61 of file explorer.h.

Referenced by TrayNotifyDlg::Command(), QuickLaunchBar::QuickLaunchBar(), TrayNotifyDlg::SetIconMode(), and NotifyArea::WndProc().

#define PM_REFRESH_CONFIG (WM_APP+0x1C)

Definition at line 62 of file explorer.h.

Referenced by TaskbarSettingsDlg::Command(), TaskbarSettingsDlg::Notify(), and NotifyArea::WndProc().

#define PM_RESIZE_CHILDREN (WM_APP+0x17)

Definition at line 58 of file explorer.h.

Referenced by NotifyArea::show_clock().


ROS Explorer: explorer.h Source File

  • File List
  • File Members

explorer.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // explorer.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include "utility/shellclasses.h"
00030
00031 #include "shell/entries.h"
00032
00033 #include "shell/winfs.h"
00034 #include "shell/shellfs.h"
00035
00036 #ifndef ROSSHELL
00037 #include "shell/unixfs.h"
00038 #endif
00039
00040 #include "utility/window.h"
00041
00042
00043 #define IDW_STATUSBAR                   0x100
00044 #define IDW_TOOLBAR                             0x101
00045 #define IDW_EXTRABAR                    0x102
00046 #define IDW_DRIVEBAR                    0x103
00047 #define IDW_ADDRESSBAR                  0x104
00048 #define IDW_COMMANDBAR                  0x105
00049 #define IDW_SIDEBAR                             0x106
00050 #define IDW_FIRST_CHILD                 0xC000  /*0x200*/
00051
00052
00053 #define PM_GET_FILEWND_PTR              (WM_APP+0x05)
00054 #define PM_GET_SHELLBROWSER_PTR (WM_APP+0x06)
00055
00056 #define PM_GET_CONTROLWINDOW    (WM_APP+0x16)
00057
00058 #define PM_RESIZE_CHILDREN              (WM_APP+0x17)
00059 #define PM_GET_WIDTH                    (WM_APP+0x18)
00060
00061 #define PM_REFRESH                              (WM_APP+0x1B)
00062 #define PM_REFRESH_CONFIG               (WM_APP+0x1C)
00063
00064
00065 #define CLASSNAME_FRAME                 TEXT("CabinetWClass")   // same class name for frame window as in MS Explorer
00066
00067 #define CLASSNAME_CHILDWND              TEXT("WFS_Child")
00068 #define CLASSNAME_WINEFILETREE  TEXT("WFS_Tree")
00069
00070
00071 #include "shell/pane.h"
00072 #include "shell/filechild.h"
00073 #include "shell/shellbrowser.h"
00074
00075
00076 #ifndef ROSSHELL
00077
00079  // for commands like "/e,/root,c:\"
00080  // or "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}" (launch of control panel)
00081 struct ExplorerCmd
00082 {
00083         ExplorerCmd()
00084          :      _flags(0),
00085                 _cmdShow(SW_SHOWNORMAL),
00086                 _mdi(false),
00087                 _valid_path(false)
00088         {
00089         }
00090
00091         ExplorerCmd(LPCTSTR url, bool mdi)
00092          :      _path(url),
00093                 _flags(0),
00094                 _cmdShow(SW_SHOWNORMAL),
00095                 _mdi(mdi),
00096                 _valid_path(true)       //@@
00097         {
00098         }
00099
00100         bool    ParseCmdLine(LPCTSTR lpCmdLine);
00101         bool    EvaluateOption(LPCTSTR option);
00102         bool    IsValidPath() const;
00103
00104         String  _path;
00105         int             _flags; // OPEN_WINDOW_MODE
00106         int             _cmdShow;
00107         bool    _mdi;
00108         bool    _valid_path;
00109 };
00110
00111 #include "shell/mainframe.h"
00112
00113 #endif


ROS Explorer: externals.h File Reference

  • File List
  • File Members

externals.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int | explorer_main (HINSTANCE hinstance, LPTSTR lpCmdLine, int cmdshow)
void | explorer_show_frame (int cmdshow, LPTSTR lpCmdLine=NULL)
void | explorer_about (HWND hwndParent)
BOOL | IsAnyDesktopRunning ()
void | ShowExitWindowsDialog (HWND hwndOwner)

Function Documentation

void explorer_about ( HWND hwndParent )

Definition at line 817 of file explorer.cpp.

References Dialog::DoModal(), IDD_ABOUT_EXPLORER, and WINDOW_CREATOR.

Referenced by DesktopBar::Command(), MainFrameBase::Command(), and DesktopShellView::DoDesktopContextMenu().

00818 {
00819         Dialog::DoModal(IDD_ABOUT_EXPLORER, WINDOW_CREATOR(ExplorerAboutDlg), hwndParent);
00820 }

Here is the call graph for this function:

int explorer_main | ( | HINSTANCE | hinstance,
 |  | LPTSTR | lpCmdLine,
 |  | int | cmdshow
 | ) |

Definition at line 844 of file explorer.cpp.

References CONTEXT, and HandleException().

Referenced by _tWinMain().

00845 {
00846         CONTEXT("explorer_main");
00847
00848          // initialize Common Controls library
00849         CommonControlInit usingCmnCtrl;
00850
00851         try {
00852                 InitInstance(hInstance);
00853         } catch(COMException& e) {
00854                 HandleException(e, GetDesktopWindow());
00855                 return -1;
00856         }
00857
00858 #ifndef ROSSHELL
00859         if (cmdShow != SW_HIDE) {
00860 /*      // don't maximize if being called from the ROS desktop
00861                 if (cmdShow == SW_SHOWNORMAL)
00863                         cmdShow = SW_MAXIMIZE;
00864 */
00865
00866                 explorer_show_frame(cmdShow, lpCmdLine);
00867         }
00868 #endif
00869
00870         return Window::MessageLoop();
00871 }

Here is the call graph for this function:

void explorer_show_frame | ( | int | cmdshow,
 |  | LPTSTR | lpCmdLine = NULL
 | ) |

Definition at line 603 of file explorer.cpp.

References ExplorerCmd::_cmdShow, ExplorerGlobals::_hMainWnd, ExplorerGlobals::_hwndDesktop, ExplorerCmd::_mdi, ExplorerGlobals::_prescan_nodes, MainFrameBase::Create(), Dialog::DoModal(), ExplorerGlobals::get_cfg(), IDD_MDI_SDI, ExplorerCmd::ParseCmdLine(), and WINDOW_CREATOR.

Referenced by DesktopBar::Command(), StartMenuHandler::Command(), ExplorerCmd::IsValidPath(), DesktopBar::ProcessHotKey(), and DesktopWindow::WndProc().

00604 {
00605         ExplorerCmd cmd;
00606
00607         if (g_Globals._hMainWnd) {
00608                 if (IsIconic(g_Globals._hMainWnd))
00609                         ShowWindow(g_Globals._hMainWnd, SW_RESTORE);
00610                 else
00611                         SetForegroundWindow(g_Globals._hMainWnd);
00612
00613                 return;
00614         }
00615
00616         g_Globals._prescan_nodes = false;
00617
00618         XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
00619         XS_String mdiStr = XMLString(explorer_options, "mdi");
00620
00621          // If there isn't yet the "mdi" setting in the configuration, display MDI/SDI dialog.
00622         if (mdiStr.empty())
00623                 Dialog::DoModal(IDD_MDI_SDI, WINDOW_CREATOR(MdiSdiDlg), g_Globals._hwndDesktop);
00624
00625          // Now read the MDI attribute again and interpret it as boolean value.
00626         cmd._mdi = XMLBool(explorer_options, "mdi", true);
00627
00628         cmd._cmdShow = cmdShow;
00629
00630          // parse command line options, which may overwrite the MDI flag
00631         if (lpCmdLine)
00632                 cmd.ParseCmdLine(lpCmdLine);
00633
00634          // create main window
00635         MainFrameBase::Create(cmd);
00636 }

Here is the call graph for this function:

BOOL IsAnyDesktopRunning ( )

Definition at line 246 of file desktop.cpp.

References HWND.

Referenced by _tWinMain().

00247 {
00248         HINSTANCE hUser32 = GetModuleHandle(TEXT("user32"));
00249
00250         SetShellWindow = (BOOL(WINAPI*)(HWND)) GetProcAddress(hUser32, "SetShellWindow");
00251         SetShellWindowEx = (BOOL(WINAPI*)(HWND,HWND)) GetProcAddress(hUser32, "SetShellWindowEx");
00252
00253         return GetShellWindow() != 0;
00254 }

void ShowExitWindowsDialog ( HWND hwndOwner )

Definition at line 2131 of file startmenu.cpp.

References IDS_TITLE.

Referenced by StartMenuHandler::Command(), and DesktopWindow::WndProc().

02132 {
02133         static DynamicFct<EXITWINDOWSDLG> ExitWindowsDialog(TEXT("SHELL32"), 60);
02134
02135         if (ExitWindowsDialog)
02136                 (*ExitWindowsDialog)(hwndOwner);
02137         else
02138                 MessageBox(hwndOwner, TEXT("ExitWindowsDialog() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02139 }


ROS Explorer: externals.h Source File

  • File List
  • File Members

externals.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // externals.h
00024  //
00025  // Martin Fuchs, 07.06.2003
00026  //
00027
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033
00034  // explorer main routine
00035 extern int explorer_main(HINSTANCE hinstance, LPTSTR lpCmdLine, int cmdshow);
00036
00037  // display explorer/file manager window
00038 extern void explorer_show_frame(int cmdshow, LPTSTR lpCmdLine=NULL);
00039
00040  // display explorer "About" dialog
00041 extern void explorer_about(HWND hwndParent);
00042
00043  // test for already running desktop instance
00044 extern BOOL IsAnyDesktopRunning();
00045
00046  // show shutdown dialog
00047 extern void ShowExitWindowsDialog(HWND hwndOwner);
00048
00049 #ifdef __cplusplus
00050 } // extern "C"
00051 #endif
00052


ROS Explorer: fatfs.cpp File Reference

  • File List
  • File Members
shell

fatfs.cpp File Reference

#include <precomp.h>
#include "fatfs.h"

Include dependency graph for fatfs.cpp:

Go to the source code of this file.


ROS Explorer: fatfs.cpp Source File

  • File List
  • File Members
shell

fatfs.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // fatfs.cpp
00024  //
00025  // Martin Fuchs, 01.02.2004
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "fatfs.h"
00032
00033
00034 static union DEntry* link_dir_entries(struct dirent* dir, struct Kette* K, int cnt)
00035 {
00036         union DEntry* Ent = (union DEntry*) dir;
00037         struct Kette* L = NULL;
00038
00039         for(; cnt; cnt--) {
00040                 K->Rueck = L;
00041                 (L=K)->Ent = Ent;
00042                 AddP(K, sizeof(struct Kette));
00043                 L->Vorw = K;
00044                 AddP(Ent, sizeof(union DEntry));
00045         }
00046
00047         L->Vorw = NULL;
00048
00049         return Ent;
00050 }
00051
00052 void FATDirectory::read_directory(int scan_flags)
00053 {
00054         CONTEXT("FATDirectory::read_directory()");
00055
00056         read_dir();
00057
00058         union DEntry* p = (union DEntry*) _dir;
00059         int i = 0;
00060
00061         do {
00062 /*              if (!IS_LNAME(p->E.attr) && p->E.name[0]!=FAT_DEL_CHAR)
00063                         gesBytes += p->E.size;
00064 */
00065
00066                 AddP(p, sizeof(union DEntry));
00067         } while(++i<_ents && p->E.name[0]);
00068
00069         _alloc = (struct Kette*) malloc((size_t)((_ents=i)+8)*sizeof(struct Kette));
00070         if (!_alloc)
00071                 return;
00072
00073         link_dir_entries(_dir, _alloc, i);
00074
00075         Entry* first_entry = NULL;
00076         int level = _level + 1;
00077
00078         Entry* last = NULL;
00079
00080         WIN32_FIND_DATA w32fd;
00081         FAT_attribute attr;
00082         String long_name;
00083
00084         TCHAR buffer[MAX_PATH];
00085
00086         _tcscpy(buffer, (LPCTSTR)_path);
00087         LPTSTR pname = buffer + _tcslen(buffer);
00088         int plen = COUNTOF(buffer) - _tcslen(buffer);
00089
00090         *pname++ = '\\';
00091         --plen;
00092
00093         for(Kette*p=_alloc; p; p=p->Vorw) {
00094                 memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00095
00096                 DEntry_E& e = p->Ent->E;
00097
00098                  // get file/directory attributes
00099                 attr.b = e.attr;
00100
00101                 if (attr.b & (_A_DELETED | _A_ILLEGAL))
00102                         attr.b |= _A_ILLEGAL;
00103
00104                 const char* s = e.name;
00105                 LPTSTR d = w32fd.cFileName;
00106
00107                 if (!IS_LNAME(attr.b) || e.name[0]==FAT_DEL_CHAR) {
00108                         if (e.name[0] == FAT_DEL_CHAR)
00109                                 w32fd.dwFileAttributes |= ATTRIBUTE_ERASED;
00110                         else if (IS_LNAME(attr.b))
00111                                 w32fd.dwFileAttributes |= ATTRIBUTE_LONGNAME;
00112                         else if (attr.a.directory)
00113                                 w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00114                         else if (attr.a.volume)
00115                                 w32fd.dwFileAttributes |= ATTRIBUTE_VOLNAME;    //@@ -> in Volume-Name der Root kopieren
00116
00117                          // get file name
00118                         *d++ = *s==FAT_DEL_CHAR? '?': *s;
00119                         ++s;
00120
00121                         for(i=0; i<7; ++i)
00122                                 *d++ = *s++;
00123
00124                         while(d>w32fd.cFileName && d[-1]==' ')
00125                                 --d;
00126
00127                         *d++ = '.';
00128
00129                         for(; i<10; ++i)
00130                                 *d++ = *s++;
00131
00132                         while(d>w32fd.cFileName && d[-1]==' ')
00133                                 --d;
00134
00135                         if (d>w32fd.cFileName && d[-1]=='.')
00136                                 --d;
00137
00138                         *d = '\0';
00139                 } else {
00140                          // read long file name
00141                         TCHAR lname[] = {s[1], s[3], s[5], s[7], s[9], s[14], s[16], s[18], s[20], s[22], s[24], s[28], s[30]};
00142
00143                         long_name = String(lname, 13) + long_name;
00144                 }
00145
00146                 if (!IS_LNAME(attr.b) && !attr.a.volume) {
00147                          // get file size
00148                         w32fd.nFileSizeLow = e.size;
00149
00150                          // convert date/time attribute into FILETIME
00151                         const fdate& date = e.date;
00152                         const ftime& time = e.time;
00153                         SYSTEMTIME stime;
00154                         FILETIME ftime;
00155
00156                         stime.wYear = date.year + 1980;
00157                         stime.wMonth = date.month;
00158                         stime.wDayOfWeek = (WORD)-1;
00159                         stime.wDay = date.day;
00160                         stime.wHour = time.hour;
00161                         stime.wMinute = time.min;
00162                         stime.wSecond = time.sec2 * 2;
00163                         stime.wMilliseconds = 0;
00164
00165                         if (SystemTimeToFileTime(&stime, &ftime))
00166                                 LocalFileTimeToFileTime(&ftime, &w32fd.ftLastWriteTime);
00167
00168                         if (!(w32fd.dwFileAttributes & ATTRIBUTE_ERASED)) { //@@
00169                                 Entry* entry;
00170
00171                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00172                                         _tcscpy_s(pname, plen, w32fd.cFileName);
00173                                         entry = new FATDirectory(_drive, this, buffer, e.fclus);
00174                                 } else
00175                                         entry = new FATEntry(this, e.fclus);
00176
00177                                 memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00178
00179                                 if (!long_name.empty()) {
00180                                         entry->_content = _tcsdup(long_name);
00181                                         long_name.erase();
00182                                 }
00183
00184                                 if (!first_entry)
00185                                         first_entry = entry;
00186
00187                                 if (last)
00188                                         last->_next = entry;
00189
00190                                 entry->_level = level;
00191
00192                                 last = entry;
00193                         }
00194                 }
00195         }
00196
00197         if (last)
00198                 last->_next = NULL;
00199
00200         _down = first_entry;
00201         _scanned = true;
00202 }
00203
00204
00205 const void* FATDirectory::get_next_path_component(const void* p) const
00206 {
00207         LPCTSTR s = (LPCTSTR) p;
00208
00209         while(*s && *s!=TEXT('\\') && *s!=TEXT('/'))
00210                 ++s;
00211
00212         while(*s==TEXT('\\') || *s==TEXT('/'))
00213                 ++s;
00214
00215         if (!*s)
00216                 return NULL;
00217
00218         return s;
00219 }
00220
00221
00222 Entry* FATDirectory::find_entry(const void* p)
00223 {
00224         LPCTSTR name = (LPCTSTR)p;
00225
00226         for(Entry*entry=_down; entry; entry=entry->_next) {
00227                 LPCTSTR p = name;
00228                 LPCTSTR q = entry->_data.cFileName;
00229
00230                 do {
00231                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00232                                 return entry;
00233                 } while(tolower(*p++) == tolower(*q++));
00234
00235                 p = name;
00236                 q = entry->_data.cAlternateFileName;
00237
00238                 do {
00239                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00240                                 return entry;
00241                 } while(tolower(*p++) == tolower(*q++));
00242         }
00243
00244         return NULL;
00245 }
00246
00247
00248  // get full path of specified directory entry
00249 bool FATEntry::get_path(PTSTR path, size_t path_count) const
00250 {
00251         return get_path_base ( path, path_count, ET_FAT );
00252 }
00253
00254 ShellPath FATEntry::create_absolute_pidl() const
00255 {
00256         CONTEXT("WinEntry::create_absolute_pidl()");
00257
00258         return (LPCITEMIDLIST)NULL;
00259 /* prepend root path if the drive is currently actually mounted in the file system -> return working PIDL
00260         TCHAR path[MAX_PATH];
00261
00262         if (get_path(path, COUNTOF(path)))
00263                 return ShellPath(path);
00264
00265         return ShellPath();
00266 */
00267 }
00268
00269
00270 FATDirectory::FATDirectory(FATDrive& drive, LPCTSTR root_path)
00271  :      FATEntry(),
00272         _drive(drive)
00273 {
00274         _path = _tcsdup(root_path);
00275
00276         _secarr         = NULL;
00277         _cur_bufs       = 0;
00278         _ents           = 0;
00279         _dir            = NULL;
00280         _cluster        = 0;
00281 }
00282
00283 FATDirectory::FATDirectory(FATDrive& drive, Entry* parent, LPCTSTR path, unsigned cluster)
00284  :      FATEntry(parent, cluster),
00285         _drive(drive)
00286 {
00287         _path = _tcsdup(path);
00288
00289         _secarr         = NULL;
00290         _cur_bufs       = 0;
00291         _ents           = 0;
00292         _dir            = NULL;
00293 }
00294
00295 FATDirectory::~FATDirectory()
00296 {
00297         free(_path);
00298         _path = NULL;
00299 }
00300
00301 bool FATDirectory::read_dir()
00302 {
00303         int i;
00304
00305         if (_cluster == 0) {
00306                 if (!_drive._boot_sector.SectorsPerFAT) {       // FAT32? [boot_sector32->reserved0==0]
00307                         BootSector32* boot_sector32 = (BootSector32*) &_drive._boot_sector;
00308                         DWORD sect = _drive._boot_sector.ReservedSectors + _drive._boot_sector.NumberFATs*boot_sector32->SectorsPerFAT32;  // lese Root-Directory ein
00309                         int RootEntries = boot_sector32->RootSectors * 32;      //@@
00310
00311                         _secarr = (struct dirsecz*)malloc(sizeof(DWORD) * (_cur_bufs = (int)((_ents=RootEntries)/_drive._bufents)));
00312
00313                         for(i=0; i<_cur_bufs; i++)
00314                                 _secarr->s[i] = sect+i;
00315
00316                         _dir = (struct dirent*)malloc((size_t)(_ents+16)*sizeof(union DEntry));
00317                         if (!_dir)
00318                                 return false;
00319
00320                         if (!(_drive.read_sector(*_secarr->s,(Buffer*)_dir,_cur_bufs)))
00321                                 return false;
00322                 } else {
00323                         DWORD sect = _drive._boot_sector.ReservedSectors + _drive._boot_sector.NumberFATs*_drive._boot_sector.SectorsPerFAT;  // read in root directory
00324
00325                         _secarr = (struct dirsecz*)malloc(sizeof(DWORD) * (_cur_bufs = (int)((_ents=_drive._boot_sector.RootEntries)/_drive._bufents)));
00326
00327                         for(i=0; i<_cur_bufs; i++)
00328                                 _secarr->s[i] = sect+i;
00329
00330                         _dir = (struct dirent*)malloc((size_t)(_ents+16)*sizeof(union DEntry));
00331                         if (!_dir)
00332                                 return false;
00333
00334                         if (!_drive.read_sector(*_secarr->s,(Buffer*)_dir,_cur_bufs))
00335                                 return false;
00336                 }
00337         } else {
00338                 Buffer* buf;
00339                 bool ok;
00340
00341                 DWORD h = _cluster;
00342
00343                 _cur_bufs = 0;
00344
00345                 do {
00346                         h = _drive.read_FAT(h, ok);
00347
00348                         if (!ok)
00349                                 return false;
00350
00351                         _cur_bufs++;
00352                 } while (h<0x0ffffff0 && h);
00353
00354                 _secarr = (struct dirsecz*) malloc(sizeof(DWORD) * _cur_bufs);
00355
00356                 if (!_secarr)
00357                         return false;
00358
00359                 _ents = _drive._bufents * (size_t)_cur_bufs * _drive._SClus;
00360
00361                 if ((buf=(Buffer*)(_dir=(struct dirent*)malloc((size_t) (_ents+16)*sizeof(union DEntry)))) == NULL)
00362                         return false;
00363
00364                 h = _cluster;
00365
00366                 DWORD fdatsec;
00367
00368                 if (!_drive._boot_sector.SectorsPerFAT) {       // FAT32 ?
00369                         BootSector32* boot_sector32 = (BootSector32*) &_drive._boot_sector;
00370                         //int RootEntries = boot_sector32->RootSectors * 32;    //@@
00371                         //fdatsec = _drive._boot_sector.ReservedSectors + _drive._boot_sector.NumberFATs*boot_sector32->SectorsPerFAT32 + RootEntries*sizeof(DEntry)/_drive._boot_sector.BytesPerSector;        // dpb.fdirsec
00372                         fdatsec = _drive._boot_sector.ReservedSectors +
00373                                                 _drive._boot_sector.NumberFATs*boot_sector32->SectorsPerFAT32 + boot_sector32->RootSectors;
00374                 } else
00375                         fdatsec = _drive._boot_sector.ReservedSectors +
00376                                                 _drive._boot_sector.NumberFATs*_drive._boot_sector.SectorsPerFAT +
00377                                                 _drive._boot_sector.RootEntries*sizeof(DEntry)/_drive._boot_sector.BytesPerSector;      // dpb.fdirsec
00378
00379                         for(i=0; i<_cur_bufs; i++) {
00380                                 _secarr->s[i] = fdatsec + (DWORD)_drive._SClus*(h-2);
00381
00382                                 h = _drive.read_FAT(h, ok);
00383
00384                                 if (!ok)
00385                                         return false;
00386                         }
00387
00388                         for(i=0; i<_cur_bufs; i++) {
00389                                 if ((ok = (_drive.read_sector(_secarr->s[i], buf, _drive._SClus))) == true)
00390                                         AddP(buf, _drive._bufl*_drive._SClus)
00391                                 else {
00392                                         //@@FPara = _secarr->s[i];
00393                                         return false;
00394                                 }
00395                         }
00396
00397                 buf->dat[0] = 0;         // Endekennzeichen für Rekurs setzen
00398         }
00399
00400         return true;
00401 }
00402
00403
00404 #ifdef _MSC_VER
00405 #pragma warning(disable: 4355)
00406 #endif
00407
00408 FATDrive::FATDrive(LPCTSTR path)
00409  :      FATDirectory(*this, TEXT("\\"))
00410 {
00411         _bufl = 0;
00412         _bufents = 0;
00413         _SClus = 0;
00414         _FATCache = NULL;
00415         _CacheCount = 0;
00416         _CacheSec = NULL;
00417         _CacheCnt = NULL;
00418         _CacheDty = NULL;
00419         _Caches = 0;
00420
00421         _hDrive = CreateFile(path, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
00422
00423         if (_hDrive != INVALID_HANDLE_VALUE) {
00424                 _boot_sector.BytesPerSector = 512;
00425
00426                 if (read_sector(0, (Buffer*)&_boot_sector, 1)) {
00427                         _bufl = _boot_sector.BytesPerSector;
00428                         _SClus = _boot_sector.SectorsPerCluster;
00429                         _bufents = _bufl / sizeof(union DEntry);
00430                 }
00431
00432                 small_cache();
00433         }
00434 }
00435
00436 FATDrive::~FATDrive()
00437 {
00438         if (_hDrive != INVALID_HANDLE_VALUE)
00439                 CloseHandle(_hDrive);
00440
00441         free(_path);
00442         _path = NULL;
00443 }
00444
00445 void FATDrive::small_cache()
00446 {
00447         if (_FATCache)
00448                 free(_FATCache);
00449
00450         if (_CacheSec) {
00451                 free(_CacheSec), _CacheSec = NULL;
00452                 free(_CacheCnt);
00453                 free(_CacheDty);
00454         }
00455
00456         _Caches = CACHE_SIZE_LOW;
00457         _FATCache = (struct Cache *) malloc((_Caches+1) * _drive._bufl);
00458
00459         reset_cache();
00460 }
00461
00462 void FATDrive::reset_cache()    // mark cache as empty
00463 {
00464         int i;
00465
00466         if (!_CacheSec) {
00467                 _CacheSec = (DWORD*) malloc(_Caches * sizeof(DWORD));
00468                 _CacheCnt = (int*) malloc(_Caches * sizeof(int));
00469                 _CacheDty = (bool*) malloc(_Caches * sizeof(bool));
00470         } else {
00471                 _CacheSec = (DWORD*) realloc(_CacheSec, _Caches * sizeof(DWORD));
00472                 _CacheCnt = (int*) realloc(_CacheCnt, _Caches * sizeof(int));
00473                 _CacheDty = (bool*) realloc(_CacheDty, _Caches * sizeof(bool));
00474         }
00475
00476         for(i=0; i<_Caches; i++)
00477                 _CacheSec[i] = 0;
00478
00479         _read_ahead = (_Caches+1) / 2;
00480 }
00481
00482 bool FATDrive::read_sector(DWORD sec, Buffer* buf, int len)
00483 {
00484         sec += 63;      //@@ jump to first partition
00485
00486         if (SetFilePointer(_hDrive, sec*_drive._boot_sector.BytesPerSector, 0, 0) == INVALID_SET_FILE_POINTER)
00487                 return false;
00488
00489         DWORD read;
00490
00491         if (!ReadFile(_hDrive, buf, len*_drive._boot_sector.BytesPerSector, &read, 0))
00492                 return false;
00493
00494         return true;
00495 }
00496
00497 DWORD FATDrive::read_FAT(DWORD cluster, bool& ok)       //@@ use exception handling
00498 {
00499         DWORD nClus;
00500         Buffer* FATBuf;
00501
00502         DWORD nclus = (_boot_sector.Sectors32? _boot_sector.Sectors32: _boot_sector.Sectors16) / _boot_sector.SectorsPerCluster;
00503
00504         if (cluster > nclus) {
00505                 ok = false;
00506                 return (DWORD)-1;
00507         }
00508
00509         if (nclus >= 65536) {           // FAT32
00510                 DWORD FATsec = cluster / (_boot_sector.BytesPerSector/4);
00511                 DWORD z = (cluster - _boot_sector.BytesPerSector/4 * FATsec)*4;
00512                 FATsec += _boot_sector.ReservedSectors;
00513                 if (!read_cache(FATsec, &FATBuf))
00514                         ok = false;
00515                 nClus = dpeek(&FATBuf->dat[z]);
00516         } else if (nclus >= 4096) {     // 16 Bit-FAT
00517                 DWORD FATsec = cluster / (_boot_sector.BytesPerSector/2);
00518                 DWORD z = (cluster - _boot_sector.BytesPerSector/2 * FATsec)*2;
00519                 FATsec += _boot_sector.ReservedSectors;
00520                 if (!read_cache(FATsec, &FATBuf))
00521                         ok = false;
00522                 nClus = wpeek(&FATBuf->dat[z]);
00523
00524                 if (nClus >= 0xfff0)
00525                         nClus |= 0x0fff0000;
00526         } else {                                                // 12 Bit-FAT
00527                 DWORD FATsec = cluster*3 / (_boot_sector.BytesPerSector*2);
00528                 DWORD z = (cluster*3 - _boot_sector.BytesPerSector*2*FATsec)/2;
00529                 FATsec += _boot_sector.ReservedSectors;
00530                 if (!read_cache(FATsec,&FATBuf))
00531                         ok = false;
00532                 BYTE a = FATBuf->dat[z++];
00533
00534                 if (z >= _boot_sector.BytesPerSector)
00535                         if (!read_cache(FATsec+1,&FATBuf))
00536                                 ok = false;
00537                 z = 0;
00538
00539                 BYTE b = FATBuf->dat[z];
00540
00541                 if (cluster & 1)
00542                         nClus = (a>>4) | (b<<4);
00543                 else
00544                         nClus = a | ((b & 0xf)<<8);
00545
00546                 if (nClus >= 0xff0)
00547                         nClus |= 0x0ffff000;
00548         }
00549
00550         return nClus;
00551 }
00552
00553 bool FATDrive::read_cache(DWORD sec, Buffer** bufptr)
00554 {
00555  int i, C, anz;
00556
00557  if (_boot_sector.BytesPerSector != BufLen)  // no standard sector size?
00558   return read_sector(sec, *bufptr=(Buffer*)&_FATCache[0], 1);
00559
00560  _CacheCount++;
00561
00562  for(i=0; _CacheSec[i]!=sec && i<_Caches; )
00563   ++i;
00564
00565  if (i < _Caches)
00566   {
00567    *bufptr = (Buffer*) &_FATCache[i];    // FAT-Sektor schon gepuffert
00568    _CacheCnt[i]++;
00569    return true;
00570   }
00571
00572  i = get_cache_buffer();
00573
00574  if (_cache_empty)              // von get_cache_buffer() gesetzt
00575   {
00576    C = _CacheCount-1;
00577    anz = _boot_sector.SectorsPerFAT*_boot_sector.NumberFATs - sec;
00578
00579    if (anz > _read_ahead)
00580         anz = _read_ahead;
00581
00582    for(i=0; i<anz; i++) {
00583         _CacheSec[i] = sec++;
00584         _CacheCnt[i] = C;
00585         _CacheDty[i] = 0;
00586    }
00587
00588    _CacheCnt[0] = _CacheCount;
00589
00590    return read_sector(_CacheSec[0], *bufptr=(Buffer*) &_FATCache[0], anz);
00591   }
00592  else
00593   {
00594    _CacheDty[i] = 0;
00595    _CacheCnt[i] = _CacheCount;
00596
00597    return read_sector(_CacheSec[i]=sec, *bufptr=(Buffer*) &_FATCache[i], 1);
00598   }
00599 }
00600
00601 int FATDrive::get_cache_buffer()        // search for free cache buffer
00602 {
00603  int i, j, minCnt;
00604
00605  for(i=0; i<_Caches; i++)
00606   if (_CacheSec[i])
00607    break;
00608
00609  _cache_empty = i==_Caches? true: false;
00610
00611  for(i=0; _CacheSec[i] && i<_Caches; )
00612   ++i;
00613
00614  if (i < _Caches)
00615   j = i;
00616  else
00617   {
00618    minCnt = 0;                  // search for least used buffer
00619
00620    for(j=i=0; i<_Caches; i++)
00621         if (minCnt < _CacheCnt[i]) {
00622          minCnt = _CacheCnt[i];
00623          j = i;
00624         }
00625
00631   }
00632
00633  return j;
00634 }


ROS Explorer: fatfs.h File Reference

  • File List
  • File Members
shell

fatfs.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | FATEntry
FAT file system file-entry. More...
struct | FATDirectory
FAT file system directory-entry. More...
struct | BootSector
struct | BootSector32
struct | ftime
struct | fdate
struct | fattr
union | FAT_attribute
struct | DEntry_E
union | DEntry
struct | Buffer
struct | Cache
struct | dskrwblk
struct | dirent
struct | dirsecz
struct | Kette
struct | FATDrive
FAT drive root entry. More...

Defines

#define | BufLen 512
#define | RONLY 0x01
#define | HIDDEN 0x02
#define | SYSTEM 0x04
#define | VOLUME 0x08
#define | DIRENT 0x10
#define | ARCHIVE 0x20
#define | _A_DELETED 0x40
#define | _A_ILLEGAL 0x80
#define | IS_LNAME(a) ((a&0xFF)==0x0F)
#define | FAT_DEL_CHAR (char)0xe5
#define | AddP(p, s) {(int&)p += s;}
#define | MK_P(ofs) ((void*) ((size_t)(ofs)))
#define | MK_LONG(l, h) ((DWORD)WORD(l)|((DWORD)WORD(h)<<16))
#define | spoke(ofs, w) (*((BYTE*)MK_P(ofs)) = (BYTE)(w))
#define | wpoke(ofs, w) (*((WORD*)MK_P(ofs)) = (WORD)(w))
#define | dpoke(ofs, w) (*((DWORD*)MK_P(ofs)) = (DWORD)(w))
#define | speek(ofs) (*((BYTE*)MK_P(ofs)))
#define | wpeek(ofs) (*((WORD*)MK_P(ofs)))
#define | dpeek(p) (*((DWORD*)MK_P(p)))
#define | CACHE_SIZE_LOW 32

Define Documentation

#define _A_DELETED 0x40

Definition at line 190 of file fatfs.h.

#define _A_ILLEGAL 0x80

Definition at line 191 of file fatfs.h.

#define AddP | ( | p,
 |  | s | ) | {(int&)p += s;}

Definition at line 196 of file fatfs.h.

Referenced by FATDirectory::read_dir(), and FATDirectory::read_directory().

#define ARCHIVE 0x20

Definition at line 188 of file fatfs.h.

#define BufLen 512

Definition at line 167 of file fatfs.h.

Referenced by FATDrive::read_cache().

#define CACHE_SIZE_LOW 32

Definition at line 243 of file fatfs.h.

Referenced by FATDrive::small_cache().

#define DIRENT 0x10

Definition at line 187 of file fatfs.h.

#define dpeek ( p ) (*((DWORD*)MK_P(p)))

Definition at line 221 of file fatfs.h.

Referenced by FATDrive::read_FAT().

#define dpoke | ( | ofs,
 |  | w | ) | (*((DWORD*)MK_P(ofs)) = (DWORD)(w))

Definition at line 218 of file fatfs.h.

#define FAT_DEL_CHAR (char)0xe5

Definition at line 194 of file fatfs.h.

#define HIDDEN 0x02

Definition at line 184 of file fatfs.h.

#define IS_LNAME ( a ) ((a&0xFF)==0x0F)

Definition at line 192 of file fatfs.h.

#define MK_LONG | ( | l,
 |  | h | ) | ((DWORD)WORD(l)|((DWORD)WORD(h)<<16))

Definition at line 214 of file fatfs.h.

#define MK_P ( ofs ) ((void*) ((size_t)(ofs)))

Definition at line 213 of file fatfs.h.

#define RONLY 0x01

Definition at line 183 of file fatfs.h.

#define speek ( ofs ) (*((BYTE*)MK_P(ofs)))

Definition at line 219 of file fatfs.h.

#define spoke | ( | ofs,
 |  | w | ) | (*((BYTE*)MK_P(ofs)) = (BYTE)(w))

Definition at line 216 of file fatfs.h.

#define SYSTEM 0x04

Definition at line 185 of file fatfs.h.

#define VOLUME 0x08

Definition at line 186 of file fatfs.h.

#define wpeek ( ofs ) (*((WORD*)MK_P(ofs)))

Definition at line 220 of file fatfs.h.

Referenced by FATDrive::read_FAT().

#define wpoke | ( | ofs,
 |  | w | ) | (*((WORD*)MK_P(ofs)) = (WORD)(w))

Definition at line 217 of file fatfs.h.


ROS Explorer: fatfs.h Source File

  • File List
  • File Members
shell

fatfs.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // fatfs.h
00024  //
00025  // Martin Fuchs, 01.02.2004
00026  //
00027
00028
00030 struct FATEntry : public Entry
00031 {
00032         FATEntry(Entry* parent, unsigned cluster) : Entry(parent, ET_FAT), _cluster(cluster) {}
00033
00034 protected:
00035         FATEntry() : Entry(ET_FAT) {}
00036
00037         virtual bool get_path(PTSTR path, size_t path_count) const;
00038         virtual ShellPath create_absolute_pidl() const;
00039
00040         DWORD   _cluster;
00041 };
00042
00043
00044 struct FATDrive;
00045
00047 struct FATDirectory : public FATEntry, public Directory
00048 {
00049         FATDirectory(FATDrive& drive, LPCTSTR root_path);
00050         FATDirectory(FATDrive& drive, Entry* parent, LPCTSTR path, unsigned cluster);
00051         ~FATDirectory();
00052
00053         virtual void read_directory(int scan_flags=SCAN_ALL);
00054         virtual const void* get_next_path_component(const void*) const;
00055         virtual Entry* find_entry(const void*);
00056
00057 protected:
00058         FATDrive&       _drive;
00059
00060         struct dirsecz* _secarr;
00061         int     _cur_bufs;
00062         int     _ents;
00063         struct dirent* _dir;
00064         struct Kette* _alloc;
00065
00066         bool    read_dir();
00067 };
00068
00069
00070 #pragma pack(push, 1)
00071
00072 struct BootSector {
00073         BYTE    jmp[3];
00074         char    OEM[8];
00075         WORD    BytesPerSector;         // dpb.bsec
00076         BYTE    SectorsPerCluster;      // dpb.sclus + 1
00077         WORD    ReservedSectors;        // dpb.ffatsec
00078         BYTE    NumberFATs;
00079         WORD    RootEntries;            // dpb.ndir
00080         WORD    Sectors16;
00081         BYTE    MediaDescr;
00082         WORD    SectorsPerFAT;
00083         WORD    SectorsPerTrack;
00084         WORD    Heads;
00085         DWORD   HiddenSectors;
00086         DWORD   Sectors32;
00087         BYTE    DriveUnit;
00088         WORD    ExtBootFlag;
00089         DWORD   SerialNr;
00090         char    Label[11];
00091         char    FileSystem[8];
00092         BYTE    BootCode[448];
00093         BYTE    BootSignature[2];
00094 };
00095
00096 struct BootSector32 {
00097         BYTE    jmp[3];
00098         char    OEM[8];
00099         WORD    BytesPerSector;
00100         BYTE    SectorsPerCluster;
00101         WORD    ReservedSectors;
00102         BYTE    NumberFATs;
00103         WORD    reserved1;      // immer 0 für FAT32
00104         WORD    Sectors16;
00105         BYTE    MediaDescr;
00106         WORD    reserved2;      // immer 0 für FAT32
00107         WORD    SectorsPerTrack;
00108         WORD    Heads;
00109         DWORD   HiddenSectors;
00110         DWORD   Sectors32;
00111         DWORD   SectorsPerFAT32;
00112         DWORD   unknown1;
00113         DWORD   RootSectors; // correct?
00114         char    unknown2[6];
00115         char    FileSystem[8];
00116         BYTE    BootCode[448];
00117         BYTE    BootSignature[2];
00118 };
00119
00120
00121 struct ftime {
00122         WORD    sec2    : 5;
00123         WORD    min     : 6;
00124         WORD    hour    : 5;
00125 };
00126
00127 struct fdate {
00128         WORD    day     : 5;
00129         WORD    month   : 4;
00130         WORD    year    : 7;
00131 };
00132
00133 typedef struct {
00134         unsigned readonly       : 1;
00135         unsigned hidden         : 1;
00136         unsigned system         : 1;
00137         unsigned volume         : 1;
00138         unsigned directory      : 1;
00139         unsigned archived       : 1;
00140         unsigned deleted        : 1;
00141 } fattr;
00142
00143 typedef union {
00144         char    b;
00145         fattr  a;
00146 } FAT_attribute;
00147
00148 struct DEntry_E {
00149         char                    name[8];
00150         char                    ext[3];
00151         char                    attr;
00152         char                    rsrvd[10];
00153         struct ftime    time;
00154         struct fdate    date;
00155         WORD                    fclus;
00156         DWORD                   size;
00157 };
00158
00159 union DEntry {
00160         DEntry_E E;
00161         BYTE B[8+3+1+10+sizeof(struct ftime)+sizeof(struct fdate)+sizeof(WORD)+sizeof(DWORD)];
00162 };
00163
00164 #pragma pack(pop)
00165
00166
00167 #define BufLen  512
00168
00169 struct Buffer {
00170  BYTE   dat[BufLen];
00171 };
00172
00173 struct Cache {
00174  BYTE   dat[BufLen];
00175 };
00176
00177 struct dskrwblk {
00178  DWORD                  sec;
00179  WORD                   anz;
00180  struct buffer  far *buf;
00181 };
00182
00183 #define RONLY                   0x01
00184 #define HIDDEN                  0x02
00185 #define SYSTEM                  0x04
00186 #define VOLUME                  0x08
00187 #define DIRENT                  0x10
00188 #define ARCHIVE                 0x20
00189
00190 #define _A_DELETED              0x40
00191 #define _A_ILLEGAL              0x80
00192 #define IS_LNAME(a) ((a&0xFF)==0x0F)    // "& 0xFF" correct?
00193
00194 #define FAT_DEL_CHAR    (char)0xe5
00195
00196 #define AddP(p,s)  {(int&)p += s;}
00197
00198 struct dirent {
00199         union DEntry  ent[1];
00200 };
00201
00202 struct dirsecz {
00203         DWORD  s[32];  // 32 only as placeholder
00204 };
00205
00206 struct Kette {
00207  struct Kette*  Vorw;
00208  struct Kette*  Rueck;
00209  union DEntry*  Ent;
00210 };
00211
00212
00213 #define MK_P(ofs)               ((void*) ((size_t)(ofs)))
00214 #define MK_LONG(l,h)    ((DWORD)WORD(l)|((DWORD)WORD(h)<<16))
00215
00216 #define spoke(ofs,w)    (*((BYTE*)MK_P(ofs)) = (BYTE)(w))
00217 #define wpoke(ofs,w)    (*((WORD*)MK_P(ofs)) = (WORD)(w))
00218 #define dpoke(ofs,w)    (*((DWORD*)MK_P(ofs)) = (DWORD)(w))
00219 #define speek(ofs)              (*((BYTE*)MK_P(ofs)))
00220 #define wpeek(ofs)              (*((WORD*)MK_P(ofs)))
00221 #define dpeek(p)                (*((DWORD*)MK_P(p)))
00222
00223
00225 struct FATDrive : public FATDirectory
00226 {
00227         FATDrive(LPCTSTR path);
00228 /*
00229         FATDrive(Entry* parent, LPCTSTR path)
00230          :      FATEntry(parent)
00231         {
00232                 _path = _tcsdup(path);
00233         }
00234 */
00235         ~FATDrive();
00236
00237         HANDLE  _hDrive;
00238         BootSector      _boot_sector;
00239         int     _bufl;
00240         int     _bufents;
00241         int     _SClus;
00242
00243 #define CACHE_SIZE_LOW  32
00244         Cache*  _FATCache;
00245         int             _CacheCount;
00246         DWORD*  _CacheSec;      // numbers of buffered cache sectors
00247         int*    _CacheCnt;      // counters for cache usage
00248         bool*   _CacheDty;      // dirty flags for cache
00249         int             _Caches;
00250         bool    _cache_empty;
00251         int             _read_ahead;
00252
00253         bool    read_sector(DWORD sec, Buffer* buf, int len);
00254         DWORD   read_FAT(DWORD Clus, bool& ok);
00255
00256         void    small_cache();
00257         void    reset_cache();
00258         bool    read_cache(DWORD sec, Buffer** bufptr);
00259         int             get_cache_buffer();
00260 };


ROS Explorer: favorites.cpp File Reference

  • File List
  • File Members
taskbar

favorites.cpp File Reference

#include <precomp.h>
#include "startmenu.h"

Include dependency graph for favorites.cpp:

Go to the source code of this file.

Functions

String DecodeURLString (const char *s)

Function Documentation

String DecodeURLString ( const char * s )

Definition at line 34 of file favorites.cpp.

References BUFFER_LEN.

Referenced by Bookmark::read_url().

00035 {
00036         TCHAR buffer[BUFFER_LEN];
00037         LPTSTR o = buffer;
00038
00039         for(const char* p=s; *p; ++p)
00040                 if (*p == '%') {
00041                         if (!strncmp(p+1, "20", 2)) {
00042                                 *o++ = ' ';
00043                                 p += 2;
00044                         } else
00045                                 *o++ = *p;
00046                 } else
00047                         *o++ = *p;
00048
00049         return String(buffer, o-buffer);
00050 }


ROS Explorer: favorites.cpp Source File

  • File List
  • File Members
taskbar

favorites.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer and Desktop clone
00022  //
00023  // favorites.cpp
00024  //
00025  // Martin Fuchs, 04.04.2004
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "startmenu.h"
00032
00033
00034 String DecodeURLString(const char* s)
00035 {
00036         TCHAR buffer[BUFFER_LEN];
00037         LPTSTR o = buffer;
00038
00039         for(const char* p=s; *p; ++p)
00040                 if (*p == '%') {
00041                         if (!strncmp(p+1, "20", 2)) {
00042                                 *o++ = ' ';
00043                                 p += 2;
00044                         } else
00045                                 *o++ = *p;
00046                 } else
00047                         *o++ = *p;
00048
00049         return String(buffer, o-buffer);
00050 }
00051
00052
00054 bool Bookmark::read_url(LPCTSTR path)
00055 {
00056         char line[BUFFER_LEN];
00057
00058         tifstream in(path);
00059
00060         while(in.good()) {
00061                 in.getline(line, BUFFER_LEN);
00062
00063                 const char* p = line;
00064                 while(isspace(*p))
00065                         ++p;
00066
00067                 const char* keyword = p;
00068                 const char* eq = strchr(p, '=');
00069
00070                 if (eq) {
00071                         const char* cont = eq + 1;
00072                         while(isspace(*cont))
00073                                 ++cont;
00074
00075                         if (!_strnicmp(keyword, "URL", 3))
00076                                 _url = DecodeURLString(cont);
00077                         else if (!_strnicmp(keyword, "IconFile", 8))
00078                                 _icon_path = DecodeURLString(cont);
00079                 }
00080         }
00081
00082         return true;
00083 }
00084
00086 bool Bookmark::read(const_XMLPos& pos)
00087 {
00088         _url = pos.get("href").c_str();
00089
00090         if (pos.go_down("title")) {
00091                 _name = pos->get_content();
00092                 pos.back();
00093         }
00094
00095         if (pos.go_down("desc")) {
00096                 _description = pos->get_content();
00097                 pos.back();
00098         }
00099
00100         if (pos.go_down("info")) {
00101                 const_XMLChildrenFilter metadata(pos, "metadata");
00102
00103                 for(const_XMLChildrenFilter::const_iterator it=metadata.begin(); it!=metadata.end(); ++it) {
00104                         const XMLNode& node = **it;
00105                         const_XMLPos sub_pos(&node);
00106
00107                         if (node.get("owner") == "ros-explorer") {
00108                                 if (sub_pos.go_down("icon")) {
00109                                         _icon_path = sub_pos.get("path").c_str();
00110                                         _icon_idx = XS_toi(sub_pos.get("index"));
00111
00112                                         sub_pos.back(); // </icon>
00113                                 }
00114                         }
00115                 }
00116
00117                 pos.back();     // </metadata>
00118                 pos.back();     // </info>
00119         }
00120
00121         return !_url.empty();   // _url is mandatory.
00122 }
00123
00125 void Bookmark::write(XMLPos& pos) const
00126 {
00127         pos.create("bookmark");
00128
00129         pos["href"] = _url.c_str();
00130
00131         if (!_name.empty()) {
00132                 pos.create("title");
00133                 pos->set_content(_name);
00134                 pos.back();
00135         }
00136
00137         if (!_description.empty()) {
00138                 pos.create("desc");
00139                 pos->set_content(_description);
00140                 pos.back();
00141         }
00142
00143         if (!_icon_path.empty()) {
00144                 pos.create("info");
00145                 pos.create("metadata");
00146                 pos["owner"] = "ros-explorer";
00147                 pos.create("icon");
00148                 pos["path"] = _icon_path.c_str();
00149                 pos["index"].printf(XS_TEXT("%d"), _icon_idx);
00150                 pos.back();     // </icon>
00151                 pos.back();     // </metadata>
00152                 pos.back();     // </info>
00153         }
00154
00155         pos.back();
00156 }
00157
00158
00160 void BookmarkFolder::read(const_XMLPos& pos)
00161 {
00162         if (pos.go_down("title")) {
00163                 _name = pos->get_content();
00164                 pos.back();
00165         }
00166
00167         if (pos.go_down("desc")) {
00168                 _description = pos->get_content();
00169                 pos.back();
00170         }
00171
00172         _bookmarks.read(pos);
00173 }
00174
00176 void BookmarkFolder::write(XMLPos& pos) const
00177 {
00178         pos.create("folder");
00179
00180         if (!_name.empty()) {
00181                 pos.create("title");
00182                 pos->set_content(_name);
00183                 pos.back();
00184         }
00185
00186         if (!_description.empty()) {
00187                 pos.create("desc");
00188                 pos->set_content(_description);
00189                 pos.back();
00190         }
00191
00192         _bookmarks.write(pos);
00193 }
00194
00195
00196 BookmarkNode::BookmarkNode()
00197  :      _type(BMNT_NONE)
00198 {
00199         _pbookmark = NULL;
00200 }
00201
00202 BookmarkNode::BookmarkNode(const Bookmark& bm)
00203  :      _type(BMNT_BOOKMARK)
00204 {
00205         _pbookmark = new Bookmark(bm);
00206 }
00207
00208 BookmarkNode::BookmarkNode(const BookmarkFolder& bmf)
00209  :      _type(BMNT_FOLDER)
00210 {
00211         _pfolder = new BookmarkFolder(bmf);
00212 }
00213
00214 BookmarkNode::BookmarkNode(const BookmarkNode& other)
00215  :      _type(other._type)
00216 {
00217         if (other._type == BMNT_BOOKMARK)
00218                 _pbookmark = new Bookmark(*other._pbookmark);
00219         else if (other._type == BMNT_FOLDER)
00220                 _pfolder = new BookmarkFolder(*other._pfolder);
00221         else
00222                 _pbookmark = NULL;
00223 }
00224
00225 BookmarkNode::~BookmarkNode()
00226 {
00227         if (_type == BMNT_BOOKMARK)
00228                 delete _pbookmark;
00229         else if (_type == BMNT_FOLDER)
00230                 delete _pfolder;
00231 }
00232
00233 BookmarkNode& BookmarkNode::operator=(const Bookmark& bm)
00234 {
00235         clear();
00236
00237         _pbookmark = new Bookmark(bm);
00238
00239         return *this;
00240 }
00241
00242 BookmarkNode& BookmarkNode::operator=(const BookmarkFolder& bmf)
00243 {
00244         clear();
00245
00246         _pfolder = new BookmarkFolder(bmf);
00247
00248         return *this;
00249 }
00250
00251 BookmarkNode& BookmarkNode::operator=(const BookmarkNode& other)
00252 {
00253         clear();
00254
00255         _type = other._type;
00256
00257         if (other._type == BMNT_BOOKMARK)
00258                 _pbookmark = new Bookmark(*other._pbookmark);
00259         else if (other._type == BMNT_FOLDER)
00260                 _pfolder = new BookmarkFolder(*other._pfolder);
00261
00262         return *this;
00263 }
00264
00265 void BookmarkNode::clear()
00266 {
00267         if (_type == BMNT_BOOKMARK) {
00268                 delete _pbookmark;
00269                 _pbookmark = NULL;
00270         }
00271         else if (_type == BMNT_FOLDER) {
00272                 delete _pfolder;
00273                 _pfolder = NULL;
00274         }
00275
00276         _type = BMNT_NONE;
00277 }
00278
00279
00281 void BookmarkList::read(const_XMLPos& pos)
00282 {
00283         const XMLNode::Children& children = pos->get_children();
00284
00285         for(XMLNode::Children::const_iterator it=children.begin(); it!=children.end(); ++it) {
00286                 const XMLNode& node = **it;
00287                 const_XMLPos sub_pos(&node);
00288
00289                 if (node == "folder") {
00290                         BookmarkFolder folder;
00291
00292                         folder.read(sub_pos);
00293
00294                         push_back(folder);
00295                 } else if (node == "bookmark") {
00296                         Bookmark bookmark;
00297
00298                         if (bookmark.read(sub_pos))
00299                                 push_back(bookmark);
00300                 }
00301         }
00302 }
00303
00305 void BookmarkList::write(XMLPos& pos) const
00306 {
00307         for(const_iterator it=begin(); it!=end(); ++it) {
00308                 const BookmarkNode& node = *it;
00309
00310                 if (node._type == BookmarkNode::BMNT_FOLDER) {
00311                         const BookmarkFolder& folder = *node._pfolder;
00312
00313                         folder.write(pos);
00314
00315                         pos.back();
00316                 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
00317                         const Bookmark& bookmark = *node._pbookmark;
00318
00319                         if (!bookmark._url.empty())
00320                                 bookmark.write(pos);
00321                 }
00322         }
00323 }
00324
00325
00327 void BookmarkList::fill_tree(HWND hwnd, HTREEITEM parent, HIMAGELIST himagelist, HDC hdc_wnd) const
00328 {
00329         TV_INSERTSTRUCT tvi;
00330
00331         tvi.hParent = parent;
00332         tvi.hInsertAfter = TVI_LAST;
00333
00334         TV_ITEM& tv = tvi.item;
00335         tv.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
00336
00337         for(const_iterator it=begin(); it!=end(); ++it) {
00338                 const BookmarkNode& node = *it;
00339
00340                 tv.lParam = (LPARAM)&node;
00341
00342                 if (node._type == BookmarkNode::BMNT_FOLDER) {
00343                         const BookmarkFolder& folder = *node._pfolder;
00344
00345                         tv.pszText = (LPTSTR)folder._name.c_str();
00346                         tv.iImage = 3;                  // folder
00347                         tv.iSelectedImage = 4;  // open folder
00348                         HTREEITEM hitem = TreeView_InsertItem(hwnd, &tvi);
00349
00350                         folder._bookmarks.fill_tree(hwnd, hitem, himagelist, hdc_wnd);
00351                 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
00352                         const Bookmark& bookmark = *node._pbookmark;
00353
00354                         tv.pszText = (LPTSTR)bookmark._name.c_str();
00355                         tv.iImage = 1;                  // bookmark
00356                         tv.iSelectedImage = 2;  // selected bookmark
00357
00358                         if (!bookmark._icon_path.empty()) {
00359                                 const Icon& icon = g_Globals._icon_cache.extract(bookmark._icon_path, bookmark._icon_idx);
00360
00361                                 if ((ICON_ID)icon != ICID_NONE)
00362                                         tv.iImage = tv.iSelectedImage = icon.add_to_imagelist(himagelist, hdc_wnd);
00363                         }
00364
00365                         (void)TreeView_InsertItem(hwnd, &tvi);
00366                 }
00367         }
00368 }
00369
00370
00372 void BookmarkList::import_IE_favorites(ShellDirectory& dir, HWND hwnd)
00373 {
00374         TCHAR path[MAX_PATH], ext[_MAX_EXT];
00375
00376         dir.smart_scan(SORT_NAME, SCAN_FILESYSTEM);
00377
00378         for(Entry*entry=dir._down; entry; entry=entry->_next) {
00379                 if (entry->_shell_attribs & SFGAO_HIDDEN)       // ignore files like "desktop.ini"
00380                         continue;
00381
00382                 String name;
00383
00384                 if (entry->_etype == ET_SHELL)
00385                         name = dir._folder.get_name(static_cast<ShellEntry*>(entry)->_pidl);
00386                 else
00387                         name = entry->_display_name;
00388
00389                 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00390                         BookmarkFolder new_folder;
00391
00392                         new_folder._name = DecodeXMLString(name);
00393
00394                         if (entry->_etype == ET_SHELL) {
00395                                 ShellDirectory new_dir(dir._folder, static_cast<ShellEntry*>(entry)->_pidl, hwnd);
00396                                 new_folder._bookmarks.import_IE_favorites(new_dir, hwnd);
00397                         } else {
00398                                 entry->get_path(path, COUNTOF(path));
00399                                 ShellDirectory new_dir(GetDesktopFolder(), path, hwnd);
00400                                 new_folder._bookmarks.import_IE_favorites(new_dir, hwnd);
00401                         }
00402
00403                         push_back(new_folder);
00404                 } else {
00405                         Bookmark bookmark;
00406
00407                         bookmark._name = DecodeXMLString(name);
00408
00409                         entry->get_path(path, COUNTOF(path));
00410                         _tsplitpath_s(path, NULL, 0, NULL, 0, NULL, 0, ext, COUNTOF(ext));
00411
00412                         if (!_tcsicmp(ext, TEXT(".url"))) {
00413                                 bookmark.read_url(path);
00414                                 push_back(bookmark);
00415                         } else {
00417                                 //assert(0);
00418                         }
00419                 }
00420         }
00421 }
00422
00423
00425 bool Favorites::read(LPCTSTR path)
00426 {
00427         XMLDoc xbel;
00428
00429         if (!xbel.read(path))
00430                 if (xbel._last_error == XML_ERROR_NO_ELEMENTS)
00431                         return false;
00432                 else
00433                         MessageBox(g_Globals._hwndDesktop, String(xbel._last_error_msg.c_str()),
00434                                                 TEXT("ROS Explorer - reading bookmark file"), MB_OK);
00435
00436         const_XMLPos pos(&xbel);
00437
00438         if (!pos.go_down("xbel"))
00439                 return false;
00440
00441         super::read(pos);
00442
00443         pos.back();
00444
00445         return true;
00446 }
00447
00449 void Favorites::write(LPCTSTR path) const
00450 {
00451         XMLDoc xbel;
00452
00453         XMLPos pos(&xbel);
00454         pos.create("xbel");
00455         super::write(pos);
00456         pos.back();
00457
00458         xbel._header._doctype = "<!DOCTYPE xbel"
00459                 " PUBLIC \"+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML\"\n"
00460                 " \"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd\">";
00461
00462         xbel.write(path);
00463 }
00464
00466 bool Favorites::import_IE_favorites(HWND hwnd)
00467 {
00468         WaitCursor wait;
00469
00470         StartMenuShellDirs dirs;
00471
00472         try {
00473                 dirs.push_back(ShellDirectory(GetDesktopFolder(), SpecialFolderPath(CSIDL_COMMON_FAVORITES, hwnd), hwnd));
00474                 dirs.push_back(ShellDirectory(GetDesktopFolder(), SpecialFolderPath(CSIDL_FAVORITES, hwnd), hwnd));
00475         } catch(COMException&) {
00476         }
00477
00478         for(StartMenuShellDirs::iterator it=dirs.begin(); it!=dirs.end(); ++it) {
00479                 StartMenuDirectory& smd = *it;
00480                 ShellDirectory& dir = smd._dir;
00481
00482                 try {
00483                         super::import_IE_favorites(dir, hwnd);
00484                 } catch(COMException&) {
00485                 }
00486         }
00487
00488         return true;
00489 }


ROS Explorer: favorites.h File Reference

  • File List
  • File Members
taskbar

favorites.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | Bookmark
struct | BookmarkNode
struct | BookmarkList
struct | BookmarkFolder
struct | Favorites

Functions

String | DecodeURLString (const char *s)

Function Documentation

String DecodeURLString ( const char * s )

Definition at line 34 of file favorites.cpp.

References BUFFER_LEN.

Referenced by Bookmark::read_url().

00035 {
00036         TCHAR buffer[BUFFER_LEN];
00037         LPTSTR o = buffer;
00038
00039         for(const char* p=s; *p; ++p)
00040                 if (*p == '%') {
00041                         if (!strncmp(p+1, "20", 2)) {
00042                                 *o++ = ' ';
00043                                 p += 2;
00044                         } else
00045                                 *o++ = *p;
00046                 } else
00047                         *o++ = *p;
00048
00049         return String(buffer, o-buffer);
00050 }


ROS Explorer: favorites.h Source File

  • File List
  • File Members
taskbar

favorites.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer and Desktop clone
00022  //
00023  // favorites.h
00024  //
00025  // Martin Fuchs, 04.04.2004
00026  //
00027
00028
00029 extern String DecodeURLString(const char* s);
00030
00031
00032 struct Bookmark
00033 {
00034         Bookmark() : _icon_idx(0) {}
00035
00036         String  _name;
00037         String  _description;
00038         String  _url;
00039         String  _icon_path;
00040         int             _icon_idx;
00041
00042         bool    read_url(LPCTSTR path);
00043         bool    read(const_XMLPos& pos);
00044         void    write(XMLPos& pos) const;
00045 };
00046
00047 struct BookmarkFolder;
00048
00049 struct BookmarkNode
00050 {
00051         BookmarkNode();
00052         BookmarkNode(const Bookmark& bm);
00053         BookmarkNode(const BookmarkFolder& bmf);
00054         BookmarkNode(const BookmarkNode& other);
00055
00056         ~BookmarkNode();
00057
00058         BookmarkNode& operator=(const Bookmark& bm);
00059         BookmarkNode& operator=(const BookmarkFolder& bmf);
00060         BookmarkNode& operator=(const BookmarkNode& other);
00061
00062         void    clear();
00063
00064         enum BOOKMARKNODE_TYPE {
00065                 BMNT_NONE, BMNT_BOOKMARK, BMNT_FOLDER
00066         };
00067
00068         BOOKMARKNODE_TYPE       _type;
00069
00070         union {
00071                 Bookmark*               _pbookmark;
00072                 BookmarkFolder* _pfolder;
00073         };
00074 };
00075
00076 struct BookmarkList : public list<BookmarkNode>
00077 {
00078         void    import_IE_favorites(struct ShellDirectory& dir, HWND hwnd);
00079
00080         void    read(const_XMLPos& pos);
00081         void    write(XMLPos& pos) const;
00082
00083         void    fill_tree(HWND hwnd, HTREEITEM parent, HIMAGELIST, HDC hdc_wnd) const;
00084 };
00085
00086 struct BookmarkFolder
00087 {
00088         String  _name;
00089         String  _description;
00090         BookmarkList _bookmarks;
00091
00092         void    read(const_XMLPos& pos);
00093         void    write(XMLPos& pos) const;
00094 };
00095
00096 struct Favorites : public BookmarkList
00097 {
00098         typedef BookmarkList super;
00099
00100         bool    read(LPCTSTR path);
00101         void    write(LPCTSTR path) const;
00102
00103         bool    import_IE_favorites(HWND hwnd);
00104 };


ROS Explorer: filechild.cpp File Reference

  • File List
  • File Members
shell

filechild.cpp File Reference

#include <precomp.h>
#include "ntobjfs.h"
#include "regfs.h"
#include "fatfs.h"
#include "../resource.h"

Include dependency graph for filechild.cpp:

Go to the source code of this file.


ROS Explorer: filechild.cpp Source File

  • File List
  • File Members
shell

filechild.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // filechild.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "ntobjfs.h"
00032 #include "regfs.h"
00033 #include "fatfs.h"
00034
00035 #include "../resource.h"
00036
00037
00038 FileChildWndInfo::FileChildWndInfo(HWND hmdiclient, LPCTSTR path, ENTRY_TYPE etype)
00039  :      super(hmdiclient),
00040         _etype(etype)
00041 {
00042         if (etype == ET_UNKNOWN)
00043 #ifdef __WINE__
00044                 if (*path == '/')
00045                         _etype = ET_UNIX;
00046                 else
00047 #endif
00048                         _etype = ET_WINDOWS;
00049
00050         _path = path;
00051
00052         _pos.length = sizeof(WINDOWPLACEMENT);
00053         _pos.flags = 0;
00054         _pos.showCmd = SW_SHOWNORMAL;
00055         _pos.rcNormalPosition.left = CW_USEDEFAULT;
00056         _pos.rcNormalPosition.top = CW_USEDEFAULT;
00057         _pos.rcNormalPosition.right = CW_USEDEFAULT;
00058         _pos.rcNormalPosition.bottom = CW_USEDEFAULT;
00059
00060         _open_mode = OWM_EXPLORE|OWM_DETAILS;
00061 }
00062
00063
00064 ShellChildWndInfo::ShellChildWndInfo(HWND hmdiclient, LPCTSTR path, const ShellPath& root_shell_path)
00065  :      FileChildWndInfo(hmdiclient, path, ET_SHELL),
00066         _shell_path(path&&*path? path: root_shell_path),
00067         _root_shell_path(root_shell_path)
00068 {
00069 }
00070
00071
00072 NtObjChildWndInfo::NtObjChildWndInfo(HWND hmdiclient, LPCTSTR path)
00073  :      FileChildWndInfo(hmdiclient, path, ET_NTOBJS)
00074 {
00075 }
00076
00077
00078 RegistryChildWndInfo::RegistryChildWndInfo(HWND hmdiclient, LPCTSTR path)
00079  :      FileChildWndInfo(hmdiclient, path, ET_REGISTRY)
00080 {
00081 }
00082
00083
00084 FATChildWndInfo::FATChildWndInfo(HWND hmdiclient, LPCTSTR path)
00085  :      FileChildWndInfo(hmdiclient, path, ET_FAT)
00086 {
00087 }
00088
00089
00090 WebChildWndInfo::WebChildWndInfo(HWND hmdiclient, LPCTSTR url)
00091  :      FileChildWndInfo(hmdiclient, url, ET_WEB)
00092 {
00093 }
00094
00095
00096 INT_PTR CALLBACK ExecuteDialog::WndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
00097 {
00098         static struct ExecuteDialog* dlg;
00099
00100         switch(nmsg) {
00101           case WM_INITDIALOG:
00102                 dlg = (struct ExecuteDialog*) lparam;
00103                 return 1;
00104
00105           case WM_COMMAND: {
00106                 int id = (int)wparam;
00107
00108                 if (id == IDOK) {
00109                         GetWindowText(GetDlgItem(hwnd, 201), dlg->cmd, COUNTOF(dlg->cmd));
00110                         dlg->cmdshow = Button_GetState(GetDlgItem(hwnd,214))&BST_CHECKED?
00111                                                                                         SW_SHOWMINIMIZED: SW_SHOWNORMAL;
00112                         EndDialog(hwnd, id);
00113                 } else if (id == IDCANCEL)
00114                         EndDialog(hwnd, id);
00115
00116                 return 1;}
00117         }
00118
00119         return 0;
00120 }
00121
00122
00123  // FileChildWindow
00124
00125 FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info)
00126  :      super(hwnd, info)
00127 {
00128         CONTEXT("FileChildWindow::FileChildWindow()");
00129
00130         TCHAR drv[_MAX_DRIVE+1];
00131         Entry* entry = NULL;
00132
00133         _left = NULL;
00134         _right = NULL;
00135
00136         switch(info._etype) {
00137           case ET_SHELL: {      //@@ separate FileChildWindow into ShellChildWindow, WinChildWindow, UnixChildWindow ?
00138                 _root._drive_type = DRIVE_UNKNOWN;
00139                 _root._sort_order = SORT_NAME;
00140
00141                 lstrcpy(drv, TEXT("\\"));
00142                 lstrcpy(_root._volname, TEXT("Desktop"));
00143                 _root._fs_flags = 0;
00144                 lstrcpy(_root._fs, TEXT("Shell"));
00145
00146                 _root._entry = new ShellDirectory(GetDesktopFolder(), DesktopFolderPath(), hwnd);
00147                 const ShellChildWndInfo& shell_info = static_cast<const ShellChildWndInfo&>(info);
00148                 entry = _root.read_tree(&*shell_info._shell_path);
00149                 break;}
00150
00151 #ifdef __WINE__
00152           case ET_UNIX:
00153                 _root._drive_type = GetDriveType(info._path);
00154                 _root._sort_order = SORT_NAME;
00155
00156                 _tsplitpath(info._path, drv, NULL, NULL, NULL);
00157                 lstrcat(drv, TEXT("/"));
00158                 lstrcpy(_root._volname, TEXT("root fs"));
00159                 _root._fs_flags = 0;
00160                 lstrcpy(_root._fs, TEXT("unixfs"));
00161                 lstrcpy(_root._path, TEXT("/"));
00162                 _root._entry = new UnixDirectory(_root._path);
00163                 entry = _root.read_tree(info._path+_tcslen(_root._path));
00164                 break;
00165 #endif
00166
00167           case ET_NTOBJS:
00168                 _root._drive_type = DRIVE_UNKNOWN;
00169                 _root._sort_order = SORT_NAME;
00170
00171                 _tsplitpath_s(info._path, drv, COUNTOF(drv), NULL, 0, NULL, 0, NULL, 0);
00172                 lstrcat(drv, TEXT("\\"));
00173                 lstrcpy(_root._volname, TEXT("NT Object Namespace"));
00174                 lstrcpy(_root._fs, TEXT("NTOBJ"));
00175                 lstrcpy(_root._path, drv);
00176                 _root._entry = new NtObjDirectory(_root._path);
00177                 entry = _root.read_tree(info._path+_tcslen(_root._path));
00178                 break;
00179
00180           case ET_REGISTRY:
00181                 _root._drive_type = DRIVE_UNKNOWN;
00182                 _root._sort_order = SORT_NONE;
00183
00184                 _tsplitpath_s(info._path, drv, COUNTOF(drv), NULL, 0, NULL, 0, NULL, 0);
00185                 lstrcat(drv, TEXT("\\"));
00186                 lstrcpy(_root._volname, TEXT("Registry"));
00187                 lstrcpy(_root._fs, TEXT("Registry"));
00188                 lstrcpy(_root._path, drv);
00189                 _root._entry = new RegistryRoot();
00190                 entry = _root.read_tree(info._path+_tcslen(_root._path));
00191                 break;
00192
00193           case ET_FAT: {
00194                 _root._drive_type = DRIVE_UNKNOWN;
00195                 _root._sort_order = SORT_NONE;
00196
00197                 _tsplitpath_s(info._path, drv, COUNTOF(drv), NULL, 0, NULL, 0, NULL, 0);
00198                 lstrcat(drv, TEXT("\\"));
00199                 lstrcpy(_root._volname, TEXT("FAT XXX"));       //@@
00200                 lstrcpy(_root._fs, TEXT("FAT"));
00201                 lstrcpy(_root._path, drv);
00202                 FATDrive* drive = new FATDrive(TEXT("c:/reactos-emu/c.img"));   //TEXT("\\\\.\\F:"));   //@@
00203
00204                 if (drive->_hDrive != INVALID_HANDLE_VALUE) {
00205                         _root._entry = drive;
00206                         entry = _root.read_tree(info._path+_tcslen(_root._path));
00207                 }
00208                 break;}
00209
00210           default:      // ET_WINDOWS
00211                 _root._drive_type = GetDriveType(info._path);
00212                 _root._sort_order = SORT_NAME;
00213
00214                 _tsplitpath_s(info._path, drv, COUNTOF(drv), NULL, 0, NULL, 0, NULL, 0);
00215                 lstrcat(drv, TEXT("\\"));
00216                 GetVolumeInformation(drv, _root._volname, _MAX_FNAME, 0, 0, &_root._fs_flags, _root._fs, COUNTOF(_root._fs));
00217                 lstrcpy(_root._path, drv);
00218                 _root._entry = new WinDirectory(_root._path);
00219                 entry = _root.read_tree(info._path+_tcslen(_root._path));
00220         }
00221
00222         if (_root._entry) {
00223                 if (info._etype != ET_SHELL)
00224                         wsprintf(_root._entry->_data.cFileName, TEXT("%s - %s"), drv, _root._fs);
00225         /*@@else
00226                         lstrcpy(_root._entry->_data.cFileName, TEXT("GetDesktopFolder"));*/
00227
00228                 _root._entry->_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
00229
00230
00232
00233                 if (info._open_mode & OWM_EXPLORE)
00234                         _left_hwnd = *(_left=new Pane(_hwnd, IDW_TREE_LEFT, IDW_HEADER_LEFT, _root._entry, true, COL_CONTENT));
00235
00236                 _right_hwnd = *(_right=new Pane(_hwnd, IDW_TREE_RIGHT, IDW_HEADER_RIGHT, NULL, false,
00237                                                                                 COL_TYPE|COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_INDEX|COL_LINKS|COL_CONTENT));
00238         }
00239
00240         _header_wdths_ok = false;
00241
00242         if (entry)
00243                 set_curdir(entry);
00244         else
00245                 set_curdir(_root._entry);
00246
00247         if (_left_hwnd) {
00248                 int idx = ListBox_FindItemData(_left_hwnd, ListBox_GetCurSel(_left_hwnd), _left->_cur);
00249                 ListBox_SetCurSel(_left_hwnd, idx);
00250                 //SetFocus(_left_hwnd);
00251         }
00252
00253          // store path into history
00254         if (info._path && *info._path)
00255                 _url_history.push(info._path);
00256 }
00257
00258
00259 void FileChildWindow::set_curdir(Entry* entry)
00260 {
00261         CONTEXT("FileChildWindow::set_curdir()");
00262
00263         _path[0] = TEXT('\0');
00264
00265         _left->_cur = entry;
00266         _right->_root = entry&&entry->_down? entry->_down: entry;
00267         _right->_cur = entry;
00268
00269         if (entry) {
00270                 WaitCursor wait;
00271
00272                 if (!entry->_scanned)
00273                         scan_entry(entry);
00274                 else {
00275                         HiddenWindow hide(_right_hwnd);
00276
00277                         ListBox_ResetContent(_right_hwnd);
00278                         _right->insert_entries(entry->_down);
00279
00280                         _right->calc_widths(false);
00281
00282                         _right->set_header();
00283                 }
00284
00285                 entry->get_path(_path, COUNTOF(_path));
00286         }
00287
00288         if (_hwnd)      // only change window title if the window already exists
00289                 SetWindowText(_hwnd, _path);
00290
00291         if (_path[0])
00292                 if (SetCurrentDirectory(_path))
00293                         set_url(_path); //set_url(FmtString(TEXT("file://%s"), _path));
00294                 else
00295                         _path[0] = TEXT('\0');
00296 }
00297
00298
00299  // expand a directory entry
00300
00301 bool FileChildWindow::expand_entry(Entry* dir)
00302 {
00303         int idx;
00304         Entry* p;
00305
00306         if (!dir || dir->_expanded || !dir->_down)
00307                 return false;
00308
00309         p = dir->_down;
00310
00311         if (p->_data.cFileName[0]=='.' && p->_data.cFileName[1]=='\0' && p->_next) {
00312                 p = p->_next;
00313
00314                 if (p->_data.cFileName[0]=='.' && p->_data.cFileName[1]=='.' &&
00315                                 p->_data.cFileName[2]=='\0' && p->_next)
00316                         p = p->_next;
00317         }
00318
00319          // no subdirectories ?
00320         if (!(p->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&  // not a directory?
00321                 !p->_down)      // not a file with NTFS sub-streams?
00322                 return FALSE;
00323
00324         idx = ListBox_FindItemData(_left_hwnd, 0, dir);
00325
00326         dir->_expanded = true;
00327
00328          // insert entries in left pane
00329         HiddenWindow hide(_left_hwnd);
00330
00331         _left->insert_entries(p, idx);
00332
00333         if (!_header_wdths_ok) {
00334                 if (_left->calc_widths(false)) {
00335                         _left->set_header();
00336
00337                         _header_wdths_ok = true;
00338                 }
00339         }
00340
00341         return true;
00342 }
00343
00344
00345 void FileChildWindow::collapse_entry(Pane* pane, Entry* dir)
00346 {
00347         int idx = ListBox_FindItemData(*pane, 0, dir);
00348
00349         SendMessage(*pane, WM_SETREDRAW, FALSE, 0);     //ShowWindow(*pane, SW_HIDE);
00350
00351          // hide sub entries
00352         for(;;) {
00353                 LRESULT res = ListBox_GetItemData(*pane, idx+1);
00354                 Entry* sub = (Entry*) res;
00355
00356                 if (res==LB_ERR || !sub || sub->_level<=dir->_level)
00357                         break;
00358
00359                 ListBox_DeleteString(*pane, idx+1);
00360         }
00361
00362         dir->_expanded = false;
00363
00364         SendMessage(*pane, WM_SETREDRAW, TRUE, 0);      //ShowWindow(*pane, SW_SHOW);
00365 }
00366
00367
00368 FileChildWindow* FileChildWindow::create(const FileChildWndInfo& info)
00369 {
00370         CONTEXT("FileChildWindow::create()");
00371
00372         MDICREATESTRUCT mcs;
00373
00374         mcs.szClass = CLASSNAME_WINEFILETREE;
00375         mcs.szTitle = (LPTSTR)info._path;
00376         mcs.hOwner      = g_Globals._hInstance;
00377         mcs.x           = info._pos.rcNormalPosition.left;
00378         mcs.y           = info._pos.rcNormalPosition.top;
00379         mcs.cx          = info._pos.rcNormalPosition.right - info._pos.rcNormalPosition.left;
00380         mcs.cy          = info._pos.rcNormalPosition.bottom - info._pos.rcNormalPosition.top;
00381         mcs.style       = 0;
00382         mcs.lParam      = 0;
00383
00384         FileChildWindow* child = static_cast<FileChildWindow*>(
00385                 create_mdi_child(info, mcs, WINDOW_CREATOR_INFO(FileChildWindow,FileChildWndInfo)));
00386
00387         return child;
00388 }
00389
00390
00391 void FileChildWindow::resize_children(int cx, int cy)
00392 {
00393         HDWP hdwp = BeginDeferWindowPos(4);
00394         RECT rt;
00395
00396         rt.left   = 0;
00397         rt.top    = 0;
00398         rt.right  = cx;
00399         rt.bottom = cy;
00400
00401         cx = _split_pos + SPLIT_WIDTH/2;
00402
00403         if (_left && _right) {
00404                 WINDOWPOS wp;
00405                 HD_LAYOUT hdl;
00406
00407                 hdl.prc   = &rt;
00408                 hdl.pwpos = &wp;
00409
00410                 Header_Layout(_left->_hwndHeader, &hdl);
00411
00412                 hdwp = DeferWindowPos(hdwp, _left->_hwndHeader, wp.hwndInsertAfter,
00413                                                         wp.x-1, wp.y, _split_pos-SPLIT_WIDTH/2+1, wp.cy, wp.flags);
00414
00415                 hdwp = DeferWindowPos(hdwp, _right->_hwndHeader, wp.hwndInsertAfter,
00416                                                                 rt.left+cx+1, wp.y, wp.cx-cx+2, wp.cy, wp.flags);
00417         }
00418
00419         if (_left_hwnd)
00420                 hdwp = DeferWindowPos(hdwp, _left_hwnd, 0, rt.left, rt.top, _split_pos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
00421
00422         if (_right_hwnd)
00423                 hdwp = DeferWindowPos(hdwp, _right_hwnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
00424
00425         EndDeferWindowPos(hdwp);
00426 }
00427
00428
00429 LRESULT FileChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00430 {
00431         switch(nmsg) {
00432                 case WM_DRAWITEM: {
00433                         LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lparam;
00434                         Entry* entry = (Entry*) dis->itemData;
00435
00436                         if (dis->CtlID == IDW_TREE_LEFT) {
00437                                 _left->draw_item(dis, entry);
00438                                 return TRUE;
00439                         } else if (dis->CtlID == IDW_TREE_RIGHT) {
00440                                 _right->draw_item(dis, entry);
00441                                 return TRUE;
00442                         }
00443
00444                         goto def;}
00445
00446                 case WM_SIZE:
00447                         if (wparam != SIZE_MINIMIZED)
00448                                 resize_children(LOWORD(lparam), HIWORD(lparam));
00449                         return DefMDIChildProc(_hwnd, nmsg, wparam, lparam);
00450
00451                 case PM_GET_FILEWND_PTR:
00452                         return (LRESULT)this;
00453
00454                 case WM_SETFOCUS: {
00455                         TCHAR path[MAX_PATH];
00456
00457                         if (_left && _left->_cur) {
00458                                 _left->_cur->get_path(path, COUNTOF(path));
00459                                 SetCurrentDirectory(path);
00460                         }
00461
00462                         SetFocus(_focus_pane? _right_hwnd: _left_hwnd);
00463                         goto def;}
00464
00465                 case PM_DISPATCH_COMMAND: {
00466                         Pane* pane = GetFocus()==_left_hwnd? _left: _right;
00467
00468                         switch(LOWORD(wparam)) {
00469                           case ID_WINDOW_NEW: {CONTEXT("FileChildWindow PM_DISPATCH_COMMAND ID_WINDOW_NEW");
00470                                 if (_root._entry->_etype == ET_SHELL)
00471                                         FileChildWindow::create(ShellChildWndInfo(GetParent(_hwnd)/*_hmdiclient*/, _path, DesktopFolderPath()));
00472                                 else
00473                                         FileChildWindow::create(FileChildWndInfo(GetParent(_hwnd)/*_hmdiclient*/, _path));
00474                                 break;}
00475
00476                           case ID_REFRESH: {CONTEXT("ID_REFRESH");
00477                                 WaitCursor wait;
00478                                 bool expanded = _left->_cur->_expanded;
00479
00480                                 scan_entry(_left->_cur);
00481
00482                                 if (expanded)
00483                                         expand_entry(_left->_cur);
00484                                 break;}
00485
00486                           case ID_ACTIVATE: {CONTEXT("ID_ACTIVATE");
00487                                 activate_entry(pane);
00488                                 break;}
00489
00490                           default:
00491                                 if (pane->command(LOWORD(wparam)))
00492                                         return TRUE;
00493                                 else
00494                                         return super::WndProc(nmsg, wparam, lparam);
00495                         }
00496
00497                         return TRUE;}
00498
00499                 case WM_CONTEXTMENU: {
00500                          // first select the current item in the listbox
00501                         HWND hpanel = (HWND) wparam;
00502                         const POINTS& pos = MAKEPOINTS(lparam);
00503                         POINT pt; POINTSTOPOINT(pt, pos);
00504                         POINT pt_screen = pt;
00505                         ScreenToClient(hpanel, &pt);
00506                         SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt.x, pt.y));
00507                         SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt.x, pt.y));
00508
00509                          // now create the popup menu using shell namespace and IContextMenu
00510                         Pane* pane = GetFocus()==_left_hwnd? _left: _right;
00511                         int idx = ListBox_GetCurSel(*pane);
00512                         if (idx != -1) {
00513                                 Entry* entry = (Entry*) ListBox_GetItemData(*pane, idx);
00514
00515                                 CHECKERROR(entry->do_context_menu(_hwnd, pt_screen, _cm_ifs));
00516                         }
00517                         break;}
00518
00519                 default: def:
00520                         return super::WndProc(nmsg, wparam, lparam);
00521         }
00522
00523         return 0;
00524 }
00525
00526
00527 int FileChildWindow::Command(int id, int code)
00528 {
00529         Pane* pane = GetFocus()==_left_hwnd? _left: _right;
00530
00531         switch(code) {
00532           case LBN_SELCHANGE: {
00533                 int idx = ListBox_GetCurSel(*pane);
00534                 Entry* entry = (Entry*) ListBox_GetItemData(*pane, idx);
00535
00536                 if (pane == _left)
00537                         set_curdir(entry);
00538                 else
00539                         pane->_cur = entry;
00540                 break;}
00541
00542           case LBN_DBLCLK:
00543                 activate_entry(pane);
00544                 break;
00545         }
00546
00547         return 0;
00548 }
00549
00550
00551 void FileChildWindow::activate_entry(Pane* pane)
00552 {
00553         Entry* entry = pane->_cur;
00554
00555         if (!entry)
00556                 return;
00557
00558         WaitCursor wait;
00559
00560         if ((entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||       // a directory?
00561                 entry->_down)   // a file with NTFS sub-streams?
00562         {
00563                 int scanned_old = entry->_scanned;
00564
00565                 if (!scanned_old)
00566                         scan_entry(entry);
00567
00568                 if (entry->_data.cFileName[0]==TEXT('.') && entry->_data.cFileName[1]==TEXT('\0'))
00569                         return;
00570
00571                 if (entry->_data.cFileName[0]==TEXT('.') && entry->_data.cFileName[1]==TEXT('.') && entry->_data.cFileName[2]==TEXT('\0')) {
00572                         entry = _left->_cur->_up;
00573                         collapse_entry(_left, entry);
00574                         goto focus_entry;
00575                 } else if (entry->_expanded)
00576                         collapse_entry(pane, _left->_cur);
00577                 else {
00578                         expand_entry(_left->_cur);
00579
00580                         if (!pane->_treePane) focus_entry: {
00581                                 int idx = ListBox_FindItemData(_left_hwnd, ListBox_GetCurSel(_left_hwnd), entry);
00582                                 ListBox_SetCurSel(_left_hwnd, idx);
00583
00584                                 set_curdir(entry);
00585                         }
00586                 }
00587
00588                 if (!scanned_old) {
00589                         pane->calc_widths(false);
00590
00591                         pane->set_header();
00592                 }
00593         } else {
00594                 entry->launch_entry(_hwnd);
00595         }
00596 }
00597
00598
00599 void FileChildWindow::scan_entry(Entry* entry)
00600 {
00601         CONTEXT("FileChildWindow::scan_entry()");
00602
00603         int idx = ListBox_GetCurSel(_left_hwnd);
00604
00605          // delete sub entries in left pane
00606         for(;;) {
00607                 LRESULT res = ListBox_GetItemData(_left_hwnd, idx+1);
00608                 Entry* sub = (Entry*) res;
00609
00610                 if (res==LB_ERR || !sub || sub->_level<=entry->_level)
00611                         break;
00612
00613                 ListBox_DeleteString(_left_hwnd, idx+1);
00614         }
00615
00616          // empty right pane
00617         ListBox_ResetContent(_right_hwnd);
00618
00619          // release memory
00620         entry->free_subentries();
00621         entry->_expanded = false;
00622
00623          // read contents from disk
00624         entry->read_directory_base(_root._sort_order);
00625
00626          // insert found entries in right pane
00627         HiddenWindow hide(_right_hwnd);
00628         _right->insert_entries(entry->_down);
00629
00630         _right->calc_widths(false);
00631         _right->set_header();
00632
00633         _header_wdths_ok = false;
00634 }
00635
00636
00637 int FileChildWindow::Notify(int id, NMHDR* pnmh)
00638 {
00639         return (pnmh->idFrom==IDW_HEADER_LEFT? _left: _right)->Notify(id, pnmh);
00640 }
00641
00642
00643 String FileChildWindow::jump_to_int(LPCTSTR url)
00644 {
00645         String dir, fname;
00646
00647         if (SplitFileSysURL(url, dir, fname)) {
00648                 Entry* entry = NULL;
00649
00650                  // call read_tree() to iterate through the hierarchy and open all folders to reach dir
00651                 if (_root._entry)
00652                         switch(_root._entry->_etype) {
00653                           case ET_SHELL: {      //@@ separate into FileChildWindow in ShellChildWindow, WinChildWindow, UnixChildWindow ?
00654                                 ShellPath shell_path(dir);
00655                                 entry = _root.read_tree(&*shell_path);
00656                                 break;}
00657
00658 #ifdef __WINE__
00659                           case ET_UNIX: {
00660                                 LPCTSTR path = dir;
00661
00662                                 if (!_tcsicmp(path, _root._path, _tcslen(_root._path)))
00663                                         path += _tcslen(_root._path);
00664
00665                                 entry = _root.read_tree(path);
00666                                 break;}
00667 #endif
00668
00669                           default: { // ET_NTOBJS, ET_REGISTRY, ET_FAT, ET_WINDOWS
00670                                 LPCTSTR path = dir;
00671
00672                                 if (!_tcsnicmp(path, _root._path, _tcslen(_root._path)))
00673                                         path += _tcslen(_root._path);
00674
00675                                 entry = _root.read_tree(path);
00676                                 break;}
00677                         }
00678
00679                         if (entry) {
00680                                  // refresh left pane entries
00681                                 HiddenWindow hide(_left_hwnd);
00682
00683                                 ListBox_ResetContent(_left_hwnd);
00684
00685                                 _left->insert_entries(_root._entry);
00686
00687                                 if (!_header_wdths_ok) {
00688                                         if (_left->calc_widths(false)) {
00689                                                 _left->set_header();
00690
00691                                                 _header_wdths_ok = true;
00692                                         }
00693                                 }
00694
00695                                 set_curdir(entry);
00696
00697                                 if (_left_hwnd) {
00698                                         int idx = ListBox_FindItemData(_left_hwnd, -1, entry);
00699
00700                                         if (idx != -1) { // The item should always be found.
00701                                                 ListBox_SetCurSel(_left_hwnd, idx);
00702                                                 SetFocus(_left_hwnd);
00703                                         }
00704                                 }
00705
00707
00708                                 return dir;     //FmtString(TEXT("file://%s"), (LPCTSTR)dir);
00709                         }
00710         }
00711
00712         return String();
00713 }


ROS Explorer: filechild.h File Reference

  • File List
  • File Members
shell

filechild.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | FileChildWndInfo
information structure for creation of FileChildWindow More...
struct | ShellChildWndInfo
information structure for creation of MDIShellBrowserChild More...
struct | NtObjChildWndInfo
information structure for creation of FileChildWindow for NT object namespace More...
struct | RegistryChildWndInfo
information structure for creation of FileChildWindow for the Registry More...
struct | FATChildWndInfo
information structure for creation of FileChildWindow More...
struct | WebChildWndInfo
information structure for creation of WebChildWindow More...
struct | FileChildWindow
MDI child window displaying file lists. More...
struct | ExecuteDialog
The "Execute..."-dialog lets the user enter a command line to launch. More...


ROS Explorer: filechild.h Source File

  • File List
  • File Members
shell

filechild.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // filechild.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00030 struct FileChildWndInfo : public ChildWndInfo
00031 {
00032         typedef ChildWndInfo super;
00033
00034         FileChildWndInfo(HWND hmdiclient, LPCTSTR path, ENTRY_TYPE etype=ET_UNKNOWN);
00035
00036         ENTRY_TYPE      _etype;
00037         LPCTSTR         _path;
00038
00039         WINDOWPLACEMENT _pos;
00040         int                     _open_mode;     //OPEN_WINDOW_MODE
00041 };
00042
00044 struct ShellChildWndInfo : public FileChildWndInfo
00045 {
00046         typedef FileChildWndInfo super;
00047
00048         ShellChildWndInfo(HWND hmdiclient, LPCTSTR path, const ShellPath& root_shell_path);
00049
00050         ShellPath       _shell_path;
00051         ShellPath       _root_shell_path;
00052 };
00053
00055 struct NtObjChildWndInfo : public FileChildWndInfo
00056 {
00057         typedef FileChildWndInfo super;
00058
00059         NtObjChildWndInfo(HWND hmdiclient, LPCTSTR path);
00060 };
00061
00063 struct RegistryChildWndInfo : public FileChildWndInfo
00064 {
00065         typedef FileChildWndInfo super;
00066
00067         RegistryChildWndInfo(HWND hmdiclient, LPCTSTR path);
00068 };
00069
00071 struct FATChildWndInfo : public FileChildWndInfo
00072 {
00073         typedef FileChildWndInfo super;
00074
00075         FATChildWndInfo(HWND hmdiclient, LPCTSTR path);
00076 };
00077
00079 struct WebChildWndInfo : public FileChildWndInfo
00080 {
00081         typedef FileChildWndInfo super;
00082
00083         WebChildWndInfo(HWND hmdiclient, LPCTSTR url);
00084 };
00085
00086
00088 struct FileChildWindow : public ExtContextMenuHandlerT<ChildWindow>
00089 {
00090         typedef ExtContextMenuHandlerT<ChildWindow> super;
00091
00092         FileChildWindow(HWND hwnd, const FileChildWndInfo& info);
00093
00094         static FileChildWindow* create(const FileChildWndInfo& info);
00095
00096 protected:
00097         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00098         int             Command(int id, int code);
00099         int             Notify(int id, NMHDR* pnmh);
00100
00101         virtual void resize_children(int cx, int cy);
00102         virtual String jump_to_int(LPCTSTR url);
00103
00104         void    scan_entry(Entry* entry);
00105
00106         bool    expand_entry(Entry* dir);
00107         static void collapse_entry(Pane* pane, Entry* dir);
00108
00109         void    set_curdir(Entry* entry);
00110         void    activate_entry(Pane* pane);
00111
00112 protected:
00113         Root    _root;
00114         Pane*   _left;
00115         Pane*   _right;
00116         TCHAR   _path[MAX_PATH];
00117         bool    _header_wdths_ok;
00118
00119 public:
00120         const Root& get_root() const {return _root;}
00121
00122         void    set_focus_pane(Pane* pane)
00123                 {_focus_pane = pane==_right? 1: 0;}
00124
00125         void    switch_focus_pane()
00126                 {SetFocus(_focus_pane? *_left: *_right);}
00127 };
00128
00129
00131 struct ExecuteDialog {
00132         TCHAR   cmd[MAX_PATH];
00133         int             cmdshow;
00134
00135         static INT_PTR CALLBACK WndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
00136 };


ROS Explorer: globals.h File Reference

  • File List
  • File Members

globals.h File Reference

#include "utility/xmlstorage.h"
#include "taskbar/favorites.h"

Include dependency graph for globals.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | FileTypeInfo
management of file types More...
struct | FileTypeManager
struct | Icon
struct | SysCacheIcon
struct | IconCache
struct | Desktop
struct | Desktops
struct | ExplorerGlobals
structure containing global variables of Explorer More...
struct | ResString
convenient loading of string resources More...
struct | ResIcon
convenient loading of standard (32x32) icon resources More...
struct | SmallIcon
convenient loading of small (16x16) icon resources More...
struct | ResIconEx
convenient loading of icon resources with specified sizes More...
struct | ResBitmap
convenient loading of bitmap resources More...

Defines

#define | ICON_SIZE_X GetSystemMetrics(large_icons? SM_CXICON: SM_CXSMICON)
#define | ICON_SIZE_Y GetSystemMetrics(large_icons? SM_CYICON: SM_CYSMICON)
#define | DESKTOP_COUNT 4

Typedefs

typedef pair< HWND, DWORD > | MinimizeStruct
desktop management
typedef Desktop | DesktopRef

Enumerations

enum | ICON_TYPE { IT_STATIC, IT_CACHED, IT_DYNAMIC, IT_SYSCACHE }
enum ICON_ID {
ICID_UNKNOWN, ICID_NONE, ICID_FOLDER, ICID_APP,
ICID_EXPLORER, ICID_CONFIG, ICID_DOCUMENTS, ICID_FAVORITES,
ICID_INFO, ICID_APPS, ICID_SEARCH, ICID_ACTION,
ICID_SEARCH_DOC, ICID_PRINTER, ICID_NETWORK, ICID_COMPUTER,
ICID_LOGOFF, ICID_BOOKMARK, ICID_DYNAMIC
}

Functions

HBITMAP | create_bitmap_from_icon (HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
create a bitmap from an icon
int | ImageList_AddAlphaIcon (HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
add icon with alpha channel to imagelist using the specified background color
HICON | get_window_icon_small (HWND hwnd)
retrieve icon from window
HICON | get_window_icon_big (HWND hwnd, bool allow_from_class=true)
void | SetWindowIcon (HWND hwnd, UINT nid)
set big and small icons out of the resources for a window

Variables

ExplorerGlobals g_Globals
structure containing global variables of Explorer

Define Documentation

#define DESKTOP_COUNT 4

Definition at line 216 of file globals.h.

Referenced by QuickLaunchBar::AddShortcuts(), Desktops::init(), and QuickLaunchBar::UpdateDesktopButtons().

#define ICON_SIZE_X GetSystemMetrics(large_icons? SM_CXICON: SM_CXSMICON)

Definition at line 153 of file globals.h.

Referenced by StartMenu::AddButton(), and IconCache::extract().

#define ICON_SIZE_Y GetSystemMetrics(large_icons? SM_CYICON: SM_CYSMICON)

Definition at line 154 of file globals.h.

Typedef Documentation

typedef Desktop DesktopRef

Definition at line 211 of file globals.h.

typedef pair<HWND, DWORD> MinimizeStruct

desktop management

Definition at line 203 of file globals.h.

Enumeration Type Documentation

enum ICON_ID

Enumerator:
ICID_UNKNOWN
ICID_NONE
ICID_FOLDER
ICID_APP
ICID_EXPLORER
ICID_CONFIG
ICID_DOCUMENTS
ICID_FAVORITES
ICID_INFO
ICID_APPS
ICID_SEARCH
ICID_ACTION
ICID_SEARCH_DOC
ICID_PRINTER
ICID_NETWORK
ICID_COMPUTER
ICID_LOGOFF
ICID_BOOKMARK
ICID_DYNAMIC

Definition at line 62 of file globals.h.

00062              {
00063         ICID_UNKNOWN,
00064         ICID_NONE,
00065
00066         ICID_FOLDER,
00067         //ICID_DOCUMENT,
00068         ICID_APP,
00069         ICID_EXPLORER,
00070
00071         ICID_CONFIG,
00072         ICID_DOCUMENTS,
00073         ICID_FAVORITES,
00074         ICID_INFO,
00075         ICID_APPS,
00076         ICID_SEARCH,
00077         ICID_ACTION,
00078         ICID_SEARCH_DOC,
00079         ICID_PRINTER,
00080         ICID_NETWORK,
00081         ICID_COMPUTER,
00082         ICID_LOGOFF,
00083         ICID_BOOKMARK,
00084
00085         ICID_DYNAMIC
00086 };

enum ICON_TYPE

Enumerator:
IT_STATIC
IT_CACHED
IT_DYNAMIC
IT_SYSCACHE

Definition at line 55 of file globals.h.

00055                {
00056         IT_STATIC,
00057         IT_CACHED,
00058         IT_DYNAMIC,
00059         IT_SYSCACHE
00060 };

Function Documentation

HBITMAP create_bitmap_from_icon | ( | HICON | hIcon,
 |  | HBRUSH | hbrush_bkgnd,
 |  | HDC | hdc_wnd
 | ) |

create a bitmap from an icon

Definition at line 325 of file explorer.cpp.

Referenced by Icon::create_bitmap(), TaskBar::EnumWndProc(), and ImageList_AddAlphaIcon().

00326 {
00327         int cx = GetSystemMetrics(SM_CXSMICON); //ICON_SIZE_X;
00328         int cy = GetSystemMetrics(SM_CYSMICON); //ICON_SIZE_Y;
00329         HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
00330
00331         MemCanvas canvas;
00332         BitmapSelection sel(canvas, hbmp);
00333
00334         RECT rect = {0, 0, cx, cy};
00335         FillRect(canvas, &rect, hbrush_bkgnd);
00336
00337         DrawIconEx(canvas, 0, 0, hIcon, cx, cy, 0, hbrush_bkgnd, DI_NORMAL);
00338
00339         return hbmp;
00340 }

HICON get_window_icon_big | ( | HWND | hwnd,
 |  | bool | allow_from_class = true
 | ) |

Definition at line 347 of file taskbar.cpp.

00348 {
00349         HICON hIcon = 0;
00350
00351         SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00352
00353         if (!hIcon)
00354                 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00355
00356         if (!hIcon)
00357                 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00358
00359         if (allow_from_class) {
00360                 if (!hIcon)
00361                         hIcon = (HICON)GetClassLong(hwnd, GCL_HICON);
00362
00363                 if (!hIcon)
00364                         hIcon = (HICON)GetClassLong(hwnd, GCL_HICONSM);
00365         }
00366
00367         if (!hIcon)
00368                 SendMessageTimeout(hwnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (LPDWORD)&hIcon);
00369
00370         return hIcon;
00371 }

HICON get_window_icon_small ( HWND hwnd )

retrieve icon from window

Definition at line 323 of file taskbar.cpp.

Referenced by TaskBar::EnumWndProc().

00324 {
00325         HICON hIcon = 0;
00326
00327         SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00328
00329         if (!hIcon)
00330                 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00331
00332         if (!hIcon)
00333                 SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00334
00335         if (!hIcon)
00336                 hIcon = (HICON)GetClassLong(hwnd, GCL_HICONSM);
00337
00338         if (!hIcon)
00339                 hIcon = (HICON)GetClassLong(hwnd, GCL_HICON);
00340
00341         if (!hIcon)
00342                 SendMessageTimeout(hwnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (LPDWORD)&hIcon);
00343
00344         return hIcon;
00345 }

int ImageList_AddAlphaIcon | ( | HIMAGELIST | himl,
 |  | HICON | hIcon,
 |  | HBRUSH | hbrush_bkgnd,
 |  | HDC | hdc_wnd
 | ) |

add icon with alpha channel to imagelist using the specified background color

Definition at line 359 of file explorer.cpp.

References create_bitmap_from_icon().

Referenced by Icon::add_to_imagelist(), MainFrameBase::FillBookmarks(), and TrayNotifyDlg::TrayNotifyDlg().

00360 {
00361         HBITMAP hbmp = create_bitmap_from_icon(hIcon, hbrush_bkgnd, hdc_wnd);
00362
00363         int ret = ImageList_Add(himl, hbmp, 0);
00364
00365         DeleteObject(hbmp);
00366
00367         return ret;
00368 }

Here is the call graph for this function:

void SetWindowIcon | ( | HWND | hwnd,
 |  | UINT | nid
 | ) |

set big and small icons out of the resources for a window

Definition at line 585 of file explorer.cpp.

References Window_SetIcon.

Referenced by DesktopBar::DesktopBar(), ExplorerAboutDlg::ExplorerAboutDlg(), FindProgramDlg::FindProgramDlg(), and TrayNotifyDlg::TrayNotifyDlg().

00586 {
00587         HICON hIcon = ResIcon(nid);
00588         (void)Window_SetIcon(hwnd, ICON_BIG, hIcon);
00589
00590         HICON hIconSmall = SmallIcon(nid);
00591         (void)Window_SetIcon(hwnd, ICON_SMALL, hIconSmall);
00592 }

Variable Documentation

struct ExplorerGlobals g_Globals

structure containing global variables of Explorer


ROS Explorer: globals.h Source File

  • File List
  • File Members

globals.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // globals.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include "utility/xmlstorage.h"
00030
00031 using namespace XMLStorage;
00032
00033 #include "taskbar/favorites.h"
00034
00035
00037 struct FileTypeInfo {
00038         String  _classname;
00039         String  _displayname;
00040         bool    _neverShowExt;
00041 };
00042
00043 struct FileTypeManager : public map<String, FileTypeInfo>
00044 {
00045         typedef map<String, FileTypeInfo> super;
00046
00047         const FileTypeInfo& operator[](String ext);
00048
00049         static bool is_exe_file(LPCTSTR ext);
00050
00051         LPCTSTR set_type(struct Entry* entry, bool dont_hide_ext=false);
00052 };
00053
00054
00055 enum ICON_TYPE {
00056         IT_STATIC,
00057         IT_CACHED,
00058         IT_DYNAMIC,
00059         IT_SYSCACHE
00060 };
00061
00062 enum ICON_ID {
00063         ICID_UNKNOWN,
00064         ICID_NONE,
00065
00066         ICID_FOLDER,
00067         //ICID_DOCUMENT,
00068         ICID_APP,
00069         ICID_EXPLORER,
00070
00071         ICID_CONFIG,
00072         ICID_DOCUMENTS,
00073         ICID_FAVORITES,
00074         ICID_INFO,
00075         ICID_APPS,
00076         ICID_SEARCH,
00077         ICID_ACTION,
00078         ICID_SEARCH_DOC,
00079         ICID_PRINTER,
00080         ICID_NETWORK,
00081         ICID_COMPUTER,
00082         ICID_LOGOFF,
00083         ICID_BOOKMARK,
00084
00085         ICID_DYNAMIC
00086 };
00087
00088 struct Icon {
00089         Icon();
00090         Icon(ICON_ID id, UINT nid);
00091         Icon(ICON_TYPE itype, int id, HICON hIcon);
00092         Icon(ICON_TYPE itype, int id, int sys_idx);
00093
00094         operator ICON_ID() const {return _id;}
00095
00096         void    draw(HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const;
00097         HBITMAP create_bitmap(COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const;
00098         int             add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const;
00099
00100         int             get_sysiml_idx() const {return _itype==IT_SYSCACHE? _sys_idx: -1;}
00101         HICON   get_hicon() const {return _itype!=IT_SYSCACHE? _hicon: 0;}
00102
00103         bool    destroy() {if (_itype == IT_DYNAMIC) {DestroyIcon(_hicon); return true;} else return false;}
00104
00105 protected:
00106         ICON_ID _id;
00107         ICON_TYPE _itype;
00108         HICON   _hicon;
00109         int             _sys_idx;
00110 };
00111
00112 struct SysCacheIcon : public Icon {
00113         SysCacheIcon(int id, int sys_idx)
00114          :      Icon(IT_SYSCACHE, id, sys_idx) {}
00115 };
00116
00117 struct IconCache {
00118         IconCache() : _himlSys_small(0) {}
00119
00120         void    init();
00121
00122         const Icon&     extract(LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL);
00123         const Icon&     extract(LPCTSTR path, int idx, ICONCACHE_FLAGS flags=ICF_HICON);
00124         const Icon&     extract(IExtractIcon* pExtract, LPCTSTR path, int idx, ICONCACHE_FLAGS flags=ICF_HICON);
00125
00126         const Icon&     add(HICON hIcon, ICON_TYPE type=IT_DYNAMIC);
00127         const Icon&     add(int sys_idx/*, ICON_TYPE type=IT_SYSCACHE*/);
00128
00129         const Icon&     get_icon(int icon_id);
00130
00131         HIMAGELIST get_sys_imagelist() const {return _himlSys_small;}
00132
00133         void    free_icon(int icon_id);
00134
00135 protected:
00136         static int s_next_id;
00137
00138         typedef map<int, Icon> IconMap;
00139         IconMap _icons;
00140
00141         typedef pair<String,int/*ICONCACHE_FLAGS*/> CacheKey;
00142         typedef map<CacheKey, ICON_ID> PathCacheMap;
00143         PathCacheMap _pathCache;
00144
00145         typedef pair<String,pair<int,int/*ICONCACHE_FLAGS*/> > IdxCacheKey;
00146         typedef map<IdxCacheKey, ICON_ID> IdxCacheMap;
00147         IdxCacheMap _idxCache;
00148
00149         HIMAGELIST _himlSys_small;
00150 };
00151
00152
00153 #define ICON_SIZE_X             GetSystemMetrics(large_icons? SM_CXICON: SM_CXSMICON)
00154 #define ICON_SIZE_Y             GetSystemMetrics(large_icons? SM_CYICON: SM_CYSMICON)
00155
00156
00158 extern HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd/*, bool large_icons*/);
00159
00161 extern int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd);
00162
00164 extern HICON get_window_icon_small(HWND hwnd);
00165 extern HICON get_window_icon_big(HWND hwnd, bool allow_from_class=true);
00166
00167
00169 #ifdef _USE_HDESK
00170
00171 typedef auto_ptr<struct DesktopThread> DesktopThreadPtr;
00172
00173 struct Desktop
00174 {
00175         HDESK   _hdesktop;
00176 //      HWINSTA _hwinsta;
00177         DesktopThreadPtr _pThread;
00178         WindowHandle _hwndDesktop;
00179
00180         Desktop(HDESK hdesktop=0/*, HWINSTA hwinsta=0*/);
00181         ~Desktop();
00182 };
00183
00184 typedef auto_ptr<Desktop> DesktopPtr;
00185 typedef DesktopPtr DesktopRef;
00186
00188 struct DesktopThread : public Thread
00189 {
00190         DesktopThread(Desktop& desktop)
00191          :      _desktop(desktop)
00192         {
00193         }
00194
00195         int     Run();
00196
00197 protected:
00198         Desktop&        _desktop;
00199 };
00200
00201 #else
00202
00203 typedef pair<HWND, DWORD> MinimizeStruct;
00204
00205 struct Desktop
00206 {
00207         set<HWND> _windows;
00208         WindowHandle _hwndForeground;
00209         list<MinimizeStruct> _minimized;
00210 };
00211 typedef Desktop DesktopRef;
00212
00213 #endif
00214
00215
00216 #define DESKTOP_COUNT   4
00217
00218 struct Desktops : public vector<DesktopRef>
00219 {
00220         Desktops();
00221         ~Desktops();
00222
00223         void    init();
00224         void    SwitchToDesktop(int idx);
00225         void    ToggleMinimize();
00226
00227 #ifdef _USE_HDESK
00228         DesktopRef& get_current_Desktop() {return (*this)[_current_desktop];}
00229 #endif
00230
00231         int             _current_desktop;
00232 };
00233
00234
00236 extern struct ExplorerGlobals
00237 {
00238         ExplorerGlobals();
00239
00240         void    init(HINSTANCE hInstance);
00241
00242         void    read_persistent();
00243         void    write_persistent();
00244
00245         XMLPos  get_cfg();
00246         XMLPos  get_cfg(const char* path);
00247
00248         HINSTANCE       _hInstance;
00249         UINT            _cfStrFName;
00250
00251 #ifndef ROSSHELL
00252         ATOM            _hframeClass;
00253         HWND            _hMainWnd;
00254         bool            _desktop_mode;
00255         bool            _prescan_nodes;
00256 #endif
00257
00258         FILE*           _log;
00259
00260 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
00261         DWORD(STDAPICALLTYPE* _SHRestricted)(RESTRICTIONS);
00262 #endif
00263
00264         FileTypeManager _ftype_mgr;
00265         IconCache       _icon_cache;
00266
00267         HWND            _hwndDesktopBar;
00268         HWND            _hwndShellView;
00269         HWND            _hwndDesktop;
00270
00271         Desktops        _desktops;
00272
00273         XMLDoc          _cfg;
00274         String          _cfg_dir;
00275         String          _cfg_path;
00276
00277         Favorites       _favorites;
00278         String          _favorites_path;
00279 } g_Globals;
00280
00281
00283 struct ResString : public String
00284 {
00285         ResString(UINT nid);
00286 };
00287
00289 struct ResIcon
00290 {
00291         ResIcon(UINT nid);
00292
00293         operator HICON() const {return _hicon;}
00294
00295 protected:
00296         HICON   _hicon;
00297 };
00298
00300 struct SmallIcon
00301 {
00302         SmallIcon(UINT nid);
00303
00304         operator HICON() const {return _hicon;}
00305
00306 protected:
00307         HICON   _hicon;
00308 };
00309
00311 struct ResIconEx
00312 {
00313         ResIconEx(UINT nid, int w, int h);
00314
00315         operator HICON() const {return _hicon;}
00316
00317 protected:
00318         HICON   _hicon;
00319 };
00320
00322 extern void SetWindowIcon(HWND hwnd, UINT nid);
00323
00325 struct ResBitmap
00326 {
00327         ResBitmap(UINT nid);
00328         ~ResBitmap() {DeleteObject(_hBmp);}
00329
00330         operator HBITMAP() const {return _hBmp;}
00331
00332 protected:
00333         HBITMAP _hBmp;
00334 };


ROS Explorer: i386-stub-win32.c File Reference

  • File List
  • File Members

i386-stub-win32.c File Reference

#include <stdio.h>
#include <string.h>
#include "utility/utility.h"

Include dependency graph for i386-stub-win32.c:

Go to the source code of this file.

Defines

#define | BUFMAX 400
#define | NUMREGS 16
#define | NUMREGBYTES (NUMREGS * 4)
#define | STACKSIZE 10000
#define | SAVE_REGISTERS1()
#define | SAVE_ERRCODE()
#define | SAVE_REGISTERS2()
#define | CHECK_FAULT()
#define | CALL_HOOK() asm("call _remcomHandler");
#define | BREAKPOINT() asm(" int $3");

Enumerations

enum regnames {
EAX, ECX, EDX, EBX,
ESP, EBP, ESI, EDI,
PC, PS, CS, SS,
DS, ES, FS, GS
}

Functions

void | putDebugChar ()
int | getDebugChar ()
void | exceptionHandler ()
void | return_to_prog ()
asm (".text")
asm (".globl _return_to_prog")
asm ("_return_to_prog:")
asm (" movw _registers+44, %ss")
asm (" movl _registers+16, %esp")
asm (" movl _registers+4, %ecx")
asm (" movl _registers+8, %edx")
asm (" movl _registers+12, %ebx")
asm (" movl _registers+20, %ebp")
asm (" movl _registers+24, %esi")
asm (" movl _registers+28, %edi")
asm (" movw _registers+48, %ds")
asm (" movw _registers+52, %es")
asm (" movw _registers+56, %fs")
asm (" movw _registers+60, %gs")
asm (" movl _registers+36, %eax")
asm (" pushl %eax")
asm (" movl _registers, %eax")
asm ("ret")
asm (" iret")
asm ("mem_fault:")
asm (" popl %eax")
asm (" movl %eax, _gdb_i386errcode")
asm (" popl %ecx")
asm (" popl %edx")
asm (" leave")
asm (" pushl %edx")
asm (" pushl %ecx")
asm (" movl $0, %eax")
asm (" movl %eax, _mem_fault_routine")
asm ("iret")
void | _catchException3 ()
asm (".globl __catchException3")
asm ("__catchException3:")
asm ("pushl $3")
void | _catchException1 ()
asm (".globl __catchException1")
asm ("__catchException1:")
asm ("pushl $1")
void | _catchException0 ()
asm (".globl __catchException0")
asm ("__catchException0:")
asm ("pushl $0")
void | _catchException4 ()
asm (".globl __catchException4")
asm ("__catchException4:")
asm ("pushl $4")
void | _catchException5 ()
asm (".globl __catchException5")
asm ("__catchException5:")
asm ("pushl $5")
void | _catchException6 ()
asm (".globl __catchException6")
asm ("__catchException6:")
asm ("pushl $6")
void | _catchException7 ()
asm (".globl __catchException7")
asm ("__catchException7:")
asm ("pushl $7")
void | _catchException8 ()
asm (".globl __catchException8")
asm ("__catchException8:")
asm ("pushl $8")
void | _catchException9 ()
asm (".globl __catchException9")
asm ("__catchException9:")
asm ("pushl $9")
void | _catchException10 ()
asm (".globl __catchException10")
asm ("__catchException10:")
asm ("pushl $10")
void | _catchException12 ()
asm (".globl __catchException12")
asm ("__catchException12:")
asm ("pushl $12")
void | _catchException16 ()
asm (".globl __catchException16")
asm ("__catchException16:")
asm ("pushl $16")
void | _catchException13 ()
asm (".globl __catchException13")
asm ("__catchException13:")
asm ("pushl $13")
void | _catchException11 ()
asm (".globl __catchException11")
asm ("__catchException11:")
asm ("pushl $11")
void | _catchException14 ()
asm (".globl __catchException14")
asm ("__catchException14:")
asm ("pushl $14")
asm ("_remcomHandler:")
asm (" movl _stackPtr, %esp")
asm (" call _handle_exception")
void | _returnFromException ()
int | hex (char ch)
char * | getpacket (void)
void | putpacket (char *buffer)
void | debug_error (char *format)
void | set_mem_err (void)
int | get_char (char *addr)
void | set_char (char *addr, int val)
char * | mem2hex (char *mem, char *buf, int count, int may_fault)
char * | hex2mem (char *buf, char *mem, int count, int may_fault)
int | computeSignal (int exceptionVector)
int | hexToInt (char **ptr, int *intValue)
void | handle_exception (int exceptionVector)
void | set_debug_traps (void)
void | breakpoint (void)

Variables

int | remote_debug
int | registers [NUMREGS]
int | remcomStack [STACKSIZE/sizeof(int)]
int | gdb_i386errcode
int | gdb_i386vector = -1

Define Documentation

#define BREAKPOINT ( ) asm(" int $3");

Definition at line 456 of file i386-stub-win32.c.

Referenced by breakpoint(), and handle_exception().

#define BUFMAX 400

Definition at line 109 of file i386-stub-win32.c.

Referenced by getpacket(), and handle_exception().

CALL_HOOK ( ) asm("call _remcomHandler");

Definition at line 260 of file i386-stub-win32.c.

CHECK_FAULT ( )

Value:

asm ("cmpl $0, _mem_fault_routine");                                                                       \
  asm ("jne mem_fault");

Definition at line 225 of file i386-stub-win32.c.

#define NUMREGBYTES (NUMREGS * 4)

Definition at line 122 of file i386-stub-win32.c.

Referenced by handle_exception().

#define NUMREGS 16

Definition at line 119 of file i386-stub-win32.c.

Referenced by handle_exception().

SAVE_ERRCODE ( )

Value:

asm ("popl %ebx");                                                                \
  asm ("movl %ebx, _gdb_i386errcode");

Definition at line 208 of file i386-stub-win32.c.

SAVE_REGISTERS1 ( )

Value:

asm ("movl %eax, _registers");                                                                            \
  asm ("movl %ecx, _registers+4");                                                                                       \
  asm ("movl %edx, _registers+8");                                                                                       \
  asm ("movl %ebx, _registers+12");                                                                              \
  asm ("movl %ebp, _registers+20");                                                                              \
  asm ("movl %esi, _registers+24");                                                                              \
  asm ("movl %edi, _registers+28");                                                                              \
  asm ("movw $0, %ax");                                                                                                          \
  asm ("movw %ds, _registers+48");                                                                                       \
  asm ("movw %ax, _registers+50");                                                                                       \
  asm ("movw %es, _registers+52");                                                                                       \
  asm ("movw %ax, _registers+54");                                                                                       \
  asm ("movw %fs, _registers+56");                                                                                       \
  asm ("movw %ax, _registers+58");                                                                                       \
  asm ("movw %gs, _registers+60");                                                                                       \
  asm ("movw %ax, _registers+62");

Definition at line 191 of file i386-stub-win32.c.

SAVE_REGISTERS2 ( )

Value:

asm ("popl %ebx"); /* old eip */                                                                                         \
  asm ("movl %ebx, _registers+32");                                                                              \
  asm ("popl %ebx");     /* old cs */                                                                            \
  asm ("movl %ebx, _registers+40");                                                                              \
  asm ("movw %ax, _registers+42");                                                                                       \
  asm ("popl %ebx");     /* old eflags */                                                                        \
  asm ("movl %ebx, _registers+36");                                                                              \
  /* Now that we've done the pops, we can save the stack pointer.");  */   \
  asm ("movw %ss, _registers+44");                                                                                       \
  asm ("movw %ax, _registers+46");                                                                                       \
  asm ("movl %esp, _registers+16");

Definition at line 211 of file i386-stub-win32.c.

#define STACKSIZE 10000

Definition at line 136 of file i386-stub-win32.c.

Referenced by set_debug_traps().

Enumeration Type Documentation

enum regnames

Enumerator:
EAX
ECX
EDX
EBX
ESP
EBP
ESI
EDI
PC
PS
CS
SS
DS
ES
FS
GS

Definition at line 124 of file i386-stub-win32.c.

00124               {EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI,
00125                            PC /* also known as eip */,
00126                            PS /* also known as eflags */,
00127                            CS, SS, DS, ES, FS, GS};

Function Documentation

void _catchException0 ( )

Referenced by set_debug_traps().

void _catchException1 ( )

Referenced by set_debug_traps().

void _catchException10 ( )

Referenced by set_debug_traps().

void _catchException11 ( )

Referenced by set_debug_traps().

void _catchException12 ( )

Referenced by set_debug_traps().

void _catchException13 ( )

Referenced by set_debug_traps().

void _catchException14 ( )

Referenced by set_debug_traps().

void _catchException16 ( )

Referenced by set_debug_traps().

void _catchException3 ( )

Referenced by set_debug_traps().

void _catchException4 ( )

Referenced by set_debug_traps().

void _catchException5 ( )

Referenced by set_debug_traps().

void _catchException6 ( )

Referenced by set_debug_traps().

void _catchException7 ( )

Referenced by set_debug_traps().

void _catchException8 ( )

Referenced by set_debug_traps().

void _catchException9 ( )

Referenced by set_debug_traps().

void _returnFromException ( )

Definition at line 445 of file i386-stub-win32.c.

References return_to_prog().

Referenced by handle_exception().

00446 {
00447   return_to_prog ();
00448 }

Here is the call graph for this function:

asm ( " call _handle_exception" )

asm | ( | " movl | _stackPtr,
 |  | %esp" |
 | ) |

asm ( "_remcomHandler:" )

asm ( "pushl $14" )

asm ( "__catchException14:" )

asm ( ".globl __catchException14" )

asm ( "pushl $11" )

asm ( "__catchException11:" )

asm ( ".globl __catchException11" )

asm ( "pushl $13" )

asm ( "__catchException13:" )

asm ( ".globl __catchException13" )

asm ( "pushl $16" )

asm ( "__catchException16:" )

asm ( ".globl __catchException16" )

asm ( "pushl $12" )

asm ( "__catchException12:" )

asm ( ".globl __catchException12" )

asm ( "pushl $10" )

asm ( "__catchException10:" )

asm ( ".globl __catchException10" )

asm ( "pushl $9" )

asm ( "__catchException9:" )

asm ( ".globl __catchException9" )

asm ( "pushl $8" )

asm ( "__catchException8:" )

asm ( ".globl __catchException8" )

asm ( "pushl $7" )

asm ( "__catchException7:" )

asm ( ".globl __catchException7" )

asm ( "pushl $6" )

asm ( "__catchException6:" )

asm ( ".globl __catchException6" )

asm ( "pushl $5" )

asm ( "__catchException5:" )

asm ( ".globl __catchException5" )

asm ( "pushl $4" )

asm ( "__catchException4:" )

asm ( ".globl __catchException4" )

asm ( "pushl $0" )

asm ( "__catchException0:" )

asm ( ".globl __catchException0" )

asm ( "pushl $1" )

asm ( "__catchException1:" )

asm ( ".globl __catchException1" )

asm ( "pushl $3" )

asm ( "__catchException3:" )

asm ( ".globl __catchException3" )

asm ( "iret" )

asm | ( | " movl % | eax,
 |  | _mem_fault_routine" |
 | ) |

asm | ( | " movl $ | 0,
 |  | %eax" |
 | ) |

asm ( " pushl %ecx" )

asm ( " pushl %edx" )

asm ( " leave" )

asm ( " popl %edx" )

asm ( " popl %ecx" )

asm | ( | " movl % | eax,
 |  | _gdb_i386errcode" |
 | ) |

asm ( " popl %eax" )

asm ( "mem_fault:" )

asm ( " iret" )

asm ( "ret" )

asm | ( | " movl | _registers,
 |  | %eax" |
 | ) |

asm ( " pushl %eax" )

asm | ( | " movl _registers+ | 36,
 |  | %eax" |
 | ) |

asm | ( | " movw _registers+ | 60,
 |  | %gs" |
 | ) |

asm | ( | " movw _registers+ | 56,
 |  | %fs" |
 | ) |

asm | ( | " movw _registers+ | 52,
 |  | %es" |
 | ) |

asm | ( | " movw _registers+ | 48,
 |  | %ds" |
 | ) |

asm | ( | " movl _registers+ | 28,
 |  | %edi" |
 | ) |

asm | ( | " movl _registers+ | 24,
 |  | %esi" |
 | ) |

asm | ( | " movl _registers+ | 20,
 |  | %ebp" |
 | ) |

asm | ( | " movl _registers+ | 12,
 |  | %ebx" |
 | ) |

asm | ( | " movl _registers+ | 8,
 |  | %edx" |
 | ) |

asm | ( | " movl _registers+ | 4,
 |  | %ecx" |
 | ) |

asm | ( | " movl _registers+ | 16,
 |  | %esp" |
 | ) |

asm | ( | " movw _registers+ | 44,
 |  | %ss" |
 | ) |

asm ( "_return_to_prog:" )

asm ( ".globl _return_to_prog" )

asm ( ".text" )

void breakpoint ( void )

Definition at line 1046 of file i386-stub-win32.c.

References BREAKPOINT.

01047 {
01048   if (initialized)
01049         BREAKPOINT ();
01050 }

int computeSignal ( int exceptionVector )

Definition at line 745 of file i386-stub-win32.c.

Referenced by handle_exception().

00746 {
00747   int sigval;
00748   switch (exceptionVector)
00749         {
00750         case 0:
00751           sigval = 8;
00752           break;                                        /* divide by zero */
00753         case 1:
00754           sigval = 5;
00755           break;                                        /* debug exception */
00756         case 3:
00757           sigval = 5;
00758           break;                                        /* breakpoint */
00759         case 4:
00760           sigval = 16;
00761           break;                                        /* into instruction (overflow) */
00762         case 5:
00763           sigval = 16;
00764           break;                                        /* bound instruction */
00765         case 6:
00766           sigval = 4;
00767           break;                                        /* Invalid opcode */
00768         case 7:
00769           sigval = 8;
00770           break;                                        /* coprocessor not available */
00771         case 8:
00772           sigval = 7;
00773           break;                                        /* double fault */
00774         case 9:
00775           sigval = 11;
00776           break;                                        /* coprocessor segment overrun */
00777         case 10:
00778           sigval = 11;
00779           break;                                        /* Invalid TSS */
00780         case 11:
00781           sigval = 11;
00782           break;                                        /* Segment not present */
00783         case 12:
00784           sigval = 11;
00785           break;                                        /* stack exception */
00786         case 13:
00787           sigval = 11;
00788           break;                                        /* general protection */
00789         case 14:
00790           sigval = 11;
00791           break;                                        /* page fault */
00792         case 16:
00793           sigval = 7;
00794           break;                                        /* coprocessor error */
00795         default:
00796           sigval = 7;                           /* "software generated" */
00797         }
00798   return (sigval);
00799 }

void debug_error ( char * format )

Definition at line 630 of file i386-stub-win32.c.

References remote_debug.

Referenced by handle_exception().

00631 {
00632   if (remote_debug)
00633     fprintf (stderr, format/*, parm*/);
00634 }

void exceptionHandler ( )

Referenced by set_debug_traps().

int get_char ( char * addr )

Definition at line 654 of file i386-stub-win32.c.

Referenced by mem2hex().

00655 {
00656   return *addr;
00657 }

int getDebugChar ( )

Referenced by getpacket(), and putpacket().

char* getpacket ( void )

Definition at line 530 of file i386-stub-win32.c.

References BUFMAX, getDebugChar(), hex(), putDebugChar(), and remote_debug.

Referenced by handle_exception().

00531 {
00532   char *buffer = &remcomInBuffer[0];
00533   unsigned char checksum;
00534   unsigned char xmitcsum;
00535   int count;
00536   char ch;
00537
00538   while (1)
00539         {
00540           /* wait around for the start character, ignore all other characters */
00541           while ((ch = getDebugChar ()) != '$')
00542                 ;
00543
00544         retry:
00545           checksum = 0;
00546           xmitcsum = -1;
00547           count = 0;
00548
00549           /* now, read until a # or end of buffer is found */
00550           while (count < BUFMAX)
00551                 {
00552                   ch = getDebugChar ();
00553                   if (ch == '$')
00554                         goto retry;
00555                   if (ch == '#')
00556                         break;
00557                   checksum = checksum + ch;
00558                   buffer[count] = ch;
00559                   count = count + 1;
00560                 }
00561           buffer[count] = 0;
00562
00563           if (ch == '#')
00564                 {
00565                   ch = getDebugChar ();
00566                   xmitcsum = hex (ch) << 4;
00567                   ch = getDebugChar ();
00568                   xmitcsum += hex (ch);
00569
00570                   if (checksum != xmitcsum)
00571                         {
00572                           if (remote_debug)
00573                                 {
00574                                   fprintf (stderr,
00575                                                    "bad checksum.  My count = 0x%x, sent=0x%x. buf=%s\n",
00576                                                    checksum, xmitcsum, buffer);
00577                                 }
00578                           putDebugChar ('-');           /* failed checksum */
00579                         }
00580                   else
00581                         {
00582                           putDebugChar ('+');           /* successful transfer */
00583
00584                           /* if a sequence char is present, reply the sequence ID */
00585                           if (buffer[2] == ':')
00586                                 {
00587                                   putDebugChar (buffer[0]);
00588                                   putDebugChar (buffer[1]);
00589
00590                                   return &buffer[3];
00591                                 }
00592
00593                           return &buffer[0];
00594                         }
00595                 }
00596         }
00597 }

Here is the call graph for this function:

void handle_exception ( int exceptionVector )

Definition at line 834 of file i386-stub-win32.c.

References _returnFromException(), BREAKPOINT, BUFMAX, computeSignal(), debug_error(), EBP, ESP, gdb_i386vector, getpacket(), hex2mem(), hexToInt(), mem2hex(), NUMREGBYTES, NUMREGS, PC, PS, putpacket(), registers, remote_debug, and strcpy_s.

00835 {
00836   int sigval, stepping;
00837   int addr, length;
00838   char *ptr;
00839   int newPC;
00840
00841 #ifndef WIN32 //MF
00842   gdb_i386vector = exceptionVector;
00843 #endif
00844
00845   if (remote_debug)
00846         {
00847           printf ("vector=%d, sr=0x%x, pc=0x%x\n",
00848                           exceptionVector, registers[PS], registers[PC]);
00849         }
00850
00851   /* reply to host that an exception has occurred */
00852   sigval = computeSignal (exceptionVector);
00853
00854   ptr = remcomOutBuffer;
00855
00856   *ptr++ = 'T';                                 /* notify gdb with signo, PC, FP and SP */
00857   *ptr++ = hexchars[sigval >> 4];
00858   *ptr++ = hexchars[sigval & 0xf];
00859
00860   *ptr++ = hexchars[ESP];
00861   *ptr++ = ':';
00862   ptr = mem2hex((char *)&registers[ESP], ptr, 4, 0);    /* SP */
00863   *ptr++ = ';';
00864
00865   *ptr++ = hexchars[EBP];
00866   *ptr++ = ':';
00867   ptr = mem2hex((char *)&registers[EBP], ptr, 4, 0);    /* FP */
00868   *ptr++ = ';';
00869
00870   *ptr++ = hexchars[PC];
00871   *ptr++ = ':';
00872   ptr = mem2hex((char *)&registers[PC], ptr, 4, 0);     /* PC */
00873   *ptr++ = ';';
00874
00875   *ptr = '\0';
00876
00877   putpacket (remcomOutBuffer);
00878
00879   stepping = 0;
00880
00881   while (1 == 1)
00882         {
00883           remcomOutBuffer[0] = 0;
00884           ptr = getpacket ();
00885
00886           switch (*ptr++)
00887                 {
00888                 case '?':
00889                   remcomOutBuffer[0] = 'S';
00890                   remcomOutBuffer[1] = hexchars[sigval >> 4];
00891                   remcomOutBuffer[2] = hexchars[sigval % 16];
00892                   remcomOutBuffer[3] = 0;
00893                   break;
00894                 case 'd':
00895                   remote_debug = !(remote_debug);               /* toggle debug flag */
00896                   break;
00897                 case 'g':                               /* return the value of the CPU registers */
00898                   mem2hex ((char *) registers, remcomOutBuffer, NUMREGBYTES, 0);
00899                   break;
00900                 case 'G':                               /* set the value of the CPU registers - return OK */
00901                   hex2mem (ptr, (char *) registers, NUMREGBYTES, 0);
00902                   strcpy_s(remcomOutBuffer, BUFMAX, "OK");
00903                   break;
00904                 case 'P':                               /* set the value of a single CPU register - return OK */
00905                   {
00906                         int regno;
00907
00908                         if (hexToInt (&ptr, &regno) && *ptr++ == '=')
00909                           if (regno >= 0 && regno < NUMREGS)
00910                                 {
00911                                   hex2mem (ptr, (char *) &registers[regno], 4, 0);
00912                                   strcpy_s(remcomOutBuffer, BUFMAX, "OK");
00913                                   break;
00914                                 }
00915
00916                         strcpy_s(remcomOutBuffer, BUFMAX, "E01");
00917                         break;
00918                   }
00919
00920                   /* mAA..AA,LLLL  Read LLLL bytes at address AA..AA */
00921                 case 'm':
00922                   /* TRY TO READ %x,%x.  IF SUCCEED, SET PTR = 0 */
00923                   if (hexToInt (&ptr, &addr))
00924                         if (*(ptr++) == ',')
00925                           if (hexToInt (&ptr, &length))
00926                                 {
00927                                   ptr = 0;
00928                                   mem_err = 0;
00929                                   mem2hex ((char *) addr, remcomOutBuffer, length, 1);
00930                                   if (mem_err)
00931                                         {
00932                                           strcpy_s(remcomOutBuffer, BUFMAX, "E03");
00933                                           debug_error ("memory fault");
00934                                         }
00935                                 }
00936
00937                   if (ptr)
00938                         {
00939                           strcpy_s(remcomOutBuffer, BUFMAX, "E01");
00940                         }
00941                   break;
00942
00943                   /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
00944                 case 'M':
00945                   /* TRY TO READ '%x,%x:'.      IF SUCCEED, SET PTR = 0 */
00946                   if (hexToInt (&ptr, &addr))
00947                         if (*(ptr++) == ',')
00948                           if (hexToInt (&ptr, &length))
00949                                 if (*(ptr++) == ':')
00950                                   {
00951                                         mem_err = 0;
00952                                         hex2mem (ptr, (char *) addr, length, 1);
00953
00954                                         if (mem_err)
00955                                           {
00956                                                 strcpy_s(remcomOutBuffer, BUFMAX, "E03");
00957                                                 debug_error ("memory fault");
00958                                           }
00959                                         else
00960                                           {
00961                                                 strcpy_s(remcomOutBuffer, BUFMAX, "OK");
00962                                           }
00963
00964                                         ptr = 0;
00965                                   }
00966                   if (ptr)
00967                         {
00968                           strcpy_s(remcomOutBuffer, BUFMAX, "E02");
00969                         }
00970                   break;
00971
00972                   /* cAA..AA    Continue at address AA..AA(optional) */
00973                   /* sAA..AA   Step one instruction from AA..AA(optional) */
00974                 case 's':
00975                   stepping = 1;
00976                 case 'c':
00977                   /* try to read optional parameter, pc unchanged if no parm */
00978                   if (hexToInt (&ptr, &addr))
00979                         registers[PC] = addr;
00980
00981                   newPC = registers[PC];
00982
00983                   /* clear the trace bit */
00984                   registers[PS] &= 0xfffffeff;
00985
00986                   /* set the trace bit if we're stepping */
00987                   if (stepping)
00988                         registers[PS] |= 0x100;
00989
00990 #ifdef WIN32 //MF
00991                   return;
00992 #else
00993                   _returnFromException ();              /* this is a jump */
00994 #endif
00995                   break;
00996
00997                   /* kill the program */
00998                 case 'k':                               /* do nothing */
00999 #if 0
01000                   /* Huh? This doesn't look like "nothing".
01001                          m68k-stub.c and sparc-stub.c don't have it.  */
01002                   BREAKPOINT ();
01003 #endif
01004                   break;
01005                 }                                               /* switch */
01006
01007           /* reply to the request */
01008           putpacket (remcomOutBuffer);
01009         }
01010 }

Here is the call graph for this function:

int hex ( char ch )

Definition at line 512 of file i386-stub-win32.c.

Referenced by getpacket(), hex2mem(), and hexToInt().

00514 {
00515   if ((ch >= 'a') && (ch <= 'f'))
00516         return (ch - 'a' + 10);
00517   if ((ch >= '0') && (ch <= '9'))
00518         return (ch - '0');
00519   if ((ch >= 'A') && (ch <= 'F'))
00520         return (ch - 'A' + 10);
00521   return (-1);
00522 }

char* hex2mem | ( | char * | buf,
 |  | char * | mem,
 |  | int | count,
 |  | int | may_fault
 | ) |

Definition at line 705 of file i386-stub-win32.c.

References hex(), set_char(), and set_mem_err().

Referenced by handle_exception().

00710 {
00711   int i;
00712   unsigned char ch;
00713
00714 #ifdef WIN32 //MF
00715    // MinGW does not support structured exception handling, so let's
00716    // go safe and make memory writable by default
00717   DWORD old_protect;
00718
00719   VirtualProtect(mem, count, PAGE_EXECUTE_READWRITE, &old_protect);
00720 #else
00721   if (may_fault)
00722         mem_fault_routine = set_mem_err;
00723 #endif
00724
00725   for (i = 0; i < count; i++)
00726         {
00727           ch = hex (*buf++) << 4;
00728           ch = ch + hex (*buf++);
00729           set_char (mem++, ch);
00730           if (may_fault && mem_err)
00731                 return (mem);
00732         }
00733
00734 #ifndef WIN32 //MF
00735   if (may_fault)
00736         mem_fault_routine = NULL;
00737 #endif
00738
00739   return (mem);
00740 }

Here is the call graph for this function:

int hexToInt | ( | char ** | ptr,
 |  | int * | intValue
 | ) |

Definition at line 806 of file i386-stub-win32.c.

References hex().

Referenced by handle_exception().

00807 {
00808   int numChars = 0;
00809   int hexValue;
00810
00811   *intValue = 0;
00812
00813   while (**ptr)
00814         {
00815           hexValue = hex (**ptr);
00816           if (hexValue >= 0)
00817                 {
00818                   *intValue = (*intValue << 4) | hexValue;
00819                   numChars++;
00820                 }
00821           else
00822                 break;
00823
00824           (*ptr)++;
00825         }
00826
00827   return (numChars);
00828 }

Here is the call graph for this function:

char* mem2hex | ( | char * | mem,
 |  | char * | buf,
 |  | int | count,
 |  | int | may_fault
 | ) |

Definition at line 670 of file i386-stub-win32.c.

References get_char(), and set_mem_err().

Referenced by handle_exception().

00675 {
00676   int i;
00677   unsigned char ch;
00678
00679 #ifdef WIN32 //MF
00680   if (IsBadReadPtr(mem, count))
00681         return mem;
00682 #else
00683   if (may_fault)
00684         mem_fault_routine = set_mem_err;
00685 #endif
00686   for (i = 0; i < count; i++)
00687         {
00688           ch = get_char (mem++);
00689           if (may_fault && mem_err)
00690                 return (buf);
00691           *buf++ = hexchars[ch >> 4];
00692           *buf++ = hexchars[ch % 16];
00693         }
00694   *buf = 0;
00695 #ifndef WIN32 //MF
00696   if (may_fault)
00697         mem_fault_routine = NULL;
00698 #endif
00699   return (buf);
00700 }

Here is the call graph for this function:

void putDebugChar ( )

Referenced by getpacket(), and putpacket().

void putpacket ( char * buffer )

Definition at line 602 of file i386-stub-win32.c.

References getDebugChar(), and putDebugChar().

Referenced by handle_exception().

00603 {
00604   unsigned char checksum;
00605   int count;
00606   char ch;
00607
00608   /*  $<packet info>#<checksum>. */
00609   do
00610         {
00611           putDebugChar ('$');
00612           checksum = 0;
00613           count = 0;
00614
00615           while ((ch = buffer[count]) != 0)
00616                 {
00617                   putDebugChar (ch);
00618                   checksum += ch;
00619                   count += 1;
00620                 }
00621
00622           putDebugChar ('#');
00623           putDebugChar (hexchars[checksum >> 4]);
00624           putDebugChar (hexchars[checksum % 16]);
00625
00626         }
00627   while (getDebugChar () != '+');
00628 }

Here is the call graph for this function:

void return_to_prog ( )

Referenced by _returnFromException().

void set_char | ( | char * | addr,
 |  | int | val
 | ) |

Definition at line 660 of file i386-stub-win32.c.

Referenced by hex2mem().

00661 {
00662   *addr = val;
00663 }

void set_debug_traps ( void )

Definition at line 1015 of file i386-stub-win32.c.

References _catchException0(), _catchException1(), _catchException10(), _catchException11(), _catchException12(), _catchException13(), _catchException14(), _catchException16(), _catchException3(), _catchException4(), _catchException5(), _catchException6(), _catchException7(), _catchException8(), _catchException9(), exceptionHandler(), and STACKSIZE.

01016 {
01017 #ifndef WIN32 //MF
01018   stackPtr = &remcomStack[STACKSIZE / sizeof (int) - 1];
01019
01020   exceptionHandler (0, _catchException0);
01021   exceptionHandler (1, _catchException1);
01022   exceptionHandler (3, _catchException3);
01023   exceptionHandler (4, _catchException4);
01024   exceptionHandler (5, _catchException5);
01025   exceptionHandler (6, _catchException6);
01026   exceptionHandler (7, _catchException7);
01027   exceptionHandler (8, _catchException8);
01028   exceptionHandler (9, _catchException9);
01029   exceptionHandler (10, _catchException10);
01030   exceptionHandler (11, _catchException11);
01031   exceptionHandler (12, _catchException12);
01032   exceptionHandler (13, _catchException13);
01033   exceptionHandler (14, _catchException14);
01034   exceptionHandler (16, _catchException16);
01035 #endif // WIN32
01036
01037   initialized = 1;
01038 }

Here is the call graph for this function:

void set_mem_err ( void )

Definition at line 644 of file i386-stub-win32.c.

Referenced by hex2mem(), and mem2hex().

00645 {
00646   mem_err = 1;
00647 }

Variable Documentation

int gdb_i386errcode

Definition at line 184 of file i386-stub-win32.c.

int gdb_i386vector = -1

Definition at line 187 of file i386-stub-win32.c.

Referenced by handle_exception().

int registers[NUMREGS]

Definition at line 132 of file i386-stub-win32.c.

Referenced by handle_exception().

int remcomStack[STACKSIZE/sizeof(int)]

Definition at line 137 of file i386-stub-win32.c.

int remote_debug

Definition at line 113 of file i386-stub-win32.c.

Referenced by debug_error(), getpacket(), and handle_exception().


ROS Explorer: i386-stub-win32.c Source File

  • File List
  • File Members

i386-stub-win32.c

Go to the documentation of this file.
00001 /****************************************************************************
00002
00003                                 THIS SOFTWARE IS NOT COPYRIGHTED
00004
00005    HP offers the following for use in the public domain.  HP makes no
00006    warranty with regard to the software or it's performance and the
00007    user accepts the software "AS IS" with all faults.
00008
00009    HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
00010    TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
00011    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00012
00013 ****************************************************************************/
00014
00015 /****************************************************************************
00016  *      Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
00017  *
00018  *      Module name: remcom.c $
00019  *      Revision: 1.34 $
00020  *      Date: 91/03/09 12:29:49 $
00021  *      Contributor:     Lake Stevens Instrument Division$
00022  *
00023  *      Description:     low level support for gdb debugger. $
00024  *
00025  *      Considerations:  only works on target hardware $
00026  *
00027  *      Written by:      Glenn Engel $
00028  *      ModuleState:     Experimental $
00029  *
00030  *      NOTES:                   See Below $
00031  *
00032  *      Modified for 386 by Jim Kingdon, Cygnus Support.
00033  *
00034  *      To enable debugger support, two things need to happen.  One, a
00035  *      call to set_debug_traps() is necessary in order to allow any breakpoints
00036  *      or error conditions to be properly intercepted and reported to gdb.
00037  *      Two, a breakpoint needs to be generated to begin communication.  This
00038  *      is most easily accomplished by a call to breakpoint().  Breakpoint()
00039  *      simulates a breakpoint by executing a trap #1.
00040  *
00041  *      The external function exceptionHandler() is
00042  *      used to attach a specific handler to a specific 386 vector number.
00043  *      It should use the same privilege level it runs at.      It should
00044  *      install it as an interrupt gate so that interrupts are masked
00045  *      while the handler runs.
00046  *
00047  *      Because gdb will sometimes write to the stack area to execute function
00048  *      calls, this program cannot rely on using the supervisor stack so it
00049  *      uses it's own stack area reserved in the int array remcomStack.
00050  *
00051  *************
00052  *
00053  *        The following gdb commands are supported:
00054  *
00055  * command                      function                                                           Return value
00056  *
00057  *        g                     return the value of the CPU registers  hex data or ENN
00058  *        G                     set the value of the CPU registers         OK or ENN
00059  *
00060  *        mAA..AA,LLLL  Read LLLL bytes at address AA..AA          hex data or ENN
00061  *        MAA..AA,LLLL: Write LLLL bytes at address AA.AA          OK or ENN
00062  *
00063  *        c                     Resume at current address                          SNN   ( signal NN)
00064  *        cAA..AA               Continue at address AA..AA                         SNN
00065  *
00066  *        s                     Step one instruction                               SNN
00067  *        sAA..AA               Step one instruction from AA..AA           SNN
00068  *
00069  *        k                     kill
00070  *
00071  *        ?                     What was the last sigval ?                         SNN   (signal NN)
00072  *
00073  * All commands and responses are sent with a packet which includes a
00074  * checksum.  A packet consists of
00075  *
00076  * $<packet info>#<checksum>.
00077  *
00078  * where
00079  * <packet info> :: <characters representing the command or response>
00080  * <checksum>    :: < two hex digits computed as modulo 256 sum of <packetinfo>>
00081  *
00082  * When a packet is received, it is first acknowledged with either '+' or '-'.
00083  * '+' indicates a successful transfer.  '-' indicates a failed transfer.
00084  *
00085  * Example:
00086  *
00087  * Host:                                  Reply:
00088  * $m0,10#2a                       +$00010203040506070809101112131415#42
00089  *
00090  ****************************************************************************/
00091
00092 #include <stdio.h>
00093 #include <string.h>
00094
00095 #include "utility/utility.h"    // for strcpy_s()
00096
00097 /************************************************************************
00098  *
00099  * external low-level support routines
00100  */
00101
00102 extern void putDebugChar();     /* write a single character      */
00103 extern int getDebugChar();              /* read and return a single char */
00104 extern void exceptionHandler(); /* assign an exception handler   */
00105
00106 /************************************************************************/
00107 /* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
00108 /* at least NUMREGBYTES*2 are needed for register packets */
00109 #define BUFMAX 400
00110
00111 static char initialized;  /* boolean flag. != 0 means we've been initialized */
00112
00113 int     remote_debug;
00114 /*      debug >  0 prints ill-formed commands in valid packets & checksum errors */
00115
00116 static const char hexchars[]="0123456789abcdef";
00117
00118 /* Number of registers.  */
00119 #define NUMREGS 16
00120
00121 /* Number of bytes of registers.  */
00122 #define NUMREGBYTES (NUMREGS * 4)
00123
00124 enum regnames {EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI,
00125                            PC /* also known as eip */,
00126                            PS /* also known as eflags */,
00127                            CS, SS, DS, ES, FS, GS};
00128
00129 /*
00130  * these should not be static cuz they can be used outside this module
00131  */
00132 int registers[NUMREGS];
00133
00134 #ifndef WIN32 //MF
00135
00136 #define STACKSIZE 10000
00137 int remcomStack[STACKSIZE/sizeof(int)];
00138 static int* stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1];
00139
00140 /***************************  ASSEMBLY CODE MACROS *************************/
00141 /*                                                                                                                                                 */
00142
00143 extern void
00144 return_to_prog ();
00145
00146 /* Restore the program's registers (including the stack pointer, which
00147    means we get the right stack and don't have to worry about popping our
00148    return address and any stack frames and so on) and return.  */
00149 asm(".text");
00150 asm(".globl _return_to_prog");
00151 asm("_return_to_prog:");
00152 asm("        movw _registers+44, %ss");
00153 asm("        movl _registers+16, %esp");
00154 asm("        movl _registers+4, %ecx");
00155 asm("        movl _registers+8, %edx");
00156 asm("        movl _registers+12, %ebx");
00157 asm("        movl _registers+20, %ebp");
00158 asm("        movl _registers+24, %esi");
00159 asm("        movl _registers+28, %edi");
00160 asm("        movw _registers+48, %ds");
00161 asm("        movw _registers+52, %es");
00162 asm("        movw _registers+56, %fs");
00163 asm("        movw _registers+60, %gs");
00164 asm("        movl _registers+36, %eax");
00165 asm("        pushl %eax");      /* saved eflags */
00166 asm("        movl _registers+40, %eax");
00167 asm("        pushl %eax");      /* saved cs */
00168 asm("        movl _registers+32, %eax");
00169 asm("        pushl %eax");      /* saved eip */
00170 asm("        movl _registers, %eax");
00171
00172 asm("ret");     //MF
00173
00174 /* use iret to restore pc and flags together so
00175    that trace flag works right.  */
00176 asm("        iret");
00177
00178
00179 #ifdef WIN32 //MF
00180 asm(".data"); //MF
00181 #endif
00182
00183 /* Put the error code here just in case the user cares.  */
00184 int gdb_i386errcode;
00185 /* Likewise, the vector number here (since GDB only gets the signal
00186    number through the usual means, and that's not very specific).  */
00187 int gdb_i386vector = -1;
00188
00189 /* GDB stores segment registers in 32-bit words (that's just the way
00190    m-i386v.h is written).  So zero the appropriate areas in registers.  */
00191 #define SAVE_REGISTERS1() \
00192   asm ("movl %eax, _registers");                                                                                  \
00193   asm ("movl %ecx, _registers+4");                                                                                       \
00194   asm ("movl %edx, _registers+8");                                                                                       \
00195   asm ("movl %ebx, _registers+12");                                                                              \
00196   asm ("movl %ebp, _registers+20");                                                                              \
00197   asm ("movl %esi, _registers+24");                                                                              \
00198   asm ("movl %edi, _registers+28");                                                                              \
00199   asm ("movw $0, %ax");                                                                                                          \
00200   asm ("movw %ds, _registers+48");                                                                                       \
00201   asm ("movw %ax, _registers+50");                                                                                       \
00202   asm ("movw %es, _registers+52");                                                                                       \
00203   asm ("movw %ax, _registers+54");                                                                                       \
00204   asm ("movw %fs, _registers+56");                                                                                       \
00205   asm ("movw %ax, _registers+58");                                                                                       \
00206   asm ("movw %gs, _registers+60");                                                                                       \
00207   asm ("movw %ax, _registers+62");
00208 #define SAVE_ERRCODE() \
00209   asm ("popl %ebx");                                                              \
00210   asm ("movl %ebx, _gdb_i386errcode");
00211 #define SAVE_REGISTERS2() \
00212   asm ("popl %ebx"); /* old eip */                                                                                       \
00213   asm ("movl %ebx, _registers+32");                                                                              \
00214   asm ("popl %ebx");     /* old cs */                                                                            \
00215   asm ("movl %ebx, _registers+40");                                                                              \
00216   asm ("movw %ax, _registers+42");                                                                                       \
00217   asm ("popl %ebx");     /* old eflags */                                                                        \
00218   asm ("movl %ebx, _registers+36");                                                                              \
00219   /* Now that we've done the pops, we can save the stack pointer.");  */   \
00220   asm ("movw %ss, _registers+44");                                                                                       \
00221   asm ("movw %ax, _registers+46");                                                                                       \
00222   asm ("movl %esp, _registers+16");
00223
00224 /* See if mem_fault_routine is set, if so just IRET to that address.  */
00225 #define CHECK_FAULT() \
00226   asm ("cmpl $0, _mem_fault_routine");                                                                     \
00227   asm ("jne mem_fault");
00228
00229 asm (".text");
00230 asm ("mem_fault:");
00231 /* OK to clobber temp registers; we're just going to end up in set_mem_err.  */
00232 /* Pop error code from the stack and save it.  */
00233 asm ("     popl %eax");
00234 asm ("     movl %eax, _gdb_i386errcode");
00235
00236 asm ("     popl %eax"); /* eip */
00237 /* We don't want to return there, we want to return to the function
00238    pointed to by mem_fault_routine instead.  */
00239 asm ("     movl _mem_fault_routine, %eax");
00240 asm ("     popl %ecx"); /* cs (low 16 bits; junk in hi 16 bits).  */
00241 asm ("     popl %edx"); /* eflags */
00242
00243 /* Remove this stack frame; when we do the iret, we will be going to
00244    the start of a function, so we want the stack to look just like it
00245    would after a "call" instruction.  */
00246 asm ("     leave");
00247
00248 /* Push the stuff that iret wants.      */
00249 asm ("     pushl %edx"); /* eflags */
00250 asm ("     pushl %ecx"); /* cs */
00251 asm ("     pushl %eax"); /* eip */
00252
00253 /* Zero mem_fault_routine.      */
00254 asm ("     movl $0, %eax");
00255 asm ("     movl %eax, _mem_fault_routine");
00256
00257 asm ("iret");
00258
00259
00260 #define CALL_HOOK() asm("call _remcomHandler");
00261
00262 /* This function is called when a i386 exception occurs.  It saves
00263  * all the cpu regs in the _registers array, munges the stack a bit,
00264  * and invokes an exception handler (remcom_handler).
00265  *
00266  * stack on entry:                                               stack on exit:
00267  *       old eflags                                              vector number
00268  *       old cs (zero-filled to 32 bits)
00269  *       old eip
00270  *
00271  */
00272 extern void _catchException3();
00273 asm(".text");
00274 asm(".globl __catchException3");
00275 asm("__catchException3:");
00276 SAVE_REGISTERS1();
00277 SAVE_REGISTERS2();
00278 asm ("pushl $3");
00279 CALL_HOOK();
00280
00281 /* Same thing for exception 1.  */
00282 extern void _catchException1();
00283 asm(".text");
00284 asm(".globl __catchException1");
00285 asm("__catchException1:");
00286 SAVE_REGISTERS1();
00287 SAVE_REGISTERS2();
00288 asm ("pushl $1");
00289 CALL_HOOK();
00290
00291 /* Same thing for exception 0.  */
00292 extern void _catchException0();
00293 asm(".text");
00294 asm(".globl __catchException0");
00295 asm("__catchException0:");
00296 SAVE_REGISTERS1();
00297 SAVE_REGISTERS2();
00298 asm ("pushl $0");
00299 CALL_HOOK();
00300
00301 /* Same thing for exception 4.  */
00302 extern void _catchException4();
00303 asm(".text");
00304 asm(".globl __catchException4");
00305 asm("__catchException4:");
00306 SAVE_REGISTERS1();
00307 SAVE_REGISTERS2();
00308 asm ("pushl $4");
00309 CALL_HOOK();
00310
00311 /* Same thing for exception 5.  */
00312 extern void _catchException5();
00313 asm(".text");
00314 asm(".globl __catchException5");
00315 asm("__catchException5:");
00316 SAVE_REGISTERS1();
00317 SAVE_REGISTERS2();
00318 asm ("pushl $5");
00319 CALL_HOOK();
00320
00321 /* Same thing for exception 6.  */
00322 extern void _catchException6();
00323 asm(".text");
00324 asm(".globl __catchException6");
00325 asm("__catchException6:");
00326 SAVE_REGISTERS1();
00327 SAVE_REGISTERS2();
00328 asm ("pushl $6");
00329 CALL_HOOK();
00330
00331 /* Same thing for exception 7.  */
00332 extern void _catchException7();
00333 asm(".text");
00334 asm(".globl __catchException7");
00335 asm("__catchException7:");
00336 SAVE_REGISTERS1();
00337 SAVE_REGISTERS2();
00338 asm ("pushl $7");
00339 CALL_HOOK();
00340
00341 /* Same thing for exception 8.  */
00342 extern void _catchException8();
00343 asm(".text");
00344 asm(".globl __catchException8");
00345 asm("__catchException8:");
00346 SAVE_REGISTERS1();
00347 SAVE_ERRCODE();
00348 SAVE_REGISTERS2();
00349 asm ("pushl $8");
00350 CALL_HOOK();
00351
00352 /* Same thing for exception 9.  */
00353 extern void _catchException9();
00354 asm(".text");
00355 asm(".globl __catchException9");
00356 asm("__catchException9:");
00357 SAVE_REGISTERS1();
00358 SAVE_REGISTERS2();
00359 asm ("pushl $9");
00360 CALL_HOOK();
00361
00362 /* Same thing for exception 10.  */
00363 extern void _catchException10();
00364 asm(".text");
00365 asm(".globl __catchException10");
00366 asm("__catchException10:");
00367 SAVE_REGISTERS1();
00368 SAVE_ERRCODE();
00369 SAVE_REGISTERS2();
00370 asm ("pushl $10");
00371 CALL_HOOK();
00372
00373 /* Same thing for exception 12.  */
00374 extern void _catchException12();
00375 asm(".text");
00376 asm(".globl __catchException12");
00377 asm("__catchException12:");
00378 SAVE_REGISTERS1();
00379 SAVE_ERRCODE();
00380 SAVE_REGISTERS2();
00381 asm ("pushl $12");
00382 CALL_HOOK();
00383
00384 /* Same thing for exception 16.  */
00385 extern void _catchException16();
00386 asm(".text");
00387 asm(".globl __catchException16");
00388 asm("__catchException16:");
00389 SAVE_REGISTERS1();
00390 SAVE_REGISTERS2();
00391 asm ("pushl $16");
00392 CALL_HOOK();
00393
00394 /* For 13, 11, and 14 we have to deal with the CHECK_FAULT stuff.  */
00395
00396 /* Same thing for exception 13.  */
00397 extern void _catchException13 ();
00398 asm (".text");
00399 asm (".globl __catchException13");
00400 asm ("__catchException13:");
00401 CHECK_FAULT();
00402 SAVE_REGISTERS1();
00403 SAVE_ERRCODE();
00404 SAVE_REGISTERS2();
00405 asm ("pushl $13");
00406 CALL_HOOK();
00407
00408 /* Same thing for exception 11.  */
00409 extern void _catchException11 ();
00410 asm (".text");
00411 asm (".globl __catchException11");
00412 asm ("__catchException11:");
00413 CHECK_FAULT();
00414 SAVE_REGISTERS1();
00415 SAVE_ERRCODE();
00416 SAVE_REGISTERS2();
00417 asm ("pushl $11");
00418 CALL_HOOK();
00419
00420 /* Same thing for exception 14.  */
00421 extern void _catchException14 ();
00422 asm (".text");
00423 asm (".globl __catchException14");
00424 asm ("__catchException14:");
00425 CHECK_FAULT();
00426 SAVE_REGISTERS1();
00427 SAVE_ERRCODE();
00428 SAVE_REGISTERS2();
00429 asm ("pushl $14");
00430 CALL_HOOK();
00431
00432 /*
00433  * remcomHandler is a front end for handle_exception.  It moves the
00434  * stack pointer into an area reserved for debugger use.
00435  */
00436 asm("_remcomHandler:");
00437 asm("           popl %eax");            /* pop off return address         */
00438 asm("           popl %eax");      /* get the exception number   */
00439 asm("           movl _stackPtr, %esp"); /* move to remcom stack area  */
00440 asm("           pushl %eax");    /* push exception onto stack  */
00441 asm("           call  _handle_exception");        /* this never returns */
00442
00443
00444 void
00445 _returnFromException ()
00446 {
00447   return_to_prog ();
00448 }
00449
00450 #endif  // !WIN32
00451
00452
00453 #ifdef _MSC_VER //MF
00454 #define BREAKPOINT() __asm int 3;
00455 #else
00456 #define BREAKPOINT() asm("   int $3");
00457 #endif
00458
00459
00460 #ifdef WIN32 //MF
00461
00462 #define WIN32_LEAN_AND_MEAN
00463 #include <windows.h>
00464
00465 void handle_exception(int exceptionVector);
00466
00467 void win32_exception_handler(EXCEPTION_POINTERS* exc_info)
00468 {
00469   PCONTEXT ctx = exc_info->ContextRecord;
00470
00471   registers[EAX] = ctx->Eax;
00472   registers[ECX] = ctx->Ecx;
00473   registers[EDX] = ctx->Edx;
00474   registers[EBX] = ctx->Ebx;
00475   registers[ESP] = ctx->Esp;
00476   registers[EBP] = ctx->Ebp;
00477   registers[ESI] = ctx->Esi;
00478   registers[EDI] = ctx->Edi;
00479    registers[PC] = ctx->Eip;
00480    registers[PS] = ctx->EFlags;
00481   registers[CS] = ctx->SegCs;
00482   registers[SS] = ctx->SegSs;
00483   registers[DS] = ctx->SegDs;
00484   registers[ES] = ctx->SegEs;
00485   registers[FS] = ctx->SegFs;
00486   registers[GS] = ctx->SegGs;
00487
00488   handle_exception(exc_info->ExceptionRecord->ExceptionCode & 0xFFFF);
00489
00490   ctx->Eax = registers[EAX];
00491   ctx->Ecx = registers[ECX];
00492   ctx->Edx = registers[EDX];
00493   ctx->Ebx = registers[EBX];
00494   ctx->Esp = registers[ESP];
00495   ctx->Ebp = registers[EBP];
00496   ctx->Esi = registers[ESI];
00497   ctx->Edi = registers[EDI];
00498    ctx->Eip = registers[PC];
00499    ctx->EFlags = registers[PS];
00500   ctx->SegCs = registers[CS];
00501   ctx->SegSs = registers[SS];
00502   ctx->SegDs = registers[DS];
00503   ctx->SegEs = registers[ES];
00504   ctx->SegFs = registers[FS];
00505   ctx->SegGs = registers[GS];
00506 }
00507
00508 #endif // WIN32
00509
00510
00511 int
00512 hex (ch)
00513          char ch;
00514 {
00515   if ((ch >= 'a') && (ch <= 'f'))
00516         return (ch - 'a' + 10);
00517   if ((ch >= '0') && (ch <= '9'))
00518         return (ch - '0');
00519   if ((ch >= 'A') && (ch <= 'F'))
00520         return (ch - 'A' + 10);
00521   return (-1);
00522 }
00523
00524 static char remcomInBuffer[BUFMAX];
00525 static char remcomOutBuffer[BUFMAX];
00526
00527 /* scan for the sequence $<data>#<checksum>     */
00528
00529 char *
00530 getpacket (void)
00531 {
00532   char *buffer = &remcomInBuffer[0];
00533   unsigned char checksum;
00534   unsigned char xmitcsum;
00535   int count;
00536   char ch;
00537
00538   while (1)
00539         {
00540           /* wait around for the start character, ignore all other characters */
00541           while ((ch = getDebugChar ()) != '$')
00542                 ;
00543
00544         retry:
00545           checksum = 0;
00546           xmitcsum = -1;
00547           count = 0;
00548
00549           /* now, read until a # or end of buffer is found */
00550           while (count < BUFMAX)
00551                 {
00552                   ch = getDebugChar ();
00553                   if (ch == '$')
00554                         goto retry;
00555                   if (ch == '#')
00556                         break;
00557                   checksum = checksum + ch;
00558                   buffer[count] = ch;
00559                   count = count + 1;
00560                 }
00561           buffer[count] = 0;
00562
00563           if (ch == '#')
00564                 {
00565                   ch = getDebugChar ();
00566                   xmitcsum = hex (ch) << 4;
00567                   ch = getDebugChar ();
00568                   xmitcsum += hex (ch);
00569
00570                   if (checksum != xmitcsum)
00571                         {
00572                           if (remote_debug)
00573                                 {
00574                                   fprintf (stderr,
00575                                                    "bad checksum.  My count = 0x%x, sent=0x%x. buf=%s\n",
00576                                                    checksum, xmitcsum, buffer);
00577                                 }
00578                           putDebugChar ('-');           /* failed checksum */
00579                         }
00580                   else
00581                         {
00582                           putDebugChar ('+');           /* successful transfer */
00583
00584                           /* if a sequence char is present, reply the sequence ID */
00585                           if (buffer[2] == ':')
00586                                 {
00587                                   putDebugChar (buffer[0]);
00588                                   putDebugChar (buffer[1]);
00589
00590                                   return &buffer[3];
00591                                 }
00592
00593                           return &buffer[0];
00594                         }
00595                 }
00596         }
00597 }
00598
00599 /* send the packet in buffer.  */
00600
00601 void
00602 putpacket (char *buffer)
00603 {
00604   unsigned char checksum;
00605   int count;
00606   char ch;
00607
00608   /*  $<packet info>#<checksum>. */
00609   do
00610         {
00611           putDebugChar ('$');
00612           checksum = 0;
00613           count = 0;
00614
00615           while ((ch = buffer[count]) != 0)
00616                 {
00617                   putDebugChar (ch);
00618                   checksum += ch;
00619                   count += 1;
00620                 }
00621
00622           putDebugChar ('#');
00623           putDebugChar (hexchars[checksum >> 4]);
00624           putDebugChar (hexchars[checksum % 16]);
00625
00626         }
00627   while (getDebugChar () != '+');
00628 }
00629
00630 void debug_error (char* format/*, char* parm*/)
00631 {
00632   if (remote_debug)
00633     fprintf (stderr, format/*, parm*/);
00634 }
00635
00636 /* Address of a routine to RTE to if we get a memory fault.  */
00637 static void (*volatile mem_fault_routine) () = NULL;
00638
00639 /* Indicate to caller of mem2hex or hex2mem that there has been an
00640    error.  */
00641 static volatile int mem_err = 0;
00642
00643 void
00644 set_mem_err (void)
00645 {
00646   mem_err = 1;
00647 }
00648
00649 /* These are separate functions so that they are so short and sweet
00650    that the compiler won't save any registers (if there is a fault
00651    to mem_fault, they won't get restored, so there better not be any
00652    saved).      */
00653 int
00654 get_char (char *addr)
00655 {
00656   return *addr;
00657 }
00658
00659 void
00660 set_char (char *addr, int val)
00661 {
00662   *addr = val;
00663 }
00664
00665 /* convert the memory pointed to by mem into hex, placing result in buf */
00666 /* return a pointer to the last char put in buf (null) */
00667 /* If MAY_FAULT is non-zero, then we should set mem_err in response to
00668    a fault; if zero treat a fault like any other fault in the stub.  */
00669 char *
00670 mem2hex (mem, buf, count, may_fault)
00671          char *mem;
00672          char *buf;
00673          int count;
00674          int may_fault;
00675 {
00676   int i;
00677   unsigned char ch;
00678
00679 #ifdef WIN32 //MF
00680   if (IsBadReadPtr(mem, count))
00681         return mem;
00682 #else
00683   if (may_fault)
00684         mem_fault_routine = set_mem_err;
00685 #endif
00686   for (i = 0; i < count; i++)
00687         {
00688           ch = get_char (mem++);
00689           if (may_fault && mem_err)
00690                 return (buf);
00691           *buf++ = hexchars[ch >> 4];
00692           *buf++ = hexchars[ch % 16];
00693         }
00694   *buf = 0;
00695 #ifndef WIN32 //MF
00696   if (may_fault)
00697         mem_fault_routine = NULL;
00698 #endif
00699   return (buf);
00700 }
00701
00702 /* convert the hex array pointed to by buf into binary to be placed in mem */
00703 /* return a pointer to the character AFTER the last byte written */
00704 char *
00705 hex2mem (buf, mem, count, may_fault)
00706          char *buf;
00707          char *mem;
00708          int count;
00709          int may_fault;
00710 {
00711   int i;
00712   unsigned char ch;
00713
00714 #ifdef WIN32 //MF
00715    // MinGW does not support structured exception handling, so let's
00716    // go safe and make memory writable by default
00717   DWORD old_protect;
00718
00719   VirtualProtect(mem, count, PAGE_EXECUTE_READWRITE, &old_protect);
00720 #else
00721   if (may_fault)
00722         mem_fault_routine = set_mem_err;
00723 #endif
00724
00725   for (i = 0; i < count; i++)
00726         {
00727           ch = hex (*buf++) << 4;
00728           ch = ch + hex (*buf++);
00729           set_char (mem++, ch);
00730           if (may_fault && mem_err)
00731                 return (mem);
00732         }
00733
00734 #ifndef WIN32 //MF
00735   if (may_fault)
00736         mem_fault_routine = NULL;
00737 #endif
00738
00739   return (mem);
00740 }
00741
00742 /* this function takes the 386 exception vector and attempts to
00743    translate this number into a unix compatible signal value */
00744 int
00745 computeSignal (int exceptionVector)
00746 {
00747   int sigval;
00748   switch (exceptionVector)
00749         {
00750         case 0:
00751           sigval = 8;
00752           break;                                        /* divide by zero */
00753         case 1:
00754           sigval = 5;
00755           break;                                        /* debug exception */
00756         case 3:
00757           sigval = 5;
00758           break;                                        /* breakpoint */
00759         case 4:
00760           sigval = 16;
00761           break;                                        /* into instruction (overflow) */
00762         case 5:
00763           sigval = 16;
00764           break;                                        /* bound instruction */
00765         case 6:
00766           sigval = 4;
00767           break;                                        /* Invalid opcode */
00768         case 7:
00769           sigval = 8;
00770           break;                                        /* coprocessor not available */
00771         case 8:
00772           sigval = 7;
00773           break;                                        /* double fault */
00774         case 9:
00775           sigval = 11;
00776           break;                                        /* coprocessor segment overrun */
00777         case 10:
00778           sigval = 11;
00779           break;                                        /* Invalid TSS */
00780         case 11:
00781           sigval = 11;
00782           break;                                        /* Segment not present */
00783         case 12:
00784           sigval = 11;
00785           break;                                        /* stack exception */
00786         case 13:
00787           sigval = 11;
00788           break;                                        /* general protection */
00789         case 14:
00790           sigval = 11;
00791           break;                                        /* page fault */
00792         case 16:
00793           sigval = 7;
00794           break;                                        /* coprocessor error */
00795         default:
00796           sigval = 7;                           /* "software generated" */
00797         }
00798   return (sigval);
00799 }
00800
00801 /**********************************************/
00802 /* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */
00803 /* RETURN NUMBER OF CHARS PROCESSED               */
00804 /**********************************************/
00805 int
00806 hexToInt (char **ptr, int *intValue)
00807 {
00808   int numChars = 0;
00809   int hexValue;
00810
00811   *intValue = 0;
00812
00813   while (**ptr)
00814         {
00815           hexValue = hex (**ptr);
00816           if (hexValue >= 0)
00817                 {
00818                   *intValue = (*intValue << 4) | hexValue;
00819                   numChars++;
00820                 }
00821           else
00822                 break;
00823
00824           (*ptr)++;
00825         }
00826
00827   return (numChars);
00828 }
00829
00830 /*
00831  * This function does all command procesing for interfacing to gdb.
00832  */
00833 void
00834 handle_exception (int exceptionVector)
00835 {
00836   int sigval, stepping;
00837   int addr, length;
00838   char *ptr;
00839   int newPC;
00840
00841 #ifndef WIN32 //MF
00842   gdb_i386vector = exceptionVector;
00843 #endif
00844
00845   if (remote_debug)
00846         {
00847           printf ("vector=%d, sr=0x%x, pc=0x%x\n",
00848                           exceptionVector, registers[PS], registers[PC]);
00849         }
00850
00851   /* reply to host that an exception has occurred */
00852   sigval = computeSignal (exceptionVector);
00853
00854   ptr = remcomOutBuffer;
00855
00856   *ptr++ = 'T';                                 /* notify gdb with signo, PC, FP and SP */
00857   *ptr++ = hexchars[sigval >> 4];
00858   *ptr++ = hexchars[sigval & 0xf];
00859
00860   *ptr++ = hexchars[ESP];
00861   *ptr++ = ':';
00862   ptr = mem2hex((char *)&registers[ESP], ptr, 4, 0);    /* SP */
00863   *ptr++ = ';';
00864
00865   *ptr++ = hexchars[EBP];
00866   *ptr++ = ':';
00867   ptr = mem2hex((char *)&registers[EBP], ptr, 4, 0);    /* FP */
00868   *ptr++ = ';';
00869
00870   *ptr++ = hexchars[PC];
00871   *ptr++ = ':';
00872   ptr = mem2hex((char *)&registers[PC], ptr, 4, 0);     /* PC */
00873   *ptr++ = ';';
00874
00875   *ptr = '\0';
00876
00877   putpacket (remcomOutBuffer);
00878
00879   stepping = 0;
00880
00881   while (1 == 1)
00882         {
00883           remcomOutBuffer[0] = 0;
00884           ptr = getpacket ();
00885
00886           switch (*ptr++)
00887                 {
00888                 case '?':
00889                   remcomOutBuffer[0] = 'S';
00890                   remcomOutBuffer[1] = hexchars[sigval >> 4];
00891                   remcomOutBuffer[2] = hexchars[sigval % 16];
00892                   remcomOutBuffer[3] = 0;
00893                   break;
00894                 case 'd':
00895                   remote_debug = !(remote_debug);               /* toggle debug flag */
00896                   break;
00897                 case 'g':                               /* return the value of the CPU registers */
00898                   mem2hex ((char *) registers, remcomOutBuffer, NUMREGBYTES, 0);
00899                   break;
00900                 case 'G':                               /* set the value of the CPU registers - return OK */
00901                   hex2mem (ptr, (char *) registers, NUMREGBYTES, 0);
00902                   strcpy_s(remcomOutBuffer, BUFMAX, "OK");
00903                   break;
00904                 case 'P':                               /* set the value of a single CPU register - return OK */
00905                   {
00906                         int regno;
00907
00908                         if (hexToInt (&ptr, &regno) && *ptr++ == '=')
00909                           if (regno >= 0 && regno < NUMREGS)
00910                                 {
00911                                   hex2mem (ptr, (char *) &registers[regno], 4, 0);
00912                                   strcpy_s(remcomOutBuffer, BUFMAX, "OK");
00913                                   break;
00914                                 }
00915
00916                         strcpy_s(remcomOutBuffer, BUFMAX, "E01");
00917                         break;
00918                   }
00919
00920                   /* mAA..AA,LLLL  Read LLLL bytes at address AA..AA */
00921                 case 'm':
00922                   /* TRY TO READ %x,%x.  IF SUCCEED, SET PTR = 0 */
00923                   if (hexToInt (&ptr, &addr))
00924                         if (*(ptr++) == ',')
00925                           if (hexToInt (&ptr, &length))
00926                                 {
00927                                   ptr = 0;
00928                                   mem_err = 0;
00929                                   mem2hex ((char *) addr, remcomOutBuffer, length, 1);
00930                                   if (mem_err)
00931                                         {
00932                                           strcpy_s(remcomOutBuffer, BUFMAX, "E03");
00933                                           debug_error ("memory fault");
00934                                         }
00935                                 }
00936
00937                   if (ptr)
00938                         {
00939                           strcpy_s(remcomOutBuffer, BUFMAX, "E01");
00940                         }
00941                   break;
00942
00943                   /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
00944                 case 'M':
00945                   /* TRY TO READ '%x,%x:'.      IF SUCCEED, SET PTR = 0 */
00946                   if (hexToInt (&ptr, &addr))
00947                         if (*(ptr++) == ',')
00948                           if (hexToInt (&ptr, &length))
00949                                 if (*(ptr++) == ':')
00950                                   {
00951                                         mem_err = 0;
00952                                         hex2mem (ptr, (char *) addr, length, 1);
00953
00954                                         if (mem_err)
00955                                           {
00956                                                 strcpy_s(remcomOutBuffer, BUFMAX, "E03");
00957                                                 debug_error ("memory fault");
00958                                           }
00959                                         else
00960                                           {
00961                                                 strcpy_s(remcomOutBuffer, BUFMAX, "OK");
00962                                           }
00963
00964                                         ptr = 0;
00965                                   }
00966                   if (ptr)
00967                         {
00968                           strcpy_s(remcomOutBuffer, BUFMAX, "E02");
00969                         }
00970                   break;
00971
00972                   /* cAA..AA    Continue at address AA..AA(optional) */
00973                   /* sAA..AA   Step one instruction from AA..AA(optional) */
00974                 case 's':
00975                   stepping = 1;
00976                 case 'c':
00977                   /* try to read optional parameter, pc unchanged if no parm */
00978                   if (hexToInt (&ptr, &addr))
00979                         registers[PC] = addr;
00980
00981                   newPC = registers[PC];
00982
00983                   /* clear the trace bit */
00984                   registers[PS] &= 0xfffffeff;
00985
00986                   /* set the trace bit if we're stepping */
00987                   if (stepping)
00988                         registers[PS] |= 0x100;
00989
00990 #ifdef WIN32 //MF
00991                   return;
00992 #else
00993                   _returnFromException ();              /* this is a jump */
00994 #endif
00995                   break;
00996
00997                   /* kill the program */
00998                 case 'k':                               /* do nothing */
00999 #if 0
01000                   /* Huh? This doesn't look like "nothing".
01001                          m68k-stub.c and sparc-stub.c don't have it.  */
01002                   BREAKPOINT ();
01003 #endif
01004                   break;
01005                 }                                               /* switch */
01006
01007           /* reply to the request */
01008           putpacket (remcomOutBuffer);
01009         }
01010 }
01011
01012 /* this function is used to set up exception handlers for tracing and
01013    breakpoints */
01014 void
01015 set_debug_traps (void)
01016 {
01017 #ifndef WIN32 //MF
01018   stackPtr = &remcomStack[STACKSIZE / sizeof (int) - 1];
01019
01020   exceptionHandler (0, _catchException0);
01021   exceptionHandler (1, _catchException1);
01022   exceptionHandler (3, _catchException3);
01023   exceptionHandler (4, _catchException4);
01024   exceptionHandler (5, _catchException5);
01025   exceptionHandler (6, _catchException6);
01026   exceptionHandler (7, _catchException7);
01027   exceptionHandler (8, _catchException8);
01028   exceptionHandler (9, _catchException9);
01029   exceptionHandler (10, _catchException10);
01030   exceptionHandler (11, _catchException11);
01031   exceptionHandler (12, _catchException12);
01032   exceptionHandler (13, _catchException13);
01033   exceptionHandler (14, _catchException14);
01034   exceptionHandler (16, _catchException16);
01035 #endif // WIN32
01036
01037   initialized = 1;
01038 }
01039
01040 /* This function will generate a breakpoint exception.  It is used at the
01041    beginning of a program to sync up with a debugger and can be used
01042    otherwise as a quick means to stop program execution and "break" into
01043    the debugger. */
01044
01045 void
01046 breakpoint (void)
01047 {
01048   if (initialized)
01049         BREAKPOINT ();
01050 }
01051
01052
01053
01054  //
01055  // debugger stub implementation for WIN32 applications
01056  // M. Fuchs, 29.11.2003
01057  //
01058
01059 #ifdef WIN32
01060
01061 #include <stdlib.h>
01062 #include <errno.h>
01063
01064 #include "utility/utility.h"
01065
01066
01067 int s_initial_breakpoint = 0;
01068
01069
01070 #ifdef DEBUG_SERIAL
01071
01072 FILE* ser_port = NULL;
01073
01074 int init_gdb_connect()
01075 {
01076                  //TODO: set up connection using serial communication port
01077
01078                 ser_port = fopen("COM1:", "rwb");
01079
01080                 return 1;
01081 }
01082
01083 int getDebugChar()
01084 {
01085                 return fgetc(ser_port);
01086 }
01087
01088 void putDebugChar(int c)
01089 {
01090                 fputc(c, ser_port);
01091 }
01092
01093
01094 #else // DEBUG_SERIAL
01095
01096
01097 static LPTOP_LEVEL_EXCEPTION_FILTER s_prev_exc_handler = 0;
01098
01099
01100 #define I386_EXCEPTION_CNT              17
01101
01102 LONG WINAPI exc_protection_handler(EXCEPTION_POINTERS* exc_info)
01103 {
01104                 int exc_nr = exc_info->ExceptionRecord->ExceptionCode & 0xFFFF;
01105
01106                 if (exc_nr < I386_EXCEPTION_CNT) {
01107                                 //LOG(FmtString(TEXT("exc_protection_handler: Exception %x"), exc_nr));
01108
01109                                 if (exc_nr==11 || exc_nr==13 || exc_nr==14) {
01110                                                 if (mem_fault_routine)
01111                                                                 mem_fault_routine();
01112                                 }
01113
01114                                 ++exc_info->ContextRecord->Eip;
01115                 }
01116
01117                 return EXCEPTION_CONTINUE_EXECUTION;
01118 }
01119
01120 LONG WINAPI exc_handler(EXCEPTION_POINTERS* exc_info)
01121 {
01122                 int exc_nr = exc_info->ExceptionRecord->ExceptionCode & 0xFFFF;
01123
01124                 if (exc_nr < I386_EXCEPTION_CNT) {
01125                                 //LOG(FmtString("Exception %x", exc_nr));
01126                                 //LOG(FmtString("EIP=%08X EFLAGS=%08X", exc_info->ContextRecord->Eip, exc_info->ContextRecord->EFlags));
01127
01128                                  // step over initial breakpoint
01129                                 if (s_initial_breakpoint) {
01130                                                 s_initial_breakpoint = 0;
01131                                                 ++exc_info->ContextRecord->Eip;
01132                                 }
01133
01134                                 SetUnhandledExceptionFilter(exc_protection_handler);
01135
01136                                 win32_exception_handler(exc_info);
01137                                 //LOG(FmtString("EIP=%08X EFLAGS=%08X", exc_info->ContextRecord->Eip, exc_info->ContextRecord->EFlags));
01138
01139                                 SetUnhandledExceptionFilter(exc_handler);
01140
01141                                 return EXCEPTION_CONTINUE_EXECUTION;
01142                 }
01143
01144                 return EXCEPTION_CONTINUE_SEARCH;
01145 }
01146
01147 /* not needed because we use win32_exception_handler() instead of catchExceptionX()
01148 void exceptionHandler(int exc_nr, void* exc_addr)
01149 {
01150                 if (exc_nr>=0 && exc_nr<I386_EXCEPTION_CNT)
01151                                 exc_handlers[exc_nr] = exc_addr;
01152 }
01153 */
01154
01155 void disable_debugging()
01156 {
01157                 if (s_prev_exc_handler) {
01158                                 SetUnhandledExceptionFilter(s_prev_exc_handler);
01159                                 s_prev_exc_handler = 0;
01160                 }
01161 }
01162
01163
01164 #include <winsock.h>
01165 #ifdef _MSC_VER
01166 #pragma comment(lib, "wsock32")
01167 #endif
01168
01169 static int s_rem_fd = -1;
01170
01171 int init_gdb_connect()
01172 {
01173                 SOCKADDR_IN srv_addr = {0};
01174                 SOCKADDR_IN rem_addr;
01175                 WSADATA wsa_data;
01176                 int srv_socket, rem_len;
01177
01178                 s_prev_exc_handler = SetUnhandledExceptionFilter(exc_handler);
01179
01180                 if (WSAStartup(MAKEWORD(2,2), &wsa_data)) {
01181                                 fprintf(stderr, "WSAStartup() failed");
01182                                 return 0;
01183                 }
01184
01185                 srv_addr.sin_family = AF_INET;
01186                 srv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
01187                 srv_addr.sin_port = htons(9999);
01188
01189                 srv_socket = socket(PF_INET, SOCK_STREAM, 0);
01190                 if (srv_socket == -1) {
01191                                 perror("socket()");
01192                                 return 0;
01193                 }
01194
01195                 if (bind(srv_socket, (struct sockaddr*) &srv_addr, sizeof(srv_addr)) == -1) {
01196                                 perror("bind()");
01197                                 return 0;
01198                 }
01199
01200                 if (listen(srv_socket, 4) == -1) {
01201                                 perror("listen()");
01202                                 return 0;
01203                 }
01204
01205                 rem_len = sizeof(rem_addr);
01206
01207                 for(;;) {
01208                                 s_rem_fd = accept(srv_socket, (struct sockaddr*)&rem_addr, &rem_len);
01209
01210                                 if (s_rem_fd < 0) {
01211                                                 if (errno == EINTR)
01212                                                                 continue;
01213
01214                                                 perror("accept()");
01215                                                 return 0;
01216                                 }
01217
01218                                 break;
01219                 }
01220
01221                 return 1;
01222 }
01223
01224 #endif // DEBUG_SERIAL
01225
01226
01227 int getDebugChar()
01228 {
01229                 char buffer[1024];
01230                 int r;
01231
01232                 if (s_rem_fd == -1)
01233                                 return EOF;
01234
01235                 r = recv(s_rem_fd, buffer, 1, 0);
01236                 if (r == -1) {
01237                                 perror("recv()");
01238                                 LOG(TEXT("debugger connection broken"));
01239                                 s_rem_fd = -1;
01240                                 return EOF;
01241                 }
01242
01243                 if (!r)
01244                                 return EOF;
01245
01246                 return buffer[0];
01247 }
01248
01249 void putDebugChar(int c)
01250 {
01251                 if (s_rem_fd != -1) {
01252                                 const char buffer[] = {c};
01253
01254                                 if (!send(s_rem_fd, buffer, 1, 0)) {
01255                                                 perror("send()");
01256                                                 LOG(TEXT("debugger connection broken"));
01257                                                 exit(-1);
01258                                 }
01259                 }
01260 }
01261
01262
01263  // start up GDB stub interface
01264
01265 int initialize_gdb_stub()
01266 {
01267                 if (!init_gdb_connect())
01268                                 return 0;
01269
01270                 set_debug_traps();
01271
01272                 s_initial_breakpoint = 1;
01273                 breakpoint();
01274
01275                 return 1;
01276 }
01277
01278 #endif // WIN32


ROS Explorer: mainframe.cpp File Reference

  • File List
  • File Members
shell

mainframe.cpp File Reference

#include <precomp.h>
#include "../resource.h"
#include "../dialogs/settings.h"

Include dependency graph for mainframe.cpp:

Go to the source code of this file.

Defines

#define | RBBS_HIDETITLE 0x400

Functions

HWND | create_webchildwindow (const WebChildWndInfo &info)

Define Documentation

#define RBBS_HIDETITLE 0x400

Referenced by DesktopBar::Init(), MainFrameBase::MainFrameBase(), and MDIMainFrame::MDIMainFrame().

Function Documentation

HWND create_webchildwindow ( const WebChildWndInfo & info )

Definition at line 195 of file webchild.cpp.

References WebChildWindow::create().

Referenced by MDIMainFrame::WndProc().

00196 {
00197         WebChildWindow* pWnd = WebChildWindow::create(info);
00198
00199         if (!pWnd)
00200                 return 0;
00201
00202         return *pWnd;
00203 }

Here is the call graph for this function:


ROS Explorer: mainframe.cpp Source File

  • File List
  • File Members
shell

mainframe.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // mainframe.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 /* We can't include webchild.h here - otherwise MinGW produces errors like: "multiple definition of `QACONTAINERFLAGS'"
00032 #include "webchild.h"
00033 */
00034 extern HWND create_webchildwindow(const WebChildWndInfo& info);
00035
00036 #include "../resource.h"
00037
00038 #include "../dialogs/settings.h"        // for MdiSdiDlg
00039
00040
00041 HWND MainFrameBase::Create(const ExplorerCmd& cmd)
00042 {
00043         HWND hFrame;
00044
00045 #ifndef _NO_MDI
00046         if (cmd._mdi)
00047                 hFrame = MDIMainFrame::Create();
00048         else
00049 #endif
00050                 hFrame = SDIMainFrame::Create();
00051
00052         if (hFrame) {
00053                 HWND hwndOld = g_Globals._hMainWnd;
00054
00055                 g_Globals._hMainWnd = hFrame;
00056
00057                 if (hwndOld)
00058                         DestroyWindow(hwndOld);
00059
00060                 ShowWindow(hFrame, cmd._cmdShow);
00061                 UpdateWindow(hFrame);
00062
00063                  // Open the first child window after initializing the application
00064                 if (cmd.IsValidPath()) {
00065                          // We use the static s_path variable to store the path string in order
00066                          // to avoid accessing prematurely freed memory in the PostMessage handlers.
00067                         static String s_path = cmd._path;
00068
00069                         PostMessage(hFrame, PM_OPEN_WINDOW, cmd._flags, (LPARAM)(LPCTSTR)s_path);
00070                 } else
00071                         PostMessage(hFrame, PM_OPEN_WINDOW, OWM_EXPLORE|OWM_DETAILS, 0);
00072         }
00073
00074         return hFrame;
00075 }
00076
00077
00078 int MainFrameBase::OpenShellFolders(LPIDA pida, HWND hFrameWnd)
00079 {
00080         int cnt = 0;
00081
00082         LPCITEMIDLIST parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
00083         ShellFolder folder(parent_pidl);
00084         LOG(FmtString(TEXT("MainFrameBase::OpenShellFolders(): parent_pidl=%s"), (LPCTSTR)FileSysShellPath(parent_pidl)));
00085
00086         for(int i=pida->cidl; i>0; --i) {
00087                 LPCITEMIDLIST pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i]);
00088
00089                 SFGAOF attribs = SFGAO_FOLDER;
00090                 HRESULT hr = folder->GetAttributesOf(1, &pidl, &attribs);
00091
00092                 if (SUCCEEDED(hr))
00093                         if (attribs & SFGAO_FOLDER) {
00094                                 try {
00095                                         XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
00096
00097                                         bool mdi = XMLBool(explorer_options, "mdi", true);
00098                                         bool separateFolders = XMLBool(explorer_options, "separate-folders", true);
00099
00100                                         ShellPath pidl_abs = ShellPath(pidl).create_absolute_pidl(parent_pidl);
00101                                         LOG(FmtString(TEXT("MainFrameBase::OpenShellFolders(): pidl_abs=%s"), (LPCTSTR)FileSysShellPath(pidl_abs)));
00102
00103                                         if (hFrameWnd && (mdi || !separateFolders)) {
00104                                                 int flags = OWM_PIDL;
00105
00106                                                 if (separateFolders)
00107                                                         flags |= OWM_SEPARATE;
00108
00109                                                 if (SendMessage(hFrameWnd, PM_OPEN_WINDOW, flags, (LPARAM)(LPCITEMIDLIST)pidl_abs))
00110                                                         ++cnt;
00111                                         } else {
00112                                                 HWND hwnd;
00113 #ifndef _NO_MDI
00114                                                 if (mdi)
00115                                                         hwnd = MDIMainFrame::Create(pidl_abs, 0);
00116                                                 else
00117 #endif
00118                                                         hwnd = SDIMainFrame::Create(pidl_abs, 0);
00119
00120                                                 if (hwnd)
00121                                                         ++cnt;
00122                                         }
00123                                 } catch(COMException& e) {
00124                                         HandleException(e, g_Globals._hMainWnd);
00125                                 }
00126                         }/*TEST
00127                         else { // !(attribs & SFGAO_FOLDER))
00128                                 SHELLEXECUTEINFOA shexinfo;
00129
00130                                 shexinfo.cbSize = sizeof(SHELLEXECUTEINFOA);
00131                                 shexinfo.fMask = SEE_MASK_INVOKEIDLIST;
00132                                 shexinfo.hwnd = NULL;
00133                                 shexinfo.lpVerb = NULL;
00134                                 shexinfo.lpFile = NULL;
00135                                 shexinfo.lpParameters = NULL;
00136                                 shexinfo.lpDirectory = NULL;
00137                                 shexinfo.nShow = SW_NORMAL;
00138                                 shexinfo.lpIDList = ILCombine(parent_pidl, pidl);
00139
00140                                 if (ShellExecuteExA(&shexinfo))
00141                                         ++cnt;
00142
00143                                 ILFree((LPITEMIDLIST)shexinfo.lpIDList);
00144                         }*/
00145         }
00146
00147         return cnt;
00148 }
00149
00150
00151 MainFrameBase::MainFrameBase(HWND hwnd)
00152  :      super(hwnd)
00153 {
00154         _himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0);
00155
00156         _hMenuFrame = GetMenu(hwnd);
00157         _hMenuWindow = GetSubMenu(_hMenuFrame, GetMenuItemCount(_hMenuFrame)-3);
00158
00159         _menu_info._hMenuView = GetSubMenu(_hMenuFrame, 1);
00160
00161         _hAccel = LoadAccelerators(g_Globals._hInstance, MAKEINTRESOURCE(IDA_EXPLORER));
00162
00163
00164         TBBUTTON toolbarBtns[] = {
00165 #ifdef _NO_REBAR
00166                 {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
00167 #endif
00168                 {7, ID_GO_BACK, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00169                 {8, ID_GO_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00170                 {9, ID_GO_UP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00171                 {10, ID_GO_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00172                 {11, ID_GO_SEARCH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00173                 {12, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00174                 {13, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}
00175         };
00176
00177         _htoolbar = CreateToolbarEx(hwnd,
00178 #ifndef _NO_REBAR
00179                 CCS_NOPARENTALIGN|CCS_NORESIZE|
00180 #endif
00181                 WS_CHILD|WS_VISIBLE, IDW_TOOLBAR, 2, g_Globals._hInstance, IDB_TOOLBAR,
00182                 toolbarBtns, sizeof(toolbarBtns)/sizeof(TBBUTTON),
00183                 16, 15, 16, 15, sizeof(TBBUTTON));
00184
00185         CheckMenuItem(_menu_info._hMenuView, ID_VIEW_TOOL_BAR, MF_BYCOMMAND|MF_CHECKED);
00186
00187
00188          // address & command bar
00189         WindowCanvas canvas(hwnd);
00190         RECT rect = {0, 0, 0, 0};
00191         DrawText(canvas, TEXT("My"), -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
00192         HFONT hfont = GetStockFont(DEFAULT_GUI_FONT);
00193
00194         _haddressedit = CreateWindow(TEXT("EDIT"), NULL, WS_CHILD|WS_VISIBLE, 0, 0, 0, rect.bottom,
00195                                                         hwnd, (HMENU)IDW_ADDRESSBAR, g_Globals._hInstance, 0);
00196         SetWindowFont(_haddressedit, hfont, FALSE);
00197         new EditController(_haddressedit);
00198
00199         _hcommandedit = CreateWindow(TEXT("EDIT"), TEXT("> "), WS_CHILD|WS_VISIBLE, 0, 0, 0, rect.bottom,
00200                                                         hwnd, (HMENU)IDW_COMMANDBAR, g_Globals._hInstance, 0);
00201         SetWindowFont(_hcommandedit, hfont, FALSE);
00202         new EditController(_hcommandedit);
00203
00204         /* CreateStatusWindow does not accept WS_BORDER
00205                 _hstatusbar = CreateWindowEx(WS_EX_NOPARENTNOTIFY, STATUSCLASSNAME, 0,
00206                                                 WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_BORDER|CCS_NODIVIDER, 0,0,0,0,
00207                                                 hwnd, (HMENU)IDW_STATUSBAR, g_Globals._hInstance, 0);*/
00208
00209         _hstatusbar = CreateStatusWindow(WS_CHILD|WS_VISIBLE, 0, hwnd, IDW_STATUSBAR);
00210         CheckMenuItem(_menu_info._hMenuView, ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
00211
00212         _hsidebar = CreateWindowEx(WS_EX_STATICEDGE, WC_TREEVIEW, TEXT("Sidebar"),
00213                                         WS_CHILD|WS_TABSTOP|WS_BORDER|/*WS_VISIBLE|*/WS_CHILD|TVS_HASLINES|TVS_HASBUTTONS|TVS_SHOWSELALWAYS|TVS_INFOTIP,
00214                                         -1, -1, 200, 0, _hwnd, (HMENU)IDW_SIDEBAR, g_Globals._hInstance, 0);
00215
00216         _himl_old = TreeView_SetImageList(_hsidebar, _himl, TVSIL_NORMAL);
00217
00218         CheckMenuItem(_menu_info._hMenuView, ID_VIEW_SIDE_BAR, MF_BYCOMMAND|MF_UNCHECKED/*MF_CHECKED*/);
00219
00220
00221          // create rebar window to manage toolbar and drivebar
00222 #ifndef _NO_REBAR
00223         _hwndrebar = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL,
00224                                         WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
00225                                         RBS_VARHEIGHT|RBS_AUTOSIZE|RBS_DBLCLKTOGGLE|
00226                                         CCS_NODIVIDER|CCS_NOPARENTALIGN,
00227                                         0, 0, 0, 0, _hwnd, 0, g_Globals._hInstance, 0);
00228
00229         int btn_hgt = HIWORD(SendMessage(_htoolbar, TB_GETBUTTONSIZE, 0, 0));
00230
00231         REBARBANDINFO rbBand;
00232
00233         rbBand.cbSize = sizeof(REBARBANDINFO);
00234         rbBand.fMask  = RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE;
00235 #ifndef RBBS_HIDETITLE // missing in MinGW headers as of 25.02.2004
00236 #define RBBS_HIDETITLE  0x400
00237 #endif
00238         rbBand.fStyle = RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE;
00239
00240         rbBand.cxMinChild = 0;
00241         rbBand.cyMinChild = 0;
00242         rbBand.cyChild = 0;
00243         rbBand.cyMaxChild = 0;
00244         rbBand.cyIntegral = btn_hgt;
00245
00246         rbBand.lpText = NULL;//TEXT("Toolbar");
00247         rbBand.hwndChild = _htoolbar;
00248         rbBand.cxMinChild = 0;
00249         rbBand.cyMinChild = btn_hgt + 4;
00250         rbBand.cx = 284;
00251         SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
00252 #endif
00253 }
00254
00255
00256 MainFrameBase::~MainFrameBase()
00257 {
00258         (void)TreeView_SetImageList(_hsidebar, _himl_old, TVSIL_NORMAL);
00259         ImageList_Destroy(_himl);
00260
00261          // don't exit desktop when closing file manager window
00262         if (!g_Globals._desktop_mode)
00263                 if (g_Globals._hMainWnd == _hwnd)       // don't quit when switching between MDI and SDI mode
00264                         PostQuitMessage(0);
00265 }
00266
00267
00268 LRESULT MainFrameBase::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00269 {
00270         LRESULT res;
00271
00272         if (ProcessMessage(nmsg, wparam, lparam, &res))
00273                 return res;
00274         else
00275                 return super::WndProc(nmsg, wparam, lparam);
00276 }
00277
00278 bool MainFrameBase::ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT* pres)
00279 {
00280         switch(nmsg) {
00281           case PM_TRANSLATE_MSG:
00282                 *pres = TranslateMsg((MSG*)lparam);
00283                 return true;
00284
00285           case WM_SHOWWINDOW:
00286                 if (wparam)     // trigger child resizing after window creation - now we can succesfully call IsWindowVisible()
00287                         resize_frame_client();
00288                 return false; // goto def;
00289
00290           case WM_CLOSE:
00291                 DestroyWindow(_hwnd);
00292                 g_Globals._hMainWnd = 0;
00293                 break;
00294
00295           case WM_DESTROY:
00296                 break;
00297
00298           case WM_SIZE:
00299                 resize_frame(LOWORD(lparam), HIWORD(lparam));
00300                 break;  // do not pass message to DefFrameProc
00301
00302           case WM_GETMINMAXINFO: {
00303                 LPMINMAXINFO lpmmi = (LPMINMAXINFO)lparam;
00304
00305                 lpmmi->ptMaxTrackSize.x <<= 1;/*2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN */
00306                 lpmmi->ptMaxTrackSize.y <<= 1;/*2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN */
00307                 break;}
00308
00309           case PM_FRM_CALC_CLIENT:
00310                 frame_get_clientspace((PRECT)lparam);
00311                 *pres = TRUE;
00312                 return true;
00313
00314           case PM_FRM_GET_MENUINFO:
00315                 *pres = (LPARAM)&_menu_info;
00316                 return true;
00317
00318           case PM_GET_CONTROLWINDOW:
00319                 if (wparam == FCW_STATUS) {
00320                         *pres = (LRESULT)(HWND)_hstatusbar;
00321                         return true;
00322                 }
00323                 break;
00324
00325           case PM_SETSTATUSTEXT:
00326                 SendMessage(_hstatusbar, SB_SETTEXT, 0, lparam);
00327                 break;
00328
00329           case PM_URL_CHANGED:
00330                 SetWindowText(_haddressedit, (LPCTSTR)lparam);
00331                 break;
00332
00333           default:
00334                 return false;
00335         }
00336
00337         *pres = 0;
00338         return true;
00339 }
00340
00341 BOOL MainFrameBase::TranslateMsg(MSG* pmsg)
00342 {
00343         if (TranslateAccelerator(_hwnd, _hAccel, pmsg))
00344                 return TRUE;
00345
00346         return FALSE;
00347 }
00348
00349
00350 int MainFrameBase::Command(int id, int code)
00351 {
00352         CONTEXT("MainFrameBase::Command()");
00353
00354         switch(id) {
00355           case ID_FILE_EXIT:
00356                 SendMessage(_hwnd, WM_CLOSE, 0, 0);
00357                 break;
00358
00359           case ID_VIEW_TOOL_BAR:
00360                 toggle_child(_hwnd, id, _htoolbar, 0);
00361                 break;
00362
00363           case ID_VIEW_STATUSBAR:
00364                 toggle_child(_hwnd, id, _hstatusbar);
00365                 break;
00366
00367           case ID_VIEW_SIDE_BAR:
00368                  // lazy initialization
00369                 if (!TreeView_GetCount(_hsidebar))
00370                         FillBookmarks();
00371
00372                 toggle_child(_hwnd, id, _hsidebar);
00373                 break;
00374
00375           case ID_EXECUTE: {
00376                 ExecuteDialog dlg = {{0}, 0};
00377
00378                 if (DialogBoxParam(g_Globals._hInstance, MAKEINTRESOURCE(IDD_EXECUTE), _hwnd, ExecuteDialog::WndProc, (LPARAM)&dlg) == IDOK) {
00379                         CONTEXT("ID_EXECUTE - ShellExecute()");
00380
00381                         HINSTANCE hinst = ShellExecute(_hwnd, NULL/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow);
00382
00383                         if ((int)hinst <= 32)
00384                                 display_error(_hwnd, GetLastError());
00385                 }
00386                 break;}
00387
00388           case ID_HELP:
00389                 WinHelp(_hwnd, TEXT("explorer")/*file explorer.hlp*/, HELP_INDEX, 0);
00390                 break;
00391
00392           case ID_VIEW_FULLSCREEN:
00393                 CheckMenuItem(_menu_info._hMenuView, id, toggle_fullscreen()?MF_CHECKED:0);
00394                 break;
00395
00396           case ID_TOOLS_OPTIONS:
00397                 Dialog::DoModal(IDD_MDI_SDI, WINDOW_CREATOR(MdiSdiDlg), _hwnd);
00398                 break;
00399
00400           case ID_ABOUT_WINDOWS:
00401                 ShellAbout(_hwnd, ResString(IDS_TITLE), NULL, 0);
00402                 break;
00403
00404           case ID_ABOUT_EXPLORER:
00405                 explorer_about(_hwnd);
00406                 break;
00407
00408           case ID_EXPLORER_FAQ:
00409                 launch_file(_hwnd, TEXT("http://www.sky.franken.de/explorer/"), SW_SHOW);
00410                 break;
00411
00412           case IDW_ADDRESSBAR:
00413                 if (code == 1) {
00414                         TCHAR url[BUFFER_LEN];
00415
00416                         if (GetWindowText(_haddressedit, url, BUFFER_LEN))
00417                                 go_to(url, false);
00418                 }
00419                 break;
00420
00421           case IDW_COMMANDBAR:
00422                 if (code == 1)
00423                         ExecuteCommandbar(NULL);
00424                 break;
00425
00426           default:
00427                 return 1;       // no command handlers in Window::Command()
00428         }
00429
00430         return 0;
00431 }
00432
00433
00434 void MainFrameBase::ExecuteCommandbar(LPCTSTR dir)
00435 {
00436         TCHAR cmd[BUFFER_LEN];
00437
00438         if (GetWindowText(_hcommandedit, cmd, BUFFER_LEN)) {
00439                 CONTEXT("ExecuteCommandbar - ShellExecute()");
00440
00441                  // remove command prompt from 'cmd' string
00442                 LPCTSTR p = cmd;
00443
00444                 if (*p == '>')
00445                         ++p;
00446
00447                 while(*p == ' ')
00448                         ++p;
00449
00450                 if (dir) {
00451                          // remove "file://" from directory URL
00452                         if (!_tcsnicmp(dir, TEXT("file://"), 7))
00453                                 dir += 7;
00454                 }
00455
00457
00458                 HINSTANCE hinst = ShellExecute(_hwnd, NULL, p, NULL, dir, SW_SHOWNORMAL);
00459
00460                 if ((int)hinst <= 32)
00461                         display_error(_hwnd, GetLastError());
00462         }
00463 }
00464
00465
00466 int MainFrameBase::Notify(int id, NMHDR* pnmh)
00467 {
00468         switch(pnmh->code) {
00469                  // resize children windows when the rebar size changes
00470           case RBN_AUTOSIZE:
00471                 resize_frame_client();
00472                 break;
00473
00474           case TVN_GETINFOTIP: {
00475                 NMTVGETINFOTIP* pnmgit = (NMTVGETINFOTIP*)pnmh;
00476
00477                 if (pnmgit->lParam) {
00478                         const BookmarkNode& node = *(BookmarkNode*)pnmgit->lParam;
00479
00480                         if (node._type == BookmarkNode::BMNT_FOLDER) {
00481                                  // display tooltips for bookmark folders
00482                                 if (!node._pfolder->_description.empty())
00483                                         lstrcpyn(pnmgit->pszText, node._pfolder->_description.c_str(), pnmgit->cchTextMax);
00484                         } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
00485                                  // display tooltips for bookmark folders
00486                                 String txt = node._pbookmark->_description;
00487
00488                                 if (!node._pbookmark->_url.empty()) {
00489                                         if (!txt.empty())
00490                                                 txt += TEXT("  -  ");
00491
00492                                         txt += node._pbookmark->_url;
00493                                 }
00494
00495                                 lstrcpyn(pnmgit->pszText, txt.c_str(), pnmgit->cchTextMax);
00496                         }
00497                 }
00498                 break;}
00499
00500           case NM_DBLCLK: {
00501                 HTREEITEM hitem = TreeView_GetSelection(_hsidebar);
00502                 LPARAM lparam = TreeView_GetItemData(_hsidebar, hitem);
00503
00504                 if (lparam) {
00505                         const BookmarkNode& node = *(BookmarkNode*)lparam;
00506
00507                         if (node._type == BookmarkNode::BMNT_BOOKMARK) {
00508                                 bool new_window = GetAsyncKeyState(VK_SHIFT)<0;
00509
00510                                 go_to(node._pbookmark->_url, new_window);
00511                         }
00512                 }
00513                 break;}
00514         }
00515
00516         return 0;
00517 }
00518
00519
00520 void MainFrameBase::resize_frame(int cx, int cy)
00521 {
00522         if (cy <= 0)
00523                 return; // avoid resizing children when receiving RBN_AUTOSIZE while getting minimized
00524
00525         RECT rect = {0, 0, cx, cy};
00526
00527         if (_hwndrebar) {
00528                 int height = ClientRect(_hwndrebar).bottom;
00529                 MoveWindow(_hwndrebar, rect.left, rect.top, rect.right-rect.left, height, TRUE);
00530                 rect.top += height;
00531         } else {
00532                 if (IsWindowVisible(_htoolbar)) {
00533                         SendMessage(_htoolbar, WM_SIZE, 0, 0);
00534                         WindowRect rt(_htoolbar);
00535                         rect.top = rt.bottom;
00536                 //      rect.bottom -= rt.bottom;
00537                 }
00538         }
00539
00540         if (IsWindowVisible(_hstatusbar)) {
00541                 int parts[] = {300, 500};
00542
00543                 SendMessage(_hstatusbar, WM_SIZE, 0, 0);
00544                 SendMessage(_hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
00545                 ClientRect rt(_hstatusbar);
00546                 rect.bottom -= rt.bottom;
00547         }
00548
00549         if (IsWindowVisible(_haddressedit) || IsWindowVisible(_hcommandedit)) {
00550                 ClientRect rt(_haddressedit);
00551                 rect.bottom -= rt.bottom;
00552
00553                 int mid = (rect.right-rect.left) / 2;
00554                 SetWindowPos(_haddressedit, 0, 0, rect.bottom, mid, rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
00555                 SetWindowPos(_hcommandedit, 0, mid+1, rect.bottom, rect.right-(mid+1), rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
00556         }
00557
00558         if (IsWindowVisible(_hsidebar)) {
00559                 WindowRect rt(_hsidebar);
00560                 rect.left += rt.right-rt.left;
00561
00562                 SetWindowPos(_hsidebar, 0, -1, rect.top-1, rt.right-rt.left, rect.bottom-rect.top+1, SWP_NOACTIVATE|SWP_NOZORDER);
00563         }
00564 }
00565
00566 void MainFrameBase::resize_frame_client()
00567 {
00568         ClientRect rect(_hwnd);
00569
00570         resize_frame(rect.right, rect.bottom);
00571 }
00572
00573 void MainFrameBase::frame_get_clientspace(PRECT prect)
00574 {
00575         if (!IsIconic(_hwnd))
00576                 GetClientRect(_hwnd, prect);
00577         else {
00578                 WINDOWPLACEMENT wp;
00579
00580                 GetWindowPlacement(_hwnd, &wp);
00581
00582                 prect->left = prect->top = 0;
00583                 prect->right = wp.rcNormalPosition.right-wp.rcNormalPosition.left-
00584                                                 2*(GetSystemMetrics(SM_CXSIZEFRAME)+GetSystemMetrics(SM_CXEDGE));
00585                 prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top-
00586                                                 2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))-
00587                                                 GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE);
00588         }
00589
00590         if (IsWindowVisible(_htoolbar)) {
00591                 ClientRect rt(_htoolbar);
00592                 prect->top += rt.bottom+2;
00593         }
00594
00595         if (IsWindowVisible(_hstatusbar)) {
00596                 ClientRect rt(_hstatusbar);
00597                 prect->bottom -= rt.bottom;
00598         }
00599 }
00600
00601 BOOL MainFrameBase::toggle_fullscreen()
00602 {
00603         RECT rt;
00604
00605         if ((_fullscreen._mode=!_fullscreen._mode)) {
00606                 GetWindowRect(_hwnd, &_fullscreen._orgPos);
00607                 _fullscreen._wasZoomed = IsZoomed(_hwnd);
00608
00609                 Frame_CalcFrameClient(_hwnd, &rt);
00610                 ClientToScreen(_hwnd, (LPPOINT)&rt.left);
00611                 ClientToScreen(_hwnd, (LPPOINT)&rt.right);
00612
00613                 rt.left = _fullscreen._orgPos.left-rt.left;
00614                 rt.top = _fullscreen._orgPos.top-rt.top;
00615                 rt.right = GetSystemMetrics(SM_CXSCREEN)+_fullscreen._orgPos.right-rt.right;
00616                 rt.bottom = GetSystemMetrics(SM_CYSCREEN)+_fullscreen._orgPos.bottom-rt.bottom;
00617
00618                 MoveWindow(_hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
00619         } else {
00620                 MoveWindow(_hwnd, _fullscreen._orgPos.left, _fullscreen._orgPos.top,
00621                                                         _fullscreen._orgPos.right-_fullscreen._orgPos.left,
00622                                                         _fullscreen._orgPos.bottom-_fullscreen._orgPos.top, TRUE);
00623
00624                 if (_fullscreen._wasZoomed)
00625                         ShowWindow(_hwnd, WS_MAXIMIZE);
00626         }
00627
00628         return _fullscreen._mode;
00629 }
00630
00631 void MainFrameBase::fullscreen_move()
00632 {
00633         RECT rt, pos;
00634         GetWindowRect(_hwnd, &pos);
00635
00636         Frame_CalcFrameClient(_hwnd, &rt);
00637         ClientToScreen(_hwnd, (LPPOINT)&rt.left);
00638         ClientToScreen(_hwnd, (LPPOINT)&rt.right);
00639
00640         rt.left = pos.left-rt.left;
00641         rt.top = pos.top-rt.top;
00642         rt.right = GetSystemMetrics(SM_CXSCREEN)+pos.right-rt.right;
00643         rt.bottom = GetSystemMetrics(SM_CYSCREEN)+pos.bottom-rt.bottom;
00644
00645         MoveWindow(_hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
00646 }
00647
00648
00649 void MainFrameBase::toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx)
00650 {
00651         BOOL vis = IsWindowVisible(hchild);
00652
00653         CheckMenuItem(_menu_info._hMenuView, cmd, vis?MF_BYCOMMAND:MF_BYCOMMAND|MF_CHECKED);
00654
00655         if (band_idx != -1)
00656                 SendMessage(_hwndrebar, RB_SHOWBAND, band_idx, !vis);
00657         else
00658                 ShowWindow(hchild, vis? SW_HIDE: SW_SHOW);
00659
00660         if (_fullscreen._mode)
00661                 fullscreen_move();
00662
00663         resize_frame_client();
00664 }
00665
00666 void MainFrameBase::FillBookmarks()
00667 {
00668         HiddenWindow hide(_hsidebar);
00669         WindowCanvas canvas(_hwnd);
00670
00671         TreeView_DeleteAllItems(_hsidebar);
00672
00673         g_Globals._icon_cache.get_icon(ICID_FAVORITES).add_to_imagelist(_himl, canvas);
00674         g_Globals._icon_cache.get_icon(ICID_BOOKMARK).add_to_imagelist(_himl, canvas);
00675         ImageList_AddAlphaIcon(_himl, SmallIcon(IDI_DOT), GetStockBrush(WHITE_BRUSH), canvas);
00676         g_Globals._icon_cache.get_icon(ICID_FOLDER).add_to_imagelist(_himl, canvas);
00677         g_Globals._icon_cache.get_icon(ICID_FOLDER).add_to_imagelist(_himl, canvas);
00678
00679         TV_INSERTSTRUCT tvi;
00680
00681         tvi.hParent = TVI_ROOT;
00682         tvi.hInsertAfter = TVI_LAST;
00683         tvi.item.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
00684         ResString sFavorites(IDS_FAVORITES);
00685         tvi.item.pszText = sFavorites.str();
00686         tvi.item.iSelectedImage = tvi.item.iImage = 0;
00687
00688         HTREEITEM hitem_bookmarks = TreeView_InsertItem(_hsidebar, &tvi);
00689
00690         g_Globals._favorites.fill_tree(_hsidebar, hitem_bookmarks, _himl, canvas);
00691
00692         TreeView_Expand(_hsidebar, hitem_bookmarks, TVE_EXPAND);
00693 }
00694
00695
00696 bool MainFrameBase::go_to(LPCTSTR url, bool new_window)
00697 {
00699
00700         return false;
00701 }
00702
00703
00704 #ifndef _NO_MDI
00705
00706 MDIMainFrame::MDIMainFrame(HWND hwnd)
00707  :      super(hwnd)
00708 {
00709         TBBUTTON mdiBtns[] = {
00710                 {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
00711                 {0, ID_WINDOW_NEW, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00712                 {1, ID_WINDOW_CASCADE, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00713                 {2, ID_WINDOW_TILE_HORZ, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00714                 {3, ID_WINDOW_TILE_VERT, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}
00715         };
00716
00717         SendMessage(_htoolbar, TB_ADDBUTTONS, sizeof(mdiBtns)/sizeof(TBBUTTON), (LPARAM)&mdiBtns);
00718
00719         CLIENTCREATESTRUCT ccs;
00720
00721         ccs.hWindowMenu = _hMenuWindow;
00722         ccs.idFirstChild = IDW_FIRST_CHILD;
00723
00724         _hmdiclient = CreateWindowEx(0, TEXT("MDICLIENT"), NULL,
00725                                         WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|WS_HSCROLL|WS_VISIBLE|WS_BORDER,
00726                                         0, 0, 0, 0,
00727                                         hwnd, 0, g_Globals._hInstance, &ccs);
00728
00729         TBBUTTON extraBtns = {0, 0, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
00730
00731 #ifndef _NO_REBAR
00732         _hextrabar = CreateToolbarEx(hwnd,
00733                                 CCS_NOPARENTALIGN|CCS_NORESIZE|
00734                                 WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
00735                                 IDW_EXTRABAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, NULL, 0,
00736                                 16, 13, 16, 13, sizeof(TBBUTTON));
00737 #else
00738         _hextrabar = CreateToolbarEx(hwnd,
00739                                 WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
00740                                 IDW_EXTRABAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, &extraBtns, 1,
00741                                 16, 13, 16, 13, sizeof(TBBUTTON));
00742 #endif
00743
00744         CheckMenuItem(_menu_info._hMenuView, ID_VIEW_EXTRA_BAR, MF_BYCOMMAND|MF_CHECKED);
00745
00746
00747         extraBtns.fsStyle = BTNS_BUTTON;
00748
00749 #ifdef __WINE__
00750          // insert unix file system button
00751         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("/\0"));
00752         extraBtns.idCommand = ID_DRIVE_UNIX_FS;
00753         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00754 #endif
00755
00756          // insert explorer window button
00757         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Explore\0"));
00758         extraBtns.idCommand = ID_DRIVE_DESKTOP;
00759         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00760
00761          // insert shell namespace button
00762         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Shell\0"));
00763         extraBtns.idCommand = ID_DRIVE_SHELL_NS;
00764         extraBtns.iBitmap = 6;
00765         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00766
00767          // insert web control button
00768         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Web\0"));
00769         extraBtns.idCommand = ID_WEB_WINDOW;
00770         extraBtns.iBitmap = 7;
00771         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00772
00773         if ((HIWORD(GetVersion())>>14) == W_VER_NT) {
00774                  // insert NT object namespace button
00775                 extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("NT Obj\0"));
00776                 extraBtns.idCommand = ID_DRIVE_NTOBJ_NS;
00777                 extraBtns.iBitmap = 8;
00778                 SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00779         }
00780
00781          // insert Registry button
00782         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Reg.\0"));
00783         extraBtns.idCommand = ID_DRIVE_REGISTRY;
00784         extraBtns.iBitmap = 9;
00785         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00786
00787 #ifdef _DEBUG
00788          // insert FAT direct file system access button
00789         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("FAT\0"));
00790         extraBtns.idCommand = ID_DRIVE_FAT;
00791         extraBtns.iBitmap = 10;
00792         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00793 #endif
00794
00795
00796         TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
00797         PTSTR p;
00798
00799 #ifndef _NO_REBAR
00800         _hdrivebar = CreateToolbarEx(hwnd,
00801                                 CCS_NOPARENTALIGN|CCS_NORESIZE|
00802                                 WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
00803                                 IDW_DRIVEBAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, NULL, 0,
00804                                 16, 13, 16, 13, sizeof(TBBUTTON));
00805 #else
00806         _hdrivebar = CreateToolbarEx(hwnd,
00807                                 WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
00808                                 IDW_DRIVEBAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, &drivebarBtn, 1,
00809                                 16, 13, 16, 13, sizeof(TBBUTTON));
00810 #endif
00811
00812         CheckMenuItem(_menu_info._hMenuView, ID_VIEW_DRIVE_BAR, MF_BYCOMMAND|MF_CHECKED);
00813
00814
00815         GetLogicalDriveStrings(BUFFER_LEN, _drives);
00816
00817          // register windows drive root strings
00818         SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)_drives);
00819
00820         drivebarBtn.fsStyle = BTNS_BUTTON;
00821         drivebarBtn.idCommand = ID_DRIVE_FIRST;
00822
00823         for(p=_drives; *p; ) {
00824                 switch(GetDriveType(p)) {
00825                         case DRIVE_REMOVABLE:   drivebarBtn.iBitmap = 1;        break;
00826                         case DRIVE_CDROM:               drivebarBtn.iBitmap = 3;        break;
00827                         case DRIVE_REMOTE:              drivebarBtn.iBitmap = 4;        break;
00828                         case DRIVE_RAMDISK:     drivebarBtn.iBitmap = 5;        break;
00829                         default:/*DRIVE_FIXED*/ drivebarBtn.iBitmap = 2;
00830                 }
00831
00832                 SendMessage(_hdrivebar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&drivebarBtn);
00833                 ++drivebarBtn.idCommand;
00834                 ++drivebarBtn.iString;
00835
00836                 while(*p++);
00837         }
00838
00839
00840 #ifndef _NO_REBAR
00841         int btn_hgt = HIWORD(SendMessage(_htoolbar, TB_GETBUTTONSIZE, 0, 0));
00842
00843         REBARBANDINFO rbBand;
00844
00845         rbBand.cbSize = sizeof(REBARBANDINFO);
00846         rbBand.fMask  = RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE;
00847 #ifndef RBBS_HIDETITLE // missing in MinGW headers as of 25.02.2004
00848 #define RBBS_HIDETITLE  0x400
00849 #endif
00850         rbBand.fStyle = RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE;
00851
00852         rbBand.lpText = TEXT("Extras");
00853         rbBand.hwndChild = _hextrabar;
00854         rbBand.cxMinChild = 0;
00855         rbBand.cyMinChild = btn_hgt + 4;
00856         rbBand.cx = 284;
00857         SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
00858
00859         rbBand.fStyle |= RBBS_BREAK;
00860         rbBand.lpText = TEXT("Drives");
00861         rbBand.hwndChild = _hdrivebar;
00862         rbBand.cxMinChild = 0;
00863         rbBand.cyMinChild = btn_hgt + 4;
00864         rbBand.cx = 400;
00865         SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
00866 #endif
00867 }
00868
00869
00870 HWND MDIMainFrame::Create()
00871 {
00872         HMENU hMenuFrame = LoadMenu(g_Globals._hInstance, MAKEINTRESOURCE(IDM_MDIFRAME));
00873
00874         return Window::Create(WINDOW_CREATOR(MDIMainFrame), 0,
00875                                 (LPCTSTR)(int)g_Globals._hframeClass, ResString(IDS_TITLE), WS_OVERLAPPEDWINDOW,
00876                                 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
00877                                 0/*hwndDesktop*/, hMenuFrame);
00878 }
00879
00880 HWND MDIMainFrame::Create(LPCTSTR path, int mode)
00881 {
00882         HWND hFrame = Create();
00883         if (!hFrame)
00884                 return 0;
00885
00886         ShowWindow(hFrame, SW_SHOW);
00887
00888         MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame);
00889
00890         if (pMainFrame)
00891                 pMainFrame->CreateChild(path, mode);
00892
00893         return hFrame;
00894 }
00895
00896 HWND MDIMainFrame::Create(LPCITEMIDLIST pidl, int mode)
00897 {
00898         HWND hFrame = Create();
00899         if (!hFrame)
00900                 return 0;
00901
00902         ShowWindow(hFrame, SW_SHOW);
00903
00904         MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame);
00905
00906         if (pMainFrame)
00907                 pMainFrame->CreateChild(pidl, mode);
00908
00909         return hFrame;
00910 }
00911
00912
00913 ChildWindow* MDIMainFrame::CreateChild(LPCTSTR path, int mode)
00914 {
00915         return reinterpret_cast<ChildWindow*>(SendMessage(_hwnd, PM_OPEN_WINDOW, mode, (LPARAM)path));
00916 }
00917
00918 ChildWindow* MDIMainFrame::CreateChild(LPCITEMIDLIST pidl, int mode)
00919 {
00920         return reinterpret_cast<ChildWindow*>(SendMessage(_hwnd, PM_OPEN_WINDOW, mode|OWM_PIDL, (LPARAM)pidl));
00921 }
00922
00923
00924 BOOL MDIMainFrame::TranslateMsg(MSG* pmsg)
00925 {
00926         if (_hmdiclient && TranslateMDISysAccel(_hmdiclient, pmsg))
00927                 return TRUE;
00928
00929         return super::TranslateMsg(pmsg);
00930 }
00931
00932 LRESULT MDIMainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00933 {
00934         switch(nmsg) {
00935           case PM_OPEN_WINDOW: {
00936                 CONTEXT("MDIMainFrame PM_OPEN_WINDOW");
00937
00938                 TCHAR buffer[MAX_PATH];
00939                 LPCTSTR path;
00940                 ShellPath root_path = DesktopFolderPath();
00941
00942                 if (lparam) {
00943                         if (wparam & OWM_PIDL) {
00944                                  // take over PIDL from lparam
00945                                 root_path.assign((LPCITEMIDLIST)lparam);        // create as "rooted" window
00946                                 FileSysShellPath fsp(root_path);
00947                                 path = fsp;
00948
00949                                 if (path) {
00950                                         LOG(FmtString(TEXT("MDIMainFrame PM_OPEN_WINDOW: path=%s"), path));
00951                                         lstrcpy(buffer, path);
00952                                         path = buffer;
00953                                 }
00954                         } else {
00955                                  // take over path from lparam
00956                                 path = (LPCTSTR)lparam;
00957                                 root_path = path;       // create as "rooted" window
00958                         }
00959                 } else {
00961                         if (!GetCurrentDirectory(MAX_PATH, buffer))
00962                                 *buffer = '\0';
00963
00964                         path = buffer;
00965                 }
00966
00967                 if (path && _tcsstr(path, TEXT("://"))) {       // "http://...", "ftp://", ...
00968                         OBJ_CONTEXT("create WebChild window", path);
00969
00970                         return (LRESULT)GET_WINDOW(ChildWindow, create_webchildwindow(WebChildWndInfo(_hmdiclient, path)));
00971                 } else {
00972                         OBJ_CONTEXT("create ShellChildWndInfo", path);
00973
00974                          // Shell Namespace as default view
00975                         ShellChildWndInfo create_info(_hmdiclient, path, root_path);
00976
00977                         create_info._pos.showCmd = wparam&OWM_SEPARATE? SW_SHOWNORMAL: SW_SHOWMAXIMIZED;
00978                         create_info._pos.rcNormalPosition.left = CW_USEDEFAULT;
00979                         create_info._pos.rcNormalPosition.top = CW_USEDEFAULT;
00980                         create_info._pos.rcNormalPosition.right = CW_USEDEFAULT;
00981                         create_info._pos.rcNormalPosition.bottom = CW_USEDEFAULT;
00982
00983                         create_info._open_mode = wparam;
00984
00985                 //      FileChildWindow::create(_hmdiclient, create_info);
00986                         return (LRESULT)MDIShellBrowserChild::create(create_info);
00987                 }
00988                 return TRUE;}   // success
00989
00990           default: {
00991                 LRESULT res;
00992
00993                 if (super::ProcessMessage(nmsg, wparam, lparam, &res))
00994                         return res;
00995                 else
00996                         return DefFrameProc(_hwnd, _hmdiclient, nmsg, wparam, lparam);
00997           }
00998         }
00999
01000         return 0;
01001 }
01002
01003 int MDIMainFrame::Command(int id, int code)
01004 {
01005         CONTEXT("MDIMainFrame::Command()");
01006
01007         HWND hwndClient = (HWND) SendMessage(_hmdiclient, WM_MDIGETACTIVE, 0, 0);
01008
01009         if (hwndClient)
01010                 if (SendMessage(hwndClient, PM_DISPATCH_COMMAND, MAKELONG(id,code), 0))
01011                         return 0;
01012
01013         if (id>=ID_DRIVE_FIRST && id<=ID_DRIVE_FIRST+0xFF) {
01014                 TCHAR drv[_MAX_DRIVE], path[MAX_PATH];
01015                 LPCTSTR root = _drives;
01016
01017                 for(int i=id-ID_DRIVE_FIRST; i--; root++)
01018                         while(*root)
01019                                 ++root;
01020
01021                 if (activate_drive_window(root))
01022                         return 0;
01023
01024                 _tsplitpath_s(root, drv, COUNTOF(drv), NULL, 0, NULL, 0, NULL, 0);
01025
01026                 if (!SetCurrentDirectory(drv)) {
01027                         display_error(_hwnd, GetLastError());
01028                         return 0;
01029                 }
01030
01031                 GetCurrentDirectory(MAX_PATH, path);
01032
01033                 FileChildWindow::create(FileChildWndInfo(_hmdiclient, path));
01034
01035                 return 1;
01036         }
01037
01038         switch(id) {
01039           case ID_WINDOW_NEW: {
01040                 TCHAR path[MAX_PATH];
01041
01042                 GetCurrentDirectory(MAX_PATH, path);
01043
01044                 FileChildWindow::create(FileChildWndInfo(_hmdiclient, path));
01045                 break;}
01046
01047           case ID_WINDOW_CASCADE:
01048                 SendMessage(_hmdiclient, WM_MDICASCADE, 0, 0);
01049                 break;
01050
01051           case ID_WINDOW_TILE_HORZ:
01052                 SendMessage(_hmdiclient, WM_MDITILE, MDITILE_HORIZONTAL, 0);
01053                 break;
01054
01055           case ID_WINDOW_TILE_VERT:
01056                 SendMessage(_hmdiclient, WM_MDITILE, MDITILE_VERTICAL, 0);
01057                 break;
01058
01059           case ID_WINDOW_ARRANGE:
01060                 SendMessage(_hmdiclient, WM_MDIICONARRANGE, 0, 0);
01061                 break;
01062
01063           case ID_VIEW_EXTRA_BAR:
01064                 toggle_child(_hwnd, id, _hextrabar, 1);
01065                 break;
01066
01067           case ID_VIEW_DRIVE_BAR:
01068                 toggle_child(_hwnd, id, _hdrivebar, 2);
01069                 break;
01070
01071 #ifdef __WINE__
01072           case ID_DRIVE_UNIX_FS: {
01073                 TCHAR path[MAX_PATH];
01074                 FileChildWindow* child;
01075
01076                 getcwd(path, COUNTOF(path));
01077
01078                 if (activate_child_window(TEXT("unixfs")))
01079                         break;
01080
01081                 FileChildWindow::create(_hmdiclient, FileChildWndInfo(path));
01082                 break;}
01083 #endif
01084
01085           case ID_DRIVE_DESKTOP: {
01086                 TCHAR path[MAX_PATH];
01087
01088                 if (activate_child_window(TEXT("Desktop")))
01089                         break;
01090
01091                 GetCurrentDirectory(MAX_PATH, path);
01092
01093                 MDIShellBrowserChild::create(ShellChildWndInfo(_hmdiclient, path, DesktopFolderPath()));
01094                 break;}
01095
01096           case ID_DRIVE_SHELL_NS: {
01097                 TCHAR path[MAX_PATH];
01098                 GetCurrentDirectory(MAX_PATH, path);
01099
01100                 if (activate_child_window(TEXT("Shell")))
01101                         break;
01102
01103                 FileChildWindow::create(ShellChildWndInfo(_hmdiclient, path, DesktopFolderPath()));
01104                 break;}
01105
01106           case ID_DRIVE_NTOBJ_NS: {
01107                 if (activate_child_window(TEXT("NTOBJ")))
01108                         break;
01109
01110                 FileChildWindow::create(NtObjChildWndInfo(_hmdiclient, TEXT("\\")));
01111           break;}
01112
01113           case ID_DRIVE_REGISTRY: {
01114                 if (activate_child_window(TEXT("Registry")))
01115                         break;
01116
01117                 FileChildWindow::create(RegistryChildWndInfo(_hmdiclient, TEXT("\\")));
01118           break;}
01119
01120           case ID_DRIVE_FAT: {
01121
01123
01124                 if (activate_child_window(TEXT("FAT")))
01125                         break;
01126
01127                 FileChildWindow::create(FATChildWndInfo(_hmdiclient, TEXT("FAT Image")));       //@@
01128           break;}
01129
01130           case ID_WEB_WINDOW:
01131 #ifdef _DEBUG
01132                 create_webchildwindow(WebChildWndInfo(_hmdiclient, TEXT("http://localhost")));
01133 #else
01134                 create_webchildwindow(WebChildWndInfo(_hmdiclient, TEXT("http://www.reactos.org")));
01135 #endif
01136                 break;
01137
01138           case ID_EXPLORER_FAQ:
01139                 create_webchildwindow(WebChildWndInfo(_hmdiclient, TEXT("http://www.sky.franken.de/explorer/")));
01140                 break;
01141
01142           case ID_VIEW_SDI:
01143                 MainFrameBase::Create(ExplorerCmd());
01144                 break;
01145
01146           case IDW_COMMANDBAR:
01147                 if (code == 1) {
01148                         TCHAR url[BUFFER_LEN];
01149                         LPCTSTR dir;
01150
01151                         if (GetWindowText(_haddressedit, url, BUFFER_LEN))
01152                                 dir = url;
01153                         else
01154                                 dir = NULL;
01155
01156                         ExecuteCommandbar(dir);
01157                 }
01158                 break;
01159
01161
01162           default:
01163                 if (super::Command(id, code) == 0)
01164                         return 0;
01165                 else
01166                         return DefFrameProc(_hwnd, _hmdiclient, WM_COMMAND, MAKELONG(id,code), 0);
01167         }
01168
01169         return 0;
01170 }
01171
01172
01173 void MDIMainFrame::frame_get_clientspace(PRECT prect)
01174 {
01175         super::frame_get_clientspace(prect);
01176
01177         if (IsWindowVisible(_hdrivebar)) {
01178                 ClientRect rt(_hdrivebar);
01179                 prect->top += rt.bottom+2;
01180         }
01181 }
01182
01183 void MDIMainFrame::resize_frame(int cx, int cy)
01184 {
01185         if (cy <= 0)
01186                 return; // avoid resizing children when receiving RBN_AUTOSIZE while getting minimized
01187
01188         RECT rect = {0, 0, cx, cy};
01189
01190         if (_hwndrebar) {
01191                 int height = ClientRect(_hwndrebar).bottom;
01192                 MoveWindow(_hwndrebar, rect.left, rect.top, rect.right-rect.left, height, TRUE);
01193                 rect.top += height;
01194         } else {
01195                 if (IsWindowVisible(_htoolbar)) {
01196                         SendMessage(_htoolbar, WM_SIZE, 0, 0);
01197                         WindowRect rt(_htoolbar);
01198                         rect.top = rt.bottom;
01199                 //      rect.bottom -= rt.bottom;
01200                 }
01201
01202                 if (IsWindowVisible(_hextrabar)) {
01203                         SendMessage(_hextrabar, WM_SIZE, 0, 0);
01204                         WindowRect rt(_hextrabar);
01205                         int new_top = --rect.top + rt.bottom;
01206                         MoveWindow(_hextrabar, 0, rect.top, rt.right, new_top, TRUE);
01207                         rect.top = new_top;
01208                 //      rect.bottom -= rt.bottom;
01209                 }
01210
01211                 if (IsWindowVisible(_hdrivebar)) {
01212                         SendMessage(_hdrivebar, WM_SIZE, 0, 0);
01213                         WindowRect rt(_hdrivebar);
01214                         int new_top = --rect.top + rt.bottom;
01215                         MoveWindow(_hdrivebar, 0, rect.top, rt.right, new_top, TRUE);
01216                         rect.top = new_top;
01217                 //      rect.bottom -= rt.bottom;
01218                 }
01219         }
01220
01221         if (IsWindowVisible(_hstatusbar)) {
01222                 int parts[] = {300, 500};
01223
01224                 SendMessage(_hstatusbar, WM_SIZE, 0, 0);
01225                 SendMessage(_hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
01226                 ClientRect rt(_hstatusbar);
01227                 rect.bottom -= rt.bottom;
01228         }
01229
01230         if (IsWindowVisible(_haddressedit) || IsWindowVisible(_hcommandedit)) {
01231                 ClientRect rt(_haddressedit);
01232                 rect.bottom -= rt.bottom;
01233
01234                 int mid = (rect.right-rect.left) / 2;
01235                 SetWindowPos(_haddressedit, 0, 0, rect.bottom, mid, rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
01236                 SetWindowPos(_hcommandedit, 0, mid+1, rect.bottom, rect.right-(mid+1), rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
01237         }
01238
01239         if (IsWindowVisible(_hsidebar)) {
01240                 WindowRect rt(_hsidebar);
01241                 rect.left += rt.right-rt.left;
01242
01243                 SetWindowPos(_hsidebar, 0, -1, rect.top-1, rt.right-rt.left, rect.bottom-rect.top+1, SWP_NOACTIVATE|SWP_NOZORDER);
01244         }
01245
01246         MoveWindow(_hmdiclient, rect.left-1, rect.top-1, rect.right-rect.left+2, rect.bottom-rect.top+1, TRUE);
01247 }
01248
01249 bool MDIMainFrame::activate_drive_window(LPCTSTR path)
01250 {
01251         TCHAR drv1[_MAX_DRIVE], drv2[_MAX_DRIVE];
01252         HWND child_wnd;
01253
01254         _tsplitpath_s(path, drv1, COUNTOF(drv1), NULL, 0, NULL, 0, NULL, 0);
01255
01256          // search for a already open window for the same drive
01257         for(child_wnd=::GetNextWindow(_hmdiclient,GW_CHILD); child_wnd; child_wnd=::GetNextWindow(child_wnd, GW_HWNDNEXT)) {
01258                 FileChildWindow* child = (FileChildWindow*) SendMessage(child_wnd, PM_GET_FILEWND_PTR, 0, 0);
01259
01260                 if (child) {
01261                         _tsplitpath_s(child->get_root()._path, drv2, COUNTOF(drv2), NULL, 0, NULL, 0, NULL, 0);
01262
01263                         if (!lstrcmpi(drv2, drv1)) {
01264                                 SendMessage(_hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
01265
01266                                 if (IsMinimized(child_wnd))
01267                                         ShowWindow(child_wnd, SW_SHOWNORMAL);
01268
01269                                 return true;
01270                         }
01271                 }
01272         }
01273
01274         return false;
01275 }
01276
01277 bool MDIMainFrame::activate_child_window(LPCTSTR filesys)
01278 {
01279         HWND child_wnd;
01280
01281          // search for a already open window of the given file system name
01282         for(child_wnd=::GetNextWindow(_hmdiclient,GW_CHILD); child_wnd; child_wnd=::GetNextWindow(child_wnd, GW_HWNDNEXT)) {
01283                 FileChildWindow* child = (FileChildWindow*) SendMessage(child_wnd, PM_GET_FILEWND_PTR, 0, 0);
01284
01285                 if (child) {
01286                         if (!lstrcmpi(child->get_root()._fs, filesys)) {
01287                                 SendMessage(_hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
01288
01289                                 if (IsMinimized(child_wnd))
01290                                         ShowWindow(child_wnd, SW_SHOWNORMAL);
01291
01292                                 return true;
01293                         }
01294                 } else {
01295                         ShellBrowser* shell_child = (ShellBrowser*) SendMessage(child_wnd, PM_GET_SHELLBROWSER_PTR, 0, 0);
01296
01297                         if (shell_child) {
01298                                 if (!lstrcmpi(shell_child->get_root()._fs, filesys)) {
01299                                         SendMessage(_hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
01300
01301                                         if (IsMinimized(child_wnd))
01302                                                 ShowWindow(child_wnd, SW_SHOWNORMAL);
01303
01304                                         return true;
01305                                 }
01306                         }
01307                 }
01308         }
01309
01310         return false;
01311 }
01312
01313 bool MDIMainFrame::go_to(LPCTSTR url, bool new_window)
01314 {
01315         if (!new_window) {
01316                 HWND hwndClient = (HWND) SendMessage(_hmdiclient, WM_MDIGETACTIVE, 0, 0);
01317
01318                 if (hwndClient)
01319                         if (SendMessage(hwndClient, PM_JUMP_TO_URL, 0, (LPARAM)url))
01320                                 return true;
01321         }
01322
01323         if (CreateChild(url))
01324                 return true;
01325
01326         return super::go_to(url, new_window);
01327 }
01328
01329 #endif // _NO_MDI
01330
01331
01332 SDIMainFrame::SDIMainFrame(HWND hwnd)
01333  :      super(hwnd)
01334 {
01335         _split_pos = DEFAULT_SPLIT_POS;
01336         _last_split = DEFAULT_SPLIT_POS;
01337
01338         /* wait for PM_OPEN_WINDOW message before creating a shell view
01339         update_shell_browser();*/
01340 }
01341
01342 HWND SDIMainFrame::Create()
01343 {
01344         HMENU hMenuFrame = LoadMenu(g_Globals._hInstance, MAKEINTRESOURCE(IDM_SDIFRAME));
01345
01346         return Window::Create(WINDOW_CREATOR(SDIMainFrame), 0,
01347                                 (LPCTSTR)(int)g_Globals._hframeClass, ResString(IDS_TITLE), WS_OVERLAPPEDWINDOW,
01348                                 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
01349                                 0/*hwndDesktop*/, hMenuFrame);
01350 }
01351
01352 HWND SDIMainFrame::Create(LPCITEMIDLIST pidl, int mode)
01353 {
01354         HWND hFrame = Create();
01355         if (!hFrame)
01356                 return 0;
01357
01358         ShowWindow(hFrame, SW_SHOW);
01359
01360         SDIMainFrame* pFrame = GET_WINDOW(SDIMainFrame, hFrame);
01361
01362         if (pFrame)
01363                 pFrame->jump_to(pidl, mode);
01364
01365         return hFrame;
01366 }
01367
01368 HWND SDIMainFrame::Create(LPCTSTR path, int mode)
01369 {
01370         HWND hFrame = Create();
01371         if (!hFrame)
01372                 return 0;
01373
01374         ShowWindow(hFrame, SW_SHOW);
01375
01376         MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame);
01377
01378         if (pMainFrame)
01379                 pMainFrame->CreateChild(path, mode);
01380
01381         return hFrame;
01382 }
01383
01384 LRESULT SDIMainFrame::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
01385 {
01386         switch(nmsg) {
01387           case WM_SIZE:
01388                 resize_frame(LOWORD(lparam), HIWORD(lparam));
01389                 break;
01390
01391           case WM_PAINT: {
01392                 PaintCanvas canvas(_hwnd);
01393
01394                 if (_left_hwnd) {
01395                         ClientRect rt(_hwnd);
01396                         rt.left = _split_pos-SPLIT_WIDTH/2;
01397                         rt.right = _split_pos+SPLIT_WIDTH/2+1;
01398
01399                         if (_right_hwnd) {
01400                                 WindowRect right_rect(_right_hwnd);
01401                                 ScreenToClient(_hwnd, &right_rect);
01402                                 rt.top = right_rect.top;
01403                                 rt.bottom = right_rect.bottom;
01404                         }
01405
01406                         HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(COLOR_SPLITBAR));
01407                         Rectangle(canvas, rt.left, rt.top-1, rt.right, rt.bottom+1);
01408                         SelectObject(canvas, lastBrush);
01409                 }
01410                 break;}
01411
01412           case WM_SETCURSOR:
01413                 if (_left_hwnd)
01414                         if (LOWORD(lparam) == HTCLIENT) {
01415                                 POINT pt;
01416                                 GetCursorPos(&pt);
01417                                 ScreenToClient(_hwnd, &pt);
01418
01419                                 if (pt.x>=_split_pos-SPLIT_WIDTH/2 && pt.x<_split_pos+SPLIT_WIDTH/2+1) {
01420                                         SetCursor(LoadCursor(0, IDC_SIZEWE));
01421                                         return TRUE;
01422                                 }
01423                         }
01424                 goto def;
01425
01426           case WM_LBUTTONDOWN:
01427                 if (_left_hwnd) {
01428                         int x = GET_X_LPARAM(lparam);
01429
01430                         ClientRect rt(_hwnd);
01431
01432                         if (x>=_split_pos-SPLIT_WIDTH/2 && x<_split_pos+SPLIT_WIDTH/2+1) {
01433                                 _last_split = _split_pos;
01434                                 SetCapture(_hwnd);
01435                         }
01436                 }
01437                 break;
01438
01439           case WM_LBUTTONUP:
01440                 if (GetCapture() == _hwnd)
01441                         ReleaseCapture();
01442                 break;
01443
01444           case WM_KEYDOWN:
01445                 if (wparam == VK_ESCAPE)
01446                         if (GetCapture() == _hwnd) {
01447                                 _split_pos = _last_split;
01448                                 resize_children();
01449                                 _last_split = -1;
01450                                 ReleaseCapture();
01451                                 SetCursor(LoadCursor(0, IDC_ARROW));
01452                         }
01453                 break;
01454
01455           case WM_MOUSEMOVE:
01456                 if (GetCapture() == _hwnd) {
01457                         int x = GET_X_LPARAM(lparam);
01458
01459                         ClientRect rt(_hwnd);
01460
01461                         if (x>=0 && x<rt.right) {
01462                                 _split_pos = x;
01463                                 resize_children();
01464                                 rt.left = x-SPLIT_WIDTH/2;
01465                                 rt.right = x+SPLIT_WIDTH/2+1;
01466                                 InvalidateRect(_hwnd, &rt, FALSE);
01467                                 UpdateWindow(_left_hwnd);
01468                                 UpdateWindow(_hwnd);
01469                                 UpdateWindow(_right_hwnd);
01470                         }
01471                 }
01472                 break;
01473
01474           case PM_OPEN_WINDOW: {
01475                 CONTEXT("SDIMainFrame PM_OPEN_WINDOW");
01476
01477                 TCHAR buffer[MAX_PATH];
01478                 LPCTSTR path;
01479                 ShellPath root_path = DesktopFolderPath();
01480
01481                 if (lparam) {
01482                         if (wparam & OWM_PIDL) {
01483                                  // take over PIDL from lparam
01484                                 root_path.assign((LPCITEMIDLIST)lparam);        // create as "rooted" window
01485                                 FileSysShellPath fsp(root_path);
01486                                 path = fsp;
01487
01488                                 if (path) {
01489                                         LOG(FmtString(TEXT("SDIMainFrame PM_OPEN_WINDOW: path=%s"), path));
01490                                         lstrcpy(buffer, path);
01491                                         path = buffer;
01492                                 }
01493                         } else {
01494                                  // take over path from lparam
01495                                 path = (LPCTSTR)lparam;
01496                                 root_path = path;       // create as "rooted" window
01497                         }
01498                 } else {
01500                         if (!GetCurrentDirectory(MAX_PATH, buffer))
01501                                 *buffer = '\0';
01502
01503                         path = buffer;
01504                         root_path = path;
01505                 }
01506
01507                 jump_to(root_path, wparam);     //@todo content of 'path' not used any more
01508                 return TRUE;}   // success
01509
01510           default: def:
01511                 return super::WndProc(nmsg, wparam, lparam);
01512         }
01513
01514         return 0;
01515 }
01516
01517 int SDIMainFrame::Command(int id, int code)
01518 {
01519         switch(id) {
01520           case ID_VIEW_MDI:
01521                 MainFrameBase::Create(ExplorerCmd(_url, true));
01522                 break;
01523
01524           case IDW_COMMANDBAR:
01525                 if (code == 1)
01526                         ExecuteCommandbar(_url);
01527                 break;
01528
01529           default:
01530                 return super::Command(id, code);
01531         }
01532
01533         return 0;
01534 }
01535
01536 void SDIMainFrame::resize_frame(int cx, int cy)
01537 {
01538         if (cy <= 0)
01539                 return; // avoid resizing children when receiving RBN_AUTOSIZE while getting minimized
01540
01541         RECT rect = {0, 0, cx, cy};
01542
01543         if (_hwndrebar) {
01544                 int height = ClientRect(_hwndrebar).bottom;
01545                 MoveWindow(_hwndrebar, rect.left, rect.top, rect.right-rect.left, height, TRUE);
01546                 rect.top += height;
01547         } else {
01548                 if (IsWindowVisible(_htoolbar)) {
01549                         SendMessage(_htoolbar, WM_SIZE, 0, 0);
01550                         WindowRect rt(_htoolbar);
01551                         rect.top = rt.bottom;
01552                 //      rect.bottom -= rt.bottom;
01553                 }
01554         }
01555
01556         if (IsWindowVisible(_hstatusbar)) {
01557                 int parts[] = {300, 500};
01558
01559                 SendMessage(_hstatusbar, WM_SIZE, 0, 0);
01560                 SendMessage(_hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
01561                 ClientRect rt(_hstatusbar);
01562                 rect.bottom -= rt.bottom;
01563         }
01564
01565         if (IsWindowVisible(_haddressedit) || IsWindowVisible(_hcommandedit)) {
01566                 ClientRect rt(_haddressedit);
01567                 rect.bottom -= rt.bottom;
01568
01569                 int mid = (rect.right-rect.left) / 2;
01570                 SetWindowPos(_haddressedit, 0, 0, rect.bottom, mid, rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
01571                 SetWindowPos(_hcommandedit, 0, mid+1, rect.bottom, rect.right-(mid+1), rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
01572         }
01573
01574         if (IsWindowVisible(_hsidebar)) {
01575                 WindowRect rt(_hsidebar);
01576                 rect.left += rt.right-rt.left;
01577
01578                 SetWindowPos(_hsidebar, 0, -1, rect.top-1, rt.right-rt.left, rect.bottom-rect.top+1, SWP_NOACTIVATE|SWP_NOZORDER);
01579         }
01580
01581         _clnt_rect = rect;
01582
01583         resize_children();
01584 }
01585
01586 void SDIMainFrame::resize_children()
01587 {
01588         HDWP hdwp = BeginDeferWindowPos(2);
01589
01590         int cx = _clnt_rect.left;
01591
01592         if (_left_hwnd) {
01593                 cx = _split_pos + SPLIT_WIDTH/2;
01594
01595                 hdwp = DeferWindowPos(hdwp, _left_hwnd, 0, _clnt_rect.left, _clnt_rect.top, _split_pos-SPLIT_WIDTH/2-_clnt_rect.left, _clnt_rect.bottom-_clnt_rect.top, SWP_NOZORDER|SWP_NOACTIVATE);
01596         } else {
01597                 //_split_pos = -1;
01598                 cx = 0;
01599         }
01600
01601         if (_right_hwnd)
01602                 hdwp = DeferWindowPos(hdwp, _right_hwnd, 0, _clnt_rect.left+cx+1, _clnt_rect.top, _clnt_rect.right-cx, _clnt_rect.bottom-_clnt_rect.top, SWP_NOZORDER|SWP_NOACTIVATE);
01603
01604         EndDeferWindowPos(hdwp);
01605 }
01606
01607 void SDIMainFrame::update_clnt_rect()
01608 {
01609         ClientRect rect(_hwnd);
01610
01611         resize_frame(rect.right, rect.bottom);
01612 }
01613
01614 void SDIMainFrame::update_shell_browser()
01615 {
01616         int split_pos = DEFAULT_SPLIT_POS;
01617
01618         if (_shellBrowser.get()) {
01619                 split_pos = _split_pos;
01620                 delete _shellBrowser.release();
01621         }
01622
01624
01625          // create explorer treeview
01626         if (_shellpath_info._open_mode & OWM_EXPLORE) {
01627                 if (!_left_hwnd) {
01628                         ClientRect rect(_hwnd);
01629
01630                         _left_hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, NULL,
01631                                                         WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_NOTOOLTIPS|TVS_SHOWSELALWAYS,
01632                                                         0, rect.top, split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top,
01633                                                         _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0);
01634
01635                          // display tree window as long as the shell view is not yet visible
01636                         resize_frame(rect.right, rect.bottom);
01637                         MoveWindow(_left_hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, TRUE);
01638                 }
01639         } else {
01640                 if (_left_hwnd) {
01641                         DestroyWindow(_left_hwnd);
01642                         _left_hwnd = 0;
01643                 }
01644         }
01645
01646         _shellBrowser = auto_ptr<ShellBrowser>(new ShellBrowser(_hwnd, _left_hwnd, _right_hwnd,
01647                                                                                                 _shellpath_info, this, _cm_ifs));
01648
01649         _shellBrowser->Init(_hwnd);
01650
01651         if (_left_hwnd)
01652                 _shellBrowser->Init();
01653
01654          // update _clnt_rect and set size of new created shell view windows
01655         update_clnt_rect();
01656 }
01657
01658 void SDIMainFrame::entry_selected(Entry* entry)
01659 {
01660         if (entry->_etype == ET_SHELL) {
01661                 ShellEntry* shell_entry = static_cast<ShellEntry*>(entry);
01662                 IShellFolder* folder;
01663
01664                 if (shell_entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
01665                         folder = static_cast<ShellDirectory*>(shell_entry)->_folder;
01666                 else
01667                         folder = shell_entry->get_parent_folder();
01668
01669                 if (!folder) {
01670                         assert(folder);
01671                         return;
01672                 }
01673
01674                 TCHAR path[MAX_PATH];
01675
01676                 if (shell_entry->get_path(path, COUNTOF(path))) {
01677                         String url;
01678
01679                         if (path[0] == ':')
01680                                 url.printf(TEXT("shell://%s"), path);
01681                         else
01682                                 url.printf(TEXT("file://%s"), path);
01683
01684                         set_url(url);
01685                 }
01686
01687                 _shellBrowser->UpdateFolderView(folder);
01688
01689                  // update _clnt_rect and set size of new created shell view windows
01690                 update_clnt_rect();
01691         }
01692 }
01693
01694 void SDIMainFrame::set_url(LPCTSTR url)
01695 {
01696         if (_url != url) {
01697                 _url = url;
01698
01699                 SetWindowText(_haddressedit, url); //SendMessage(_hwndFrame, PM_URL_CHANGED, 0, (LPARAM)url);
01700         }
01701 }
01702
01703 void SDIMainFrame::jump_to(LPCTSTR path, int mode)
01704 {/*@@todo
01705         if (_shellBrowser.get() && (_shellpath_info._open_mode&~OWM_PIDL)==(mode&~OWM_PIDL)) {
01706                 _shellBrowser->jump_to(path);
01707
01708                 _shellpath_info._shell_path = path;
01709         } else */{
01710                 _shellpath_info._open_mode = mode;
01711                 _shellpath_info._shell_path = path;
01712                 _shellpath_info._root_shell_path = SpecialFolderPath(CSIDL_DRIVES, _hwnd);      //@@ path
01713
01714                 update_shell_browser();
01715         }
01716 }
01717
01718 void SDIMainFrame::jump_to(LPCITEMIDLIST path, int mode)
01719 {
01720         if (_shellBrowser.get() && (_shellpath_info._open_mode&~OWM_PIDL)==(mode&~OWM_PIDL)) {
01721                 ShellPath shell_path = path;
01722
01723                 _shellBrowser->jump_to(shell_path);
01724
01725                 _shellpath_info._shell_path = shell_path;
01726         } else {
01727                 _shellpath_info._open_mode = mode;
01728                 _shellpath_info._shell_path = path;
01729                 _shellpath_info._root_shell_path = path;        //@@ MF 02.10.2005 was: SpecialFolderPath(CSIDL_DRIVES, _hwnd);
01730
01731                 update_shell_browser();
01732         }
01733 }


ROS Explorer: mainframe.h File Reference

  • File List
  • File Members
shell

mainframe.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | MainFrameBase
Explorer frame window base class. More...
struct | MDIMainFrame
struct | SDIMainFrame

Defines

#define | PM_OPEN_WINDOW (WM_APP+0x07)

Enumerations

enum OPEN_WINDOW_MODE {
OWM_EXPLORE = 1, OWM_ROOTED = 2, OWM_DETAILS = 4, OWM_PIDL = 8,
OWM_SEPARATE = 16
}

Define Documentation

#define PM_OPEN_WINDOW (WM_APP+0x07)

Definition at line 29 of file mainframe.h.

Referenced by MainFrameBase::Create(), MDIMainFrame::CreateChild(), MainFrameBase::OpenShellFolders(), and SDIMainFrame::WndProc().

Enumeration Type Documentation

enum OPEN_WINDOW_MODE

Enumerator:
OWM_EXPLORE
OWM_ROOTED | window in explore mode
OWM_DETAILS | "rooted" window with special shell namespace root
OWM_PIDL | view files in detail mode
OWM_SEPARATE | path is given as PIDL, otherwise as LPCTSTR

Definition at line 31 of file mainframe.h.

00031                       {
00032         OWM_EXPLORE=1,
00033         OWM_ROOTED=2,
00034         OWM_DETAILS=4,
00035         OWM_PIDL=8,
00036         OWM_SEPARATE=16
00037 };


ROS Explorer: mainframe.h Source File

  • File List
  • File Members
shell

mainframe.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // mainframe.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #define PM_OPEN_WINDOW                  (WM_APP+0x07)
00030
00031 enum OPEN_WINDOW_MODE {
00032         OWM_EXPLORE=1,
00033         OWM_ROOTED=2,
00034         OWM_DETAILS=4,
00035         OWM_PIDL=8,
00036         OWM_SEPARATE=16
00037 };
00038
00039
00041 struct MainFrameBase : public PreTranslateWindow
00042 {
00043         typedef PreTranslateWindow super;
00044
00045         MainFrameBase(HWND hwnd);
00046         ~MainFrameBase();
00047
00048         static HWND Create(const ExplorerCmd& cmd);
00049         static int OpenShellFolders(LPIDA pida, HWND hFrameWnd);
00050
00051         WindowHandle _hwndrebar;
00052
00053         WindowHandle _htoolbar;
00054         WindowHandle _hstatusbar;
00055
00056         WindowHandle _haddressedit;
00057         WindowHandle _hcommandedit;
00058
00059         WindowHandle _hsidebar;
00060         HIMAGELIST      _himl;
00061
00062         HMENU           _hMenuFrame;
00063         HMENU           _hMenuWindow;
00064
00065         MenuInfo        _menu_info;
00066
00067 protected:
00068         FullScreenParameters _fullscreen;
00069
00070         HACCEL          _hAccel;
00071         HIMAGELIST      _himl_old;
00072
00073         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00074         bool    ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT* pres);
00075         int             Command(int id, int code);
00076         int             Notify(int id, NMHDR* pnmh);
00077
00078         virtual BOOL TranslateMsg(MSG* pmsg);
00079
00080         void    toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1);
00081
00082         void    resize_frame_client();
00083         virtual void resize_frame(int cx, int cy);
00084         virtual void frame_get_clientspace(PRECT prect);
00085
00086         BOOL    toggle_fullscreen();
00087         void    fullscreen_move();
00088
00089         void    FillBookmarks();
00090         virtual bool go_to(LPCTSTR url, bool new_window);
00091
00092         void    ExecuteCommandbar(LPCTSTR dir);
00093 };
00094
00095
00096 #ifndef _NO_MDI
00097
00098 struct MDIMainFrame : public MainFrameBase
00099 {
00100         typedef MainFrameBase super;
00101
00102         MDIMainFrame(HWND hwnd);
00103
00104         static HWND Create();
00105         static HWND Create(LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS);
00106         static HWND Create(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL);
00107
00108         ChildWindow* CreateChild(LPCTSTR path=NULL, int mode=OWM_EXPLORE|OWM_DETAILS);
00109         ChildWindow* CreateChild(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL);
00110
00111 protected:
00112         HWND    _hmdiclient;
00113
00114         WindowHandle _hextrabar;
00115         WindowHandle _hdrivebar;
00116
00117 protected:
00118         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00119         int             Command(int id, int code);
00120
00121         virtual BOOL TranslateMsg(MSG* pmsg);
00122
00123         bool    activate_drive_window(LPCTSTR path);
00124         bool    activate_child_window(LPCTSTR filesys);
00125
00126         virtual void resize_frame(int cx, int cy);
00127         virtual void frame_get_clientspace(PRECT prect);
00128
00129         virtual bool go_to(LPCTSTR url, bool new_window);
00130
00131         TCHAR   _drives[BUFFER_LEN];
00132 };
00133
00134 #endif
00135
00136
00137 struct SDIMainFrame : public ExtContextMenuHandlerT<
00138                                 ShellBrowserChildT<MainFrameBase>
00139                         >
00140 {
00141         typedef ExtContextMenuHandlerT<
00142                                 ShellBrowserChildT<MainFrameBase>
00143                         > super;
00144
00145         SDIMainFrame(HWND hwnd);
00146
00147         static HWND Create();
00148         static HWND Create(LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS);
00149         static HWND Create(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL);
00150
00151 protected:
00152         ShellPathInfo _shellpath_info;
00153
00154         WindowHandle _left_hwnd;
00155         WindowHandle _right_hwnd;
00156
00161         int     _split_pos;
00162         int             _last_split;
00163         RECT    _clnt_rect;
00164
00165         String  _url;
00166
00167         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00168         int             Command(int id, int code);
00169
00170         void    resize_frame(int cx, int cy);
00171         void    resize_children();
00172         void    update_clnt_rect();
00173
00174         void    update_shell_browser();
00175         void    jump_to(LPCTSTR path, int mode);
00176         void    jump_to(LPCITEMIDLIST path, int mode);
00177
00178          // interface BrowserCallback
00179         virtual void    entry_selected(Entry* entry);
00180
00181         void    set_url(LPCTSTR url);
00182 };


ROS Explorer: ntobjfs.cpp File Reference

  • File List
  • File Members
shell

ntobjfs.cpp File Reference

#include <precomp.h>
#include "ntobjfs.h"
#include "regfs.h"

Include dependency graph for ntobjfs.cpp:

Go to the source code of this file.

Classes

struct | NTDLL
struct | UnicodeString

Defines

#define | CONSTRUCT_NTDLLFCT(x) x(TEXT("NTDLL"), #x)

Typedefs

typedef DWORD(__stdcall * | NTOBJECTOPENFUNCTIONS )(HANDLE *, DWORD, OpenStruct *)

Variables

NTDLL * | g_NTDLL = NULL

Define Documentation

#define CONSTRUCT_NTDLLFCT ( x ) x(TEXT("NTDLL"), #x)

Definition at line 36 of file ntobjfs.cpp.

Typedef Documentation

typedef DWORD(__stdcall* NTOBJECTOPENFUNCTIONS)(HANDLE *, DWORD, OpenStruct *)

Definition at line 38 of file ntobjfs.cpp.

Variable Documentation

NTDLL* g_NTDLL = NULL

Definition at line 132 of file ntobjfs.cpp.


ROS Explorer: ntobjfs.cpp Source File

  • File List
  • File Members
shell

ntobjfs.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // ntobjfs.cpp
00024  //
00025  // Martin Fuchs, 31.01.2004
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "ntobjfs.h"
00032 //#include "winfs.h"
00033 #include "regfs.h"
00034
00035
00036 #define CONSTRUCT_NTDLLFCT(x) x(TEXT("NTDLL"), #x)
00037
00038 typedef DWORD (__stdcall* NTOBJECTOPENFUNCTIONS)(HANDLE*, DWORD, OpenStruct*);
00039
00040 struct NTDLL {
00041         NTDLL()
00042          :      CONSTRUCT_NTDLLFCT(RtlInitAnsiString),
00043                 CONSTRUCT_NTDLLFCT(RtlInitUnicodeString),
00044                 CONSTRUCT_NTDLLFCT(RtlFreeAnsiString),
00045                 CONSTRUCT_NTDLLFCT(RtlFreeUnicodeString),
00046                 CONSTRUCT_NTDLLFCT(RtlAnsiStringToUnicodeString),
00047                 CONSTRUCT_NTDLLFCT(RtlUnicodeStringToAnsiString),
00048                 CONSTRUCT_NTDLLFCT(NtOpenDirectoryObject),
00049                 CONSTRUCT_NTDLLFCT(NtQueryDirectoryObject),
00050                 CONSTRUCT_NTDLLFCT(NtOpenFile),
00051                 CONSTRUCT_NTDLLFCT(NtOpenSymbolicLinkObject),
00052                 CONSTRUCT_NTDLLFCT(NtQuerySymbolicLinkObject),
00053                 CONSTRUCT_NTDLLFCT(NtQueryObject),
00054                 CONSTRUCT_NTDLLFCT(NtOpenMutant),
00055                 CONSTRUCT_NTDLLFCT(NtOpenSection),
00056                 CONSTRUCT_NTDLLFCT(NtOpenEvent),
00057                 CONSTRUCT_NTDLLFCT(NtOpenEventPair),
00058                 CONSTRUCT_NTDLLFCT(NtOpenIoCompletion),
00059                 CONSTRUCT_NTDLLFCT(NtOpenSemaphore),
00060                 CONSTRUCT_NTDLLFCT(NtOpenTimer),
00061                 CONSTRUCT_NTDLLFCT(NtOpenKey),
00062                 CONSTRUCT_NTDLLFCT(NtClose),
00063                 CONSTRUCT_NTDLLFCT(NtOpenProcess),
00064                 CONSTRUCT_NTDLLFCT(NtOpenThread)
00065         {
00066                 NTOBJECTOPENFUNCTIONS* p = _ObjectOpenFunctions;
00067
00068                 *p++ = *NtOpenDirectoryObject;
00069                 *p++ = *NtOpenSymbolicLinkObject;
00070                 *p++ = *NtOpenMutant;
00071                 *p++ = *NtOpenSection;
00072                 *p++ = *NtOpenEvent;
00073                 *p++ = *NtOpenSemaphore;
00074                 *p++ = *NtOpenTimer;
00075                 *p++ = *NtOpenKey;
00076                 *p++ = *NtOpenEventPair;
00077                 *p++ = *NtOpenIoCompletion;
00078                 *p++ = 0/*Device Object*/;
00079                 *p++ = 0/*NtOpenFile*/;
00080                 *p++ = 0/*CONTROLLER_OBJECT*/;
00081                 *p++ = 0/*PROFILE_OBJECT*/;
00082                 *p++ = 0/*TYPE_OBJECT*/;
00083                 *p++ = 0/*DESKTOP_OBJECT*/;
00084                 *p++ = 0/*WINDOWSTATION_OBJECT*/;
00085                 *p++ = 0/*DRIVER_OBJECT*/;
00086                 *p++ = 0/*TOKEN_OBJECT*/;
00087                 *p++ = 0/*PROCESS_OBJECT*/;
00088                 *p++ = 0/*THREAD_OBJECT*/;
00089                 *p++ = 0/*ADAPTER_OBJECT*/;
00090                 *p++ = 0/*PORT_OBJECT*/;
00091         }
00092
00093         NTOBJECTOPENFUNCTIONS _ObjectOpenFunctions[23];
00094         static const LPCWSTR s_ObjectTypes[];
00095
00096         DynamicFct<void (__stdcall*)(RtlAnsiString*, LPCSTR)> RtlInitAnsiString;
00097         DynamicFct<void (__stdcall*)(RtlUnicodeString*, LPCWSTR)> RtlInitUnicodeString;
00098         DynamicFct<DWORD (__stdcall*)(RtlAnsiString*)> RtlFreeAnsiString;
00099         DynamicFct<DWORD (__stdcall*)(RtlUnicodeString*)> RtlFreeUnicodeString;
00100         DynamicFct<DWORD (__stdcall*)(RtlUnicodeString*, const RtlAnsiString*, BOOL)> RtlAnsiStringToUnicodeString;
00101         DynamicFct<DWORD (__stdcall*)(RtlAnsiString*, const RtlUnicodeString*, BOOL)> RtlUnicodeStringToAnsiString;
00102
00103         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenDirectoryObject;
00104         DynamicFct<DWORD (__stdcall*)(HANDLE, NtObjectInfo*, DWORD size, BOOL, BOOL, void*, void*)> NtQueryDirectoryObject;
00105         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, void*, DWORD*, DWORD, OpenStruct*)> NtOpenFile;
00106         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenSymbolicLinkObject;
00107         DynamicFct<DWORD (__stdcall*)(HANDLE, RtlUnicodeString*, DWORD*)> NtQuerySymbolicLinkObject;
00108         DynamicFct<DWORD (__stdcall*)(HANDLE, DWORD, NtObject*, DWORD size, DWORD* read)> NtQueryObject;
00109         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenMutant;
00110         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenSection;
00111         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenEvent;
00112         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenEventPair;
00113         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenIoCompletion;
00114         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenSemaphore;
00115         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenTimer;
00116         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenKey;
00117         DynamicFct<DWORD (__stdcall*)(HANDLE)> NtClose;
00118         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenProcess;
00119         DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NtOpenThread;
00120 };
00121
00122 const LPCWSTR NTDLL::s_ObjectTypes[] = {
00123         L"Directory", L"SymbolicLink",
00124         L"Mutant", L"Section", L"Event", L"Semaphore",
00125         L"Timer", L"Key", L"EventPair", L"IoCompletion",
00126         L"Device", L"File", L"Controller", L"Profile",
00127         L"Type", L"Desktop", L"WindowStatiom", L"Driver",
00128         L"Token", L"Process", L"Thread", L"Adapter", L"Port",
00129         0
00130 };
00131
00132 NTDLL* g_NTDLL = NULL;
00133
00134
00135 struct UnicodeString : public RtlUnicodeString {
00136         UnicodeString(LPCWSTR str)
00137         {
00138                 (*g_NTDLL->RtlInitUnicodeString)(this, str);
00139         }
00140
00141         UnicodeString(size_t len, LPWSTR buffer)
00142         {
00143                 alloc_len = len;
00144                 string_ptr = buffer;
00145         }
00146
00147         operator LPCWSTR() const {return string_ptr;}
00148 };
00149
00150
00151 static DWORD NtOpenObject(OBJECT_TYPE type, HANDLE* phandle, DWORD access, LPCWSTR path/*, BOOL xflag=FALSE*/)
00152 {
00153         UnicodeString ustr(path);
00154         OpenStruct open_struct = {sizeof(OpenStruct), 0x00, &ustr, 0x40};
00155
00156         if (type==DIRECTORY_OBJECT || type==SYMBOLICLINK_OBJECT)
00157                 access |= FILE_LIST_DIRECTORY;
00158
00159         /* if (xflag)
00160                 access |= GENERIC_READ; */
00161
00162         DWORD ioStatusBlock[2]; // IO_STATUS_BLOCK
00163
00164         if (type>=DIRECTORY_OBJECT && type<=IOCOMPLETITION_OBJECT)
00165                 return g_NTDLL->_ObjectOpenFunctions[type](phandle, access|STANDARD_RIGHTS_READ, &open_struct);
00166         else if (type == FILE_OBJECT)
00167                 return (*g_NTDLL->NtOpenFile)(phandle, access, &open_struct, ioStatusBlock, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0/*OpenOptions*/);
00168         else
00169                 return ERROR_INVALID_FUNCTION;
00170 }
00171
00172
00173 void NtObjDirectory::read_directory(int scan_flags)
00174 {
00175         CONTEXT("NtObjDirectory::read_directory()");
00176
00177         if (!g_NTDLL)
00178                 g_NTDLL = new NTDLL();
00179
00180         Entry* first_entry = NULL;
00181         int level = _level + 1;
00182
00183         LPCTSTR path = (LPCTSTR)_path;
00184
00185         TCHAR buffer[MAX_PATH], *p=buffer;
00186 #ifndef UNICODE
00187         WCHAR wbuffer[MAX_PATH], *w=wbuffer;
00188 #endif
00189
00190         do {
00191                 *p++ = *path;
00192 #ifndef UNICODE
00193                 *w++ = *path;
00194 #endif
00195         } while(*path++);
00196         --p;
00197 #ifndef UNICODE
00198         --w;
00199 #endif
00200
00201         DWORD idx;
00202         HANDLE dir_handle;
00203
00204 #ifdef UNICODE
00205         if (NtOpenObject(_type, &dir_handle, 0, buffer))
00206 #else
00207         if (NtOpenObject(_type, &dir_handle, 0, wbuffer))
00208 #endif
00209                 return;
00210
00211 #ifdef UNICODE
00212         if (p[-1] != '\\')
00213                 *p++ = '\\';
00214 #else
00215         if (w[-1] != '\\')
00216                 *w++ = '\\';
00217 #endif
00218
00219         NtObjectInfo* info = (NtObjectInfo*)alloca(2048);
00220
00221         if (!(*g_NTDLL->NtQueryDirectoryObject)(dir_handle, info, 2048, TRUE, TRUE, &idx, NULL)) {
00222                 WIN32_FIND_DATA w32fd;
00223                 Entry* last = NULL;
00224                 Entry* entry;
00225
00226                 do {
00227                         memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00228
00229 #ifdef UNICODE
00230                         if (info->name.string_ptr) {
00231                                 info->name.string_ptr[info->name.string_len / sizeof(WCHAR)] = 0;
00232                         } else {
00233                                 info->name.string_ptr = TEXT("");
00234                         }
00235                         if (info->type.string_ptr) {
00236                                 info->type.string_ptr[info->type.string_len / sizeof(WCHAR)] = 0;
00237                         } else {
00238                                 info->type.string_ptr = TEXT("");
00239                         }
00240                         lstrcpynW(p, info->name.string_ptr, COUNTOF(buffer));
00241 #else
00242                         WideCharToMultiByte(CP_ACP, 0, info->name.string_ptr, info->name.string_len, p, COUNTOF(buffer), 0, 0);
00243 #endif
00244
00245                         lstrcpyn(w32fd.cFileName, p, sizeof(w32fd.cFileName) / sizeof(0[w32fd.cFileName]));
00246
00247                         const LPCWSTR* tname = NTDLL::s_ObjectTypes;
00248                         OBJECT_TYPE type = UNKNOWN_OBJECT_TYPE;
00249
00250                         for(; *tname; tname++)
00251                                 if (!wcsncmp(info->type.string_ptr, *tname, 32))
00252                                         {type=OBJECT_TYPE(tname-NTDLL::s_ObjectTypes); break;}
00253
00254                         if (type == DIRECTORY_OBJECT) {
00255                                 w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00256
00257                                 entry = new NtObjDirectory(this, buffer);
00258                         }
00259
00260                         else if (type == SYMBOLICLINK_OBJECT) {
00261                                 w32fd.dwFileAttributes |= ATTRIBUTE_SYMBOLIC_LINK;
00262
00263                                 entry = NULL;
00264
00265                                 if (*w32fd.cFileName>='A' &&*w32fd.cFileName<='Z' && w32fd.cFileName[1]==':')
00266                                         if (!_tcsncmp(buffer,TEXT("\\??\\"),4) ||               // NT4
00267                                                 !_tcsncmp(buffer,TEXT("\\GLOBAL??"),9)) {       // XP
00268                                                 w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00269                                                 entry = new WinDirectory(this, w32fd.cFileName);
00270                                         }
00271
00272                                 if (!entry)
00273                                         entry = new NtObjDirectory(this, buffer);
00274                         }
00275
00276                         else if (type == KEY_OBJECT) {
00277                                 w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00278
00279                                 entry = new RegistryRoot(this, buffer);
00280                         }
00281                         else
00282                                 entry = new NtObjEntry(this, type);
00283
00284                         HANDLE handle;
00285
00286 #ifdef UNICODE
00287                         lstrcpyW(p, info->name.string_ptr);
00288                         if (!NtOpenObject(type, &handle, 0, buffer))
00289 #else
00290                         lstrcpyW(w, info->name.string_ptr);
00291                         if (!NtOpenObject(type, &handle, 0, wbuffer))
00292 #endif
00293                         {
00294                                 NtObject object;
00295                                 DWORD read;
00296
00297                                 if (!(*g_NTDLL->NtQueryObject)(handle, 0/*ObjectBasicInformation*/, &object, sizeof(NtObject), &read)) {
00298                                         memcpy(&w32fd.ftCreationTime, &object.creation_time, sizeof(FILETIME));
00299
00300                                         memset(&entry->_bhfi, 0, sizeof(BY_HANDLE_FILE_INFORMATION));
00301                                         entry->_bhfi.nNumberOfLinks = object.reference_count - 1;
00302                                         entry->_bhfi_valid = true;
00303                                 }
00304
00305                                 if (type == SYMBOLICLINK_OBJECT) {
00306                                         WCHAR wbuffer[_MAX_PATH];
00307                                         UnicodeString link(_MAX_PATH, wbuffer);
00308
00309                                         if (!(*g_NTDLL->NtQuerySymbolicLinkObject)(handle, &link, NULL)) {
00310                                                 int len = link.string_len/sizeof(WCHAR);
00311                                                 entry->_content = (LPTSTR) malloc((len+1)*sizeof(TCHAR));
00312 #ifdef UNICODE
00313                                                 wcsncpy_s(entry->_content, len+1, link, len);
00314 #else
00315                                                 U2nA(link, entry->_content, len);
00316 #endif
00317                                                 entry->_content[len] = '\0';
00318                                         }
00319                                 }
00320
00321                                 (*g_NTDLL->NtClose)(handle);
00322                         }
00323
00324                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00325
00326 #ifdef UNICODE
00327                         entry->_type_name = _wcsdup(info->type.string_ptr);
00328 #else
00329                         char type_name[32];
00330                         WideCharToMultiByte(CP_ACP, 0, info->type.string_ptr, info->type.string_len, type_name, 32, 0, 0);
00331                         entry->_type_name = _strdup(type_name);
00332 #endif
00333
00334                         if (!first_entry)
00335                                 first_entry = entry;
00336
00337                         if (last)
00338                                 last->_next = entry;
00339
00340                         entry->_level = level;
00341
00342                         last = entry;
00343                 } while(!(*g_NTDLL->NtQueryDirectoryObject)(dir_handle, info, 2048, TRUE, FALSE, &idx, NULL));
00344
00345                 last->_next = NULL;
00346         }
00347
00348         (*g_NTDLL->NtClose)(dir_handle);
00349
00350         _down = first_entry;
00351         _scanned = true;
00352 }
00353
00354
00355 Entry* NtObjDirectory::find_entry(const void* p)
00356 {
00357         LPCTSTR name = (LPCTSTR)p;
00358
00359         for(Entry*entry=_down; entry; entry=entry->_next) {
00360                 LPCTSTR p = name;
00361                 LPCTSTR q = entry->_data.cFileName;
00362
00363                 do {
00364                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00365                                 return entry;
00366                 } while(tolower(*p++) == tolower(*q++));
00367
00368                 p = name;
00369                 q = entry->_data.cAlternateFileName;
00370
00371                 do {
00372                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00373                                 return entry;
00374                 } while(tolower(*p++) == tolower(*q++));
00375         }
00376
00377         return NULL;
00378 }
00379
00380
00381  // get full path of specified directory entry
00382 bool NtObjEntry::get_path(PTSTR path, size_t path_count) const
00383 {
00384         return get_path_base ( path, path_count, ET_NTOBJS );
00385 }
00386
00387 BOOL NtObjEntry::launch_entry(HWND hwnd, UINT nCmdShow)
00388 {
00389         return FALSE;
00390 }


ROS Explorer: ntobjfs.h File Reference

  • File List
  • File Members
shell

ntobjfs.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | RtlAnsiString
struct | RtlUnicodeString
struct | NtObjectInfo
struct | OpenStruct
struct | NtObject
struct | NtObjEntry
NtObj file system file-entry. More...
struct | NtObjDirectory
NtObj file system directory-entry. More...

Enumerations

enum OBJECT_TYPE {
DIRECTORY_OBJECT, SYMBOLICLINK_OBJECT, MUTANT_OBJECT, SECTION_OBJECT,
EVENT_OBJECT, SEMAPHORE_OBJECT, TIMER_OBJECT, KEY_OBJECT,
EVENTPAIR_OBJECT, IOCOMPLETITION_OBJECT, DEVICE_OBJECT, FILE_OBJECT,
CONTROLLER_OBJECT, PROFILE_OBJECT, TYPE_OBJECT, DESKTOP_OBJECT,
WINDOWSTATION_OBJECT, DRIVER_OBJECT, TOKEN_OBJECT, PROCESS_OBJECT,
THREAD_OBJECT, ADAPTER_OBJECT, PORT_OBJECT, UNKNOWN_OBJECT_TYPE = -1
}

Enumeration Type Documentation

enum OBJECT_TYPE

Enumerator:
DIRECTORY_OBJECT
SYMBOLICLINK_OBJECT
MUTANT_OBJECT
SECTION_OBJECT
EVENT_OBJECT
SEMAPHORE_OBJECT
TIMER_OBJECT
KEY_OBJECT
EVENTPAIR_OBJECT
IOCOMPLETITION_OBJECT
DEVICE_OBJECT
FILE_OBJECT
CONTROLLER_OBJECT
PROFILE_OBJECT
TYPE_OBJECT
DESKTOP_OBJECT
WINDOWSTATION_OBJECT
DRIVER_OBJECT
TOKEN_OBJECT
PROCESS_OBJECT
THREAD_OBJECT
ADAPTER_OBJECT
PORT_OBJECT
UNKNOWN_OBJECT_TYPE

Definition at line 29 of file ntobjfs.h.

00029                  {
00030         DIRECTORY_OBJECT, SYMBOLICLINK_OBJECT,
00031         MUTANT_OBJECT, SECTION_OBJECT, EVENT_OBJECT, SEMAPHORE_OBJECT,
00032         TIMER_OBJECT, KEY_OBJECT, EVENTPAIR_OBJECT, IOCOMPLETITION_OBJECT,
00033         DEVICE_OBJECT, FILE_OBJECT, CONTROLLER_OBJECT, PROFILE_OBJECT,
00034         TYPE_OBJECT, DESKTOP_OBJECT, WINDOWSTATION_OBJECT, DRIVER_OBJECT,
00035         TOKEN_OBJECT, PROCESS_OBJECT, THREAD_OBJECT, ADAPTER_OBJECT, PORT_OBJECT,
00036
00037         UNKNOWN_OBJECT_TYPE=-1
00038 };


ROS Explorer: ntobjfs.h Source File

  • File List
  • File Members
shell

ntobjfs.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // ntobjfs.h
00024  //
00025  // Martin Fuchs, 31.01.2004
00026  //
00027
00028
00029 enum OBJECT_TYPE {
00030         DIRECTORY_OBJECT, SYMBOLICLINK_OBJECT,
00031         MUTANT_OBJECT, SECTION_OBJECT, EVENT_OBJECT, SEMAPHORE_OBJECT,
00032         TIMER_OBJECT, KEY_OBJECT, EVENTPAIR_OBJECT, IOCOMPLETITION_OBJECT,
00033         DEVICE_OBJECT, FILE_OBJECT, CONTROLLER_OBJECT, PROFILE_OBJECT,
00034         TYPE_OBJECT, DESKTOP_OBJECT, WINDOWSTATION_OBJECT, DRIVER_OBJECT,
00035         TOKEN_OBJECT, PROCESS_OBJECT, THREAD_OBJECT, ADAPTER_OBJECT, PORT_OBJECT,
00036
00037         UNKNOWN_OBJECT_TYPE=-1
00038 };
00039
00040 struct RtlAnsiString {
00041         WORD    string_len;
00042         WORD    alloc_len;
00043         LPSTR   string_ptr;
00044 };
00045
00046 struct RtlUnicodeString {
00047         WORD    string_len;
00048         WORD    alloc_len;
00049         LPWSTR  string_ptr;
00050 };
00051
00052 struct NtObjectInfo {
00053         RtlUnicodeString name;
00054         RtlUnicodeString type;
00055         BYTE    padding[16];
00056 };
00057
00058 struct OpenStruct {
00059         DWORD   size;
00060         DWORD   _1;
00061         RtlUnicodeString* string;
00062         DWORD   _3;
00063         DWORD   _4;
00064         DWORD   _5;
00065 };
00066
00067 struct NtObject {
00068         DWORD   _0;
00069         DWORD   _1;
00070         DWORD   handle_count;
00071         DWORD   reference_count;
00072         DWORD   _4;
00073         DWORD   _5;
00074         DWORD   _6;
00075         DWORD   _7;
00076         DWORD   _8;
00077         DWORD   _9;
00078         DWORD   _A;
00079         DWORD   _B;
00080         FILETIME creation_time;
00081 };
00082
00083
00085 struct NtObjEntry : public Entry
00086 {
00087         NtObjEntry(Entry* parent, OBJECT_TYPE type) : Entry(parent, ET_NTOBJS), _type(type) {}
00088
00089         OBJECT_TYPE     _type;
00090
00091 protected:
00092         NtObjEntry(OBJECT_TYPE type) : Entry(ET_NTOBJS), _type(type) {}
00093
00094         virtual bool get_path(PTSTR path, size_t path_count) const;
00095         virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow);
00096 };
00097
00098
00100 struct NtObjDirectory : public NtObjEntry, public Directory
00101 {
00102         NtObjDirectory(LPCTSTR root_path)
00103          :      NtObjEntry(DIRECTORY_OBJECT)
00104         {
00105                 _path = _tcsdup(root_path);
00106         }
00107
00108         NtObjDirectory(Entry* parent, LPCTSTR path)
00109          :      NtObjEntry(parent, DIRECTORY_OBJECT)
00110         {
00111                 _path = _tcsdup(path);
00112         }
00113
00114         ~NtObjDirectory()
00115         {
00116                 free(_path);
00117                 _path = NULL;
00118         }
00119
00120         virtual void read_directory(int scan_flags=SCAN_ALL);
00121         virtual Entry* find_entry(const void*);
00122 };


ROS Explorer: pane.cpp File Reference

  • File List
  • File Members
shell

pane.cpp File Reference

#include <precomp.h>
#include "../resource.h"

Include dependency graph for pane.cpp:

Go to the source code of this file.

Defines

#define | IMAGE_WIDTH 16
#define | IMAGE_HEIGHT 13

Enumerations

enum IMAGE {
IMG_NONE = -1, IMG_FILE = 0, IMG_DOCUMENT, IMG_EXECUTABLE,
IMG_FOLDER, IMG_OPEN_FOLDER, IMG_FOLDER_PLUS, IMG_OPEN_PLUS,
IMG_OPEN_MINUS, IMG_FOLDER_UP, IMG_FOLDER_CUR
}

Define Documentation

#define IMAGE_HEIGHT 13

Definition at line 42 of file pane.cpp.

Referenced by Pane::draw_item().

#define IMAGE_WIDTH 16

Definition at line 41 of file pane.cpp.

Referenced by Pane::draw_item().

Enumeration Type Documentation

enum IMAGE

Enumerator:
IMG_NONE
IMG_FILE
IMG_DOCUMENT
IMG_EXECUTABLE
IMG_FOLDER
IMG_OPEN_FOLDER
IMG_FOLDER_PLUS
IMG_OPEN_PLUS
IMG_OPEN_MINUS
IMG_FOLDER_UP
IMG_FOLDER_CUR

Definition at line 34 of file pane.cpp.

00034            {
00035         IMG_NONE=-1,    IMG_FILE=0,             IMG_DOCUMENT,   IMG_EXECUTABLE,
00036         IMG_FOLDER,     IMG_OPEN_FOLDER,        IMG_FOLDER_PLUS,IMG_OPEN_PLUS,  IMG_OPEN_MINUS,
00037         IMG_FOLDER_UP,  IMG_FOLDER_CUR
00038 };


ROS Explorer: pane.cpp Source File

  • File List
  • File Members
shell

pane.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // pane.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "../resource.h"
00032
00033
00034 enum IMAGE {
00035         IMG_NONE=-1,    IMG_FILE=0,             IMG_DOCUMENT,   IMG_EXECUTABLE,
00036         IMG_FOLDER,     IMG_OPEN_FOLDER,        IMG_FOLDER_PLUS,IMG_OPEN_PLUS,  IMG_OPEN_MINUS,
00037         IMG_FOLDER_UP,  IMG_FOLDER_CUR
00038 };
00039
00040
00041 #define IMAGE_WIDTH             16
00042 #define IMAGE_HEIGHT            13
00043
00044
00045 static const LPTSTR g_pos_names[COLUMNS] = {
00046         TEXT(""),                       /* symbol */
00047         TEXT("Name"),
00048         TEXT("Type"),
00049         TEXT("Size"),
00050         TEXT("CDate"),
00051         TEXT("ADate"),
00052         TEXT("MDate"),
00053         TEXT("Index/Inode"),
00054         TEXT("Links"),
00055         TEXT("Attributes"),
00056         TEXT("Security"),
00057         TEXT("Content")
00058 };
00059
00060 static const int g_pos_align[] = {
00061         0,
00062         HDF_LEFT,       /* Name */
00063         HDF_LEFT,       /* Type */
00064         HDF_RIGHT,      /* Size */
00065         HDF_LEFT,       /* CDate */
00066         HDF_LEFT,       /* ADate */
00067         HDF_LEFT,       /* MDate */
00068         HDF_LEFT,       /* Index */
00069         HDF_RIGHT,      /* Links */
00070         HDF_CENTER,     /* Attributes */
00071         HDF_LEFT,       /* Security */
00072         HDF_LEFT        /* Content / Description */
00073 };
00074
00075
00076 Pane::Pane(HWND hparent, int id, int id_header, Entry* root, bool treePane, int visible_cols)
00077  :      super(CreateWindow(TEXT("ListBox"), TEXT(""), WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|
00078                         LBS_DISABLENOSCROLL|LBS_NOINTEGRALHEIGHT|LBS_OWNERDRAWFIXED|LBS_NOTIFY,
00079                         0, 0, 0, 0, hparent, (HMENU)id, g_Globals._hInstance, 0)),
00080         _root(root),
00081         _visible_cols(visible_cols),
00082         _treePane(treePane)
00083 {
00084          // insert entries into listbox
00085         Entry* entry = _root;
00086
00087         if (entry)
00088                 insert_entries(entry);
00089
00090         init();
00091
00092         create_header(hparent, id_header);
00093 }
00094
00095 Pane::~Pane()
00096 {
00097         ImageList_Destroy(_himl);
00098 }
00099
00100
00101 LRESULT Pane::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00102 {
00103         switch(nmsg) {
00104           case WM_HSCROLL:
00105                 set_header();
00106                 break;
00107
00108           case WM_SETFOCUS: {
00109                 FileChildWindow* child = (FileChildWindow*) SendMessage(GetParent(_hwnd), PM_GET_FILEWND_PTR, 0, 0);
00110
00111                 child->set_focus_pane(this);
00112                 ListBox_SetSel(_hwnd, TRUE, 1);
00113                 /*@todo check menu items */
00114                 break;}
00115
00116           case WM_KEYDOWN: {
00117                 FileChildWindow* child = (FileChildWindow*) SendMessage(GetParent(_hwnd), PM_GET_FILEWND_PTR, 0, 0);
00118
00119                 if (wparam == VK_TAB) {
00120                         /*@todo SetFocus(g_Globals.hdrivebar) */
00121                         child->switch_focus_pane();
00122                 }
00123                 break;}
00124         }
00125
00126         return super::WndProc(nmsg, wparam, lparam);
00127 }
00128
00129
00130 bool Pane::create_header(HWND hparent, int id)
00131 {
00132         HWND hwnd = CreateWindow(WC_HEADER, 0, WS_CHILD|WS_VISIBLE|HDS_HORZ/*@todo |HDS_BUTTONS + sort orders*/,
00133                                                                 0, 0, 0, 0, hparent, (HMENU)id, g_Globals._hInstance, 0);
00134         if (!hwnd)
00135                 return false;
00136
00137         SetWindowFont(hwnd, GetStockFont(DEFAULT_GUI_FONT), FALSE);
00138
00139         HD_ITEM hdi;
00140
00141         hdi.mask = HDI_TEXT|HDI_WIDTH|HDI_FORMAT;
00142
00143         for(int idx=0; idx<COLUMNS; idx++) {
00144                 hdi.pszText = g_pos_names[idx];
00145                 hdi.fmt = HDF_STRING | g_pos_align[idx];
00146                 hdi.cxy = _widths[idx];
00147                 Header_InsertItem(hwnd, idx, &hdi);
00148         }
00149
00150         _hwndHeader = hwnd;
00151
00152         return true;
00153 }
00154
00155
00156 void Pane::init()
00157 {
00158         _himl = ImageList_LoadBitmap(g_Globals._hInstance, MAKEINTRESOURCE(IDB_IMAGES), 16, 0, RGB(0,255,0));
00159
00160         SetWindowFont(_hwnd, _out_wrkr._hfont, FALSE);
00161
00162          // read the color for compressed files from registry
00163         HKEY hkeyExplorer = 0;
00164         DWORD len = sizeof(_clrCompressed);
00165
00166         if (RegOpenKey(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer"), &hkeyExplorer) ||
00167                 RegQueryValueEx(hkeyExplorer, TEXT("AltColor"), 0, NULL, (LPBYTE)&_clrCompressed, &len) || len!=sizeof(_clrCompressed))
00168                 _clrCompressed = RGB(0,0,255);
00169
00170         if (hkeyExplorer)
00171                 RegCloseKey(hkeyExplorer);
00172
00173          // calculate column widths
00174         _out_wrkr.init_output(_hwnd);
00175         calc_widths(true);
00176 }
00177
00178
00179  // calculate prefered width for all visible columns
00180
00181 bool Pane::calc_widths(bool anyway)
00182 {
00183         int col, x, cx, spc=3*_out_wrkr._spaceSize.cx;
00184         int entries = ListBox_GetCount(_hwnd);
00185         int orgWidths[COLUMNS];
00186         int orgPositions[COLUMNS+1];
00187         HFONT hfontOld;
00188         HDC hdc;
00189         int cnt;
00190
00191         if (!anyway) {
00192                 memcpy(orgWidths, _widths, sizeof(orgWidths));
00193                 memcpy(orgPositions, _positions, sizeof(orgPositions));
00194         }
00195
00196         for(col=0; col<COLUMNS; col++)
00197                 _widths[col] = 0;
00198
00199         hdc = GetDC(_hwnd);
00200         hfontOld = SelectFont(hdc, _out_wrkr._hfont);
00201
00202         for(cnt=0; cnt<entries; cnt++) {
00203                 Entry* entry = (Entry*) ListBox_GetItemData(_hwnd, cnt);
00204
00205                 DRAWITEMSTRUCT dis;
00206
00207                 dis.CtlType               = 0;
00208                 dis.CtlID                 = 0;
00209                 dis.itemID                = 0;
00210                 dis.itemAction    = 0;
00211                 dis.itemState     = 0;
00212                 dis.hwndItem      = _hwnd;
00213                 dis.hDC                   = hdc;
00214                 dis.rcItem.left   = 0;
00215                 dis.rcItem.top    = 0;
00216                 dis.rcItem.right  = 0;
00217                 dis.rcItem.bottom = 0;
00218                 /*dis.itemData    = 0; */
00219
00220                 draw_item(&dis, entry, COLUMNS);
00221         }
00222
00223         SelectObject(hdc, hfontOld);
00224         ReleaseDC(_hwnd, hdc);
00225
00226         x = 0;
00227         for(col=0; col<COLUMNS; col++) {
00228                 _positions[col] = x;
00229                 cx = _widths[col];
00230
00231                 if (cx) {
00232                         cx += spc;
00233
00234                         if (cx < IMAGE_WIDTH)
00235                                 cx = IMAGE_WIDTH;
00236
00237                         _widths[col] = cx;
00238                 }
00239
00240                 x += cx;
00241         }
00242
00243         _positions[COLUMNS] = x;
00244
00245         ListBox_SetHorizontalExtent(_hwnd, x);
00246
00247          // no change?
00248         if (!memcmp(orgWidths, _widths, sizeof(orgWidths)))
00249                 return FALSE;
00250
00251          // don't move, if only collapsing an entry
00252         if (!anyway && _widths[0]<orgWidths[0] &&
00253                 !memcmp(orgWidths+1, _widths+1, sizeof(orgWidths)-sizeof(int))) {
00254                 _widths[0] = orgWidths[0];
00255                 memcpy(_positions, orgPositions, sizeof(orgPositions));
00256
00257                 return FALSE;
00258         }
00259
00260         InvalidateRect(_hwnd, 0, TRUE);
00261
00262         return TRUE;
00263 }
00264
00265
00266 static void format_date(const FILETIME* ft, TCHAR* buffer, int visible_cols)
00267 {
00268         SYSTEMTIME systime;
00269         FILETIME lft;
00270         int len = 0;
00271
00272         *buffer = TEXT('\0');
00273
00274         if (!ft->dwLowDateTime && !ft->dwHighDateTime)
00275                 return;
00276
00277         if (!FileTimeToLocalFileTime(ft, &lft))
00278                 {err: lstrcpy(buffer,TEXT("???")); return;}
00279
00280         if (!FileTimeToSystemTime(&lft, &systime))
00281                 goto err;
00282
00283         if (visible_cols & COL_DATE) {
00284                 len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer, BUFFER_LEN);
00285                 if (!len)
00286                         goto err;
00287         }
00288
00289         if (visible_cols & COL_TIME) {
00290                 if (len)
00291                         buffer[len-1] = ' ';
00292
00293                 buffer[len++] = ' ';
00294
00295                 if (!GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, buffer+len, BUFFER_LEN-len))
00296                         buffer[len] = TEXT('\0');
00297         }
00298 }
00299
00300
00301 void Pane::draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol)
00302 {
00303         TCHAR buffer[BUFFER_LEN];
00304         DWORD attrs;
00305         int visible_cols = _visible_cols;
00306         COLORREF bkcolor, textcolor;
00307         RECT focusRect = dis->rcItem;
00308         enum IMAGE img;
00309         int img_pos, cx;
00310         int col = 0;
00311
00312         if (entry) {
00313                 attrs = entry->_data.dwFileAttributes;
00314
00315                 if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
00316                         if (entry->_data.cFileName[0]==TEXT('.') && entry->_data.cFileName[1]==TEXT('.')
00317                                         && entry->_data.cFileName[2]==TEXT('\0'))
00318                                 img = IMG_FOLDER_UP;
00319                         else if (entry->_data.cFileName[0]==TEXT('.') && entry->_data.cFileName[1]==TEXT('\0'))
00320                                 img = IMG_FOLDER_CUR;
00321                         else if ((_treePane && (dis->itemState&ODS_FOCUS)))
00322                                 img = IMG_OPEN_FOLDER;
00323                         else
00324                                 img = IMG_FOLDER;
00325                 } else {
00326                         if (attrs & ATTRIBUTE_EXECUTABLE)
00327                                 img = IMG_EXECUTABLE;
00328                         else if (entry->_type_name)
00329                                 img = IMG_DOCUMENT;
00330                         else
00331                                 img = IMG_FILE;
00332                 }
00333         } else {
00334                 attrs = 0;
00335                 img = IMG_NONE;
00336         }
00337
00338         if (_treePane) {
00339                 if (entry) {
00340                         img_pos = dis->rcItem.left + entry->_level*(IMAGE_WIDTH+_out_wrkr._spaceSize.cx);
00341
00342                         if (calcWidthCol == -1) {
00343                                 int x;
00344                                 int y = dis->rcItem.top + IMAGE_HEIGHT/2;
00345                                 Entry* up;
00346                                 RECT rt_clip;
00347                                 HRGN hrgn_org = CreateRectRgn(0, 0, 0, 0);
00348                                 HRGN hrgn;
00349
00350                                 rt_clip.left   = dis->rcItem.left;
00351                                 rt_clip.top    = dis->rcItem.top;
00352                                 rt_clip.right  = dis->rcItem.left+_widths[col];
00353                                 rt_clip.bottom = dis->rcItem.bottom;
00354
00355                                 hrgn = CreateRectRgnIndirect(&rt_clip);
00356
00357                                 if (!GetClipRgn(dis->hDC, hrgn_org)) {
00358                                         DeleteObject(hrgn_org);
00359                                         hrgn_org = 0;
00360                                 }
00361
00362                                 //HGDIOBJ holdPen = SelectObject(dis->hDC, GetStockObject(BLACK_PEN));
00363                                 ExtSelectClipRgn(dis->hDC, hrgn, RGN_AND);
00364                                 DeleteObject(hrgn);
00365
00366                                 if ((up=entry->_up) != NULL) {
00367                                         MoveToEx(dis->hDC, img_pos-IMAGE_WIDTH/2, y, 0);
00368                                         LineTo(dis->hDC, img_pos-2, y);
00369
00370                                         x = img_pos - IMAGE_WIDTH/2;
00371
00372                                         do {
00373                                                 x -= IMAGE_WIDTH+_out_wrkr._spaceSize.cx;
00374
00375                                                 if (up->_next) {
00376 #ifndef _LEFT_FILES
00377                                                         bool following_child = (up->_next->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)!=0; // a directory?
00378
00379                                                         if (!following_child)
00380                                                                 for(Entry*n=up->_next; n; n=n->_next)
00381                                                                         if (n->_down) { // any file with NTFS sub-streams?
00382                                                                                 following_child = true;
00383                                                                                 break;
00384                                                                         }
00385
00386                                                         if (following_child)
00387 #endif
00388                                                         {
00389                                                                 MoveToEx(dis->hDC, x, dis->rcItem.top, 0);
00390                                                                 LineTo(dis->hDC, x, dis->rcItem.bottom);
00391                                                         }
00392                                                 }
00393                                         } while((up=up->_up) != NULL);
00394                                 }
00395
00396                                 x = img_pos - IMAGE_WIDTH/2;
00397
00398                                 MoveToEx(dis->hDC, x, dis->rcItem.top, 0);
00399                                 LineTo(dis->hDC, x, y);
00400
00401                                 if (entry->_next) {
00402 #ifndef _LEFT_FILES
00403                                         bool following_child = (entry->_next->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)!=0;      // a directory?
00404
00405                                         if (!following_child)
00406                                                 for(Entry*n=entry->_next; n; n=n->_next)
00407                                                         if (n->_down) { // any file with NTFS sub-streams?
00408                                                                 following_child = true;
00409                                                                 break;
00410                                                         }
00411
00412                                         if (following_child)
00413 #endif
00414                                                 LineTo(dis->hDC, x, dis->rcItem.bottom);
00415                                 }
00416
00417                                 if (entry->_down && entry->_expanded) {
00418                                         x += IMAGE_WIDTH + _out_wrkr._spaceSize.cx;
00419                                         MoveToEx(dis->hDC, x, dis->rcItem.top+IMAGE_HEIGHT, 0);
00420                                         LineTo(dis->hDC, x, dis->rcItem.bottom);
00421                                 }
00422
00423                                 SelectClipRgn(dis->hDC, hrgn_org);
00424                                 if (hrgn_org) DeleteObject(hrgn_org);
00425                                 //SelectObject(dis->hDC, holdPen);
00426                         } else if (calcWidthCol==col || calcWidthCol==COLUMNS) {
00427                                 int right = img_pos + IMAGE_WIDTH - _out_wrkr._spaceSize.cx;
00428
00429                                 if (right > _widths[col])
00430                                         _widths[col] = right;
00431                         }
00432                 } else  {
00433                         img_pos = dis->rcItem.left;
00434                 }
00435         } else {
00436                 img_pos = dis->rcItem.left;
00437
00438                 if (calcWidthCol==col || calcWidthCol==COLUMNS)
00439                         _widths[col] = IMAGE_WIDTH;
00440         }
00441
00442         if (calcWidthCol == -1) {
00443                 focusRect.left = img_pos -2;
00444
00445                 if (attrs & FILE_ATTRIBUTE_COMPRESSED)
00446                         textcolor = _clrCompressed;
00447                 else
00448                         textcolor = RGB(0,0,0);
00449
00450                 if (dis->itemState & ODS_FOCUS) {
00451                         textcolor = GetSysColor(COLOR_HIGHLIGHTTEXT);
00452                         bkcolor = GetSysColor(COLOR_HIGHLIGHT);
00453                 } else {
00454                         bkcolor = GetSysColor(COLOR_WINDOW);
00455                 }
00456
00457                 HBRUSH hbrush = CreateSolidBrush(bkcolor);
00458                 FillRect(dis->hDC, &focusRect, hbrush);
00459                 DeleteObject(hbrush);
00460
00461                 SetBkMode(dis->hDC, TRANSPARENT);
00462                 SetTextColor(dis->hDC, textcolor);
00463
00464                 cx = _widths[col];
00465
00466                 if (cx && img!=IMG_NONE) {
00467                         if (cx > IMAGE_WIDTH)
00468                                 cx = IMAGE_WIDTH;
00469
00470                         if (entry->_icon_id > ICID_NONE)
00471                                 g_Globals._icon_cache.get_icon(entry->_icon_id).draw(dis->hDC, img_pos, dis->rcItem.top, cx, GetSystemMetrics(SM_CYSMICON), bkcolor, 0);
00472                         else
00473                                 ImageList_DrawEx(_himl, img, dis->hDC,
00474                                                                  img_pos, dis->rcItem.top, cx,
00475                                                                  IMAGE_HEIGHT, bkcolor, CLR_DEFAULT, ILD_NORMAL);
00476                 }
00477         }
00478
00479         if (!entry)
00480                 return;
00481
00482         ++col;
00483
00484          // output file name
00485         if (calcWidthCol == -1)
00486                 _out_wrkr.output_text(dis, _positions, col, entry->_display_name, 0);
00487         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00488                 calc_width(dis, col, entry->_display_name);
00489         ++col;
00490
00491          // output type/class name
00492         if (visible_cols & COL_TYPE) {
00493                 if (calcWidthCol == -1)
00494                         _out_wrkr.output_text(dis, _positions, col, entry->_type_name? entry->_type_name: TEXT(""), 0);
00495                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00496                         calc_width(dis, col, entry->_type_name? entry->_type_name: TEXT(""));
00497         }
00498         ++col;
00499
00500          // display file size
00501         if (visible_cols & COL_SIZE) {
00502                 ULONGLONG size = ((ULONGLONG)entry->_data.nFileSizeHigh << 32) | entry->_data.nFileSizeLow;
00503
00504                 _stprintf(buffer, TEXT("%") LONGLONGARG TEXT("d"), size);
00505
00506                 if (calcWidthCol == -1)
00507                         _out_wrkr.output_number(dis, _positions, col, buffer);
00508                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00509                         calc_width(dis, col, buffer);
00510         }
00511         ++col;
00512
00513          // display file date
00514         if (visible_cols & (COL_DATE|COL_TIME)) {
00515                 format_date(&entry->_data.ftCreationTime, buffer, visible_cols);
00516                 if (calcWidthCol == -1)
00517                         _out_wrkr.output_text(dis, _positions, col, buffer, 0);
00518                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00519                         calc_width(dis, col, buffer);
00520                 ++col;
00521
00522                 format_date(&entry->_data.ftLastAccessTime, buffer, visible_cols);
00523                 if (calcWidthCol == -1)
00524                         _out_wrkr.output_text(dis,_positions,  col, buffer, 0);
00525                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00526                         calc_width(dis, col, buffer);
00527                 ++col;
00528
00529                 format_date(&entry->_data.ftLastWriteTime, buffer, visible_cols);
00530                 if (calcWidthCol == -1)
00531                         _out_wrkr.output_text(dis, _positions, col, buffer, 0);
00532                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00533                         calc_width(dis, col, buffer);
00534                 ++col;
00535         } else
00536                 col += 3;
00537
00538         if (entry->_bhfi_valid) {
00539                 ULONGLONG index = ((ULONGLONG)entry->_bhfi.nFileIndexHigh << 32) | entry->_bhfi.nFileIndexLow;
00540
00541                 if (visible_cols & COL_INDEX) {
00542                         _stprintf(buffer, TEXT("%") LONGLONGARG TEXT("X"), index);
00543
00544                         if (calcWidthCol == -1)
00545                                 _out_wrkr.output_text(dis, _positions, col, buffer, DT_RIGHT);
00546                         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00547                                 calc_width(dis, col, buffer);
00548
00549                         ++col;
00550                 }
00551
00552                 if (visible_cols & COL_LINKS) {
00553                         wsprintf(buffer, TEXT("%d"), entry->_bhfi.nNumberOfLinks);
00554
00555                         if (calcWidthCol == -1)
00556                                 _out_wrkr.output_text(dis, _positions, col, buffer, DT_RIGHT);
00557                         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00558                                 calc_width(dis, col, buffer);
00559
00560                         ++col;
00561                 }
00562         } else
00563                 col += 2;
00564
00565          // show file attributes
00566         if (visible_cols & COL_ATTRIBUTES) {
00567                 lstrcpy(buffer, TEXT(" \t \t \t \t \t \t \t \t \t \t \t \t \t \t "));
00568
00569                 if (attrs & FILE_ATTRIBUTE_NORMAL)                                      buffer[ 0] = 'N';
00570                 else {
00571                         if (attrs & FILE_ATTRIBUTE_READONLY)                    buffer[ 2] = 'R';
00572                         if (attrs & FILE_ATTRIBUTE_HIDDEN)                              buffer[ 4] = 'H';
00573                         if (attrs & FILE_ATTRIBUTE_SYSTEM)                              buffer[ 6] = 'S';
00574                         if (attrs & FILE_ATTRIBUTE_ARCHIVE)                     buffer[ 8] = 'A';
00575                         if (attrs & FILE_ATTRIBUTE_COMPRESSED)                  buffer[10] = 'C';
00576                         if (attrs & FILE_ATTRIBUTE_DIRECTORY)                   buffer[12] = 'D';
00577                         if (attrs & FILE_ATTRIBUTE_ENCRYPTED)                   buffer[14] = 'E';
00578                         if (attrs & FILE_ATTRIBUTE_TEMPORARY)                   buffer[16] = 'T';
00579                         if (attrs & FILE_ATTRIBUTE_SPARSE_FILE)                 buffer[18] = 'P';
00580                         if (attrs & FILE_ATTRIBUTE_REPARSE_POINT)               buffer[20] = 'Q';
00581                         if (attrs & FILE_ATTRIBUTE_OFFLINE)                     buffer[22] = 'O';
00582                         if (attrs & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) buffer[24] = 'X';
00583                         if (attrs & ATTRIBUTE_EXECUTABLE)                               buffer[26] = 'x';
00584                         if (attrs & ATTRIBUTE_SYMBOLIC_LINK)                    buffer[28] = 'L';
00585                 }
00586
00587                 if (calcWidthCol == -1)
00588                         _out_wrkr.output_tabbed_text(dis, _positions, col, buffer);
00589                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00590                         calc_tabbed_width(dis, col, buffer);
00591         }
00592         ++col;
00593
00594 /*TODO
00595         if (flags.security) {
00596                 DWORD rights = get_access_mask();
00597
00598                 tcscpy(buffer, TEXT(" \t \t \t  \t  \t \t \t  \t  \t \t \t "));
00599
00600                 if (rights & FILE_READ_DATA)                    buffer[ 0] = 'R';
00601                 if (rights & FILE_WRITE_DATA)                   buffer[ 2] = 'W';
00602                 if (rights & FILE_APPEND_DATA)                  buffer[ 4] = 'A';
00603                 if (rights & FILE_READ_EA)                              {buffer[6] = 'entry'; buffer[ 7] = 'R';}
00604                 if (rights & FILE_WRITE_EA)                     {buffer[9] = 'entry'; buffer[10] = 'W';}
00605                 if (rights & FILE_EXECUTE)                              buffer[12] = 'X';
00606                 if (rights & FILE_DELETE_CHILD)                 buffer[14] = 'D';
00607                 if (rights & FILE_READ_ATTRIBUTES)              {buffer[16] = 'a'; buffer[17] = 'R';}
00608                 if (rights & FILE_WRITE_ATTRIBUTES)     {buffer[19] = 'a'; buffer[20] = 'W';}
00609                 if (rights & WRITE_DAC)                                 buffer[22] = 'C';
00610                 if (rights & WRITE_OWNER)                               buffer[24] = 'O';
00611                 if (rights & SYNCHRONIZE)                               buffer[26] = 'S';
00612
00613                 output_text(dis, col++, buffer, DT_LEFT, 3, psize);
00614         }
00615
00616         if (flags.description) {
00617                 get_description(buffer);
00618                 output_text(dis, col++, buffer, 0, psize);
00619         }
00620 */
00621         ++col;
00622
00623          // output content / symbolic link target / comment
00624         if (visible_cols & COL_CONTENT) {
00625                 if (calcWidthCol == -1)
00626                         _out_wrkr.output_text(dis, _positions, col, entry->_content? entry->_content: TEXT(""), 0);
00627                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00628                         calc_width(dis, col, entry->_content? entry->_content: TEXT(""));
00629         }
00630 }
00631
00632
00633 void Pane::calc_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
00634 {
00635         RECT rt = {0, 0, 0, 0};
00636
00637         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX);
00638
00639         if (rt.right > _widths[col])
00640                 _widths[col] = rt.right;
00641 }
00642
00643 void Pane::calc_tabbed_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
00644 {
00645         RECT rt = {0, 0, 0, 0};
00646
00647 /*      DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
00648         DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
00649
00650         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
00651         //FIXME rt (0,0) ???
00652
00653         if (rt.right > _widths[col])
00654                 _widths[col] = rt.right;
00655 }
00656
00657
00658  // insert listbox entries after index idx
00659
00660 int Pane::insert_entries(Entry* dir, int idx)
00661 {
00662         Entry* entry = dir;
00663
00664         if (!entry)
00665                 return idx;
00666
00667         for(; entry; entry=entry->_next) {
00668 #ifndef _LEFT_FILES
00669                 if (_treePane &&
00670                         !(entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) &&    // not a directory?
00671                         !entry->_down)  // not a file with NTFS sub-streams?
00672                         continue;
00673 #endif
00674
00675                  // don't display entries "." and ".." in the left pane
00676                 if (_treePane && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
00677                                 && entry->_data.cFileName[0]==TEXT('.'))
00678                         if (entry->_data.cFileName[1]==TEXT('\0') ||
00679                                 (entry->_data.cFileName[1]==TEXT('.') && entry->_data.cFileName[2]==TEXT('\0')))
00680                                 continue;
00681
00682                 if (idx != -1)
00683                         ++idx;
00684
00685                 ListBox_InsertItemData(_hwnd, idx, entry);
00686
00687                 if (_treePane && entry->_expanded)
00688                         idx = insert_entries(entry->_down, idx);
00689         }
00690
00691         return idx;
00692 }
00693
00694
00695 void Pane::set_header()
00696 {
00697         HD_ITEM item;
00698         int scroll_pos = GetScrollPos(_hwnd, SB_HORZ);
00699         int i=0, x=0;
00700
00701         item.mask = HDI_WIDTH;
00702         item.cxy = 0;
00703
00704         for(; x+_widths[i]<scroll_pos && i<COLUMNS; i++) {
00705                 x += _widths[i];
00706                 Header_SetItem(_hwndHeader, i, &item);
00707         }
00708
00709         if (i < COLUMNS) {
00710                 x += _widths[i];
00711                 item.cxy = x - scroll_pos;
00712                 Header_SetItem(_hwndHeader, i++, &item);
00713
00714                 for(; i<COLUMNS; i++) {
00715                         item.cxy = _widths[i];
00716                         x += _widths[i];
00717                         Header_SetItem(_hwndHeader, i, &item);
00718                 }
00719         }
00720 }
00721
00722
00723  // calculate one prefered column width
00724
00725 void Pane::calc_single_width(int col)
00726 {
00727         HFONT hfontOld;
00728         int x, cx;
00729         int cnt;
00730         HDC hdc;
00731
00732         int entries = ListBox_GetCount(_hwnd);
00733
00734         _widths[col] = 0;
00735
00736         hdc = GetDC(_hwnd);
00737         hfontOld = SelectFont(hdc, _out_wrkr._hfont);
00738
00739         for(cnt=0; cnt<entries; cnt++) {
00740                 Entry* entry = (Entry*) ListBox_GetItemData(_hwnd, cnt);
00741
00742                 DRAWITEMSTRUCT dis;
00743
00744                 dis.CtlType               = 0;
00745                 dis.CtlID                 = 0;
00746                 dis.itemID                = 0;
00747                 dis.itemAction    = 0;
00748                 dis.itemState     = 0;
00749                 dis.hwndItem      = _hwnd;
00750                 dis.hDC                   = hdc;
00751                 dis.rcItem.left   = 0;
00752                 dis.rcItem.top    = 0;
00753                 dis.rcItem.right  = 0;
00754                 dis.rcItem.bottom = 0;
00755                 /*dis.itemData    = 0; */
00756
00757                 draw_item(&dis, entry, col);
00758         }
00759
00760         SelectObject(hdc, hfontOld);
00761         ReleaseDC(_hwnd, hdc);
00762
00763         cx = _widths[col];
00764
00765         if (cx) {
00766                 cx += 3*_out_wrkr._spaceSize.cx;
00767
00768                 if (cx < IMAGE_WIDTH)
00769                         cx = IMAGE_WIDTH;
00770         }
00771
00772         _widths[col] = cx;
00773
00774         x = _positions[col] + cx;
00775
00776         for(; col<COLUMNS; ) {
00777                 _positions[++col] = x;
00778                 x += _widths[col];
00779         }
00780
00781         ListBox_SetHorizontalExtent(_hwnd, x);
00782 }
00783
00784
00785 int Pane::Notify(int id, NMHDR* pnmh)
00786 {
00787         switch(pnmh->code) {
00788                 case HDN_TRACK:
00789                 case HDN_ENDTRACK: {
00790                         HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
00791                         int idx = phdn->iItem;
00792                         int dx = phdn->pitem->cxy - _widths[idx];
00793                         int i;
00794
00795                         ClientRect clnt(_hwnd);
00796
00797                          // move immediate to simulate HDS_FULLDRAG (for now [04/2000] not realy needed with WINELIB)
00798                         Header_SetItem(_hwndHeader, idx, phdn->pitem);
00799
00800                         _widths[idx] += dx;
00801
00802                         for(i=idx; ++i<=COLUMNS; )
00803                                 _positions[i] += dx;
00804
00805                         {
00806                                 int scroll_pos = GetScrollPos(_hwnd, SB_HORZ);
00807                                 RECT rt_scr;
00808                                 RECT rt_clip;
00809
00810                                 rt_scr.left   = _positions[idx+1]-scroll_pos;
00811                                 rt_scr.top    = 0;
00812                                 rt_scr.right  = clnt.right;
00813                                 rt_scr.bottom = clnt.bottom;
00814
00815                                 rt_clip.left   = _positions[idx]-scroll_pos;
00816                                 rt_clip.top    = 0;
00817                                 rt_clip.right  = clnt.right;
00818                                 rt_clip.bottom = clnt.bottom;
00819
00820                                 if (rt_scr.left < 0) rt_scr.left = 0;
00821                                 if (rt_clip.left < 0) rt_clip.left = 0;
00822
00823                                 ScrollWindowEx(_hwnd, dx, 0, &rt_scr, &rt_clip, 0, 0, SW_INVALIDATE);
00824
00825                                 rt_clip.right = _positions[idx+1];
00826                                 RedrawWindow(_hwnd, &rt_clip, 0, RDW_INVALIDATE|RDW_UPDATENOW);
00827
00828                                 if (pnmh->code == HDN_ENDTRACK) {
00829                                         ListBox_SetHorizontalExtent(_hwnd, _positions[COLUMNS]);
00830
00831                                         if (GetScrollPos(_hwnd, SB_HORZ) != scroll_pos)
00832                                                 set_header();
00833                                 }
00834                         }
00835
00836                         return 0;
00837                 }
00838
00839                 case HDN_DIVIDERDBLCLICK: {
00840                         HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
00841                         HD_ITEM item;
00842
00843                         calc_single_width(phdn->iItem);
00844                         item.mask = HDI_WIDTH;
00845                         item.cxy = _widths[phdn->iItem];
00846
00847                         Header_SetItem(_hwndHeader, phdn->iItem, &item);
00848                         InvalidateRect(_hwnd, 0, TRUE);
00849                         break;}
00850
00851                 default:
00852                         return super::Notify(id, pnmh);
00853         }
00854
00855         return 0;
00856 }
00857
00858
00859 OutputWorker::OutputWorker()
00860 {
00861         _hfont = CreateFont(-MulDiv(8,GetDeviceCaps(WindowCanvas(0),LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, TEXT("MS Sans Serif"));
00862 }
00863
00864 void OutputWorker::init_output(HWND hwnd)
00865 {
00866         TCHAR b[16];
00867
00868         WindowCanvas canvas(hwnd);
00869
00870         if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, TEXT("1000"), 0, b, 16) > 4)
00871                 _num_sep = b[1];
00872         else
00873                 _num_sep = TEXT('.');
00874
00875         FontSelection font(canvas, _hfont);
00876         GetTextExtentPoint32(canvas, TEXT(" "), 1, &_spaceSize);
00877 }
00878
00879
00880 void OutputWorker::output_text(LPDRAWITEMSTRUCT dis, int* positions, int col, LPCTSTR str, DWORD flags)
00881 {
00882         int x = dis->rcItem.left;
00883         RECT rt;
00884
00885         rt.left   = x+positions[col]+_spaceSize.cx;
00886         rt.top    = dis->rcItem.top;
00887         rt.right  = x+positions[col+1]-_spaceSize.cx;
00888         rt.bottom = dis->rcItem.bottom;
00889
00890         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|flags);
00891 }
00892
00893 void OutputWorker::output_tabbed_text(LPDRAWITEMSTRUCT dis, int* positions, int col, LPCTSTR str)
00894 {
00895         int x = dis->rcItem.left;
00896         RECT rt;
00897
00898         rt.left   = x+positions[col]+_spaceSize.cx;
00899         rt.top    = dis->rcItem.top;
00900         rt.right  = x+positions[col+1]-_spaceSize.cx;
00901         rt.bottom = dis->rcItem.bottom;
00902
00903 /*      DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
00904         DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
00905
00906         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
00907 }
00908
00909 void OutputWorker::output_number(LPDRAWITEMSTRUCT dis, int* positions, int col, LPCTSTR str)
00910 {
00911         int x = dis->rcItem.left;
00912         RECT rt;
00913         LPCTSTR s = str;
00914         TCHAR b[128];
00915         LPTSTR d = b;
00916         int pos;
00917
00918         rt.left   = x+positions[col]+_spaceSize.cx;
00919         rt.top    = dis->rcItem.top;
00920         rt.right  = x+positions[col+1]-_spaceSize.cx;
00921         rt.bottom = dis->rcItem.bottom;
00922
00923         if (*s)
00924                 *d++ = *s++;
00925
00926          // insert number separator characters
00927         pos = lstrlen(s) % 3;
00928
00929         while(*s)
00930                 if (pos--)
00931                         *d++ = *s++;
00932                 else {
00933                         *d++ = _num_sep;
00934                         pos = 3;
00935                 }
00936
00937         DrawText(dis->hDC, b, d-b, &rt, DT_RIGHT|DT_SINGLELINE|DT_NOPREFIX|DT_END_ELLIPSIS);
00938 }
00939
00940
00941 BOOL Pane::command(UINT cmd)
00942 {
00943         switch(cmd) {
00944                 case ID_VIEW_NAME:
00945                         if (_visible_cols) {
00946                                 _visible_cols = 0;
00947                                 calc_widths(true);
00948                                 set_header();
00949                                 InvalidateRect(_hwnd, 0, TRUE);
00950                                 MenuInfo* menu_info = Frame_GetMenuInfo(GetParent(_hwnd));
00951                                 if (menu_info) {
00952                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_NAME, MF_BYCOMMAND|MF_CHECKED);
00953                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND);
00954                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
00955                                 }
00956                         }
00957                         break;
00958
00959                 case ID_VIEW_ALL_ATTRIBUTES:
00960                         if (_visible_cols != COL_ALL) {
00961                                 _visible_cols = COL_ALL;
00962                                 calc_widths(true);
00963                                 set_header();
00964                                 InvalidateRect(_hwnd, 0, TRUE);
00965                                 MenuInfo* menu_info = Frame_GetMenuInfo(GetParent(_hwnd));
00966                                 if (menu_info) {
00967                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_NAME, MF_BYCOMMAND);
00968                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND|MF_CHECKED);
00969                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
00970                                 }
00971                         }
00972                         break;
00973
00974                 case ID_PREFERED_SIZES: {
00975                         calc_widths(true);
00976                         set_header();
00977                         InvalidateRect(_hwnd, 0, TRUE);
00978                         break;}
00979
00980                         /*@todo more command ids... */
00981
00982                 default:
00983                         return FALSE;
00984         }
00985
00986         return TRUE;
00987 }
00988
00989 MainFrameBase* Pane::get_frame()
00990 {
00991         HWND owner = GetParent(_hwnd);
00992
00993         return (MainFrameBase*)owner;
00994 }


ROS Explorer: pane.h File Reference

  • File List
  • File Members
shell

pane.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | OutputWorker
Worker for drawing contents of file lists in child pane. More...
struct | Pane
child window pane for displaying file lists More...

Defines

#define | IDW_TREE_LEFT 3
#define | IDW_TREE_RIGHT 6
#define | IDW_HEADER_LEFT 2
#define | IDW_HEADER_RIGHT 5
#define | COLUMNS 12

Enumerations

enum COLUMN_FLAGS {
COL_TYPE = 0x0001, COL_SIZE = 0x0002, COL_DATE = 0x0004, COL_TIME = 0x0008,
COL_ATTRIBUTES = 0x0010, COL_DOSNAMES = 0x0020, COL_INDEX = 0x0040, COL_LINKS = 0x0080,
COL_CONTENT = 0x0100, COL_ALL = COL_TYPE|COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES|COL_INDEX|COL_LINKS|COL_CONTENT
}

Define Documentation

#define COLUMNS 12

Definition at line 73 of file pane.h.

Referenced by Pane::calc_widths(), Pane::create_header(), Pane::draw_item(), and Pane::set_header().

#define IDW_HEADER_LEFT 2

Definition at line 31 of file pane.h.

Referenced by FileChildWindow::Notify().

#define IDW_HEADER_RIGHT 5

Definition at line 32 of file pane.h.

#define IDW_TREE_LEFT 3

Definition at line 29 of file pane.h.

Referenced by FileChildWindow::WndProc().

#define IDW_TREE_RIGHT 6

Definition at line 30 of file pane.h.

Referenced by FileChildWindow::WndProc().

Enumeration Type Documentation

enum COLUMN_FLAGS

Enumerator:
COL_TYPE
COL_SIZE
COL_DATE
COL_TIME
COL_ATTRIBUTES
COL_DOSNAMES
COL_INDEX
COL_LINKS
COL_CONTENT
COL_ALL

Definition at line 35 of file pane.h.

00035                   {
00036         COL_TYPE                = 0x0001,
00037         COL_SIZE                = 0x0002,
00038         COL_DATE                = 0x0004,
00039         COL_TIME                = 0x0008,
00040         COL_ATTRIBUTES  = 0x0010,
00041         COL_DOSNAMES    = 0x0020,
00042         COL_INDEX               = 0x0040,
00043         COL_LINKS               = 0x0080,
00044         COL_CONTENT             = 0x0100,
00045         COL_ALL = COL_TYPE|COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES|COL_INDEX|COL_LINKS|COL_CONTENT
00046 };


ROS Explorer: pane.h Source File

  • File List
  • File Members
shell

pane.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // pane.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #define IDW_TREE_LEFT           3
00030 #define IDW_TREE_RIGHT          6
00031 #define IDW_HEADER_LEFT         2
00032 #define IDW_HEADER_RIGHT        5
00033
00034
00035 enum COLUMN_FLAGS {
00036         COL_TYPE                = 0x0001,
00037         COL_SIZE                = 0x0002,
00038         COL_DATE                = 0x0004,
00039         COL_TIME                = 0x0008,
00040         COL_ATTRIBUTES  = 0x0010,
00041         COL_DOSNAMES    = 0x0020,
00042         COL_INDEX               = 0x0040,
00043         COL_LINKS               = 0x0080,
00044         COL_CONTENT             = 0x0100,
00045         COL_ALL = COL_TYPE|COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES|COL_INDEX|COL_LINKS|COL_CONTENT
00046 };
00047
00048
00050 struct OutputWorker
00051 {
00052         OutputWorker();
00053
00054         void    init_output(HWND hwnd);
00055         void    output_text(LPDRAWITEMSTRUCT dis, int* positions, int col, LPCTSTR str, DWORD flags);
00056         void    output_tabbed_text(LPDRAWITEMSTRUCT dis, int* positions, int col, LPCTSTR str);
00057         void    output_number(LPDRAWITEMSTRUCT dis, int* positions, int col, LPCTSTR str);
00058
00059         SIZE    _spaceSize;
00060         TCHAR   _num_sep;
00061         HFONT   _hfont;
00062 };
00063
00064
00066 struct Pane : public SubclassedWindow
00067 {
00068         typedef SubclassedWindow super;
00069
00070         Pane(HWND hparent, int id, int id_header, Entry* rool, bool treePane, int visible_cols);
00071         ~Pane();
00072
00073 #define COLUMNS 12
00074         int     _widths[COLUMNS];
00075         int     _positions[COLUMNS+1];
00076
00077         WindowHandle _hwndHeader;
00078
00079         Entry*  _root;
00080         Entry*  _cur;
00081
00082         COLORREF _clrCompressed;
00083
00084         int     _visible_cols;
00085         bool    _treePane;
00086
00087         void    init();
00088         void    set_header();
00089         bool    create_header(HWND parent, int id);
00090
00091         bool    calc_widths(bool anyway);
00092         void    calc_single_width(int col);
00093         void    draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol=-1);
00094
00095         int             insert_entries(Entry* dir, int idx=-1);
00096         BOOL    command(UINT cmd);
00097         int             Notify(int id, NMHDR* pnmh);
00098
00099 protected:
00100         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00101
00102         void    calc_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str);
00103         void    calc_tabbed_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str);
00104         struct MainFrameBase* get_frame();
00105
00106 protected:
00107         HIMAGELIST      _himl;
00108         OutputWorker _out_wrkr;
00109 };
00110


ROS Explorer: precomp.cpp File Reference

  • File List
  • File Members

precomp.cpp File Reference

#include "precomp.h"

Include dependency graph for precomp.cpp:

Go to the source code of this file.


ROS Explorer: precomp.cpp Source File

  • File List
  • File Members

precomp.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone - precompiled header support
00022  //
00023  // precomp.h
00024  //
00025  // Martin Fuchs, 17.05.2004
00026  //
00027
00028 #include "precomp.h"


ROS Explorer: precomp.h File Reference

  • File List
  • File Members

precomp.h File Reference

#include "utility/utility.h"
#include "explorer.h"
#include "desktop/desktop.h"
#include "globals.h"
#include "externals.h"

Include dependency graph for precomp.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define | _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define | _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1

Define Documentation

#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1

Definition at line 28 of file precomp.h.

#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1

Definition at line 29 of file precomp.h.


ROS Explorer: precomp.h Source File

  • File List
  • File Members

precomp.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone - precompiled header support
00022  //
00023  // precomp.h
00024  //
00025  // Martin Fuchs, 17.05.2004
00026  //
00027
00028 #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES                 1
00029 #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT   1
00030
00031 #include "utility/utility.h"
00032
00033 #include "explorer.h"
00034 #include "desktop/desktop.h"
00035
00036 #include "globals.h"
00037 #include "externals.h"


ROS Explorer: quicklaunch.cpp File Reference

  • File List
  • File Members
taskbar

quicklaunch.cpp File Reference

#include <precomp.h>
#include "../resource.h"
#include "quicklaunch.h"

Include dependency graph for quicklaunch.cpp:

Go to the source code of this file.


ROS Explorer: quicklaunch.cpp Source File

  • File List
  • File Members
taskbar

quicklaunch.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // quicklaunch.cpp
00024  //
00025  // Martin Fuchs, 22.08.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "../resource.h"
00032
00033 #include "quicklaunch.h"
00034
00035
00036 QuickLaunchEntry::QuickLaunchEntry()
00037 {
00038         _hbmp = 0;
00039 }
00040
00041 QuickLaunchMap::~QuickLaunchMap()
00042 {
00043         while(!empty()) {
00044                 iterator it = begin();
00045                 DeleteBitmap(it->second._hbmp);
00046                 erase(it);
00047         }
00048 }
00049
00050
00051 QuickLaunchBar::QuickLaunchBar(HWND hwnd)
00052  :      super(hwnd)
00053 {
00054         CONTEXT("QuickLaunchBar::QuickLaunchBar()");
00055
00056         _dir = NULL;
00057         _next_id = IDC_FIRST_QUICK_ID;
00058         _btn_dist = 20;
00059         _size = 0;
00060
00061         HWND hwndToolTip = (HWND) SendMessage(hwnd, TB_GETTOOLTIPS, 0, 0);
00062
00063         SetWindowStyle(hwndToolTip, GetWindowStyle(hwndToolTip)|TTS_ALWAYSTIP);
00064
00065          // delay refresh to some time later
00066         PostMessage(hwnd, PM_REFRESH, 0, 0);
00067 }
00068
00069 QuickLaunchBar::~QuickLaunchBar()
00070 {
00071         delete _dir;
00072 }
00073
00074 HWND QuickLaunchBar::Create(HWND hwndParent)
00075 {
00076         CONTEXT("QuickLaunchBar::Create()");
00077
00078         ClientRect clnt(hwndParent);
00079
00080         HWND hwnd = CreateToolbarEx(hwndParent,
00081                                                                 WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
00082                                                                 CCS_TOP|CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_NORESIZE|
00083                                                                 TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE|TBSTYLE_FLAT,
00084                                                                 IDW_QUICKLAUNCHBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
00085
00086         if (hwnd)
00087                 new QuickLaunchBar(hwnd);
00088
00089         return hwnd;
00090 }
00091
00092 void QuickLaunchBar::AddShortcuts()
00093 {
00094         CONTEXT("QuickLaunchBar::AddShortcuts()");
00095
00096         WaitCursor wait;
00097
00098         try {
00099                 TCHAR path[MAX_PATH];
00100
00101                 SpecialFolderFSPath app_data(CSIDL_APPDATA, _hwnd);
00102
00103                 _stprintf(path, TEXT("%s\\")QUICKLAUNCH_FOLDER, (LPCTSTR)app_data);
00104
00105                 RecursiveCreateDirectory(path);
00106                 _dir = new ShellDirectory(GetDesktopFolder(), path, _hwnd);
00107
00108                 _dir->smart_scan(SORT_NAME, /*SCAN_EXTRACT_ICONS|*/SCAN_FILESYSTEM);
00109
00110                  // immediatelly extract the shortcut icons
00111                 for(Entry*entry=_dir->_down; entry; entry=entry->_next)
00112                         entry->_icon_id = entry->safe_extract_icon(ICF_NORMAL);
00113         } catch(COMException&) {
00114                 return;
00115         }
00116
00117
00118         ShellFolder desktop_folder;
00119         WindowCanvas canvas(_hwnd);
00120
00121         COLORREF bk_color = GetSysColor(COLOR_BTNFACE);
00122         HBRUSH bk_brush = GetSysColorBrush(COLOR_BTNFACE);
00123
00124         AddButton(ID_MINIMIZE_ALL, g_Globals._icon_cache.get_icon(ICID_LOGOFF/*@@*/).create_bitmap(bk_color, bk_brush, canvas), ResString(IDS_MINIMIZE_ALL), NULL);
00125         AddButton(ID_EXPLORE, g_Globals._icon_cache.get_icon(ICID_EXPLORER).create_bitmap(bk_color, bk_brush, canvas), ResString(IDS_TITLE), NULL);
00126
00127         TBBUTTON sep = {0, -1, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
00128         SendMessage(_hwnd, TB_INSERTBUTTON, INT_MAX, (LPARAM)&sep);
00129
00130         int cur_desktop = g_Globals._desktops._current_desktop;
00131         ResString desktop_fmt(IDS_DESKTOP_NUM);
00132
00133         HDC hdc = CreateCompatibleDC(canvas);
00134         DWORD size = SendMessage(_hwnd, TB_GETBUTTONSIZE, 0, 0);
00135         int cx = LOWORD(size);
00136         int cy = HIWORD(size);
00137         RECT rect = {0, 0, cx, cy};
00138         RECT textRect = {0, 0, cx-7, cy-7};
00139
00140         for(int i=0; i<DESKTOP_COUNT; ++i) {
00141                 HBITMAP hbmp = CreateCompatibleBitmap(canvas, cx, cy);
00142                 HBITMAP hbmp_old = SelectBitmap(hdc, hbmp);
00143
00144                 FmtString num_txt(TEXT("%d"), i+1);
00145                 TextColor color(hdc, RGB(64,64,64));
00146                 BkMode mode(hdc, TRANSPARENT);
00147                 FillRect(hdc, &rect, GetSysColorBrush(COLOR_BTNFACE));
00148                 DrawText(hdc, num_txt, num_txt.length(), &textRect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
00149
00150                 SelectBitmap(hdc, hbmp_old);
00151
00152                 AddButton(ID_SWITCH_DESKTOP_1+i, hbmp, FmtString(desktop_fmt, i+1), NULL, cur_desktop==i?TBSTATE_ENABLED|TBSTATE_CHECKED:TBSTATE_ENABLED);
00153         }
00154         DeleteDC(hdc);
00155
00156         SendMessage(_hwnd, TB_INSERTBUTTON, INT_MAX, (LPARAM)&sep);
00157
00158         for(Entry*entry=_dir->_down; entry; entry=entry->_next) {
00159                  // hide files like "desktop.ini"
00160                 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
00161                         continue;
00162
00163                          // hide subfolders
00164                         if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
00165                                 HBITMAP hbmp = g_Globals._icon_cache.get_icon(entry->_icon_id).create_bitmap(bk_color, bk_brush, canvas);
00166
00167                                 AddButton(_next_id++, hbmp, entry->_display_name, entry);       //entry->_etype==ET_SHELL? desktop_folder.get_name(static_cast<ShellEntry*>(entry)->_pidl): entry->_display_name);
00168                         }
00169         }
00170
00171         _btn_dist = LOWORD(SendMessage(_hwnd, TB_GETBUTTONSIZE, 0, 0));
00172         _size = _entries.size() * _btn_dist;
00173
00174         SendMessage(GetParent(_hwnd), PM_RESIZE_CHILDREN, 0, 0);
00175 }
00176
00177 void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, int flags)
00178 {
00179         TBADDBITMAP ab = {0, (UINT_PTR)hbmp};
00180         int bmp_idx = SendMessage(_hwnd, TB_ADDBITMAP, 1, (LPARAM)&ab);
00181
00182         QuickLaunchEntry qle;
00183
00184         qle._hbmp = hbmp;
00185         qle._title = name;
00186         qle._entry = entry;
00187
00188         _entries[id] = qle;
00189
00190         TBBUTTON btn = {0, 0, flags, BTNS_BUTTON|BTNS_NOPREFIX, {0, 0}, 0, 0};
00191
00192         btn.idCommand = id;
00193         btn.iBitmap = bmp_idx;
00194
00195         SendMessage(_hwnd, TB_INSERTBUTTON, INT_MAX, (LPARAM)&btn);
00196 }
00197
00198 void QuickLaunchBar::UpdateDesktopButtons(int desktop_idx)
00199 {
00200         for(int i=0; i<DESKTOP_COUNT; ++i) {
00201                 TBBUTTONINFO tbi = {sizeof(TBBUTTONINFO), TBIF_STATE, 0, 0, desktop_idx==i? TBSTATE_ENABLED|TBSTATE_CHECKED: TBSTATE_ENABLED};
00202
00203                 SendMessage(_hwnd, TB_SETBUTTONINFO, ID_SWITCH_DESKTOP_1+i, (LPARAM)&tbi);
00204         }
00205 }
00206
00207 LRESULT QuickLaunchBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00208 {
00209         switch(nmsg) {
00210           case PM_REFRESH:
00211                 AddShortcuts();
00212                 break;
00213
00214           case PM_GET_WIDTH: {
00215                  // take line wrapping into account
00216                 int btns = SendMessage(_hwnd, TB_BUTTONCOUNT, 0, 0);
00217                 int rows = SendMessage(_hwnd, TB_GETROWS, 0, 0);
00218
00219                 if (rows<2 || rows==btns)
00220                         return _size;
00221
00222                 RECT rect;
00223                 int max_cx = 0;
00224
00225                 for(QuickLaunchMap::const_iterator it=_entries.begin(); it!=_entries.end(); ++it) {
00226                         SendMessage(_hwnd, TB_GETRECT, it->first, (LPARAM)&rect);
00227
00228                         if (rect.right > max_cx)
00229                                 max_cx = rect.right;
00230                 }
00231
00232                 return max_cx;}
00233
00234           case PM_UPDATE_DESKTOP:
00235                 UpdateDesktopButtons(wparam);
00236                 break;
00237
00238           case WM_CONTEXTMENU: {
00239                 TBBUTTON btn;
00240                 QuickLaunchMap::iterator it;
00241                 Point screen_pt(lparam), clnt_pt=screen_pt;
00242                 ScreenToClient(_hwnd, &clnt_pt);
00243
00244                 Entry* entry = NULL;
00245                 int idx = SendMessage(_hwnd, TB_HITTEST, 0, (LPARAM)&clnt_pt);
00246
00247                 if (idx>=0 &&
00248                         SendMessage(_hwnd, TB_GETBUTTON, idx, (LPARAM)&btn)!=-1 &&
00249                         (it=_entries.find(btn.idCommand))!=_entries.end()) {
00250                         entry = it->second._entry;
00251                 }
00252
00253                 if (entry)      // entry is NULL for desktop switch buttons
00254                         CHECKERROR(entry->do_context_menu(_hwnd, screen_pt, _cm_ifs));
00255                 else
00256                         goto def;
00257                 break;}
00258
00259           default: def:
00260                 return super::WndProc(nmsg, wparam, lparam);
00261         }
00262
00263         return 0;
00264 }
00265
00266 int QuickLaunchBar::Command(int id, int code)
00267 {
00268         CONTEXT("QuickLaunchBar::Command()");
00269
00270         if ((id&~0xFF) == IDC_FIRST_QUICK_ID) {
00271                 QuickLaunchEntry& qle = _entries[id];
00272
00273                 if (qle._entry) {
00274                         qle._entry->launch_entry(_hwnd);
00275                         return 0;
00276                 }
00277         }
00278
00279         return 0; // Don't return 1 to avoid recursion with DesktopBar::Command()
00280 }
00281
00282 int QuickLaunchBar::Notify(int id, NMHDR* pnmh)
00283 {
00284         switch(pnmh->code) {
00285           case TTN_GETDISPINFO: {
00286                 NMTTDISPINFO* ttdi = (NMTTDISPINFO*) pnmh;
00287
00288                 int id = ttdi->hdr.idFrom;
00289                 ttdi->lpszText = _entries[id]._title.str();
00290 #ifdef TTF_DI_SETITEM
00291                 ttdi->uFlags |= TTF_DI_SETITEM;
00292 #endif
00293
00294                  // enable multiline tooltips (break at CR/LF and for very long one-line strings)
00295                 SendMessage(pnmh->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 400);
00296
00297                 break;}
00298
00299                 return super::Notify(id, pnmh);
00300         }
00301
00302         return 0;
00303 }


ROS Explorer: quicklaunch.h File Reference

  • File List
  • File Members
taskbar

quicklaunch.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | QuickLaunchEntry
quick launch bar shortcut More...
struct | QuickLaunchMap
map for managing the task bar buttons More...
struct | QuickLaunchBar
quick launch bar window More...

Defines

#define | QUICKLAUNCH_WIDTH_DEF 70
#define | QUICKLAUNCH_WIDTH_DEF 70
#define | IDW_QUICKLAUNCHBAR 101
#define | PM_UPDATE_DESKTOP (WM_APP+0x23)
#define | IDC_FIRST_QUICK_ID 0x4000
#define | QUICKLAUNCH_FOLDER TEXT("Microsoft\\Internet Explorer\\Quick Launch")

Define Documentation

#define IDC_FIRST_QUICK_ID 0x4000

Definition at line 36 of file quicklaunch.h.

Referenced by QuickLaunchBar::Command(), and QuickLaunchBar::QuickLaunchBar().

#define IDW_QUICKLAUNCHBAR 101

Definition at line 32 of file quicklaunch.h.

Referenced by QuickLaunchBar::Create(), and DesktopBar::Init().

#define PM_UPDATE_DESKTOP (WM_APP+0x23)

Definition at line 34 of file quicklaunch.h.

Referenced by DesktopBar::Command().

#define QUICKLAUNCH_FOLDER TEXT("Microsoft\\Internet Explorer\\Quick Launch")

Definition at line 39 of file quicklaunch.h.

Referenced by QuickLaunchBar::AddShortcuts().

#define QUICKLAUNCH_WIDTH_DEF 70

Definition at line 30 of file quicklaunch.h.

#define QUICKLAUNCH_WIDTH_DEF 70

Definition at line 30 of file quicklaunch.h.


ROS Explorer: quicklaunch.h Source File

  • File List
  • File Members
taskbar

quicklaunch.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer and Desktop clone
00022  //
00023  // quicklaunch.h
00024  //
00025  // Martin Fuchs, 22.08.2003
00026  //
00027
00028
00029 #define QUICKLAUNCH_WIDTH_DEF   70
00030 #define QUICKLAUNCH_WIDTH_DEF   70
00031
00032 #define IDW_QUICKLAUNCHBAR      101
00033
00034 #define PM_UPDATE_DESKTOP       (WM_APP+0x23)
00035
00036 #define IDC_FIRST_QUICK_ID      0x4000
00037
00038
00039 #define QUICKLAUNCH_FOLDER      TEXT("Microsoft\\Internet Explorer\\Quick Launch")
00040
00041
00043 struct QuickLaunchEntry
00044 {
00045         QuickLaunchEntry();
00046
00047         HBITMAP _hbmp;
00048         String  _title;
00049         Entry*  _entry;
00050 };
00051
00053 struct QuickLaunchMap : public map<int, QuickLaunchEntry>
00054 {
00055         ~QuickLaunchMap();
00056 };
00057
00058
00060 struct QuickLaunchBar : public ExtContextMenuHandlerT<SubclassedWindow>
00061 {
00062         typedef ExtContextMenuHandlerT<SubclassedWindow> super;
00063
00064         QuickLaunchBar(HWND hwnd);
00065         ~QuickLaunchBar();
00066
00067         static HWND     Create(HWND hwndParent);
00068
00069 protected:
00070         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00071         int             Command(int id, int code);
00072         int             Notify(int id, NMHDR* pnmh);
00073
00074         ShellDirectory* _dir;
00075
00076         int                             _next_id;
00077         QuickLaunchMap  _entries;
00078         int                             _btn_dist;
00079         int                             _size;
00080
00081         void    AddShortcuts();
00082         void    AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, int flags=TBSTATE_ENABLED);
00083         void    UpdateDesktopButtons(int desktop_idx);
00084 };


ROS Explorer: regfs.cpp File Reference

  • File List
  • File Members
shell

regfs.cpp File Reference

#include <precomp.h>
#include "regfs.h"

Include dependency graph for regfs.cpp:

Go to the source code of this file.


ROS Explorer: regfs.cpp Source File

  • File List
  • File Members
shell

regfs.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // ntobjfs.cpp
00024  //
00025  // Martin Fuchs, 31.01.2004
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "regfs.h"
00032
00033
00034 void RegDirectory::read_directory(int scan_flags)
00035 {
00036         CONTEXT("RegDirectory::read_directory()");
00037
00038         Entry* first_entry = NULL;
00039         int level = _level + 1;
00040
00041         TCHAR buffer[MAX_PATH];
00042
00043         _tcscpy(buffer, (LPCTSTR)_path);
00044         LPTSTR pname = buffer + _tcslen(buffer);
00045         int plen = MAX_PATH - _tcslen(buffer);
00046
00047         HKEY hkey;
00048
00049         if (!RegOpenKeyEx(_hKeyRoot, *buffer=='\\'?buffer+1:buffer, 0, STANDARD_RIGHTS_READ|KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS, &hkey)) {
00050                 if (pname[-1] != '\\')
00051                         *pname++ = '\\', plen--;
00052
00053                 TCHAR name[MAX_PATH], class_name[MAX_PATH];
00054                 WIN32_FIND_DATA w32fd;
00055                 Entry* last = NULL;
00056                 RegEntry* entry;
00057
00058                 for(int idx=0; ; ++idx) {
00059                         memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00060
00061                         DWORD name_len = MAX_PATH;
00062                         DWORD class_len = MAX_PATH;
00063
00064                         if (RegEnumKeyEx(hkey, idx, name, &name_len, 0, class_name, &class_len, &w32fd.ftLastWriteTime))
00065                                 break;
00066
00067                         w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00068                         _tcsncpy(w32fd.cFileName, name, name_len);
00069
00070                         _tcscpy_s(pname, plen, name);
00071                         entry = new RegDirectory(this, buffer, _hKeyRoot);
00072
00073                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00074
00075                         if (class_len)
00076                                 entry->_type_name = _tcsdup(String(class_name, class_len));
00077
00078                         if (!first_entry)
00079                                 first_entry = entry;
00080
00081                         if (last)
00082                                 last->_next = entry;
00083
00084                         entry->_level = level;
00085
00086                         last = entry;
00087                 }
00088 /*
00089                 TCHAR value[MAX_PATH];
00090                 LONG value_len = sizeof(value);
00091
00092                 if (!RegQueryValue(hkey, NULL, value, &value_len) && value_len>1) {
00093                         memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00094
00095                         lstrcpy(w32fd.cFileName, TEXT("(Default)"));
00096
00097                         entry = new RegEntry(this);
00098
00099                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00100
00101                         entry->_content = _tcsdup(value);
00102
00103                         if (!first_entry)
00104                                 first_entry = entry;
00105
00106                         if (last)
00107                                 last->_next = entry;
00108
00109                         entry->_level = level;
00110
00111                         last = entry;
00112                 }
00113 */
00114                 DWORD type;
00115                 for(int idx=0; ; ++idx) {
00116                         DWORD name_len = MAX_PATH;
00117
00118                         if (RegEnumValue(hkey, idx, name, &name_len, 0, &type, NULL, NULL))
00119                                 break;
00120
00121                         memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00122
00123                         if (name[0])
00124                                 lstrcpy(w32fd.cFileName, name);
00125                         else
00126                                 lstrcpy(w32fd.cFileName, TEXT("(Default)"));
00127
00128                         entry = new RegEntry(this);
00129
00130                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00131
00132                         switch(type) {
00133                           case REG_NONE:                                                entry->_type_name = _tcsdup(TEXT("REG_NONE"));                                          break;
00134                           case REG_SZ:                                                  entry->_type_name = _tcsdup(TEXT("REG_SZ"));                                            break;
00135                           case REG_EXPAND_SZ:                                   entry->_type_name = _tcsdup(TEXT("REG_EXPAND_SZ"));                                     break;
00136                           case REG_BINARY:                                              entry->_type_name = _tcsdup(TEXT("REG_BINARY"));                                        break;
00137                           case REG_DWORD:                                               entry->_type_name = _tcsdup(TEXT("REG_DWORD"));                                         break;
00138                           case REG_DWORD_BIG_ENDIAN:                    entry->_type_name = _tcsdup(TEXT("REG_DWORD_BIG_ENDIAN"));                      break;
00139                           case REG_LINK:                                                entry->_type_name = _tcsdup(TEXT("REG_LINK"));                                          break;
00140                           case REG_MULTI_SZ:                                    entry->_type_name = _tcsdup(TEXT("REG_MULTI_SZ"));                                      break;
00141                           case REG_RESOURCE_LIST:                               entry->_type_name = _tcsdup(TEXT("REG_RESOURCE_LIST"));                         break;
00142                           case REG_FULL_RESOURCE_DESCRIPTOR:    entry->_type_name = _tcsdup(TEXT("REG_FULL_RESOURCE_DESCRIPTOR"));      break;
00143                           case REG_RESOURCE_REQUIREMENTS_LIST:  entry->_type_name = _tcsdup(TEXT("REG_RESOURCE_REQUIREMENTS_LIST"));break;
00144                           case REG_QWORD:                                               entry->_type_name = _tcsdup(TEXT("REG_QWORD"));                                         break;
00145                         }
00146
00148                         TCHAR value[MAX_PATH];
00149                         DWORD value_len = sizeof(value);
00150
00151                         if (!RegQueryValueEx(hkey, name, NULL, NULL, (LPBYTE)value, &value_len)) {
00152                                 if (type==REG_SZ || type==REG_EXPAND_SZ || type==REG_LINK)
00153                                         entry->_content = _tcsdup(value);
00154                                 else if (type == REG_DWORD) {
00155                                         TCHAR b[32];
00156                                         _stprintf(b, TEXT("%ld"), *(DWORD*)&value);
00157                                         entry->_content = _tcsdup(b);
00158                                 }
00159                         }
00160
00161                         if (!first_entry)
00162                                 first_entry = entry;
00163
00164                         if (last)
00165                                 last->_next = entry;
00166
00167                         entry->_level = level;
00168
00169                         last = entry;
00170                 }
00171
00172                 if (last)
00173                         last->_next = NULL;
00174
00175                 RegCloseKey(hkey);
00176         }
00177
00178         _down = first_entry;
00179         _scanned = true;
00180 }
00181
00182
00183 const void* RegDirectory::get_next_path_component(const void* p) const
00184 {
00185         LPCTSTR s = (LPCTSTR) p;
00186
00187         while(*s && *s!=TEXT('\\'))
00188                 ++s;
00189
00190         while(*s==TEXT('\\'))
00191                 ++s;
00192
00193         if (!*s)
00194                 return NULL;
00195
00196         return s;
00197 }
00198
00199
00200 Entry* RegDirectory::find_entry(const void* p)
00201 {
00202         LPCTSTR name = (LPCTSTR)p;
00203
00204         for(Entry*entry=_down; entry; entry=entry->_next) {
00205                 LPCTSTR p = name;
00206                 LPCTSTR q = entry->_data.cFileName;
00207
00208                 do {
00209                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00210                                 return entry;
00211                 } while(tolower(*p++) == tolower(*q++));
00212
00213                 p = name;
00214                 q = entry->_data.cAlternateFileName;
00215
00216                 do {
00217                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00218                                 return entry;
00219                 } while(tolower(*p++) == tolower(*q++));
00220         }
00221
00222         return NULL;
00223 }
00224
00225
00226  // get full path of specified registry entry
00227 bool RegEntry::get_path(PTSTR path, size_t path_count) const
00228 {
00229         return get_path_base ( path, path_count, ET_REGISTRY );
00230 }
00231
00232 BOOL RegEntry::launch_entry(HWND hwnd, UINT nCmdShow)
00233 {
00234         return FALSE;
00235 }
00236
00237
00238 RegDirectory::RegDirectory(Entry* parent, LPCTSTR path, HKEY hKeyRoot)
00239  :      RegEntry(parent),
00240         _hKeyRoot(hKeyRoot)
00241 {
00242         _path = _tcsdup(path);
00243
00244         memset(&_data, 0, sizeof(WIN32_FIND_DATA));
00245         _data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00246 }
00247
00248
00249 void RegistryRoot::read_directory(int scan_flags)
00250 {
00251         Entry *entry, *last, *first_entry;
00252         int level = _level + 1;
00253
00254         _data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00255
00256         entry = new RegDirectory(this, TEXT("\\"), HKEY_CURRENT_USER);
00257         _tcscpy(entry->_data.cFileName, TEXT("HKEY_CURRENT_USER"));
00258         entry->_level = level;
00259
00260         first_entry = entry;
00261         last = entry;
00262
00263         entry = new RegDirectory(this, TEXT("\\"), HKEY_LOCAL_MACHINE);
00264         _tcscpy(entry->_data.cFileName, TEXT("HKEY_LOCAL_MACHINE"));
00265         entry->_level = level;
00266
00267         last->_next = entry;
00268         last = entry;
00269
00270         entry = new RegDirectory(this, TEXT("\\"), HKEY_CLASSES_ROOT);
00271         _tcscpy(entry->_data.cFileName, TEXT("HKEY_CLASSES_ROOT"));
00272         entry->_level = level;
00273
00274         last->_next = entry;
00275         last = entry;
00276
00277         entry = new RegDirectory(this, TEXT("\\"), HKEY_USERS);
00278         _tcscpy(entry->_data.cFileName, TEXT("HKEY_USERS"));
00279         entry->_level = level;
00280
00281         last->_next = entry;
00282         last = entry;
00283 /*
00284         entry = new RegDirectory(this, TEXT("\\"), HKEY_PERFORMANCE_DATA);
00285         _tcscpy(entry->_data.cFileName, TEXT("HKEY_PERFORMANCE_DATA"));
00286         entry->_level = level;
00287
00288         last->_next = entry;
00289         last = entry;
00290 */
00291         entry = new RegDirectory(this, TEXT("\\"), HKEY_CURRENT_CONFIG);
00292         _tcscpy(entry->_data.cFileName, TEXT("HKEY_CURRENT_CONFIG"));
00293         entry->_level = level;
00294
00295         last->_next = entry;
00296         last = entry;
00297 /*
00298         entry = new RegDirectory(this, TEXT("\\"), HKEY_DYN_DATA);
00299         _tcscpy(entry->_data.cFileName, TEXT("HKEY_DYN_DATA"));
00300         entry->_level = level;
00301
00302         last->_next = entry;
00303         last = entry;
00304 */
00305         last->_next = NULL;
00306
00307         _down = first_entry;
00308         _scanned = true;
00309 }


ROS Explorer: regfs.h File Reference

  • File List
  • File Members
shell

regfs.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | RegEntry
Registry entry. More...
struct | RegDirectory
Registry key entry. More...
struct | RegistryRoot
Registry key entry. More...


ROS Explorer: regfs.h Source File

  • File List
  • File Members
shell

regfs.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // regfs.h
00024  //
00025  // Martin Fuchs, 31.01.2004
00026  //
00027
00028
00030 struct RegEntry : public Entry
00031 {
00032         RegEntry(Entry* parent) : Entry(parent, ET_REGISTRY) {}
00033
00034 protected:
00035         RegEntry() : Entry(ET_REGISTRY) {}
00036
00037         virtual bool get_path(PTSTR path, size_t path_count) const;
00038         virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow);
00039 };
00040
00041
00043 struct RegDirectory : public RegEntry, public Directory
00044 {
00045         RegDirectory(Entry* parent, LPCTSTR path, HKEY hKeyRoot);
00046
00047         ~RegDirectory()
00048         {
00049                 free(_path);
00050                 _path = NULL;
00051         }
00052
00053         virtual void read_directory(int scan_flags=SCAN_ALL);
00054         virtual const void* get_next_path_component(const void*) const;
00055         virtual Entry* find_entry(const void*);
00056
00057 protected:
00058         HKEY    _hKeyRoot;
00059 };
00060
00061
00063 struct RegistryRoot : public RegEntry, public Directory
00064 {
00065         RegistryRoot()
00066         {
00067         }
00068
00069         RegistryRoot(Entry* parent, LPCTSTR path)
00070          :      RegEntry(parent)
00071         {
00072                 _path = _tcsdup(path);
00073         }
00074
00075         ~RegistryRoot()
00076         {
00077                 free(_path);
00078                 _path = NULL;
00079         }
00080
00081         virtual void read_directory(int scan_flags=SCAN_ALL);
00082 };


ROS Explorer: resource.h File Reference

  • File List
  • File Members

resource.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define | IDS_TITLE 1
#define | MANIFEST_RESOURCE_ID 1
#define | IDS_START 2
#define | IDS_LOGOFF 3
#define | IDS_SHUTDOWN 4
#define | IDS_LAUNCH 5
#define | IDS_START_HELP 6
#define | IDS_SEARCH_FILES 7
#define | IDS_DOCUMENTS 8
#define | IDS_FAVORITES 9
#define | IDS_PROGRAMS 10
#define | IDS_SETTINGS 11
#define | IDS_EXPLORE 12
#define | IDS_EMPTY 13
#define | IDS_RECENT 14
#define | IDS_ADMIN 15
#define | IDS_NETWORK 16
#define | IDS_CONNECTIONS 17
#define | IDS_DRIVES 18
#define | IDS_SEARCH_COMPUTER 19
#define | IDS_SETTINGS_MENU 20
#define | IDS_CONTROL_PANEL 21
#define | IDS_PRINTERS 22
#define | IDS_BROWSE 23
#define | IDS_SEARCH_PRG 24
#define | IDS_ALL_USERS 25
#define | IDS_SEARCH 26
#define | IDS_ABOUT_EXPLORER 27
#define | IDS_LAUNCH_MANY_PROGRAMS 28
#define | IDS_DESKTOPBAR_SETTINGS 29
#define | IDS_DESKTOP 30
#define | IDS_TASKBAR 31
#define | IDS_STARTMENU 32
#define | IDS_MINIMIZE_ALL 33
#define | IDS_DESKTOP_NUM 34
#define | IDS_VOLUME 35
#define | IDS_ITEMS_CUR 36
#define | IDS_ITEMS_CONFIGURED 37
#define | IDS_ITEMS_VISIBLE 38
#define | IDS_ITEMS_HIDDEN 39
#define | IDS_NOTIFY_SHOW 40
#define | IDS_NOTIFY_HIDE 41
#define | IDS_NOTIFY_AUTOHIDE 42
#define | IDS_SHOW_HIDDEN_ICONS 43
#define | IDS_HIDE_ICONS 44
#define | IDS_TERMINATE 45
#define | IDI_REACTOS 100
#define | IDI_EXPLORER 101
#define | IDI_STARTMENU 102
#define | IDB_TOOLBAR 103
#define | IDA_EXPLORER 104
#define | ID_ACTIVATE 105
#define | IDD_SEARCH_PROGRAM 105
#define | IDB_DRIVEBAR 106
#define | IDD_DESKBAR_DESKTOP 106
#define | IDB_IMAGES 107
#define | IDD_EXECUTE 108
#define | IDR_MAINFRAME 109
#define | IDM_MDIFRAME 110
#define | ID_EXECUTE 111
#define | IDM_SDIFRAME 113
#define | IDI_LOGOFF 124
#define | IDI_FOLDERARROW 125
#define | IDI_ARROW 125
#define | IDI_ARROW_SELECTED 126
#define | IDB_LOGOV 129
#define | IDB_LOGOV256 130
#define | IDA_SEARCH_PROGRAM 133
#define | IDI_APPICON 134
#define | IDA_TRAYNOTIFY 134
#define | IDI_FLOATING 135
#define | IDD_ABOUT_EXPLORER 135
#define | IDI_REACTOS_BIG 137
#define | IDI_DOCUMENTS 138
#define | IDI_CONFIG 139
#define | IDI_FAVORITES 140
#define | IDI_INFO 141
#define | IDI_APPS 142
#define | IDI_SEARCH 143
#define | IDI_ACTION 144
#define | IDI_FOLDER 145
#define | IDI_SEARCH_DOC 146
#define | IDI_PRINTER 147
#define | IDI_NETWORK 148
#define | IDI_COMPUTER 149
#define | IDM_DESKTOPBAR 150
#define | IDM_VOLUME 151
#define | IDM_NOTIFYAREA 152
#define | IDD_DESKBAR_TASKBAR 153
#define | IDB_ICON_ALIGN_0 153
#define | IDD_DESKBAR_STARTMENU 154
#define | IDB_ICON_ALIGN_1 154
#define | IDB_ICON_ALIGN_2 155
#define | IDD_NOTIFYAREA 155
#define | IDB_ICON_ALIGN_3 156
#define | IDD_MDI_SDI 156
#define | IDB_ICON_ALIGN_4 157
#define | IDB_ICON_ALIGN_5 158
#define | IDB_ICON_ALIGN_6 159
#define | IDB_ICON_ALIGN_7 160
#define | IDB_ICON_ALIGN_8 161
#define | IDB_ICON_ALIGN_9 162
#define | IDI_SPEAKER 162
#define | IDB_ICON_ALIGN_10 163
#define | IDI_DOT 163
#define | IDB_LOGOV16 164
#define | IDI_DOT_TRANS 164
#define | IDI_DOT_RED 165
#define | IDI_ARROW_UP 166
#define | IDI_ARROW_DOWN 167
#define | IDI_NOTIFY_L 168
#define | IDI_NOTIFY_R 169
#define | IDB_MDI 170
#define | IDB_SDI 171
#define | ID_VIEW_NAME 401
#define | ID_VIEW_ALL_ATTRIBUTES 402
#define | ID_VIEW_SELECTED_ATTRIBUTES 403
#define | ID_VIEW_STATUSBAR 503
#define | ID_VIEW_DRIVE_BAR 507
#define | ID_VIEW_TOOL_BAR 508
#define | ID_VIEW_EXTRA_BAR 509
#define | ID_VIEW_SIDE_BAR 510
#define | IDC_ROS_EXPLORER 1000
#define | IDC_ICON_ALIGN_0 1002
#define | IDC_ICON_ALIGN_1 1003
#define | IDC_NOTIFY_ICONS 1003
#define | IDC_ICON_ALIGN_2 1004
#define | IDC_ICON_ALIGN_3 1005
#define | IDC_ICON_ALIGN_4 1006
#define | IDC_NOTIFY_TOOLTIP 1006
#define | IDC_ICON_ALIGN_5 1007
#define | IDC_NOTIFY_TITLE 1007
#define | IDC_ICON_ALIGN_6 1008
#define | IDC_NOTIFY_MODULE 1008
#define | IDC_ICON_ALIGN_7 1009
#define | IDC_LABEL1 1009
#define | IDC_ICON_ALIGN_8 1010
#define | IDC_LABEL2 1010
#define | IDC_ICON_ALIGN_9 1011
#define | IDC_LABEL3 1011
#define | IDC_ICON_ALIGN_10 1012
#define | IDC_WWW 1012
#define | IDC_LABEL6 1012
#define | IDC_ICON_ALIGN_11 1013
#define | IDC_LAST_CHANGE 1013
#define | IDC_FILTER 1017
#define | IDC_PROGRAMS_FOUND 1018
#define | IDC_PICTURE 1019
#define | IDC_NOTIFY_SHOW 1020
#define | IDC_NOTIFY_HIDE 1021
#define | IDC_NOTIFY_AUTOHIDE 1022
#define | IDC_LABEL4 1023
#define | ID_HIDE_INACTIVE_ICONS 1025
#define | ID_SHOW_CLOCK 1026
#define | ID_DESKTOP_VERSION 1027
#define | IDC_BUTTON1 1028
#define | IDC_CHECK_ENTRIES 1028
#define | IDC_VERSION_TXT 1029
#define | IDC_WIN_VERSION 1030
#define | IDC_MDI 1030
#define | IDC_SDI 1031
#define | IDC_SEPARATE_SUBFOLDERS 1034
#define | ID_REFRESH 1704
#define | IDS_VERSION_STR 5000
#define | IDS_EXPLORER_VERSION_STR 5001
#define | IDC_FILETREE 10001
#define | ID_EXPLORER_FAQ 10002
#define | ID_WEB_WINDOW 10003
#define | ID_WINDOW_AUTOSORT 0x8003
#define | ID_VIEW_FULLSCREEN 0x8004
#define | ID_PREFERED_SIZES 0x8005
#define | ID_DRIVE_DESKTOP 0x9000
#define | ID_DRIVE_SHELL_NS 0x9001
#define | ID_DRIVE_UNIX_FS 0x9002
#define | ID_DRIVE_NTOBJ_NS 0x9003
#define | ID_DRIVE_REGISTRY 0x9004
#define | ID_DRIVE_FAT 0x9005
#define | ID_DRIVE_FIRST 0x9006
#define | ID_ABOUT_WINDOWS 40002
#define | ID_ABOUT_EXPLORER 40003
#define | ID_DESKTOPBAR_SETTINGS 40004
#define | ID_GO_BACK 40005
#define | ID_GO_FORWARD 40006
#define | ID_GO_HOME 40007
#define | ID_GO_SEARCH 40008
#define | ID_GO_UP 40009
#define | ID_STOP 40010
#define | ID_MINIMIZE_ALL 40011
#define | ID_EXPLORE 40012
#define | ID_TASKMGR 40013
#define | ID_TRAY_VOLUME 40014
#define | ID_VOLUME_PROPERTIES 40015
#define | ID_SHOW_HIDDEN_ICONS 40016
#define | ID_CONFIG_NOTIFYAREA 40017
#define | ID_CONFIG_TIME 40018
#define | ID_VIEW_MDI 40019
#define | ID_VIEW_SDI 40020
#define | ID_TOOLS_OPTIONS 40021
#define | ID_SHOW_ICON_BUTTON 40023
#define | ID_SWITCH_DESKTOP_1 50000
#define | ID_WINDOW_NEW 0xE130
#define | ID_WINDOW_ARRANGE 0xE131
#define | ID_WINDOW_CASCADE 0xE132
#define | ID_WINDOW_TILE_HORZ 0xE133
#define | ID_WINDOW_TILE_VERT 0xE134
#define | ID_WINDOW_SPLIT 0xE135
#define | ID_EDIT_PROPERTIES 57656
#define | ID_FILE_EXIT 0xE141
#define | ID_HELP_USING 0xE144
#define | ID_HELP 0xE146
#define | IDC_STATIC -1

Define Documentation

#define ID_ABOUT_EXPLORER 40003

Definition at line 184 of file resource.h.

Referenced by MainFrameBase::Command(), and DesktopBar::Command().

#define ID_ABOUT_WINDOWS 40002

Definition at line 183 of file resource.h.

Referenced by MainFrameBase::Command().

#define ID_ACTIVATE 105

Definition at line 56 of file resource.h.

#define ID_CONFIG_NOTIFYAREA 40017

Definition at line 198 of file resource.h.

Referenced by NotifyArea::Command().

#define ID_CONFIG_TIME 40018

Definition at line 199 of file resource.h.

Referenced by NotifyArea::Command().

#define ID_DESKTOP_VERSION 1027

Definition at line 159 of file resource.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg().

#define ID_DESKTOPBAR_SETTINGS 40004

Definition at line 185 of file resource.h.

Referenced by SettingsMenu::AddEntries(), StartMenuHandler::Command(), and DesktopBar::Command().

#define ID_DRIVE_DESKTOP 0x9000

Definition at line 176 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_DRIVE_FAT 0x9005

Definition at line 181 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_DRIVE_FIRST 0x9006

Definition at line 182 of file resource.h.

Referenced by MDIMainFrame::Command(), and MDIMainFrame::MDIMainFrame().

#define ID_DRIVE_NTOBJ_NS 0x9003

Definition at line 179 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_DRIVE_REGISTRY 0x9004

Definition at line 180 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_DRIVE_SHELL_NS 0x9001

Definition at line 177 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_DRIVE_UNIX_FS 0x9002

Definition at line 178 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_EDIT_PROPERTIES 57656

Definition at line 211 of file resource.h.

#define ID_EXECUTE 111

Definition at line 64 of file resource.h.

Referenced by MainFrameBase::Command().

#define ID_EXPLORE 40012

Definition at line 193 of file resource.h.

Referenced by QuickLaunchBar::AddShortcuts(), and DesktopBar::Command().

#define ID_EXPLORER_FAQ 10002

Definition at line 171 of file resource.h.

Referenced by MainFrameBase::Command().

#define ID_FILE_EXIT 0xE141

Definition at line 212 of file resource.h.

#define ID_GO_BACK 40005

Definition at line 186 of file resource.h.

Referenced by MainFrameBase::MainFrameBase().

#define ID_GO_FORWARD 40006

Definition at line 187 of file resource.h.

Referenced by MainFrameBase::MainFrameBase(), and WebChildWindow::WndProc().

#define ID_GO_HOME 40007

Definition at line 188 of file resource.h.

Referenced by MainFrameBase::MainFrameBase(), and WebChildWindow::WndProc().

#define ID_GO_SEARCH 40008

Definition at line 189 of file resource.h.

Referenced by MainFrameBase::MainFrameBase(), and WebChildWindow::WndProc().

#define ID_GO_UP 40009

Definition at line 190 of file resource.h.

Referenced by MainFrameBase::MainFrameBase(), and WebChildWindow::WndProc().

#define ID_HELP 0xE146

Definition at line 214 of file resource.h.

Referenced by MainFrameBase::Command().

#define ID_HELP_USING 0xE144

Definition at line 213 of file resource.h.

#define ID_HIDE_INACTIVE_ICONS 1025

Definition at line 157 of file resource.h.

Referenced by TaskbarSettingsDlg::Command(), and TaskbarSettingsDlg::TaskbarSettingsDlg().

#define ID_MINIMIZE_ALL 40011

Definition at line 192 of file resource.h.

Referenced by QuickLaunchBar::AddShortcuts(), and DesktopBar::Command().

#define ID_PREFERED_SIZES 0x8005

Definition at line 175 of file resource.h.

Referenced by Pane::command().

#define ID_REFRESH 1704

Definition at line 167 of file resource.h.

Referenced by MainFrameBase::MainFrameBase(), WebChildWindow::WndProc(), and MDIShellBrowserChild::WndProc().

#define ID_SHOW_CLOCK 1026

Definition at line 158 of file resource.h.

Referenced by TaskbarSettingsDlg::Command(), and TaskbarSettingsDlg::TaskbarSettingsDlg().

#define ID_SHOW_HIDDEN_ICONS 40016

Definition at line 197 of file resource.h.

Referenced by TrayNotifyDlg::Command(), TrayNotifyDlg::TrayNotifyDlg(), and NotifyArea::WndProc().

#define ID_SHOW_ICON_BUTTON 40023

Definition at line 203 of file resource.h.

Referenced by NotifyArea::Command(), and NotifyArea::WndProc().

#define ID_STOP 40010

Definition at line 191 of file resource.h.

Referenced by MainFrameBase::MainFrameBase(), and WebChildWindow::WndProc().

#define ID_SWITCH_DESKTOP_1 50000

Definition at line 204 of file resource.h.

Referenced by QuickLaunchBar::AddShortcuts(), and DesktopBar::Command().

#define ID_TASKMGR 40013

Definition at line 194 of file resource.h.

Referenced by DesktopBar::Command().

#define ID_TOOLS_OPTIONS 40021

Definition at line 202 of file resource.h.

Referenced by MainFrameBase::Command().

#define ID_TRAY_VOLUME 40014

Definition at line 195 of file resource.h.

Referenced by DesktopBar::Command().

#define ID_VIEW_ALL_ATTRIBUTES 402

Definition at line 120 of file resource.h.

Referenced by Pane::command().

#define ID_VIEW_DRIVE_BAR 507

Definition at line 123 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_VIEW_EXTRA_BAR 509

Definition at line 125 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_VIEW_FULLSCREEN 0x8004

Definition at line 174 of file resource.h.

Referenced by MainFrameBase::Command().

#define ID_VIEW_MDI 40019

Definition at line 200 of file resource.h.

#define ID_VIEW_NAME 401

Definition at line 119 of file resource.h.

Referenced by Pane::command().

#define ID_VIEW_SDI 40020

Definition at line 201 of file resource.h.

Referenced by MDIShellBrowserChild::WndProc().

#define ID_VIEW_SELECTED_ATTRIBUTES 403

Definition at line 121 of file resource.h.

Referenced by Pane::command().

#define ID_VIEW_SIDE_BAR 510

Definition at line 126 of file resource.h.

Referenced by MainFrameBase::Command(), and MainFrameBase::MainFrameBase().

#define ID_VIEW_STATUSBAR 503

Definition at line 122 of file resource.h.

Referenced by MainFrameBase::Command(), and MainFrameBase::MainFrameBase().

#define ID_VIEW_TOOL_BAR 508

Definition at line 124 of file resource.h.

Referenced by MainFrameBase::Command(), and MainFrameBase::MainFrameBase().

#define ID_VOLUME_PROPERTIES 40015

Definition at line 196 of file resource.h.

Referenced by DesktopBar::Command().

#define ID_WEB_WINDOW 10003

Definition at line 172 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_WINDOW_ARRANGE 0xE131

Definition at line 206 of file resource.h.

#define ID_WINDOW_AUTOSORT 0x8003

Definition at line 173 of file resource.h.

#define ID_WINDOW_CASCADE 0xE132

Definition at line 207 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_WINDOW_NEW 0xE130

Definition at line 205 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame(), and MDIShellBrowserChild::WndProc().

#define ID_WINDOW_SPLIT 0xE135

Definition at line 210 of file resource.h.

#define ID_WINDOW_TILE_HORZ 0xE133

Definition at line 208 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define ID_WINDOW_TILE_VERT 0xE134

Definition at line 209 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define IDA_EXPLORER 104

Definition at line 55 of file resource.h.

Referenced by MainFrameBase::MainFrameBase().

#define IDA_SEARCH_PROGRAM 133

Definition at line 72 of file resource.h.

Referenced by FindProgramDlg::FindProgramDlg().

#define IDA_TRAYNOTIFY 134

Definition at line 74 of file resource.h.

Referenced by TrayNotifyDlg::TrayNotifyDlg().

#define IDB_DRIVEBAR 106

Definition at line 58 of file resource.h.

Referenced by MDIMainFrame::MDIMainFrame().

#define IDB_ICON_ALIGN_0 153

Definition at line 94 of file resource.h.

#define IDB_ICON_ALIGN_1 154

Definition at line 96 of file resource.h.

#define IDB_ICON_ALIGN_10 163

Definition at line 108 of file resource.h.

#define IDB_ICON_ALIGN_2 155

Definition at line 97 of file resource.h.

#define IDB_ICON_ALIGN_3 156

Definition at line 99 of file resource.h.

#define IDB_ICON_ALIGN_4 157

Definition at line 101 of file resource.h.

#define IDB_ICON_ALIGN_5 158

Definition at line 102 of file resource.h.

#define IDB_ICON_ALIGN_6 159

Definition at line 103 of file resource.h.

#define IDB_ICON_ALIGN_7 160

Definition at line 104 of file resource.h.

#define IDB_ICON_ALIGN_8 161

Definition at line 105 of file resource.h.

#define IDB_ICON_ALIGN_9 162

Definition at line 106 of file resource.h.

#define IDB_IMAGES 107

Definition at line 60 of file resource.h.

Referenced by Pane::init().

#define IDB_LOGOV 129

Definition at line 70 of file resource.h.

Referenced by StartMenuRoot::GetLogoResId().

#define IDB_LOGOV16 164

Definition at line 110 of file resource.h.

Referenced by StartMenuRoot::GetLogoResId().

#define IDB_LOGOV256 130

Definition at line 71 of file resource.h.

Referenced by StartMenuRoot::GetLogoResId().

#define IDB_MDI 170

Definition at line 117 of file resource.h.

#define IDB_SDI 171

Definition at line 118 of file resource.h.

#define IDB_TOOLBAR 103

Definition at line 54 of file resource.h.

Referenced by MainFrameBase::MainFrameBase().

#define IDC_BUTTON1 1028

Definition at line 160 of file resource.h.

#define IDC_CHECK_ENTRIES 1028

Definition at line 161 of file resource.h.

Referenced by FindProgramDlg::Command(), and FindProgramDlg::FindProgramDlg().

#define IDC_FILETREE 10001

Definition at line 170 of file resource.h.

#define IDC_FILTER 1017

Definition at line 150 of file resource.h.

Referenced by FindProgramDlg::FindProgramDlg(), and FindProgramDlg::Refresh().

#define IDC_ICON_ALIGN_0 1002

Definition at line 128 of file resource.h.

Referenced by DesktopSettingsDlg::Command(), DesktopSettingsDlg::DesktopSettingsDlg(), and DesktopSettingsDlg::Notify().

#define IDC_ICON_ALIGN_1 1003

Definition at line 129 of file resource.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg().

#define IDC_ICON_ALIGN_10 1012

Definition at line 145 of file resource.h.

Referenced by DesktopSettingsDlg::Command(), and DesktopSettingsDlg::DesktopSettingsDlg().

#define IDC_ICON_ALIGN_11 1013

Definition at line 148 of file resource.h.

#define IDC_ICON_ALIGN_2 1004

Definition at line 131 of file resource.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg().

#define IDC_ICON_ALIGN_3 1005

Definition at line 132 of file resource.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg().

#define IDC_ICON_ALIGN_4 1006

Definition at line 133 of file resource.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg().

#define IDC_ICON_ALIGN_5 1007

Definition at line 135 of file resource.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg().

#define IDC_ICON_ALIGN_6 1008

Definition at line 137 of file resource.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg().

#define IDC_ICON_ALIGN_7 1009

Definition at line 139 of file resource.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg().

#define IDC_ICON_ALIGN_8 1010

Definition at line 141 of file resource.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg().

#define IDC_ICON_ALIGN_9 1011

Definition at line 143 of file resource.h.

Referenced by DesktopSettingsDlg::DesktopSettingsDlg().

#define IDC_LABEL1 1009

Definition at line 140 of file resource.h.

Referenced by TrayNotifyDlg::TrayNotifyDlg().

#define IDC_LABEL2 1010

Definition at line 142 of file resource.h.

Referenced by TrayNotifyDlg::TrayNotifyDlg().

#define IDC_LABEL3 1011

Definition at line 144 of file resource.h.

Referenced by TrayNotifyDlg::TrayNotifyDlg().

#define IDC_LABEL4 1023

Definition at line 156 of file resource.h.

Referenced by TrayNotifyDlg::TrayNotifyDlg().

#define IDC_LABEL6 1012

Definition at line 147 of file resource.h.

Referenced by TrayNotifyDlg::TrayNotifyDlg().

#define IDC_LAST_CHANGE 1013

Definition at line 149 of file resource.h.

Referenced by TrayNotifyDlg::RefreshProperties(), and TrayNotifyDlg::TrayNotifyDlg().

#define IDC_MDI 1030

Definition at line 164 of file resource.h.

Referenced by MdiSdiDlg::Command(), and MdiSdiDlg::MdiSdiDlg().

#define IDC_NOTIFY_AUTOHIDE 1022

Definition at line 155 of file resource.h.

Referenced by TrayNotifyDlg::Command(), TrayNotifyDlg::Notify(), TrayNotifyDlg::RefreshProperties(), and TrayNotifyDlg::TrayNotifyDlg().

#define IDC_NOTIFY_HIDE 1021

Definition at line 154 of file resource.h.

Referenced by TrayNotifyDlg::Command(), and TrayNotifyDlg::TrayNotifyDlg().

#define IDC_NOTIFY_ICONS 1003

Definition at line 130 of file resource.h.

Referenced by TrayNotifyDlg::TrayNotifyDlg().

#define IDC_NOTIFY_MODULE 1008

Definition at line 138 of file resource.h.

Referenced by TrayNotifyDlg::RefreshProperties(), and TrayNotifyDlg::TrayNotifyDlg().

#define IDC_NOTIFY_SHOW 1020

Definition at line 153 of file resource.h.

Referenced by TrayNotifyDlg::Command(), TrayNotifyDlg::Notify(), TrayNotifyDlg::RefreshProperties(), and TrayNotifyDlg::TrayNotifyDlg().

#define IDC_NOTIFY_TITLE 1007

Definition at line 136 of file resource.h.

Referenced by TrayNotifyDlg::RefreshProperties(), and TrayNotifyDlg::TrayNotifyDlg().

#define IDC_NOTIFY_TOOLTIP 1006

Definition at line 134 of file resource.h.

Referenced by TrayNotifyDlg::RefreshProperties(), and TrayNotifyDlg::TrayNotifyDlg().

#define IDC_PICTURE 1019

Definition at line 152 of file resource.h.

Referenced by TrayNotifyDlg::TrayNotifyDlg().

#define IDC_PROGRAMS_FOUND 1018

Definition at line 151 of file resource.h.

Referenced by FindProgramDlg::FindProgramDlg().

#define IDC_ROS_EXPLORER 1000

Definition at line 127 of file resource.h.

Referenced by ExplorerAboutDlg::ExplorerAboutDlg().

#define IDC_SDI 1031

Definition at line 165 of file resource.h.

Referenced by MdiSdiDlg::MdiSdiDlg().

#define IDC_SEPARATE_SUBFOLDERS 1034

Definition at line 166 of file resource.h.

Referenced by MdiSdiDlg::Command(), and MdiSdiDlg::MdiSdiDlg().

#define IDC_STATIC -1

Definition at line 215 of file resource.h.

#define IDC_VERSION_TXT 1029

Definition at line 162 of file resource.h.

Referenced by ExplorerAboutDlg::ExplorerAboutDlg().

#define IDC_WIN_VERSION 1030

Definition at line 163 of file resource.h.

Referenced by ExplorerAboutDlg::ExplorerAboutDlg().

#define IDC_WWW 1012

Definition at line 146 of file resource.h.

Referenced by ExplorerAboutDlg::ExplorerAboutDlg().

#define IDD_ABOUT_EXPLORER 135

Definition at line 76 of file resource.h.

Referenced by explorer_about().

#define IDD_DESKBAR_DESKTOP 106

Definition at line 59 of file resource.h.

Referenced by ExplorerPropertySheet().

#define IDD_DESKBAR_STARTMENU 154

Definition at line 95 of file resource.h.

Referenced by ExplorerPropertySheet().

#define IDD_DESKBAR_TASKBAR 153

Definition at line 93 of file resource.h.

Referenced by ExplorerPropertySheet().

#define IDD_EXECUTE 108

Definition at line 61 of file resource.h.

Referenced by MainFrameBase::Command().

#define IDD_MDI_SDI 156

Definition at line 100 of file resource.h.

Referenced by MainFrameBase::Command(), and explorer_show_frame().

#define IDD_NOTIFYAREA 155

Definition at line 98 of file resource.h.

Referenced by NotifyArea::Command(), and TaskbarSettingsDlg::Command().

#define IDD_SEARCH_PROGRAM 105

Definition at line 57 of file resource.h.

Referenced by StartMenuHandler::Command().

#define IDI_ACTION 144

Definition at line 84 of file resource.h.

Referenced by IconCache::init().

#define IDI_APPICON 134

Definition at line 73 of file resource.h.

Referenced by IconCache::init().

#define IDI_APPS 142

Definition at line 82 of file resource.h.

Referenced by IconCache::init().

#define IDI_ARROW 125

Definition at line 68 of file resource.h.

#define IDI_ARROW_DOWN 167

Definition at line 114 of file resource.h.

Referenced by StartMenu::DrawArrows().

#define IDI_ARROW_SELECTED 126

Definition at line 69 of file resource.h.

#define IDI_ARROW_UP 166

Definition at line 113 of file resource.h.

Referenced by StartMenu::DrawArrows().

#define IDI_COMPUTER 149

Definition at line 89 of file resource.h.

Referenced by IconCache::init().

#define IDI_CONFIG 139

Definition at line 79 of file resource.h.

Referenced by IconCache::init().

#define IDI_DOCUMENTS 138

Definition at line 78 of file resource.h.

Referenced by IconCache::init().

#define IDI_DOT 163

Definition at line 109 of file resource.h.

Referenced by MainFrameBase::FillBookmarks(), and TrayNotifyDlg::TrayNotifyDlg().

#define IDI_DOT_RED 165

Definition at line 112 of file resource.h.

Referenced by TrayNotifyDlg::TrayNotifyDlg().

#define IDI_DOT_TRANS 164

Definition at line 111 of file resource.h.

Referenced by IconCache::init(), and TrayNotifyDlg::TrayNotifyDlg().

#define IDI_EXPLORER 101

Definition at line 52 of file resource.h.

Referenced by IconCache::init().

#define IDI_FAVORITES 140

Definition at line 80 of file resource.h.

Referenced by IconCache::init().

#define IDI_FLOATING 135

Definition at line 75 of file resource.h.

Referenced by StartMenu::DrawFloatingButton().

#define IDI_FOLDER 145

Definition at line 85 of file resource.h.

Referenced by IconCache::init().

#define IDI_FOLDERARROW 125

Definition at line 67 of file resource.h.

#define IDI_INFO 141

Definition at line 81 of file resource.h.

Referenced by IconCache::init().

#define IDI_LOGOFF 124

Definition at line 66 of file resource.h.

Referenced by IconCache::init().

#define IDI_NETWORK 148

Definition at line 88 of file resource.h.

Referenced by IconCache::init().

#define IDI_NOTIFY_L 168

Definition at line 115 of file resource.h.

Referenced by NotifyArea::Paint().

#define IDI_NOTIFY_R 169

Definition at line 116 of file resource.h.

Referenced by NotifyArea::Paint().

#define IDI_PRINTER 147

Definition at line 87 of file resource.h.

Referenced by IconCache::init().

#define IDI_REACTOS 100

Definition at line 51 of file resource.h.

Referenced by DesktopWindow::Create(), DesktopBar::DesktopBar(), ExplorerAboutDlg::ExplorerAboutDlg(), ExplorerPropertySheet(), and TrayNotifyDlg::TrayNotifyDlg().

#define IDI_REACTOS_BIG 137

Definition at line 77 of file resource.h.

Referenced by ExplorerAboutDlg::Paint().

#define IDI_SEARCH 143

Definition at line 83 of file resource.h.

Referenced by FindProgramDlg::FindProgramDlg(), and IconCache::init().

#define IDI_SEARCH_DOC 146

Definition at line 86 of file resource.h.

Referenced by IconCache::init().

#define IDI_SPEAKER 162

Definition at line 107 of file resource.h.

#define IDI_STARTMENU 102

Definition at line 53 of file resource.h.

#define IDM_DESKTOPBAR 150

Definition at line 90 of file resource.h.

#define IDM_MDIFRAME 110

Definition at line 63 of file resource.h.

Referenced by MDIMainFrame::Create().

#define IDM_NOTIFYAREA 152

Definition at line 92 of file resource.h.

Referenced by NotifyArea::WndProc().

#define IDM_SDIFRAME 113

Definition at line 65 of file resource.h.

Referenced by SDIMainFrame::Create().

#define IDM_VOLUME 151

Definition at line 91 of file resource.h.

#define IDR_MAINFRAME 109

Definition at line 62 of file resource.h.

#define IDS_ABOUT_EXPLORER 27

Definition at line 32 of file resource.h.

Referenced by DesktopShellView::DoDesktopContextMenu().

#define IDS_ADMIN 15

Definition at line 20 of file resource.h.

Referenced by SettingsMenu::AddEntries(), and StartMenuHandler::Command().

#define IDS_ALL_USERS 25

Definition at line 30 of file resource.h.

Referenced by FindProgramDlg::collect_programs_callback().

#define IDS_BROWSE 23

Definition at line 28 of file resource.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDS_CONNECTIONS 17

Definition at line 22 of file resource.h.

Referenced by SettingsMenu::AddEntries(), and StartMenuHandler::Command().

#define IDS_CONTROL_PANEL 21

Definition at line 26 of file resource.h.

Referenced by SettingsMenu::AddEntries().

#define IDS_DESKTOP 30

Definition at line 35 of file resource.h.

Referenced by ExplorerPropertySheet().

#define IDS_DESKTOP_NUM 34

Definition at line 39 of file resource.h.

Referenced by QuickLaunchBar::AddShortcuts().

#define IDS_DESKTOPBAR_SETTINGS 29

Definition at line 34 of file resource.h.

Referenced by SettingsMenu::AddEntries().

#define IDS_DOCUMENTS 8

Definition at line 13 of file resource.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDS_DRIVES 18

Definition at line 23 of file resource.h.

Referenced by BrowseMenu::AddEntries(), and StartMenuHandler::Command().

#define IDS_EMPTY 13

Definition at line 18 of file resource.h.

Referenced by StartMenu::Init().

#define IDS_EXPLORE 12

Definition at line 17 of file resource.h.

Referenced by StartMenuRoot::AddEntries().

#define IDS_EXPLORER_VERSION_STR 5001

Definition at line 169 of file resource.h.

Referenced by ExplorerAboutDlg::ExplorerAboutDlg().

#define IDS_FAVORITES 9

Definition at line 14 of file resource.h.

Referenced by StartMenuHandler::Command(), MainFrameBase::FillBookmarks(), and StartMenuRoot::Init().

#define IDS_HIDE_ICONS 44

Definition at line 49 of file resource.h.

Referenced by NotifyArea::Notify().

#define IDS_ITEMS_CONFIGURED 37

Definition at line 42 of file resource.h.

Referenced by TrayNotifyDlg::Refresh().

#define IDS_ITEMS_CUR 36

Definition at line 41 of file resource.h.

Referenced by TrayNotifyDlg::Refresh().

#define IDS_ITEMS_HIDDEN 39

Definition at line 44 of file resource.h.

Referenced by TrayNotifyDlg::Refresh().

#define IDS_ITEMS_VISIBLE 38

Definition at line 43 of file resource.h.

Referenced by TrayNotifyDlg::Refresh().

#define IDS_LAUNCH 5

Definition at line 10 of file resource.h.

Referenced by StartMenuRoot::Init().

#define IDS_LAUNCH_MANY_PROGRAMS 28

Definition at line 33 of file resource.h.

Referenced by FindProgramDlg::LaunchSelected().

#define IDS_LOGOFF 3

Definition at line 8 of file resource.h.

Referenced by StartMenuRoot::Init().

#define IDS_MINIMIZE_ALL 33

Definition at line 38 of file resource.h.

Referenced by QuickLaunchBar::AddShortcuts().

#define IDS_NETWORK 16

Definition at line 21 of file resource.h.

Referenced by BrowseMenu::AddEntries(), and StartMenuHandler::Command().

#define IDS_NOTIFY_AUTOHIDE 42

Definition at line 47 of file resource.h.

Referenced by TrayNotifyDlg::InsertItem(), and string_from_mode().

#define IDS_NOTIFY_HIDE 41

Definition at line 46 of file resource.h.

Referenced by TrayNotifyDlg::InsertItem(), and string_from_mode().

#define IDS_NOTIFY_SHOW 40

Definition at line 45 of file resource.h.

Referenced by TrayNotifyDlg::InsertItem(), and string_from_mode().

#define IDS_PRINTERS 22

Definition at line 27 of file resource.h.

Referenced by SettingsMenu::AddEntries(), and StartMenuHandler::Command().

#define IDS_PROGRAMS 10

Definition at line 15 of file resource.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDS_RECENT 14

Definition at line 19 of file resource.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDS_SEARCH 26

Definition at line 31 of file resource.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDS_SEARCH_COMPUTER 19

Definition at line 24 of file resource.h.

Referenced by SearchMenu::AddEntries().

#define IDS_SEARCH_FILES 7

Definition at line 12 of file resource.h.

Referenced by SearchMenu::AddEntries().

#define IDS_SEARCH_PRG 24

Definition at line 29 of file resource.h.

Referenced by SearchMenu::AddEntries().

#define IDS_SETTINGS 11

Definition at line 16 of file resource.h.

Referenced by StartMenuHandler::Command(), and StartMenuRoot::Init().

#define IDS_SETTINGS_MENU 20

Definition at line 25 of file resource.h.

Referenced by SettingsMenu::AddEntries(), and StartMenuHandler::Command().

#define IDS_SHOW_HIDDEN_ICONS 43

Definition at line 48 of file resource.h.

Referenced by NotifyArea::Notify().

#define IDS_SHUTDOWN 4

Definition at line 9 of file resource.h.

Referenced by StartMenuRoot::Init().

#define IDS_START 2

Definition at line 7 of file resource.h.

Referenced by DesktopBar::Init().

#define IDS_START_HELP 6

Definition at line 11 of file resource.h.

Referenced by StartMenuRoot::Init().

#define IDS_STARTMENU 32

Definition at line 37 of file resource.h.

Referenced by ExplorerPropertySheet().

#define IDS_TASKBAR 31

Definition at line 36 of file resource.h.

Referenced by ExplorerPropertySheet().

#define IDS_TERMINATE 45

Definition at line 50 of file resource.h.

Referenced by StartMenuRoot::Init().

#define IDS_TITLE 1

Definition at line 5 of file resource.h.

Referenced by QuickLaunchBar::AddShortcuts(), StartMenuHandler::Command(), MainFrameBase::Command(), SDIMainFrame::Create(), MDIMainFrame::Create(), FindProgramDlg::LaunchSelected(), ShowExitWindowsDialog(), StartMenuHandler::ShowLogoffDialog(), StartMenuHandler::ShowSearchComputer(), and StartMenuHandler::ShowSearchDialog().

#define IDS_VERSION_STR 5000

Definition at line 168 of file resource.h.

Referenced by ExplorerAboutDlg::ExplorerAboutDlg().

#define IDS_VOLUME 35

Definition at line 40 of file resource.h.

#define MANIFEST_RESOURCE_ID 1

Definition at line 6 of file resource.h.


ROS Explorer: resource.h Source File

  • File List
  • File Members

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by explorer-hu.rc
00004 //
00005 #define IDS_TITLE                       1
00006 #define MANIFEST_RESOURCE_ID            1
00007 #define IDS_START                       2
00008 #define IDS_LOGOFF                      3
00009 #define IDS_SHUTDOWN                    4
00010 #define IDS_LAUNCH                      5
00011 #define IDS_START_HELP                  6
00012 #define IDS_SEARCH_FILES                7
00013 #define IDS_DOCUMENTS                   8
00014 #define IDS_FAVORITES                   9
00015 #define IDS_PROGRAMS                    10
00016 #define IDS_SETTINGS                    11
00017 #define IDS_EXPLORE                     12
00018 #define IDS_EMPTY                       13
00019 #define IDS_RECENT                      14
00020 #define IDS_ADMIN                       15
00021 #define IDS_NETWORK                     16
00022 #define IDS_CONNECTIONS                 17
00023 #define IDS_DRIVES                      18
00024 #define IDS_SEARCH_COMPUTER             19
00025 #define IDS_SETTINGS_MENU               20
00026 #define IDS_CONTROL_PANEL               21
00027 #define IDS_PRINTERS                    22
00028 #define IDS_BROWSE                      23
00029 #define IDS_SEARCH_PRG                  24
00030 #define IDS_ALL_USERS                   25
00031 #define IDS_SEARCH                      26
00032 #define IDS_ABOUT_EXPLORER              27
00033 #define IDS_LAUNCH_MANY_PROGRAMS        28
00034 #define IDS_DESKTOPBAR_SETTINGS         29
00035 #define IDS_DESKTOP                     30
00036 #define IDS_TASKBAR                     31
00037 #define IDS_STARTMENU                   32
00038 #define IDS_MINIMIZE_ALL                33
00039 #define IDS_DESKTOP_NUM                 34
00040 #define IDS_VOLUME                      35
00041 #define IDS_ITEMS_CUR                   36
00042 #define IDS_ITEMS_CONFIGURED            37
00043 #define IDS_ITEMS_VISIBLE               38
00044 #define IDS_ITEMS_HIDDEN                39
00045 #define IDS_NOTIFY_SHOW                 40
00046 #define IDS_NOTIFY_HIDE                 41
00047 #define IDS_NOTIFY_AUTOHIDE             42
00048 #define IDS_SHOW_HIDDEN_ICONS           43
00049 #define IDS_HIDE_ICONS                  44
00050 #define IDS_TERMINATE                   45
00051 #define IDI_REACTOS                     100
00052 #define IDI_EXPLORER                    101
00053 #define IDI_STARTMENU                   102
00054 #define IDB_TOOLBAR                     103
00055 #define IDA_EXPLORER                    104
00056 #define ID_ACTIVATE                     105
00057 #define IDD_SEARCH_PROGRAM              105
00058 #define IDB_DRIVEBAR                    106
00059 #define IDD_DESKBAR_DESKTOP             106
00060 #define IDB_IMAGES                      107
00061 #define IDD_EXECUTE                     108
00062 #define IDR_MAINFRAME                   109
00063 #define IDM_MDIFRAME                    110
00064 #define ID_EXECUTE                      111
00065 #define IDM_SDIFRAME                    113
00066 #define IDI_LOGOFF                      124
00067 #define IDI_FOLDERARROW                 125
00068 #define IDI_ARROW                       125
00069 #define IDI_ARROW_SELECTED              126
00070 #define IDB_LOGOV                       129
00071 #define IDB_LOGOV256                    130
00072 #define IDA_SEARCH_PROGRAM              133
00073 #define IDI_APPICON                     134
00074 #define IDA_TRAYNOTIFY                  134
00075 #define IDI_FLOATING                    135
00076 #define IDD_ABOUT_EXPLORER              135
00077 #define IDI_REACTOS_BIG                 137
00078 #define IDI_DOCUMENTS                   138
00079 #define IDI_CONFIG                      139
00080 #define IDI_FAVORITES                   140
00081 #define IDI_INFO                        141
00082 #define IDI_APPS                        142
00083 #define IDI_SEARCH                      143
00084 #define IDI_ACTION                      144
00085 #define IDI_FOLDER                      145
00086 #define IDI_SEARCH_DOC                  146
00087 #define IDI_PRINTER                     147
00088 #define IDI_NETWORK                     148
00089 #define IDI_COMPUTER                    149
00090 #define IDM_DESKTOPBAR                  150
00091 #define IDM_VOLUME                      151
00092 #define IDM_NOTIFYAREA                  152
00093 #define IDD_DESKBAR_TASKBAR             153
00094 #define IDB_ICON_ALIGN_0                153
00095 #define IDD_DESKBAR_STARTMENU           154
00096 #define IDB_ICON_ALIGN_1                154
00097 #define IDB_ICON_ALIGN_2                155
00098 #define IDD_NOTIFYAREA                  155
00099 #define IDB_ICON_ALIGN_3                156
00100 #define IDD_MDI_SDI                     156
00101 #define IDB_ICON_ALIGN_4                157
00102 #define IDB_ICON_ALIGN_5                158
00103 #define IDB_ICON_ALIGN_6                159
00104 #define IDB_ICON_ALIGN_7                160
00105 #define IDB_ICON_ALIGN_8                161
00106 #define IDB_ICON_ALIGN_9                162
00107 #define IDI_SPEAKER                     162
00108 #define IDB_ICON_ALIGN_10               163
00109 #define IDI_DOT                         163
00110 #define IDB_LOGOV16                     164
00111 #define IDI_DOT_TRANS                   164
00112 #define IDI_DOT_RED                     165
00113 #define IDI_ARROW_UP                    166
00114 #define IDI_ARROW_DOWN                  167
00115 #define IDI_NOTIFY_L                    168
00116 #define IDI_NOTIFY_R                    169
00117 #define IDB_MDI                         170
00118 #define IDB_SDI                         171
00119 #define ID_VIEW_NAME                    401
00120 #define ID_VIEW_ALL_ATTRIBUTES          402
00121 #define ID_VIEW_SELECTED_ATTRIBUTES     403
00122 #define ID_VIEW_STATUSBAR               503
00123 #define ID_VIEW_DRIVE_BAR               507
00124 #define ID_VIEW_TOOL_BAR                508
00125 #define ID_VIEW_EXTRA_BAR               509
00126 #define ID_VIEW_SIDE_BAR                510
00127 #define IDC_ROS_EXPLORER                1000
00128 #define IDC_ICON_ALIGN_0                1002
00129 #define IDC_ICON_ALIGN_1                1003
00130 #define IDC_NOTIFY_ICONS                1003
00131 #define IDC_ICON_ALIGN_2                1004
00132 #define IDC_ICON_ALIGN_3                1005
00133 #define IDC_ICON_ALIGN_4                1006
00134 #define IDC_NOTIFY_TOOLTIP              1006
00135 #define IDC_ICON_ALIGN_5                1007
00136 #define IDC_NOTIFY_TITLE                1007
00137 #define IDC_ICON_ALIGN_6                1008
00138 #define IDC_NOTIFY_MODULE               1008
00139 #define IDC_ICON_ALIGN_7                1009
00140 #define IDC_LABEL1                      1009
00141 #define IDC_ICON_ALIGN_8                1010
00142 #define IDC_LABEL2                      1010
00143 #define IDC_ICON_ALIGN_9                1011
00144 #define IDC_LABEL3                      1011
00145 #define IDC_ICON_ALIGN_10               1012
00146 #define IDC_WWW                         1012
00147 #define IDC_LABEL6                      1012
00148 #define IDC_ICON_ALIGN_11               1013
00149 #define IDC_LAST_CHANGE                 1013
00150 #define IDC_FILTER                      1017
00151 #define IDC_PROGRAMS_FOUND              1018
00152 #define IDC_PICTURE                     1019
00153 #define IDC_NOTIFY_SHOW                 1020
00154 #define IDC_NOTIFY_HIDE                 1021
00155 #define IDC_NOTIFY_AUTOHIDE             1022
00156 #define IDC_LABEL4                      1023
00157 #define ID_HIDE_INACTIVE_ICONS          1025
00158 #define ID_SHOW_CLOCK                   1026
00159 #define ID_DESKTOP_VERSION              1027
00160 #define IDC_BUTTON1                     1028
00161 #define IDC_CHECK_ENTRIES               1028
00162 #define IDC_VERSION_TXT                 1029
00163 #define IDC_WIN_VERSION                 1030
00164 #define IDC_MDI                         1030
00165 #define IDC_SDI                         1031
00166 #define IDC_SEPARATE_SUBFOLDERS         1034
00167 #define ID_REFRESH                      1704
00168 #define IDS_VERSION_STR                 5000
00169 #define IDS_EXPLORER_VERSION_STR        5001
00170 #define IDC_FILETREE                    10001
00171 #define ID_EXPLORER_FAQ                 10002
00172 #define ID_WEB_WINDOW                   10003
00173 #define ID_WINDOW_AUTOSORT              0x8003
00174 #define ID_VIEW_FULLSCREEN              0x8004
00175 #define ID_PREFERED_SIZES               0x8005
00176 #define ID_DRIVE_DESKTOP                0x9000
00177 #define ID_DRIVE_SHELL_NS               0x9001
00178 #define ID_DRIVE_UNIX_FS                0x9002
00179 #define ID_DRIVE_NTOBJ_NS               0x9003
00180 #define ID_DRIVE_REGISTRY               0x9004
00181 #define ID_DRIVE_FAT                    0x9005
00182 #define ID_DRIVE_FIRST                  0x9006
00183 #define ID_ABOUT_WINDOWS                40002
00184 #define ID_ABOUT_EXPLORER               40003
00185 #define ID_DESKTOPBAR_SETTINGS          40004
00186 #define ID_GO_BACK                      40005
00187 #define ID_GO_FORWARD                   40006
00188 #define ID_GO_HOME                      40007
00189 #define ID_GO_SEARCH                    40008
00190 #define ID_GO_UP                        40009
00191 #define ID_STOP                         40010
00192 #define ID_MINIMIZE_ALL                 40011
00193 #define ID_EXPLORE                      40012
00194 #define ID_TASKMGR                      40013
00195 #define ID_TRAY_VOLUME                  40014
00196 #define ID_VOLUME_PROPERTIES            40015
00197 #define ID_SHOW_HIDDEN_ICONS            40016
00198 #define ID_CONFIG_NOTIFYAREA            40017
00199 #define ID_CONFIG_TIME                  40018
00200 #define ID_VIEW_MDI                     40019
00201 #define ID_VIEW_SDI                     40020
00202 #define ID_TOOLS_OPTIONS                40021
00203 #define ID_SHOW_ICON_BUTTON             40023
00204 #define ID_SWITCH_DESKTOP_1             50000
00205 #define ID_WINDOW_NEW                   0xE130
00206 #define ID_WINDOW_ARRANGE               0xE131
00207 #define ID_WINDOW_CASCADE               0xE132
00208 #define ID_WINDOW_TILE_HORZ             0xE133
00209 #define ID_WINDOW_TILE_VERT             0xE134
00210 #define ID_WINDOW_SPLIT                 0xE135
00211 #define ID_EDIT_PROPERTIES              57656
00212 #define ID_FILE_EXIT                    0xE141
00213 #define ID_HELP_USING                   0xE144
00214 #define ID_HELP                         0xE146
00215 #define IDC_STATIC                      -1
00216
00217 // Next default values for new objects
00218 //
00219 #ifdef APSTUDIO_INVOKED
00220 #ifndef APSTUDIO_READONLY_SYMBOLS
00221 #define _APS_NEXT_RESOURCE_VALUE        169
00222 #define _APS_NEXT_COMMAND_VALUE         40024
00223 #define _APS_NEXT_CONTROL_VALUE         1035
00224 #define _APS_NEXT_SYMED_VALUE           101
00225 #endif
00226 #endif


ROS Explorer: searchprogram.cpp File Reference

  • File List
  • File Members
dialogs

searchprogram.cpp File Reference

#include <precomp.h>
#include "../resource.h"
#include "searchprogram.h"

Include dependency graph for searchprogram.cpp:

Go to the source code of this file.


ROS Explorer: searchprogram.cpp Source File

  • File List
  • File Members
dialogs

searchprogram.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // dialogs/searchprogram.cpp
00024  //
00025  // Explorer dialogs
00026  //
00027  // Martin Fuchs, 02.10.2003
00028  //
00029
00030
00031 #include <precomp.h>
00032
00033 #include "../resource.h"
00034
00035 #include "searchprogram.h"
00036
00037
00038 int CollectProgramsThread::Run()
00039 {
00040         try {
00041                 collect_programs(SpecialFolderPath(CSIDL_COMMON_PROGRAMS, _hwnd));
00042         } catch(COMException&) {
00043         }
00044
00045         if (_alive)
00046                 try {
00047                         collect_programs(SpecialFolderPath(CSIDL_PROGRAMS, _hwnd));
00048                 } catch(COMException&) {
00049                 }
00050
00051         if (_alive)
00052                 _cache_valid = true;
00053
00054         return 0;
00055 }
00056
00057 void CollectProgramsThread::collect_programs(const ShellPath& path)
00058 {
00059         ShellDirectory* dir = new ShellDirectory(GetDesktopFolder(), path, 0);
00060         _dirs.push(dir);
00061
00062         dir->smart_scan(SORT_NONE, /*SCAN_EXTRACT_ICONS|*/SCAN_FILESYSTEM);
00063
00064         for(Entry*entry=dir->_down; _alive && entry; entry=entry->_next) {
00065                 if (entry->_shell_attribs & SFGAO_HIDDEN)
00066                         continue;
00067
00068                 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00069                         collect_programs(entry->create_absolute_pidl());
00070                 else if (entry->_shell_attribs & SFGAO_LINK)
00071                         if (_alive)
00072                                 _callback(entry, _para);
00073         }
00074 }
00075
00076 void CollectProgramsThread::free_dirs()
00077 {
00078         while(!_dirs.empty()) {
00079                 ShellDirectory* dir = _dirs.top();
00080                 dir->free_subentries();
00081                 _dirs.pop();
00082         }
00083 }
00084
00085
00086 #ifdef _MSC_VER
00087 #pragma warning(disable: 4355)
00088 #endif
00089
00090 FindProgramDlg::FindProgramDlg(HWND hwnd)
00091  :      super(hwnd),
00092         _list_ctrl(GetDlgItem(hwnd, IDC_PROGRAMS_FOUND)),
00093         _thread(collect_programs_callback, hwnd, this),
00094         _sort(_list_ctrl, CompareFunc/*, (LPARAM)this*/)
00095 {
00096         SetWindowIcon(hwnd, IDI_SEARCH);
00097
00098         _resize_mgr.Add(IDC_FILTER,                     RESIZE_X);
00099         _resize_mgr.Add(IDC_CHECK_ENTRIES,      MOVE_X);
00100         _resize_mgr.Add(IDC_PROGRAMS_FOUND,     RESIZE);
00101
00102         _resize_mgr.Resize(+520, +300);
00103
00104         _haccel = LoadAccelerators(g_Globals._hInstance, MAKEINTRESOURCE(IDA_SEARCH_PROGRAM));
00105
00106         (void)ListView_SetImageList(_list_ctrl, g_Globals._icon_cache.get_sys_imagelist(), LVSIL_SMALL);
00107
00108         LV_COLUMN column = {LVCF_FMT|LVCF_WIDTH|LVCF_TEXT, LVCFMT_LEFT, 250};
00109
00110         column.pszText = _T("Name");
00111         ListView_InsertColumn(_list_ctrl, 0, &column);
00112
00113         column.cx = 300;
00114         column.pszText = _T("Path");
00115         ListView_InsertColumn(_list_ctrl, 1, &column);
00116
00117         column.cx = 400;
00118         column.pszText = _T("Menu Path");
00119         ListView_InsertColumn(_list_ctrl, 2, &column);
00120
00121         ListView_SetExtendedListViewStyleEx(_list_ctrl, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
00122
00123         _common_programs = SpecialFolderFSPath(CSIDL_COMMON_PROGRAMS, hwnd);
00124         if (!_common_programs.empty())
00125                 _common_programs.append(_T("\\"));
00126
00127         _user_programs = SpecialFolderFSPath(CSIDL_PROGRAMS, hwnd);
00128         if (!_user_programs.empty())
00129                 _user_programs.append(_T("\\"));
00130
00131         CenterWindow(hwnd);
00132
00133         Refresh();
00134
00135         register_pretranslate(hwnd);
00136 }
00137
00138 FindProgramDlg::~FindProgramDlg()
00139 {
00140         _thread.Stop();
00141
00142         unregister_pretranslate(_hwnd);
00143 }
00144
00145
00146 void FindProgramDlg::Refresh(bool delete_cache)
00147 {
00148         WaitCursor wait;
00149
00150         _thread.Stop();
00151
00152         TCHAR buffer[1024];
00153         GetWindowText(GetDlgItem(_hwnd, IDC_FILTER), buffer, COUNTOF(buffer));
00154         CharLower(buffer);
00155         _lwr_filter = buffer;
00156
00157         HiddenWindow hide_listctrl(_list_ctrl);
00158
00159         ListView_DeleteAllItems(_list_ctrl);
00160
00161         if (delete_cache || !_thread._cache_valid) {
00162                 _thread.free_dirs();
00163                 _thread.Start();
00164         } else {
00165                 for(FPDCache::const_iterator it=_cache.begin(); it!=_cache.end(); ++it)
00166                         add_entry(*it);
00167         }
00168 }
00169
00170 void FindProgramDlg::collect_programs_callback(Entry* entry, void* param)
00171 {
00172         FindProgramDlg* pThis = (FindProgramDlg*) param;
00173
00174         IShellLink* pShellLink;
00175         HRESULT hr = entry->GetUIObjectOf(pThis->_hwnd, IID_IShellLink, (LPVOID*)&pShellLink);
00176
00177         if (SUCCEEDED(hr)) {
00178                 ShellLinkPtr shell_link(pShellLink);
00179
00180                 shell_link->Release();
00181
00182                 /*hr = pShellLink->Resolve(pThis->_hwnd, SLR_NO_UI);
00183                 if (SUCCEEDED(hr))*/ {
00184                         WIN32_FIND_DATA wfd;
00185                         TCHAR path[MAX_PATH];
00186
00187                         hr = pShellLink->GetPath(path, COUNTOF(path)-1, &wfd, SLGP_UNCPRIORITY);
00188
00189                         if (SUCCEEDED(hr)) {
00190                                 TCHAR entry_path[MAX_PATH];
00191
00192                                 entry->get_path(entry_path, COUNTOF(entry_path));
00193
00194                                 String menu_path;
00195
00196                                 int len = pThis->_common_programs.size();
00197
00198                                 if (len && !_tcsnicmp(entry_path, pThis->_common_programs, len))
00199                                         menu_path = ResString(IDS_ALL_USERS) + (String(entry_path)+len);
00200                                 else if ((len=pThis->_user_programs.size()) && !_tcsnicmp(entry_path, pThis->_user_programs, len))
00201                                         menu_path = String(entry_path)+len;
00202
00203                                  // store info in cache
00204                                 FPDEntry new_entry;
00205
00206                                 new_entry._entry = entry;
00207                                 new_entry._menu_path = menu_path;
00208                                 new_entry._path = path;
00209                                 new_entry._idxIcon = I_IMAGECALLBACK;
00210
00211                                 pThis->_cache.push_front(new_entry);
00212                                 FPDEntry& cache_entry = pThis->_cache.front();
00213
00214                                 Lock lock(pThis->_thread._crit_sect);
00215
00216                                  // resolve deadlocks while executing Thread::Stop()
00217                                 if (!pThis->_thread.is_alive())
00218                                         return;
00219
00220                                 pThis->add_entry(cache_entry);
00221                         }
00222                 }
00223         }
00224 }
00225
00226 void FindProgramDlg::add_entry(const FPDEntry& cache_entry)
00227 {
00228         String lwr_path = cache_entry._path;
00229         String lwr_name = cache_entry._entry->_display_name;
00230
00231         lwr_path.toLower();
00232         lwr_name.toLower();
00233
00234         if (_lwr_filter.empty())
00235                 if (_tcsstr(lwr_name, _T("uninstal")) || _tcsstr(lwr_name, _T("deinstal")))     // filter out deinstallation links
00236                         return;
00237
00238         if (!_tcsstr(lwr_path, _lwr_filter) && !_tcsstr(lwr_name, _lwr_filter))
00239                 return;
00240
00241         LV_ITEM item = {LVIF_TEXT|LVIF_IMAGE|LVIF_PARAM, INT_MAX};
00242
00243         item.pszText = cache_entry._entry->_display_name;
00244         item.iImage = cache_entry._idxIcon;
00245         item.lParam = (LPARAM) &cache_entry;
00246         item.iItem = ListView_InsertItem(_list_ctrl, &item);    // We could use the information in _sort to enable manual sorting while populating the list.
00247
00248         item.mask = LVIF_TEXT;
00249         item.iSubItem = 1;
00250         item.pszText = (LPTSTR)(LPCTSTR)cache_entry._path;
00251         ListView_SetItem(_list_ctrl, &item);
00252
00253         item.iSubItem = 2;
00254         item.pszText = (LPTSTR)(LPCTSTR)cache_entry._menu_path;
00255         ListView_SetItem(_list_ctrl, &item);
00256 }
00257
00258 LRESULT FindProgramDlg::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00259 {
00260         switch(nmsg) {
00261           case WM_CLOSE:
00262                 (void)ListView_SetImageList(_list_ctrl, 0, LVSIL_SMALL);        // detach system image list
00263                 goto def;
00264
00265           case PM_TRANSLATE_MSG: {
00266                 MSG* pmsg = (MSG*) lparam;
00267
00268                 if (TranslateAccelerator(_hwnd, _haccel, pmsg))
00269                         return TRUE;
00270
00271                 return FALSE;}
00272
00273           default: def:
00274                 return super::WndProc(nmsg, wparam, lparam);
00275         }
00276
00277         return 0;
00278 }
00279
00280 int FindProgramDlg::Command(int id, int code)
00281 {
00282         if (code == BN_CLICKED) {
00283                 switch(id) {
00284                   case ID_REFRESH:
00285                         Refresh(true);
00286                         break;
00287
00288                   case IDOK:
00289                         LaunchSelected();
00290                         break;
00291
00292                   case IDC_CHECK_ENTRIES:
00293                         CheckEntries();
00294                         break;
00295
00296                   default:
00297                         return super::Command(id, code);
00298                 }
00299
00300                 return 0;
00301         }
00302         else if (code == EN_CHANGE) {
00303                 switch(id) {
00304                   case IDC_FILTER:
00305                         Refresh();
00306                         break;
00307                 }
00308
00309                 return 0;
00310         }
00311
00312         return 1;
00313 }
00314
00315 void FindProgramDlg::LaunchSelected()
00316 {
00317         Lock lock(_thread._crit_sect);
00318
00319         int count = ListView_GetSelectedCount(_list_ctrl);
00320
00321         if (count > 1)
00322                 if (MessageBox(_hwnd, ResString(IDS_LAUNCH_MANY_PROGRAMS), ResString(IDS_TITLE), MB_OKCANCEL) != IDOK)
00323                         return;
00324
00325         for(int idx=-1; (idx=ListView_GetNextItem(_list_ctrl, idx, LVNI_SELECTED))!=-1; ) {
00326                 LPARAM lparam = ListView_GetItemData(_list_ctrl, idx);
00327
00328                 if (lparam) {
00329                         FPDEntry& cache_entry = *(FPDEntry*)lparam;
00330                         cache_entry._entry->launch_entry(_hwnd);
00331                 }
00332         }
00333 }
00334
00335 int FindProgramDlg::Notify(int id, NMHDR* pnmh)
00336 {
00337         switch(pnmh->code) {
00338           case LVN_GETDISPINFO: {
00339                 LV_DISPINFO* pDispInfo = (LV_DISPINFO*) pnmh;
00340
00341                 if (pnmh->hwndFrom == _list_ctrl) {
00342                         if (pDispInfo->item.mask & LVIF_IMAGE) {
00343                                 FPDEntry& cache_entry = *(FPDEntry*)pDispInfo->item.lParam;
00344                                 Entry* entry = cache_entry._entry;
00345
00346                                 if (entry->_icon_id == ICID_UNKNOWN)
00347                                         entry->_icon_id = entry->extract_icon(ICF_SYSCACHE);
00348
00349                                 pDispInfo->item.iImage = g_Globals._icon_cache.get_icon(entry->_icon_id).get_sysiml_idx();
00350                                 pDispInfo->item.mask |= LVIF_DI_SETITEM;
00351
00352                                 return 1;
00353                         }
00354                 }}
00355                 break;
00356
00357           case NM_DBLCLK:
00358                 if (pnmh->hwndFrom == _list_ctrl)
00359                         LaunchSelected();
00360                 /*{
00361                         Lock lock(_thread._crit_sect);
00362
00363                         LPNMLISTVIEW pnmv = (LPNMLISTVIEW) pnmh;
00364                         LPARAM lparam = ListView_GetItemData(pnmh->hwndFrom, pnmv->iItem);
00365
00366                         if (lparam) {
00367                                 FPDEntry& cache_entry = *(FPDEntry*)lparam;
00368                                 cache_entry._entry->launch_entry(_hwnd);
00369                         }
00370                 }*/
00371                 break;
00372
00373           case HDN_ITEMCLICK: {
00374                 WaitCursor wait;
00375                 NMHEADER* phdr = (NMHEADER*)pnmh;
00376
00377                 if (GetParent(pnmh->hwndFrom) == _list_ctrl) {
00378                         if (_thread._cache_valid) {     // disable manual sorting while populating the list
00379                                 _sort.toggle_sort(phdr->iItem);
00380                                 _sort.sort();
00381                         }
00382                 }
00383                 break;}
00384         }
00385
00386         return 0;
00387 }
00388
00389 int CALLBACK FindProgramDlg::CompareFunc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort)
00390 {
00391         ListSort* sort = (ListSort*)lparamSort;
00392
00393         FPDEntry& a = *(FPDEntry*)lparam1;
00394         FPDEntry& b = *(FPDEntry*)lparam2;
00395
00396         int cmp = 0;
00397
00398         switch(sort->_sort_crit) {
00399           case 0:
00400                 cmp = _tcsicoll(a._entry->_display_name, b._entry->_display_name);
00401                 break;
00402
00403           case 1:
00404                 cmp = _tcsicoll(a._path, b._path);
00405                 break;
00406
00407           case 2:
00408                 cmp = _tcsicoll(a._menu_path, b._menu_path);
00409         }
00410
00411         return sort->_direction? -cmp: cmp;
00412 }
00413
00414 void FindProgramDlg::CheckEntries()
00415 {
00417 }


ROS Explorer: searchprogram.h File Reference

  • File List
  • File Members
dialogs

searchprogram.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | CollectProgramsThread
Thread for collecting start menu entries. More...
struct | FPDEntry
entry for the list in "find program" dialogs More...
struct | FindProgramDlg
Dialog to work with the complete list of start menu entries. More...

Typedefs

typedef void(* | COLLECT_CALLBACK )(Entry *entry, void *param)
typedef stack< ShellDirectory * > | ShellDirectoryStack
typedef list< FPDEntry > | FPDCache

Typedef Documentation

typedef void(* COLLECT_CALLBACK)(Entry *entry, void *param)

Definition at line 31 of file searchprogram.h.

typedef list<FPDEntry> FPDCache

Definition at line 74 of file searchprogram.h.

typedef stack<ShellDirectory*> ShellDirectoryStack

Definition at line 32 of file searchprogram.h.


ROS Explorer: searchprogram.h Source File

  • File List
  • File Members
dialogs

searchprogram.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // dialogs/searchprogram.h
00024  //
00025  // Explorer dialogs
00026  //
00027  // Martin Fuchs, 02.10.2003
00028  //
00029
00030
00031 typedef void (*COLLECT_CALLBACK)(Entry* entry, void* param);
00032 typedef stack<ShellDirectory*> ShellDirectoryStack;
00033
00035 struct CollectProgramsThread : public Thread
00036 {
00037         CollectProgramsThread(COLLECT_CALLBACK callback, HWND hwnd, void* para)
00038          :      _cache_valid(false),
00039                 _callback(callback),
00040                 _hwnd(hwnd),
00041                 _para(para)
00042         {
00043         }
00044
00045         ~CollectProgramsThread()
00046         {
00047                 free_dirs();
00048         }
00049
00050         int             Run();
00051         void    free_dirs();
00052
00053         bool    _cache_valid;
00054
00055 protected:
00056         COLLECT_CALLBACK _callback;
00057         HWND    _hwnd;
00058         void*   _para;
00059         ShellDirectoryStack _dirs;
00060
00061         void    collect_programs(const ShellPath& path);
00062 };
00063
00064
00066 struct FPDEntry
00067 {
00068         Entry*  _entry;
00069         int             _idxIcon;
00070         String  _menu_path;
00071         String  _path;
00072 };
00073
00074 typedef list<FPDEntry> FPDCache;
00075
00076
00078 struct FindProgramDlg : public ResizeController<Dialog>
00079 {
00080         typedef ResizeController<Dialog> super;
00081
00082         FindProgramDlg(HWND hwnd);
00083         ~FindProgramDlg();
00084
00085 protected:
00086         HWND    _list_ctrl;
00087         HACCEL  _haccel;
00088         String  _lwr_filter;
00089
00090         CollectProgramsThread _thread;
00091         FPDCache _cache;
00092
00093         String  _common_programs, _user_programs;
00094
00095         ListSort _sort;
00096
00097         virtual LRESULT WndProc(UINT, WPARAM, LPARAM);
00098         virtual int     Command(int id, int code);
00099         virtual int     Notify(int id, NMHDR* pnmh);
00100
00101         void    Refresh(bool delete_cache=false);
00102         void    add_entry(const FPDEntry& cache_entry);
00103         void    LaunchSelected();
00104         void    CheckEntries();
00105
00106         static void collect_programs_callback(Entry* entry, void* param);
00107         static int CALLBACK CompareFunc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort);
00108 };


ROS Explorer: settings.cpp File Reference

  • File List
  • File Members
dialogs

settings.cpp File Reference

#include <precomp.h>
#include "../resource.h"
#include "../taskbar/traynotify.h"
#include "settings.h"

Include dependency graph for settings.cpp:

Go to the source code of this file.

Defines

#define | PSN_QUERYINITIALFOCUS (-213)

Functions

void | ExplorerPropertySheet (HWND hparent)

Define Documentation

#define PSN_QUERYINITIALFOCUS (-213)

Definition at line 100 of file settings.cpp.

Function Documentation

void ExplorerPropertySheet ( HWND hparent )

Definition at line 39 of file settings.cpp.

References PropertySheetDialog::add(), PropertySheetDialog::DoModal(), IDD_DESKBAR_DESKTOP, IDD_DESKBAR_STARTMENU, IDD_DESKBAR_TASKBAR, IDI_REACTOS, IDS_DESKTOP, IDS_STARTMENU, IDS_TASKBAR, and WINDOW_CREATOR.

Referenced by StartMenuHandler::Command(), and DesktopBar::Command().

00040 {
00041         PropertySheetDialog ps(hparent);
00042
00043         ps.dwFlags |= PSH_USEICONID | PSH_PROPTITLE;
00044         ps.pszIcon = MAKEINTRESOURCE(IDI_REACTOS);
00045         ps.pszCaption = TEXT("Explorer");
00046
00047         PropSheetPage psp1(IDD_DESKBAR_DESKTOP, WINDOW_CREATOR(DesktopSettingsDlg));
00048         psp1.dwFlags |= PSP_USETITLE;
00049         psp1.pszTitle = MAKEINTRESOURCE(IDS_DESKTOP);
00050         ps.add(psp1);
00051
00052         PropSheetPage psp2(IDD_DESKBAR_TASKBAR, WINDOW_CREATOR(TaskbarSettingsDlg));
00053         psp2.dwFlags |= PSP_USETITLE;
00054         psp2.pszTitle = MAKEINTRESOURCE(IDS_TASKBAR);
00055         ps.add(psp2);
00056
00057         PropSheetPage psp3(IDD_DESKBAR_STARTMENU, WINDOW_CREATOR(StartmenuSettingsDlg));
00058         psp3.dwFlags |= PSP_USETITLE;
00059         psp3.pszTitle = MAKEINTRESOURCE(IDS_STARTMENU);
00060         ps.add(psp3);
00061
00062         ps.DoModal();
00063 }

Here is the call graph for this function:


ROS Explorer: settings.cpp Source File

  • File List
  • File Members
dialogs

settings.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // dialogs/settings.cpp
00024  //
00025  // Explorer dialogs
00026  //
00027  // Martin Fuchs, 18.01.2004
00028  //
00029
00030
00031 #include <precomp.h>
00032
00033 #include "../resource.h"
00034
00035 #include "../taskbar/traynotify.h"
00036 #include "settings.h"
00037
00038
00039 void ExplorerPropertySheet(HWND hparent)
00040 {
00041         PropertySheetDialog ps(hparent);
00042
00043         ps.dwFlags |= PSH_USEICONID | PSH_PROPTITLE;
00044         ps.pszIcon = MAKEINTRESOURCE(IDI_REACTOS);
00045         ps.pszCaption = TEXT("Explorer");
00046
00047         PropSheetPage psp1(IDD_DESKBAR_DESKTOP, WINDOW_CREATOR(DesktopSettingsDlg));
00048         psp1.dwFlags |= PSP_USETITLE;
00049         psp1.pszTitle = MAKEINTRESOURCE(IDS_DESKTOP);
00050         ps.add(psp1);
00051
00052         PropSheetPage psp2(IDD_DESKBAR_TASKBAR, WINDOW_CREATOR(TaskbarSettingsDlg));
00053         psp2.dwFlags |= PSP_USETITLE;
00054         psp2.pszTitle = MAKEINTRESOURCE(IDS_TASKBAR);
00055         ps.add(psp2);
00056
00057         PropSheetPage psp3(IDD_DESKBAR_STARTMENU, WINDOW_CREATOR(StartmenuSettingsDlg));
00058         psp3.dwFlags |= PSP_USETITLE;
00059         psp3.pszTitle = MAKEINTRESOURCE(IDS_STARTMENU);
00060         ps.add(psp3);
00061
00062         ps.DoModal();
00063 }
00064
00065
00066 DesktopSettingsDlg::DesktopSettingsDlg(HWND hwnd)
00067  :      super(hwnd),
00068         _bmp0(IDB_ICON_ALIGN_0),
00069         _bmp1(IDB_ICON_ALIGN_1),
00070         _bmp2(IDB_ICON_ALIGN_2),
00071         _bmp3(IDB_ICON_ALIGN_3),
00072         _bmp4(IDB_ICON_ALIGN_4),
00073         _bmp5(IDB_ICON_ALIGN_5),
00074         _bmp6(IDB_ICON_ALIGN_6),
00075         _bmp7(IDB_ICON_ALIGN_7),
00076         _bmp8(IDB_ICON_ALIGN_8),
00077         _bmp9(IDB_ICON_ALIGN_9),
00078         _bmp10(IDB_ICON_ALIGN_10)
00079 {
00080         new PictureButton(_hwnd, IDC_ICON_ALIGN_0, _bmp0);
00081         new PictureButton(_hwnd, IDC_ICON_ALIGN_1, _bmp1);
00082         new PictureButton(_hwnd, IDC_ICON_ALIGN_2, _bmp2);
00083         new PictureButton(_hwnd, IDC_ICON_ALIGN_3, _bmp3);
00084         new PictureButton(_hwnd, IDC_ICON_ALIGN_4, _bmp4);
00085         new PictureButton(_hwnd, IDC_ICON_ALIGN_5, _bmp5);
00086         new PictureButton(_hwnd, IDC_ICON_ALIGN_6, _bmp6);
00087         new PictureButton(_hwnd, IDC_ICON_ALIGN_7, _bmp7);
00088         new PictureButton(_hwnd, IDC_ICON_ALIGN_8, _bmp8);
00089         new PictureButton(_hwnd, IDC_ICON_ALIGN_9, _bmp9);
00090         new PictureButton(_hwnd, IDC_ICON_ALIGN_10, _bmp10);
00091
00092         _alignment_cur = SendMessage(g_Globals._hwndShellView, PM_GET_ICON_ALGORITHM, 0, 0);
00093         _alignment_tmp = _alignment_cur;
00094
00095         _display_version_org = SendMessage(g_Globals._hwndShellView, PM_DISPLAY_VERSION, 0, MAKELONG(0,0));
00096         CheckDlgButton(hwnd, ID_DESKTOP_VERSION, _display_version_org? BST_CHECKED: BST_UNCHECKED);
00097 }
00098
00099 #ifndef PSN_QUERYINITIALFOCUS   // currently (as of 18.01.2004) missing in MinGW headers
00100 #define PSN_QUERYINITIALFOCUS (-213)
00101 #endif
00102
00103 int DesktopSettingsDlg::Notify(int id, NMHDR* pnmh)
00104 {
00105         switch(pnmh->code) {
00106           case PSN_QUERYINITIALFOCUS:
00107                 SetWindowLong(_hwnd, DWL_MSGRESULT, (LPARAM)GetDlgItem(_hwnd, IDC_ICON_ALIGN_0+_alignment_cur));
00108                 break;
00109
00110           case PSN_APPLY:
00111                 _alignment_cur = _alignment_tmp;
00112                 _display_version_org = SendMessage(g_Globals._hwndShellView, PM_DISPLAY_VERSION, 0, MAKELONG(0,0));
00113                 break;
00114
00115           case PSN_RESET:
00116                 if (_alignment_tmp != _alignment_cur)
00117                         SendMessage(g_Globals._hwndShellView, PM_SET_ICON_ALGORITHM, _alignment_cur, 0);
00118                 SendMessage(g_Globals._hwndShellView, PM_DISPLAY_VERSION, _display_version_org, MAKELONG(1,0));
00119                 break;
00120
00121           default:
00122                 return super::Notify(id, pnmh);
00123         }
00124
00125         return 0;
00126 }
00127
00128 int     DesktopSettingsDlg::Command(int id, int code)
00129 {
00130         if (id>=IDC_ICON_ALIGN_0 && id<=IDC_ICON_ALIGN_10) {
00131                 int alignment = id - IDC_ICON_ALIGN_0;
00132
00133                 if (alignment != _alignment_tmp) {
00134                         _alignment_tmp = alignment;
00135
00136                         PropSheet_Changed(GetParent(_hwnd), _hwnd);
00137
00138                         SendMessage(g_Globals._hwndShellView, PM_SET_ICON_ALGORITHM, alignment, 0);
00139                 }
00140
00141                 return 0;
00142         }
00143
00144         switch(id) {
00145           case ID_DESKTOP_VERSION:
00146                 SendMessage(g_Globals._hwndShellView, PM_DISPLAY_VERSION, 0, MAKELONG(0,1));    // toggle version display flag
00147                 PropSheet_Changed(GetParent(_hwnd), _hwnd);
00148                 break;
00149
00150           default:
00151                 return 1;
00152         }
00153
00154         return 0;
00155 }
00156
00157
00158 TaskbarSettingsDlg::TaskbarSettingsDlg(HWND hwnd)
00159  :      super(hwnd),
00160         _cfg_org(g_Globals._cfg)
00161 {
00162         XMLPos options = g_Globals.get_cfg("desktopbar/options");
00163
00164         CheckDlgButton(hwnd, ID_SHOW_CLOCK, XMLBool(options, "show-clock", true)? BST_CHECKED: BST_UNCHECKED);
00165         CheckDlgButton(hwnd, ID_HIDE_INACTIVE_ICONS, XMLBool(options, "hide-inactive", true)? BST_CHECKED: BST_UNCHECKED);
00166 }
00167
00168 int TaskbarSettingsDlg::Notify(int id, NMHDR* pnmh)
00169 {
00170         switch(pnmh->code) {
00171           case PSN_APPLY:
00172                 _cfg_org = g_Globals._cfg;
00173                 break;
00174
00175           case PSN_RESET:
00176                 g_Globals._cfg = _cfg_org;
00177                 SendMessage(g_Globals._hwndDesktopBar, PM_REFRESH_CONFIG, 0, 0);
00178                 break;
00179
00180           default:
00181                 return super::Notify(id, pnmh);
00182         }
00183
00184         return 0;
00185 }
00186
00187 int     TaskbarSettingsDlg::Command(int id, int code)
00188 {
00189         switch(id) {
00190           case ID_CONFIG_NOTIFYAREA:
00191                 Dialog::DoModal(IDD_NOTIFYAREA, WINDOW_CREATOR(TrayNotifyDlg), _hwnd);
00192                 break;
00193
00194           case ID_SHOW_CLOCK: {
00195                 XMLBoolRef boolRef1(XMLPos(g_Globals.get_cfg("desktopbar/options")), "show-clock", true);
00196                 boolRef1.toggle();
00197                 SendMessage(g_Globals._hwndDesktopBar, PM_REFRESH_CONFIG, 0, 0);
00198                 PropSheet_Changed(GetParent(_hwnd), _hwnd);
00199                 break;}
00200
00201           case ID_HIDE_INACTIVE_ICONS: {
00202                 XMLBoolRef boolRef2(XMLPos(g_Globals.get_cfg("notify-icons/options")), "hide-inactive", true);
00203         boolRef2.toggle();
00204                 SendMessage(g_Globals._hwndDesktopBar, PM_REFRESH_CONFIG, 0, 0);
00205                 PropSheet_Changed(GetParent(_hwnd), _hwnd);
00206                 break;}
00207
00208           default:
00209                 return 1;
00210         }
00211
00212         return 0;
00213 }
00214
00215
00216 StartmenuSettingsDlg::StartmenuSettingsDlg(HWND hwnd)
00217  :      super(hwnd)
00218 {
00219 }
00220
00221 int     StartmenuSettingsDlg::Command(int id, int code)
00222 {
00223 /*
00224         switch(id) {
00225           case ID_CONFIG_NOTIFYAREA:
00226                 Dialog::DoModal(IDD_NOTIFYAREA, WINDOW_CREATOR(TrayNotifyDlg), _hwnd);
00227                 return 0;
00228         }
00229 */
00230         return 1;
00231 }
00232
00233
00234 MdiSdiDlg::MdiSdiDlg(HWND hwnd)
00235  :      super(hwnd)
00236 {
00237         CenterWindow(hwnd);
00238
00239         XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
00240         bool mdi = XMLBool(explorer_options, "mdi", true);
00241         bool separateFolders = XMLBool(explorer_options, "separate-folders", true);
00242
00243         int id = mdi? IDC_MDI: IDC_SDI;
00244         CheckDlgButton(hwnd, id, BST_CHECKED);
00245         SetFocus(GetDlgItem(hwnd, id));
00246
00247         CheckDlgButton(hwnd, IDC_SEPARATE_SUBFOLDERS, separateFolders?BST_CHECKED:BST_UNCHECKED);
00248 }
00249
00250 int     MdiSdiDlg::Command(int id, int code)
00251 {
00252         if (code == BN_CLICKED) {
00253                 switch(id) {
00254                   case IDOK: {
00255                         bool mdi = IsDlgButtonChecked(_hwnd, IDC_MDI)==BST_CHECKED;
00256                         bool separateFolders = IsDlgButtonChecked(_hwnd, IDC_SEPARATE_SUBFOLDERS)==BST_CHECKED;
00257
00258                         XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
00259
00260                         XMLBoolRef(explorer_options, "mdi") = mdi;
00261                         XMLBoolRef(explorer_options, "separate-folders") = separateFolders;
00262                   } // fall through
00263
00264                   case IDCANCEL:
00265                         EndDialog(_hwnd, id);
00266                         break;
00267                 }
00268
00269                 return 0;
00270         }
00271
00272         return 1;
00273 }


ROS Explorer: settings.h File Reference

  • File List
  • File Members
dialogs

settings.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | DesktopSettingsDlg
"Desktopbar Settings" Property Sheet Dialog More...
struct | TaskbarSettingsDlg
"Taskbar Settings" Property Sheet Dialog More...
struct | StartmenuSettingsDlg
"Startmenu Settings" Property Sheet Dialog More...
struct | MdiSdiDlg
configuration dialog to choose between MDI and SDI mode More...

Functions

void | ExplorerPropertySheet (HWND hparent)

Function Documentation

void ExplorerPropertySheet ( HWND hparent )

Definition at line 39 of file settings.cpp.

References PropertySheetDialog::add(), PropertySheetDialog::DoModal(), IDD_DESKBAR_DESKTOP, IDD_DESKBAR_STARTMENU, IDD_DESKBAR_TASKBAR, IDI_REACTOS, IDS_DESKTOP, IDS_STARTMENU, IDS_TASKBAR, and WINDOW_CREATOR.

Referenced by DesktopBar::Command(), and StartMenuHandler::Command().

00040 {
00041         PropertySheetDialog ps(hparent);
00042
00043         ps.dwFlags |= PSH_USEICONID | PSH_PROPTITLE;
00044         ps.pszIcon = MAKEINTRESOURCE(IDI_REACTOS);
00045         ps.pszCaption = TEXT("Explorer");
00046
00047         PropSheetPage psp1(IDD_DESKBAR_DESKTOP, WINDOW_CREATOR(DesktopSettingsDlg));
00048         psp1.dwFlags |= PSP_USETITLE;
00049         psp1.pszTitle = MAKEINTRESOURCE(IDS_DESKTOP);
00050         ps.add(psp1);
00051
00052         PropSheetPage psp2(IDD_DESKBAR_TASKBAR, WINDOW_CREATOR(TaskbarSettingsDlg));
00053         psp2.dwFlags |= PSP_USETITLE;
00054         psp2.pszTitle = MAKEINTRESOURCE(IDS_TASKBAR);
00055         ps.add(psp2);
00056
00057         PropSheetPage psp3(IDD_DESKBAR_STARTMENU, WINDOW_CREATOR(StartmenuSettingsDlg));
00058         psp3.dwFlags |= PSP_USETITLE;
00059         psp3.pszTitle = MAKEINTRESOURCE(IDS_STARTMENU);
00060         ps.add(psp3);
00061
00062         ps.DoModal();
00063 }

Here is the call graph for this function:


ROS Explorer: settings.h Source File

  • File List
  • File Members
dialogs

settings.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // dialogs/settings.h
00024  //
00025  // Explorer dialogs
00026  //
00027  // Martin Fuchs, 18.01.2004
00028  //
00029
00030
00031 void ExplorerPropertySheet(HWND hparent);
00032
00033
00035 struct DesktopSettingsDlg : public OwnerDrawParent<PropSheetPageDlg>
00036 {
00037         typedef OwnerDrawParent<PropSheetPageDlg> super;
00038
00039         DesktopSettingsDlg(HWND hwnd);
00040
00041 protected:
00042         ResBitmap       _bmp0;
00043         ResBitmap       _bmp1;
00044         ResBitmap       _bmp2;
00045         ResBitmap       _bmp3;
00046         ResBitmap       _bmp4;
00047         ResBitmap       _bmp5;
00048         ResBitmap       _bmp6;
00049         ResBitmap       _bmp7;
00050         ResBitmap       _bmp8;
00051         ResBitmap       _bmp9;
00052         ResBitmap       _bmp10;
00053
00054         int     _alignment_cur;
00055         int     _alignment_tmp;
00056
00057         int     _display_version_org;
00058
00059         virtual int Command(int id, int code);
00060         virtual int Notify(int id, NMHDR* pnmh);
00061 };
00062
00063
00065 struct TaskbarSettingsDlg : public PropSheetPageDlg
00066 {
00067         typedef PropSheetPageDlg super;
00068
00069         TaskbarSettingsDlg(HWND hwnd);
00070
00071         virtual int     Command(int id, int code);
00072         virtual int Notify(int id, NMHDR* pnmh);
00073
00074 protected:
00075         XMLDoc  _cfg_org;
00076 };
00077
00078
00080 struct StartmenuSettingsDlg : public PropSheetPageDlg
00081 {
00082         typedef PropSheetPageDlg super;
00083
00084         StartmenuSettingsDlg(HWND hwnd);
00085
00086         virtual int     Command(int id, int code);
00087 };
00088
00089
00091 struct MdiSdiDlg : public ResizeController<Dialog>
00092 {
00093         typedef ResizeController<Dialog> super;
00094
00095         MdiSdiDlg(HWND hwnd);
00096
00097 protected:
00098         virtual int     Command(int id, int code);
00099 };


ROS Explorer: shellbrowser.cpp File Reference

  • File List
  • File Members
shell

shellbrowser.cpp File Reference

#include <precomp.h>
#include "../resource.h"

Include dependency graph for shellbrowser.cpp:

Go to the source code of this file.


ROS Explorer: shellbrowser.cpp Source File

  • File List
  • File Members
shell

shellbrowser.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // shellbrowser.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "../resource.h"
00032
00033
00034  // work around GCC's wide string constant bug
00035 #ifdef __GNUC__
00036 const LPCTSTR C_DRIVE = C_DRIVE_STR;
00037 #endif
00038
00039
00040 ShellBrowser::ShellBrowser(HWND hwnd, HWND left_hwnd, WindowHandle& right_hwnd, ShellPathInfo& create_info,
00041                                                         BrowserCallback* cb, CtxMenuInterfaces& cm_ifs)
00042 #ifndef __MINGW32__     // IShellFolderViewCB missing in MinGW (as of 25.09.2005)
00043  :      super(IID_IShellFolderViewCB),
00044 #else
00045  :
00046 #endif
00047         _hwnd(hwnd),
00048         _left_hwnd(left_hwnd),
00049         _right_hwnd(right_hwnd),
00050         _create_info(create_info),
00051         _callback(cb),
00052         _cm_ifs(cm_ifs)
00053 {
00054         _pShellView = NULL;
00055         _pDropTarget = NULL;
00056         _last_sel = 0;
00057
00058         _cur_dir = NULL;
00059
00060         _himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0);
00061         ImageList_SetBkColor(_himl, GetSysColor(COLOR_WINDOW));
00062 }
00063
00064 ShellBrowser::~ShellBrowser()
00065 {
00066         (void)TreeView_SetImageList(_left_hwnd, _himl_old, TVSIL_NORMAL);
00067         ImageList_Destroy(_himl);
00068
00069         if (_pShellView)
00070                 _pShellView->Release();
00071
00072         if (_pDropTarget) {
00073                 _pDropTarget->Release();
00074                 _pDropTarget = NULL;
00075         }
00076
00077         if (_right_hwnd) {
00078                 DestroyWindow(_right_hwnd);
00079                 _right_hwnd = 0;
00080         }
00081 }
00082
00083
00084 LRESULT ShellBrowser::Init(HWND hWndFrame)
00085 {
00086         CONTEXT("ShellBrowser::Init()");
00087
00088         _hWndFrame = hWndFrame;
00089
00090         const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORADDRESSBAR);
00091
00092         _root._drive_type = DRIVE_UNKNOWN;
00093         lstrcpy(_root._volname, root_name);
00094         _root._fs_flags = 0;
00095         lstrcpy(_root._fs, TEXT("Desktop"));
00096
00097         _root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd);
00098
00099         jump_to(_create_info._shell_path);
00100
00101          // -> set_curdir()
00102         _root._entry->read_directory();
00103
00104         /* already filled by ShellDirectory constructor
00105         lstrcpy(_root._entry->_data.cFileName, TEXT("Desktop")); */
00106
00107         return 0;
00108 }
00109
00110 void ShellBrowser::jump_to(LPCITEMIDLIST pidl)
00111 {
00112         Entry* entry = NULL;
00113
00114          //@@
00115         if (!_cur_dir)
00116                 _cur_dir = static_cast<ShellDirectory*>(_root._entry);
00117
00118         //LOG(FmtString(TEXT("ShellBrowser::jump_to(): pidl=%s"), (LPCTSTR)FileSysShellPath(pidl)));
00119
00120         if (_cur_dir) {
00121                 static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILFindChild(TEXT("SHELL32"), 24);
00122
00123 /*@todo
00124         we should call read_tree() here to iterate through the hierarchy and open all folders from _create_info._root_shell_path (_cur_dir) to _create_info._shell_path (pidl)
00125         _root._entry->read_tree(_create_info._root_shell_path.get_folder(), info._shell_path, SORT_NAME);
00126         -> see FileChildWindow::FileChildWindow()_create_info._shell_path
00127 */
00128
00129                 LPCITEMIDLIST child_pidl;
00130
00131                 if (ILFindChild)
00132                         child_pidl = (*ILFindChild)(_cur_dir->create_absolute_pidl(), pidl);
00133                 else
00134                         child_pidl = pidl;      // This is not correct in the common case, but works on the desktop level.
00135
00136                 if (child_pidl) {
00137                         _cur_dir->smart_scan();
00138
00139                         entry = _cur_dir->find_entry(child_pidl);
00140
00141                         if (entry) {
00142                                 _cur_dir = static_cast<ShellDirectory*>(entry);
00143                                 _callback->entry_selected(entry);
00144                         }
00145                 }
00146         }
00147
00148                 //@@ work around as long as we don't iterate correctly through the ShellEntry tree
00149         if (!entry)
00150                 UpdateFolderView(ShellFolder(pidl));
00151 }
00152
00153
00154 void ShellBrowser::InitializeTree()
00155 {
00156         CONTEXT("ShellBrowserChild::InitializeTree()");
00157
00158         _himl_old = TreeView_SetImageList(_left_hwnd, _himl, TVSIL_NORMAL);
00159         TreeView_SetScrollTime(_left_hwnd, 100);
00160
00161         TV_INSERTSTRUCT tvInsert;
00162         TV_ITEM& tvItem = tvInsert.item;
00163
00164         tvInsert.hParent = 0;
00165         tvInsert.hInsertAfter = TVI_LAST;
00166
00167         tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;
00168         tvItem.lParam = (LPARAM)_root._entry;
00169         tvItem.pszText = _root._volname; //LPSTR_TEXTCALLBACK;
00170         tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;
00171         tvItem.cChildren = 1;
00172
00173         HTREEITEM hItem = TreeView_InsertItem(_left_hwnd, &tvInsert);
00174         TreeView_SelectItem(_left_hwnd, hItem);
00175         TreeView_Expand(_left_hwnd, hItem, TVE_EXPAND);
00176 }
00177
00178 bool ShellBrowser::InitDragDrop()
00179 {
00180         CONTEXT("ShellBrowser::InitDragDrop()");
00181
00182         _pDropTarget = new TreeDropTarget(_left_hwnd);
00183
00184         if (!_pDropTarget)
00185                 return false;
00186
00187         _pDropTarget->AddRef();
00188
00189         if (FAILED(RegisterDragDrop(_left_hwnd, _pDropTarget))) {//calls addref
00190                 _pDropTarget->Release(); // free TreeDropTarget
00191                 _pDropTarget = NULL;
00192                 return false;
00193         } else
00194                 _pDropTarget->Release();
00195
00196         FORMATETC ftetc;
00197
00198         ftetc.dwAspect = DVASPECT_CONTENT;
00199         ftetc.lindex = -1;
00200         ftetc.tymed = TYMED_HGLOBAL;
00201         ftetc.cfFormat = CF_HDROP;
00202
00203         _pDropTarget->AddSuportedFormat(ftetc);
00204
00205         return true;
00206 }
00207
00208
00209 void ShellBrowser::OnTreeItemRClick(int idCtrl, LPNMHDR pnmh)
00210 {
00211         CONTEXT("ShellBrowser::OnTreeItemRClick()");
00212
00213         TVHITTESTINFO tvhti;
00214
00215         GetCursorPos(&tvhti.pt);
00216         ScreenToClient(_left_hwnd, &tvhti.pt);
00217
00218         tvhti.flags = LVHT_NOWHERE;
00219         (void)TreeView_HitTest(_left_hwnd, &tvhti);
00220
00221         if (TVHT_ONITEM & tvhti.flags) {
00222                 LPARAM itemData = TreeView_GetItemData(_left_hwnd, tvhti.hItem);
00223
00224                 if (itemData) {
00225                         Entry* entry = (Entry*)itemData;
00226                         ClientToScreen(_left_hwnd, &tvhti.pt);
00227
00228                         CHECKERROR(entry->do_context_menu(_hwnd, tvhti.pt, _cm_ifs));
00229                 }
00230         }
00231 }
00232
00233 void ShellBrowser::OnTreeGetDispInfo(int idCtrl, LPNMHDR pnmh)
00234 {
00235         CONTEXT("ShellBrowser::OnTreeGetDispInfo()");
00236
00237         LPNMTVDISPINFO lpdi = (LPNMTVDISPINFO)pnmh;
00238         ShellEntry* entry = (ShellEntry*)lpdi->item.lParam;
00239
00240         if (entry) {
00241                 if (lpdi->item.mask & TVIF_TEXT)
00242                         lpdi->item.pszText = entry->_display_name;
00243
00244                 if (lpdi->item.mask & (TVIF_IMAGE|TVIF_SELECTEDIMAGE)) {
00245                         if (lpdi->item.mask & TVIF_IMAGE)
00246                                 lpdi->item.iImage = get_image_idx(
00247                                                 entry->safe_extract_icon((ICONCACHE_FLAGS)(ICF_HICON|ICF_OVERLAYS)));
00248
00249                         if (lpdi->item.mask & TVIF_SELECTEDIMAGE)
00250                                 lpdi->item.iSelectedImage = get_image_idx(
00251                                                 entry->safe_extract_icon((ICONCACHE_FLAGS)(ICF_HICON|ICF_OVERLAYS|ICF_OPEN)));
00252                 }
00253         }
00254 }
00255
00256 int ShellBrowser::get_image_idx(int icon_id)
00257 {
00258         if (icon_id != ICID_NONE) {
00259                 map<int,int>::const_iterator found = _image_map.find(icon_id);
00260
00261                 if (found != _image_map.end())
00262                         return found->second;
00263
00264                 int idx = ImageList_AddIcon(_himl, g_Globals._icon_cache.get_icon(icon_id).get_hicon());
00265
00266                 _image_map[icon_id] = idx;
00267
00268                 return idx;
00269         } else
00270                 return -1;
00271 }
00272
00273 void ShellBrowser::invalidate_cache()
00274 {
00275         (void)TreeView_SetImageList(_left_hwnd, _himl_old, TVSIL_NORMAL);
00276         ImageList_Destroy(_himl);
00277
00278         _himl_old = TreeView_SetImageList(_left_hwnd, _himl, TVSIL_NORMAL);
00279         _himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0);
00280
00281         for(map<int,int>::const_iterator it=_image_map.begin(); it!=_image_map.end(); ++it)
00282                 g_Globals._icon_cache.free_icon(it->first);
00283
00284         _image_map.clear();
00285 }
00286
00287 void ShellBrowser::OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv)
00288 {
00289         CONTEXT("ShellBrowser::OnTreeItemExpanding()");
00290
00291         if (pnmtv->action == TVE_COLLAPSE)
00292         TreeView_Expand(_left_hwnd, pnmtv->itemNew.hItem, TVE_COLLAPSE|TVE_COLLAPSERESET);
00293     else if (pnmtv->action == TVE_EXPAND) {
00294                 ShellDirectory* entry = (ShellDirectory*)TreeView_GetItemData(_left_hwnd, pnmtv->itemNew.hItem);
00295
00296                 if (entry)
00297                         if (!InsertSubitems(pnmtv->itemNew.hItem, entry, entry->_folder)) {
00298                                 entry->_shell_attribs &= ~SFGAO_HASSUBFOLDER;
00299
00300                                  // remove subitem "+"
00301                                 TV_ITEM tvItem;
00302
00303                                 tvItem.mask = TVIF_CHILDREN;
00304                                 tvItem.hItem = pnmtv->itemNew.hItem;
00305                                 tvItem.cChildren = 0;
00306
00307                                 TreeView_SetItem(_left_hwnd, &tvItem);
00308                         }
00309         }
00310 }
00311
00312 int ShellBrowser::InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFolder* pParentFolder)
00313 {
00314         CONTEXT("ShellBrowser::InsertSubitems()");
00315
00316         WaitCursor wait;
00317
00318         int cnt = 0;
00319
00320         SendMessage(_left_hwnd, WM_SETREDRAW, FALSE, 0);
00321
00322         try {
00323                 entry->smart_scan();
00324         } catch(COMException& e) {
00325                 HandleException(e, g_Globals._hMainWnd);
00326         }
00327
00328         TV_ITEM tvItem;
00329         TV_INSERTSTRUCT tvInsert;
00330
00331         for(entry=entry->_down; entry; entry=entry->_next) {
00332 #ifndef _LEFT_FILES
00333                 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00334 #endif
00335                 {
00336                         ZeroMemory(&tvItem, sizeof(tvItem));
00337
00338                         tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;
00339                         tvItem.pszText = LPSTR_TEXTCALLBACK;
00340                         tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;
00341                         tvItem.lParam = (LPARAM)entry;
00342                         tvItem.cChildren = entry->_shell_attribs & SFGAO_HASSUBFOLDER? 1: 0;
00343
00344                         if (entry->_shell_attribs & SFGAO_SHARE) {
00345                                 tvItem.mask |= TVIF_STATE;
00346                                 tvItem.stateMask |= TVIS_OVERLAYMASK;
00347                                 tvItem.state |= INDEXTOOVERLAYMASK(1);
00348                         }
00349
00350                         tvInsert.item = tvItem;
00351                         tvInsert.hInsertAfter = TVI_LAST;
00352                         tvInsert.hParent = hParentItem;
00353
00354                         (void)TreeView_InsertItem(_left_hwnd, &tvInsert);
00355                 }
00356
00357                 ++cnt;
00358         }
00359
00360         SendMessage(_left_hwnd, WM_SETREDRAW, TRUE, 0);
00361
00362         return cnt;
00363 }
00364
00365 void ShellBrowser::OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv)
00366 {
00367         CONTEXT("ShellBrowser::OnTreeItemSelected()");
00368
00369         ShellEntry* entry = (ShellEntry*)pnmtv->itemNew.lParam;
00370
00371         _last_sel = pnmtv->itemNew.hItem;
00372
00373         if (entry)
00374                 _callback->entry_selected(entry);
00375 }
00376
00377 void ShellBrowser::UpdateFolderView(IShellFolder* folder)
00378 {
00379         CONTEXT("ShellBrowser::UpdateFolderView()");
00380
00381         FOLDERSETTINGS fs;
00382         IShellView* pLastShellView = _pShellView;
00383
00384         _folder = folder;
00385
00386         if (pLastShellView)
00387                 pLastShellView->GetCurrentInfo(&fs);
00388         else {
00389                 fs.ViewMode = _create_info._open_mode&OWM_DETAILS? FVM_DETAILS: FVM_ICON;
00390                 fs.fFlags = FWF_NOCLIENTEDGE|FWF_BESTFITWINDOW;
00391         }
00392
00393 #ifndef __MINGW32__     // IShellFolderViewCB missing in MinGW (as of 25.09.2005)
00394         SFV_CREATE sfv_create;
00395
00396         sfv_create.cbSize = sizeof(SFV_CREATE);
00397         sfv_create.pshf = folder;
00398         sfv_create.psvOuter = NULL;
00399         sfv_create.psfvcb = this;
00400
00401         HRESULT hr = SHCreateShellFolderView(&sfv_create, &_pShellView);
00402 #else
00403         HRESULT hr = folder->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView);
00404 #endif
00405
00406         if (FAILED(hr)) {
00407                 _pShellView = NULL;
00408                 return;
00409         }
00410
00411         RECT rect = {CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT};
00412         hr = _pShellView->CreateViewWindow(pLastShellView, &fs, static_cast<IShellBrowser*>(this), &rect, &_right_hwnd/*&m_hWndListView*/);
00413
00414         if (pLastShellView) {
00415                 pLastShellView->GetCurrentInfo(&fs);
00416                 pLastShellView->UIActivate(SVUIA_DEACTIVATE);
00417                 pLastShellView->DestroyViewWindow();
00418                 pLastShellView->Release();
00419         }
00420
00421         _pShellView->UIActivate(SVUIA_ACTIVATE_NOFOCUS);
00422 }
00423
00424
00425 #ifndef __MINGW32__     // IShellFolderViewCB missing in MinGW (as of 25.09.2005)
00426
00428 HRESULT STDMETHODCALLTYPE ShellBrowser::MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
00429 {
00430         if (uMsg == SFVM_INITMENUPOPUP) {
00431                 //@todo never reached
00432                 InsertMenu((HMENU)lParam, 0, MF_BYPOSITION, 12345, TEXT("TEST ENTRY"));
00433                 return S_OK;
00434         }
00435
00436         return E_NOTIMPL;
00437 }
00438
00439 #endif
00440
00441
00442 HRESULT ShellBrowser::OnDefaultCommand(LPIDA pida)
00443 {
00444         CONTEXT("ShellBrowser::OnDefaultCommand()");
00445
00446         if (pida->cidl >= 1) {
00447                 if (_left_hwnd) {       // explorer mode
00448                         if (_last_sel) {
00449                                 ShellDirectory* parent = (ShellDirectory*)TreeView_GetItemData(_left_hwnd, _last_sel);
00450
00451                                 if (parent) {
00452                                         try {
00453                                                 parent->smart_scan();
00454                                         } catch(COMException& e) {
00455                                                 return e.Error();
00456                                         }
00457
00458                                         UINT firstOffset = pida->aoffset[1];
00459                                         LPITEMIDLIST pidl = (LPITEMIDLIST)((LPBYTE)pida+firstOffset);
00460
00461                                         Entry* entry = parent->find_entry(pidl);
00462
00463                                         if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
00464                                                 if (entry->_etype == ET_SHELL)
00465                                                         if (_last_sel && select_entry(_last_sel, entry))
00466                                                                 return S_OK;
00467                                 }
00468                         }
00469                 } else { // no tree control
00470                         if (MainFrameBase::OpenShellFolders(pida, _hWndFrame))
00471                                 return S_OK;
00472
00473 /* create new Frame Window
00474                         if (MainFrame::OpenShellFolders(pida, 0))
00475                                 return S_OK;
00476 */
00477                 }
00478         }
00479
00480         return E_NOTIMPL;
00481 }
00482
00483
00484 HTREEITEM ShellBrowser::select_entry(HTREEITEM hitem, Entry* entry, bool expand)
00485 {
00486         CONTEXT("ShellBrowser::select_entry()");
00487
00488         if (expand && !TreeView_Expand(_left_hwnd, hitem, TVE_EXPAND))
00489                 return 0;
00490
00491         for(hitem=TreeView_GetChild(_left_hwnd,hitem); hitem; hitem=TreeView_GetNextSibling(_left_hwnd,hitem)) {
00492                 if ((Entry*)TreeView_GetItemData(_left_hwnd,hitem) == entry) {
00493                         if (TreeView_SelectItem(_left_hwnd, hitem)) {
00494                                 if (expand)
00495                                         TreeView_Expand(_left_hwnd, hitem, TVE_EXPAND);
00496
00497                                 return hitem;
00498                         }
00499
00500                         break;
00501                 }
00502         }
00503
00504         return 0;
00505 }
00506
00507
00508 bool ShellBrowser::jump_to_pidl(LPCITEMIDLIST pidl)
00509 {
00510         if (!_root._entry)
00511                 return false;
00512
00513          // iterate through the hierarchy and open all folders to reach pidl
00514         WaitCursor wait;
00515
00516         HTREEITEM hitem = TreeView_GetRoot(_left_hwnd);
00517         Entry* entry = _root._entry;
00518
00519         for(const void*p=pidl;;) {
00520                 if (!p)
00521                         return true;
00522
00523                 if (!entry || !hitem)
00524                         break;
00525
00526                 entry->smart_scan(SORT_NAME);
00527
00528                 Entry* found = entry->find_entry(p);
00529                 p = entry->get_next_path_component(p);
00530
00531                 if (found)
00532                         hitem = select_entry(hitem, found);
00533
00534                 entry = found;
00535         }
00536
00537         return false;
00538 }
00539
00540
00541 #ifndef _NO_MDI
00542
00543 MDIShellBrowserChild::MDIShellBrowserChild(HWND hwnd, const ShellChildWndInfo& info)
00544  :      super(hwnd, info),
00545         _create_info(info),
00546         _shellpath_info(info)   //@@ copies info -> no referenz to _create_info !
00547 {
00556 }
00557
00558
00559 MDIShellBrowserChild* MDIShellBrowserChild::create(const ShellChildWndInfo& info)
00560 {
00561         ChildWindow* child = ChildWindow::create(info, info._pos.rcNormalPosition,
00562                 WINDOW_CREATOR_INFO(MDIShellBrowserChild,ShellChildWndInfo), CLASSNAME_CHILDWND, NULL, info._pos.showCmd==SW_SHOWMAXIMIZED? WS_MAXIMIZE: 0);
00563
00564         return static_cast<MDIShellBrowserChild*>(child);
00565 }
00566
00567
00568 LRESULT MDIShellBrowserChild::Init(LPCREATESTRUCT pcs)
00569 {
00570         CONTEXT("MDIShellBrowserChild::Init()");
00571
00572         if (super::Init(pcs))
00573                 return 1;
00574
00575         update_shell_browser();
00576
00577         if (_shellBrowser.get())
00578                 if (_left_hwnd)
00579                         _shellBrowser->Init();
00580                 else
00581                         _shellBrowser->UpdateFolderView(_create_info._shell_path.get_folder());
00582
00583         return 0;
00584 }
00585
00586
00587 LRESULT MDIShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00588 {
00589         switch(nmsg) {
00590           case PM_DISPATCH_COMMAND: {
00591                 switch(LOWORD(wparam)) {
00592                   case ID_WINDOW_NEW: {CONTEXT("MDIShellBrowserChild PM_DISPATCH_COMMAND ID_WINDOW_NEW");
00593                         MDIShellBrowserChild::create(_create_info);
00594                         break;}
00595
00596                   case ID_REFRESH:
00597                         //@todo refresh shell child
00598                         _shellBrowser->invalidate_cache();
00599                         break;
00600
00601                   case ID_VIEW_SDI:
00602                         MainFrameBase::Create(ExplorerCmd(_url, false));
00603                         break;
00604
00605                   default:
00606                         return super::WndProc(nmsg, wparam, lparam);
00607                 }
00608                 return TRUE;}
00609
00610           default:
00611                 return super::WndProc(nmsg, wparam, lparam);
00612         }
00613
00614         return 0;
00615 }
00616
00617 void MDIShellBrowserChild::update_shell_browser()
00618 {
00619         int split_pos = DEFAULT_SPLIT_POS;
00620
00621         if (_shellBrowser.get()) {
00622                 split_pos = _split_pos;
00623                 delete _shellBrowser.release();
00624         }
00625
00627
00628          // create explorer treeview
00629         if (_create_info._open_mode & OWM_EXPLORE) {
00630                 if (!_left_hwnd) {
00631                         ClientRect rect(_hwnd);
00632
00633                         _left_hwnd = CreateWindowEx(0, WC_TREEVIEW, NULL,
00634                                                         WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS,//|TVS_NOTOOLTIPS
00635                                                         0, rect.top, split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top,
00636                                                         _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0);
00637                 }
00638         } else {
00639                 if (_left_hwnd) {
00640                         DestroyWindow(_left_hwnd);
00641                         _left_hwnd = 0;
00642                 }
00643         }
00644
00645         _shellBrowser = auto_ptr<ShellBrowser>(new ShellBrowser(_hwnd, _left_hwnd, _right_hwnd,
00646                                                                                                 _shellpath_info, this, _cm_ifs));
00647
00648         _shellBrowser->Init(_hwndFrame);
00649 }
00650
00651
00652 String MDIShellBrowserChild::jump_to_int(LPCTSTR url)
00653 {
00654         String dir, fname;
00655
00656         if (!_tcsnicmp(url, TEXT("shell://"), 8)) {
00657                 if (_shellBrowser->jump_to_pidl(ShellPath(url+8)))
00658                         return url;
00659         }
00660
00661         if (SplitFileSysURL(url, dir, fname)) {
00662
00664
00665                 if (_shellBrowser->jump_to_pidl(ShellPath(dir)))
00666                         return FmtString(TEXT("file://%s"), (LPCTSTR)dir);
00667         }
00668
00669         return String();
00670 }
00671
00672
00673 void MDIShellBrowserChild::entry_selected(Entry* entry)
00674 {
00675         if (entry->_etype == ET_SHELL) {
00676                 ShellEntry* shell_entry = static_cast<ShellEntry*>(entry);
00677                 IShellFolder* folder;
00678
00679                 if (shell_entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00680                         folder = static_cast<ShellDirectory*>(shell_entry)->_folder;
00681                 else
00682                         folder = shell_entry->get_parent_folder();
00683
00684                 if (!folder) {
00685                         assert(folder);
00686                         return;
00687                 }
00688
00689                 TCHAR path[MAX_PATH];
00690
00691                 if (shell_entry->get_path(path, COUNTOF(path))) {
00692                         String url;
00693
00694                         if (path[0] == ':')
00695                                 url.printf(TEXT("shell://%s"), path);
00696                         else
00697                                 url.printf(TEXT("file://%s"), path);
00698
00699                         set_url(url);
00700                 }
00701
00702                 _shellBrowser->UpdateFolderView(folder);
00703
00704                  // set size of new created shell view windows
00705                 ClientRect rt(_hwnd);
00706                 resize_children(rt.right, rt.bottom);
00707         }
00708 }
00709
00710 #endif


ROS Explorer: shellbrowser.h File Reference

  • File List
  • File Members
shell

shellbrowser.h File Reference

#include "../utility/treedroptarget.h"
#include "../utility/shellbrowserimpl.h"

Include dependency graph for shellbrowser.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | ShellPathInfo
information structure to hold current shell folder information More...
struct | BrowserCallback
struct | ShellBrowser
Implementation of IShellBrowserImpl interface in explorer child windows. More...
struct | ShellBrowserChildT< BASE >
struct | MDIShellBrowserChild

Defines

#define | C_DRIVE_STR TEXT("C:\\")
#define | C_DRIVE C_DRIVE_STR

Define Documentation

#define C_DRIVE C_DRIVE_STR

Definition at line 191 of file shellbrowser.h.

#define C_DRIVE_STR TEXT("C:\\")

Definition at line 185 of file shellbrowser.h.


ROS Explorer: shellbrowser.h Source File

  • File List
  • File Members
shell

shellbrowser.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // shellbrowser.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028 #include "../utility/treedroptarget.h"
00029 #include "../utility/shellbrowserimpl.h"
00030
00031
00033 struct ShellPathInfo
00034 {
00035         ShellPathInfo(int mode=0) : _open_mode(mode) {}
00036
00037         ShellPathInfo(const ShellChildWndInfo& info)
00038          :      _shell_path(info._shell_path),
00039                 _root_shell_path(info._root_shell_path),
00040                 _open_mode(info._open_mode)
00041         {
00042         }
00043
00044         ShellPath       _shell_path;
00045         ShellPath       _root_shell_path;
00046
00047         int                     _open_mode;     //OPEN_WINDOW_MODE
00048 };
00049
00050
00051 struct BrowserCallback
00052 {
00053         virtual ~BrowserCallback() {}
00054         virtual void entry_selected(Entry* entry) = 0;
00055 };
00056
00057
00059 struct ShellBrowser : public IShellBrowserImpl
00060 #ifndef __MINGW32__     // IShellFolderViewCB missing in MinGW (as of 25.09.2005)
00061         ,       public IComSrvBase<IShellFolderViewCB, ShellBrowser>, public SimpleComObject
00062 #endif
00063 {
00064         ShellBrowser(HWND hwnd, HWND left_hwnd, WindowHandle& right_hwnd, ShellPathInfo& create_info,
00065                                         BrowserCallback* cb, CtxMenuInterfaces& cm_ifs);
00066         virtual ~ShellBrowser();
00067
00068         //IOleWindow
00069         virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND* lphwnd)
00070         {
00071                 *lphwnd = _hwnd;
00072                 return S_OK;
00073         }
00074
00075         //IShellBrowser
00076         virtual HRESULT STDMETHODCALLTYPE QueryActiveShellView(IShellView** ppshv)
00077         {
00078                 _pShellView->AddRef();
00079                 *ppshv = _pShellView;
00080                 return S_OK;
00081         }
00082
00083         virtual HRESULT STDMETHODCALLTYPE GetControlWindow(UINT id, HWND* lphwnd)
00084         {
00085                 if (!lphwnd)
00086                         return E_POINTER;
00087
00088                 if (id == FCW_TREE) {
00089                         *lphwnd = _left_hwnd;
00090                         return S_OK;
00091                 }
00092
00093                 HWND hwnd = (HWND)SendMessage(_hWndFrame, PM_GET_CONTROLWINDOW, id, 0);
00094
00095                 if (hwnd) {
00096                         *lphwnd = hwnd;
00097                         return S_OK;
00098                 }
00099
00100                 return E_NOTIMPL;
00101         }
00102
00103         virtual HRESULT STDMETHODCALLTYPE SendControlMsg(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* pret)
00104         {
00105                 if (!pret)
00106                         return E_POINTER;
00107
00108                 HWND hstatusbar = (HWND)SendMessage(_hWndFrame, PM_GET_CONTROLWINDOW, id, 0);
00109
00110                 if (hstatusbar) {
00111                         *pret = ::SendMessage(hstatusbar, uMsg, wParam, lParam);
00112                         return S_OK;
00113                 }
00114
00115                 return E_NOTIMPL;
00116         }
00117
00118         const Root& get_root() const {return _root;}
00119
00120         void    OnTreeGetDispInfo(int idCtrl, LPNMHDR pnmh);
00121         void    OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv);
00122         void    OnTreeItemRClick(int idCtrl, LPNMHDR pnmh);
00123         void    OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv);
00124
00125         LRESULT Init(HWND hWndFrame);
00126
00127         void    Init()
00128         {
00129                 InitializeTree();
00130                 InitDragDrop();
00131         }
00132
00133         int             InsertSubitems(HTREEITEM hParentItem, Entry* entry, IShellFolder* pParentFolder);
00134
00135         bool    jump_to_pidl(LPCITEMIDLIST pidl);
00136
00137         HRESULT OnDefaultCommand(LPIDA pida);
00138
00139         void    UpdateFolderView(IShellFolder* folder);
00140         HTREEITEM select_entry(HTREEITEM hitem, Entry* entry, bool expand=true);
00141
00142          // for SDIMainFrame
00143         void    jump_to(LPCITEMIDLIST pidl);
00144
00145         void    invalidate_cache();
00146
00147 protected:
00148         HWND    _hwnd;
00149         HWND    _left_hwnd;
00150         WindowHandle& _right_hwnd;
00151         ShellPathInfo& _create_info;
00152         HIMAGELIST      _himl;
00153         HIMAGELIST      _himl_old;
00154         BrowserCallback* _callback;
00155
00156         WindowHandle _hWndFrame;
00157         ShellFolder     _folder;
00158
00159         IShellView*     _pShellView;    // current hosted shellview
00160         TreeDropTarget* _pDropTarget;
00161
00162         HTREEITEM _last_sel;
00163
00164         Root    _root;
00165         ShellDirectory* _cur_dir;
00166
00167         CtxMenuInterfaces& _cm_ifs;
00168
00169         void    InitializeTree();
00170         bool    InitDragDrop();
00171
00172 #ifndef __MINGW32__     // IShellFolderViewCB missing in MinGW (as of 25.09.2005)
00173         typedef IComSrvBase<IShellFolderViewCB, ShellBrowser> super;
00174
00175          // IShellFolderViewCB
00176         virtual HRESULT STDMETHODCALLTYPE MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam);
00177 #endif
00178
00179         map<int, int> _image_map;
00180
00181         int             get_image_idx(int icon_id);
00182 };
00183
00184
00185 #define C_DRIVE_STR TEXT("C:\\")
00186
00187  // work around GCC's wide string constant bug
00188 #ifdef __GNUC__
00189 extern const LPCTSTR C_DRIVE;
00190 #else
00191 #define C_DRIVE C_DRIVE_STR
00192 #endif
00193
00194 template<typename BASE> struct ShellBrowserChildT
00195  : public BASE, public BrowserCallback
00196 {
00197         typedef BASE super;
00198
00199          // constructor for SDIMainFrame
00200         ShellBrowserChildT(HWND hwnd)
00201          :      super(hwnd)
00202         {
00203         }
00204
00205          // constructor for MDIShellBrowserChild
00206         ShellBrowserChildT(HWND hwnd, const ShellChildWndInfo& info)
00207          :      super(hwnd, info)
00208         {
00209         }
00210
00211 protected:
00212         auto_ptr<ShellBrowser> _shellBrowser;
00213
00214         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00215         {
00216                 switch(nmsg) {
00217                   case PM_GET_SHELLBROWSER_PTR:
00218                         return (LRESULT)&*_shellBrowser;
00219
00220                   case WM_GETISHELLBROWSER:     // for Registry Explorer Plugin
00221                         return (LRESULT)static_cast<IShellBrowser*>(&*_shellBrowser);
00222
00223                   default:
00224                         return super::WndProc(nmsg, wparam, lparam);
00225                 }
00226
00227                 return 0;
00228         }
00229
00230         int Notify(int id, NMHDR* pnmh)
00231         {
00232                 if (_shellBrowser.get())
00233                         switch(pnmh->code) {
00234                           case TVN_GETDISPINFO:         _shellBrowser->OnTreeGetDispInfo(id, pnmh);                                     break;
00235                           case TVN_SELCHANGED:          _shellBrowser->OnTreeItemSelected(id, (LPNMTREEVIEW)pnmh);      break;
00236                           case TVN_ITEMEXPANDING:       _shellBrowser->OnTreeItemExpanding(id, (LPNMTREEVIEW)pnmh);     break;
00237                           case NM_RCLICK:                       _shellBrowser->OnTreeItemRClick(id, pnmh);                                      break;
00238                           default:                                      return super::Notify(id, pnmh);
00239                         }
00240                 else
00241                         return super::Notify(id, pnmh);
00242
00243                 return 0;
00244         }
00245 };
00246
00247
00248 #ifndef _NO_MDI
00249
00250 struct MDIShellBrowserChild : public ExtContextMenuHandlerT<
00251                                 ShellBrowserChildT<ChildWindow>
00252                         >
00253 {
00254         typedef ExtContextMenuHandlerT<
00255                                 ShellBrowserChildT<ChildWindow>
00256                         > super;
00257
00258         MDIShellBrowserChild(HWND hwnd, const ShellChildWndInfo& info);
00259
00260         static MDIShellBrowserChild* create(const ShellChildWndInfo& info);
00261
00262         LRESULT Init(LPCREATESTRUCT);
00263
00264         virtual String jump_to_int(LPCTSTR url);
00265
00266 protected:
00267         ShellChildWndInfo _create_info;
00268         ShellPathInfo   _shellpath_info;
00269
00270         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00271
00272         void    update_shell_browser();
00273
00274          // interface BrowserCallback
00275         virtual void    entry_selected(Entry* entry);
00276 };
00277
00278 #endif


ROS Explorer: shellbrowserimpl.cpp File Reference

  • File List
  • File Members
utility

shellbrowserimpl.cpp File Reference

#include <precomp.h>

Include dependency graph for shellbrowserimpl.cpp:

Go to the source code of this file.


ROS Explorer: shellbrowserimpl.cpp Source File

  • File List
  • File Members
utility

shellbrowserimpl.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // shellbrowserimpl.cpp
00024  //
00025  // Martin Fuchs, 28.09.2003
00026  //
00027  // Credits: Thanks to Leon Finker for his explorer cabinet window example
00028  //
00029
00030
00031 #include <precomp.h>
00032
00033
00034 HRESULT IShellBrowserImpl::QueryInterface(REFIID iid, void** ppvObject)
00035 {
00036         if (!ppvObject)
00037                 return E_POINTER;
00038
00039         if (iid == IID_IUnknown)
00040                 *ppvObject = (IUnknown*)static_cast<IShellBrowser*>(this);
00041         else if (iid == IID_IOleWindow)
00042                 *ppvObject = static_cast<IOleWindow*>(this);
00043         else if (iid == IID_IShellBrowser)
00044                 *ppvObject = static_cast<IShellBrowser*>(this);
00045         else if (iid == IID_ICommDlgBrowser)
00046                 *ppvObject = static_cast<ICommDlgBrowser*>(this);
00047         else if (iid == IID_IServiceProvider)
00048                 *ppvObject = static_cast<IServiceProvider*>(this);
00049         else {
00050                 *ppvObject = NULL;
00051                 return E_NOINTERFACE;
00052         }
00053
00054         return S_OK;
00055 }
00056
00057 HRESULT IShellBrowserImpl::QueryService(REFGUID guidService, REFIID riid, void** ppvObject)
00058 {
00059         if (!ppvObject)
00060                 return E_POINTER;
00061
00063
00064         if (riid == IID_IUnknown)
00065                 *ppvObject = (IUnknown*)static_cast<IShellBrowser*>(this);
00066         else if (riid == IID_IOleWindow)
00067                 *ppvObject = static_cast<IOleWindow*>(this);
00068         else if (riid == IID_IShellBrowser)
00069                 *ppvObject = static_cast<IShellBrowser*>(this);
00070         else if (riid == IID_ICommDlgBrowser)
00071                 *ppvObject = static_cast<ICommDlgBrowser*>(this);
00072         else if (riid == IID_IServiceProvider)
00073                 *ppvObject = static_cast<IServiceProvider*>(this);
00074         else if (riid == IID_IOleCommandTarget)
00075                 *ppvObject = static_cast<IOleCommandTarget*>(this);
00076         else {
00077                 *ppvObject = NULL;
00078                 return E_NOINTERFACE;
00079         }
00080
00081         return S_OK;
00082 }
00083
00084 HRESULT IShellBrowserImpl::QueryStatus(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT* pCmdText)
00085 {
00086         return E_FAIL;
00087 }
00088
00089 HRESULT IShellBrowserImpl::Exec(const GUID* pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT* pvaIn, VARIANT* pvaOut)
00090 {
00091         return E_FAIL;
00092 }
00093
00094
00095  // process default command: look for folders and traverse into them
00096 HRESULT IShellBrowserImpl::OnDefaultCommand(IShellView* ppshv)
00097 {
00098         IDataObject* selection;
00099
00100         HRESULT hr = ppshv->GetItemObject(SVGIO_SELECTION, IID_IDataObject, (void**)&selection);
00101         if (FAILED(hr))
00102                 return hr;
00103
00104         PIDList pidList;
00105
00106         hr = pidList.GetData(selection);
00107         if (FAILED(hr)) {
00108                 selection->Release();
00109                 return hr;
00110         }
00111
00112         hr = OnDefaultCommand(pidList);
00113
00114         selection->Release();
00115
00116         return hr;
00117 }


ROS Explorer: shellbrowserimpl.h File Reference

  • File List
  • File Members
utility

shellbrowserimpl.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | IShellBrowserImpl
Implementation of IShellBrowser and ICommDlgBrowser interfaces for explorer child windows (see ShellBrowserChild). More...

Defines

#define | WM_GETISHELLBROWSER (WM_USER+7)

Define Documentation

#define WM_GETISHELLBROWSER (WM_USER+7)

Definition at line 99 of file shellbrowserimpl.h.

Referenced by ShellBrowserChildT< MainFrameBase >::WndProc(), and DesktopWindow::WndProc().


ROS Explorer: shellbrowserimpl.h Source File

  • File List
  • File Members
utility

shellbrowserimpl.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // shellbrowserimpl.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027  // Credits: Thanks to Leon Finker for his explorer cabinet window example
00028  //
00029
00030 #ifdef __MINGW32__
00031 #include "servprov.h"   // for IServiceProvider
00032 #include "docobj.h"     // for IOleCommandTarget
00033 #endif
00034
00035
00037 struct IShellBrowserImpl
00038  :      public IShellBrowser,
00039         public ICommDlgBrowser,
00040         public IServiceProvider,
00041         public IOleCommandTarget
00042 {
00043         IShellBrowserImpl()
00044          :      _dwRef(0)
00045         {
00046         }
00047
00048         virtual ~IShellBrowserImpl()
00049         {
00050         }
00051
00052         virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** ppvObject);
00053
00054         virtual ULONG STDMETHODCALLTYPE AddRef() {return ++_dwRef;}
00055         virtual ULONG STDMETHODCALLTYPE Release() {return --_dwRef;}  //not heap based
00056
00057         // *** IOleWindow methods ***
00058         virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode) {return E_NOTIMPL;}
00059
00060         // *** ICommDlgBrowser methods ***
00061         virtual HRESULT STDMETHODCALLTYPE OnDefaultCommand(IShellView* ppshv);
00062
00063         virtual HRESULT STDMETHODCALLTYPE OnStateChange(IShellView* ppshv, ULONG uChange)
00064         {       //handle selection, rename, focus if needed
00065                 return E_NOTIMPL;
00066         }
00067
00068         virtual HRESULT STDMETHODCALLTYPE IncludeObject(IShellView* ppshv, LPCITEMIDLIST pidl)
00069         {       //filter files if needed
00070                 return S_OK;
00071         }
00072
00073         // *** IShellBrowser methods *** (same as IOleInPlaceFrame)
00074         virtual HRESULT STDMETHODCALLTYPE InsertMenusSB(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) {return E_NOTIMPL;}
00075         virtual HRESULT STDMETHODCALLTYPE SetMenuSB(HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject) {return E_NOTIMPL;}
00076         virtual HRESULT STDMETHODCALLTYPE RemoveMenusSB(HMENU hmenuShared) {return E_NOTIMPL;}
00077         virtual HRESULT STDMETHODCALLTYPE SetStatusTextSB(LPCOLESTR lpszStatusText) {return E_NOTIMPL;}
00078         virtual HRESULT STDMETHODCALLTYPE EnableModelessSB(BOOL fEnable) {return E_NOTIMPL;}
00079         virtual HRESULT STDMETHODCALLTYPE BrowseObject(LPCITEMIDLIST pidl, UINT wFlags) {return E_NOTIMPL;}
00080         virtual HRESULT STDMETHODCALLTYPE GetViewStateStream(DWORD grfMode, LPSTREAM* ppStrm) {return E_NOTIMPL;}
00081         virtual HRESULT STDMETHODCALLTYPE OnViewWindowActive(IShellView* ppshv) {return E_NOTIMPL;}
00082         virtual HRESULT STDMETHODCALLTYPE SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) {return E_NOTIMPL;}
00083         virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorSB(LPMSG lpmsg, WORD wID) {return S_OK;}
00084
00085         // IServiceProvider
00086         virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void** ppvObject);
00087
00088         // IOleCommandTarget
00089         virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT* pCmdText);
00090         virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
00091
00092 protected:
00093         DWORD   _dwRef;
00094
00095         virtual HRESULT OnDefaultCommand(LPIDA pida) {return E_NOTIMPL;}
00096 };
00097
00098 #ifndef WM_GETISHELLBROWSER
00099 #define WM_GETISHELLBROWSER (WM_USER+7)
00100 #endif


ROS Explorer: shellclasses.cpp File Reference

  • File List
  • File Members
utility

shellclasses.cpp File Reference

#include <precomp.h>

Include dependency graph for shellclasses.cpp:

Go to the source code of this file.

Defines

#define | CSIDL_FLAG_CREATE 0x8000

Functions

void | HandleException (COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
ShellFolder & GetDesktopFolder ()
HRESULT | path_from_pidlA (IShellFolder *folder, LPCITEMIDLIST pidl, LPSTR buffer, int len)
HRESULT | path_from_pidlW (IShellFolder *folder, LPCITEMIDLIST pidl, LPWSTR buffer, int len)
HRESULT | name_from_pidl (IShellFolder *folder, LPCITEMIDLIST pidl, LPTSTR buffer, int len, SHGDNF flags)
UINT | ILGetSize_local (LPCITEMIDLIST pidl)
HRESULT | ShellFolderContextMenu (IShellFolder *shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST *apidl, int x, int y, CtxMenuInterfaces &cm_ifs)

Define Documentation

#define CSIDL_FLAG_CREATE 0x8000

Definition at line 441 of file shellclasses.cpp.

Referenced by SpecialFolderFSPath::SpecialFolderFSPath().

Function Documentation

ShellFolder& GetDesktopFolder ( )

Definition at line 113 of file shellclasses.cpp.

References CommonDesktop::init().

Referenced by QuickLaunchBar::AddShortcuts(), CollectProgramsThread::collect_programs(), ShellEntry::do_context_menu(), Entry::do_context_menu(), FileChildWindow::FileChildWindow(), ShellEntry::get_parent_folder(), Favorites::import_IE_favorites(), BookmarkList::import_IE_favorites(), ShellBrowser::Init(), DesktopWindow::Init(), main(), ShellFolder::ShellFolder(), ShellPath::ShellPath(), StartMenu::StartMenu(), and StartMenuRoot::StartMenuRoot().

00114 {
00115         static CommonDesktop s_desktop;
00116
00117          // initialize s_desktop
00118         s_desktop.init();
00119
00120         return s_desktop;
00121 }

Here is the call graph for this function:

void HandleException | ( | COMException & | e,
 |  | HWND | hwnd
 | ) |

Exception Handler for COM exceptions.

Definition at line 89 of file shellclasses.cpp.

References COMException::toString().

Referenced by PropertySheetDialog::DoModal(), explorer_main(), ShellBrowser::InsertSubitems(), Window::MessageLoop(), MainFrameBase::OpenShellFolders(), and ShellDirectory::read_directory().

00090 {
00091         String msg = e.toString();
00092
00093         SetLastError(0);
00094
00095         if (hwnd && !IsWindowVisible(hwnd))
00096                 hwnd = 0;
00097
00098         MessageBox(hwnd, msg, TEXT("ShellClasses Exception"), MB_ICONHAND|MB_OK);
00099
00100          // If displaying the error message box _with_ parent was not successfull, display it now without a parent window.
00101         if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
00102                 MessageBox(0, msg, TEXT("ShellClasses Exception"), MB_ICONHAND|MB_OK);
00103 }

Here is the call graph for this function:

UINT ILGetSize_local ( LPCITEMIDLIST pidl )

Definition at line 424 of file shellclasses.cpp.

00425 {
00426         if (!pidl)
00427                 return 0;
00428
00429         int l = sizeof(USHORT/*SHITEMID::cb*/);
00430
00431         while(pidl->mkid.cb) {
00432                 l += pidl->mkid.cb;
00433                 pidl = LPCITEMIDLIST((LPBYTE)pidl+pidl->mkid.cb);
00434         }
00435
00436         return l;
00437 }

HRESULT name_from_pidl | ( | IShellFolder * | folder,
 |  | LPCITEMIDLIST | pidl,
 |  | LPTSTR | buffer,
 |  | int | len,
 |  | SHGDNF | flags
 | ) |

Definition at line 171 of file shellclasses.cpp.

References CONTEXT, and StrRet.

Referenced by ShellDirectory::read_directory().

00172 {
00173         CONTEXT("name_from_pidl()");
00174
00175         StrRet str;
00176
00177         HRESULT hr = folder->GetDisplayNameOf(pidl, flags, &str);
00178
00179         if (SUCCEEDED(hr))
00180                 str.GetString(pidl->mkid, buffer, len);
00181         else
00182                 buffer[0] = '\0';
00183
00184         return hr;
00185 }

HRESULT path_from_pidlA | ( | IShellFolder * | folder,
 |  | LPCITEMIDLIST | pidl,
 |  | LPSTR | buffer,
 |  | int | len
 | ) |

Definition at line 139 of file shellclasses.cpp.

References CONTEXT, and StrRetA::GetString().

00140 {
00141         CONTEXT("path_from_pidlA()");
00142
00143         StrRetA str;
00144
00145         HRESULT hr = folder->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &str);
00146
00147         if (SUCCEEDED(hr))
00148                 str.GetString(pidl->mkid, buffer, len);
00149         else
00150                 buffer[0] = '\0';
00151
00152         return hr;
00153 }

Here is the call graph for this function:

HRESULT path_from_pidlW | ( | IShellFolder * | folder,
 |  | LPCITEMIDLIST | pidl,
 |  | LPWSTR | buffer,
 |  | int | len
 | ) |

Definition at line 155 of file shellclasses.cpp.

References CONTEXT, and StrRetW::GetString().

00156 {
00157         CONTEXT("path_from_pidlW()");
00158
00159         StrRetW str;
00160
00161         HRESULT hr = folder->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &str);
00162
00163         if (SUCCEEDED(hr))
00164                 str.GetString(pidl->mkid, buffer, len);
00165         else
00166                 buffer[0] = '\0';
00167
00168         return hr;
00169 }

Here is the call graph for this function:

HRESULT ShellFolderContextMenu | ( | IShellFolder * | shell_folder,
 |  | HWND | hwndParent,
 |  | int | cidl,
 |  | LPCITEMIDLIST * | apidl,
 |  | int | x,
 |  | int | y,
 |  | CtxMenuInterfaces & | cm_ifs
 | ) |

Definition at line 527 of file shellclasses.cpp.

References CtxMenuInterfaces::query_interfaces(), and CtxMenuInterfaces::reset().

Referenced by ShellEntry::do_context_menu(), Entry::do_context_menu(), and DesktopShellView::DoContextMenu().

00529 {
00530         IContextMenu* pcm;
00531
00532         HRESULT hr = shell_folder->GetUIObjectOf(hwndParent, cidl, apidl, IID_IContextMenu, NULL, (LPVOID*)&pcm);
00533 //      HRESULT hr = CDefFolderMenu_Create2(dir?dir->_pidl:DesktopFolder(), hwndParent, 1, &pidl, shell_folder, NULL, 0, NULL, &pcm);
00534
00535         if (SUCCEEDED(hr)) {
00536                 pcm = cm_ifs.query_interfaces(pcm);
00537
00538                 HMENU hmenu = CreatePopupMenu();
00539
00540                 if (hmenu) {
00541                         hr = pcm->QueryContextMenu(hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL|CMF_EXPLORE);
00542
00543                         if (SUCCEEDED(hr)) {
00544                                 UINT idCmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN|TPM_RETURNCMD|TPM_RIGHTBUTTON, x, y, 0, hwndParent, NULL);
00545
00546                                 cm_ifs.reset();
00547
00548                                 if (idCmd) {
00549                                   CMINVOKECOMMANDINFO cmi;
00550
00551                                   cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
00552                                   cmi.fMask = 0;
00553                                   cmi.hwnd = hwndParent;
00554                                   cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - FCIDM_SHVIEWFIRST);
00555                                   cmi.lpParameters = NULL;
00556                                   cmi.lpDirectory = NULL;
00557                                   cmi.nShow = SW_SHOWNORMAL;
00558                                   cmi.dwHotKey = 0;
00559                                   cmi.hIcon = 0;
00560
00561                                   hr = pcm->InvokeCommand(&cmi);
00562                                 }
00563                         } else
00564                                 cm_ifs.reset();
00565                 }
00566
00567                 pcm->Release();
00568         }
00569
00570         return hr;
00571 }

Here is the call graph for this function:


ROS Explorer: shellclasses.cpp Source File

  • File List
  • File Members
utility

shellclasses.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // shellclasses.cpp
00024  //
00025  // C++ wrapper classes for COM interfaces and shell objects
00026  //
00027  // Martin Fuchs, 20.07.2003
00028  //
00029
00030
00031 #include <precomp.h>
00032
00033
00034 #ifdef _MS_VER
00035 #pragma comment(lib, "shell32") // link to shell32.dll
00036 #endif
00037
00038
00039  // work around GCC's wide string constant bug
00040 #ifdef __GNUC__
00041 const LPCTSTR sCFSTR_SHELLIDLIST = TEXT("Shell IDList Array");
00042 #endif
00043
00044
00045  // helper functions for string copying
00046
00047 /*LPSTR strcpyn(LPSTR dest, LPCSTR source, size_t count)
00048 {
00049         LPCSTR s;
00050         LPSTR d = dest;
00051
00052         for(s=source; count&&(*d++=*s++); )
00053                 count--;
00054
00055         return dest;
00056 }
00057
00058 LPWSTR wcscpyn(LPWSTR dest, LPCWSTR source, size_t count)
00059 {
00060         LPCWSTR s;
00061         LPWSTR d = dest;
00062
00063         for(s=source; count&&(*d++=*s++); )
00064                 count--;
00065
00066         return dest;
00067 }*/
00068
00069
00070 String COMException::toString() const
00071 {
00072         TCHAR msg[4*BUFFER_LEN];
00073         int l = 4*BUFFER_LEN;
00074         LPTSTR p = msg;
00075
00076         int n = _stprintf_s2(p, l, TEXT("%s\nContext: %s"), super::ErrorMessage(), (LPCTSTR)_context.toString());
00077         p += n;
00078         l -= n;
00079
00080         if (_file)
00081                 p += _stprintf_s2(p, l, TEXT("\nLocation: %hs:%d"), _file, _line);
00082
00083         return msg;
00084 }
00085
00086
00088
00089 void HandleException(COMException& e, HWND hwnd)
00090 {
00091         String msg = e.toString();
00092
00093         SetLastError(0);
00094
00095         if (hwnd && !IsWindowVisible(hwnd))
00096                 hwnd = 0;
00097
00098         MessageBox(hwnd, msg, TEXT("ShellClasses Exception"), MB_ICONHAND|MB_OK);
00099
00100          // If displaying the error message box _with_ parent was not successfull, display it now without a parent window.
00101         if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
00102                 MessageBox(0, msg, TEXT("ShellClasses Exception"), MB_ICONHAND|MB_OK);
00103 }
00104
00105
00106  // common IMalloc object
00107
00108 CommonShellMalloc ShellMalloc::s_cmn_shell_malloc;
00109
00110
00111  // common desktop object
00112
00113 ShellFolder& GetDesktopFolder()
00114 {
00115         static CommonDesktop s_desktop;
00116
00117          // initialize s_desktop
00118         s_desktop.init();
00119
00120         return s_desktop;
00121 }
00122
00123
00124 void CommonDesktop::init()
00125 {
00126         CONTEXT("CommonDesktop::init()");
00127
00128         if (!_desktop)
00129                 _desktop = new ShellFolder;
00130 }
00131
00132 CommonDesktop::~CommonDesktop()
00133 {
00134         if (_desktop)
00135                 delete _desktop;
00136 }
00137
00138
00139 HRESULT path_from_pidlA(IShellFolder* folder, LPCITEMIDLIST pidl, LPSTR buffer, int len)
00140 {
00141         CONTEXT("path_from_pidlA()");
00142
00143         StrRetA str;
00144
00145         HRESULT hr = folder->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &str);
00146
00147         if (SUCCEEDED(hr))
00148                 str.GetString(pidl->mkid, buffer, len);
00149         else
00150                 buffer[0] = '\0';
00151
00152         return hr;
00153 }
00154
00155 HRESULT path_from_pidlW(IShellFolder* folder, LPCITEMIDLIST pidl, LPWSTR buffer, int len)
00156 {
00157         CONTEXT("path_from_pidlW()");
00158
00159         StrRetW str;
00160
00161         HRESULT hr = folder->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &str);
00162
00163         if (SUCCEEDED(hr))
00164                 str.GetString(pidl->mkid, buffer, len);
00165         else
00166                 buffer[0] = '\0';
00167
00168         return hr;
00169 }
00170
00171 HRESULT name_from_pidl(IShellFolder* folder, LPCITEMIDLIST pidl, LPTSTR buffer, int len, SHGDNF flags)
00172 {
00173         CONTEXT("name_from_pidl()");
00174
00175         StrRet str;
00176
00177         HRESULT hr = folder->GetDisplayNameOf(pidl, flags, &str);
00178
00179         if (SUCCEEDED(hr))
00180                 str.GetString(pidl->mkid, buffer, len);
00181         else
00182                 buffer[0] = '\0';
00183
00184         return hr;
00185 }
00186
00187
00188 #ifndef _NO_COMUTIL
00189
00190 ShellFolder::ShellFolder()
00191 {
00192         CONTEXT("ShellFolder::ShellFolder()");
00193
00194         IShellFolder* desktop;
00195
00196         CHECKERROR(SHGetDesktopFolder(&desktop));
00197
00198         super::Attach(desktop);
00199         desktop->AddRef();
00200 }
00201
00202 ShellFolder::ShellFolder(IShellFolder* p)
00203  :      super(p)
00204 {
00205         CONTEXT("ShellFolder::ShellFolder(IShellFolder*)");
00206
00207         p->AddRef();
00208 }
00209
00210 ShellFolder::ShellFolder(IShellFolder* parent, LPCITEMIDLIST pidl)
00211 {
00212         CONTEXT("ShellFolder::ShellFolder(IShellFolder*, LPCITEMIDLIST)");
00213
00214         IShellFolder* ptr;
00215
00216         if (!pidl)
00217                 CHECKERROR(E_INVALIDARG);
00218
00219         if (pidl && pidl->mkid.cb)
00220                 CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&ptr));
00221         else
00222                 ptr = parent;
00223
00224         super::Attach(ptr);
00225         ptr->AddRef();
00226 }
00227
00228 ShellFolder::ShellFolder(LPCITEMIDLIST pidl)
00229 {
00230         CONTEXT("ShellFolder::ShellFolder(LPCITEMIDLIST)");
00231
00232         IShellFolder* ptr;
00233         IShellFolder* parent = GetDesktopFolder();
00234
00235         if (pidl && pidl->mkid.cb)
00236                 CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&ptr));
00237         else
00238                 ptr = parent;
00239
00240         super::Attach(ptr);
00241         ptr->AddRef();
00242 }
00243
00244 void ShellFolder::attach(IShellFolder* parent, LPCITEMIDLIST pidl)
00245 {
00246         CONTEXT("ShellFolder::attach(IShellFolder*, LPCITEMIDLIST)");
00247
00248         IShellFolder* ptr;
00249
00250         if (pidl && pidl->mkid.cb)
00251                 CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&ptr));
00252         else
00253                 ptr = parent;
00254
00255         super::Attach(ptr);
00256         ptr->AddRef();
00257 }
00258
00259 #else // _com_ptr not available -> use SIfacePtr
00260
00261 ShellFolder::ShellFolder()
00262 {
00263         CONTEXT("ShellFolder::ShellFolder()");
00264
00265         CHECKERROR(SHGetDesktopFolder(&_p));
00266
00267         _p->AddRef();
00268 }
00269
00270 ShellFolder::ShellFolder(IShellFolder* p)
00271  :      super(p)
00272 {
00273         CONTEXT("ShellFolder::ShellFolder(IShellFolder*)");
00274
00275         _p->AddRef();
00276 }
00277
00278 ShellFolder::ShellFolder(IShellFolder* parent, LPCITEMIDLIST pidl)
00279 {
00280         CONTEXT("ShellFolder::ShellFolder(IShellFolder*, LPCITEMIDLIST)");
00281
00282         if (pidl && pidl->mkid.cb)
00283                 CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&_p));
00284         else
00285                 _p = GetDesktopFolder();
00286
00287         _p->AddRef();
00288 }
00289
00290 ShellFolder::ShellFolder(LPCITEMIDLIST pidl)
00291 {
00292         CONTEXT("ShellFolder::ShellFolder(LPCITEMIDLIST)");
00293
00294         if (pidl && pidl->mkid.cb)
00295                 CHECKERROR(GetDesktopFolder()->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&_p));
00296         else
00297                 _p = GetDesktopFolder();
00298
00299         _p->AddRef();
00300 }
00301
00302 void ShellFolder::attach(IShellFolder* parent, LPCITEMIDLIST pidl)
00303 {
00304         CONTEXT("ShellFolder::ShellFolder(IShellFolder*, LPCITEMIDLIST)");
00305
00306         IShellFolder* h = _p;
00307
00308         CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&_p));
00309
00310         _p->AddRef();
00311         h->Release();
00312 }
00313
00314 #endif
00315
00316 String ShellFolder::get_name(LPCITEMIDLIST pidl, SHGDNF flags) const
00317 {
00318         CONTEXT("ShellFolder::get_name()");
00319
00320         TCHAR buffer[MAX_PATH];
00321         StrRet strret;
00322
00323         HRESULT hr = ((IShellFolder*)*const_cast<ShellFolder*>(this))->GetDisplayNameOf(pidl, flags, &strret);
00324
00325         if (hr == S_OK)
00326                 strret.GetString(pidl->mkid, buffer, COUNTOF(buffer));
00327         else {
00328                 CHECKERROR(hr);
00329                 *buffer = TEXT('\0');
00330         }
00331
00332         return buffer;
00333 }
00334
00335
00336 void ShellPath::split(ShellPath& parent, ShellPath& obj) const
00337 {
00338         SHITEMID *piid, *piidLast;
00339         int size = 0;
00340
00341          // find last item-id and calculate total size of pidl
00342         for(piid=piidLast=&_p->mkid; piid->cb; ) {
00343                 piidLast = piid;
00344                 size += (piid->cb);
00345                 piid = (SHITEMID*)((LPBYTE)piid + (piid->cb));
00346         }
00347
00348          // copy parent folder portion
00349         size -= piidLast->cb;  // don't count "object" item-id
00350
00351         if (size > 0)
00352                 parent.assign(_p, size);
00353
00354          // copy "object" portion
00355         obj.assign((ITEMIDLIST*)piidLast, piidLast->cb);
00356 }
00357
00358 void ShellPath::GetUIObjectOf(REFIID riid, LPVOID* ppvOut, HWND hWnd, ShellFolder& sf)
00359 {
00360         CONTEXT("ShellPath::GetUIObjectOf()");
00361
00362         ShellPath parent, obj;
00363
00364         split(parent, obj);
00365
00366         LPCITEMIDLIST idl = obj;
00367
00368         if (parent && parent->mkid.cb)
00369                  // use the IShellFolder of the parent
00370                 CHECKERROR(ShellFolder((IShellFolder*)sf,parent)->GetUIObjectOf(hWnd, 1, &idl, riid, 0, ppvOut));
00371         else // else use desktop folder
00372                 CHECKERROR(sf->GetUIObjectOf(hWnd, 1, &idl, riid, 0, ppvOut));
00373 }
00374
00375 #if 0   // ILCombine() was missing in previous versions of MinGW and is not exported from shell32.dll on Windows 2000.
00376
00377  // convert an item id list from relative to absolute (=relative to the desktop) format
00378 ShellPath ShellPath::create_absolute_pidl(LPCITEMIDLIST parent_pidl) const
00379 {
00380         CONTEXT("ShellPath::create_absolute_pidl()");
00381
00382         return ILCombine(parent_pidl, _p);
00383
00384 /* seems to work only for NT upwards
00385          // create a new item id list with _p append behind parent_pidl
00386         int l1 = ILGetSize(parent_pidl) - sizeof(USHORT/ SHITEMID::cb /);
00387         int l2 = ILGetSize(_p);
00388
00389         LPITEMIDLIST p = (LPITEMIDLIST) _malloc->Alloc(l1+l2);
00390
00391         memcpy(p, parent_pidl, l1);
00392         memcpy((LPBYTE)p+l1, _p, l2);
00393
00394         return p;
00395 */
00396 }
00397
00398 #else
00399
00400 ShellPath ShellPath::create_absolute_pidl(LPCITEMIDLIST parent_pidl) const
00401 {
00402         CONTEXT("ShellPath::create_absolute_pidl()");
00403
00404         static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILCombine(TEXT("SHELL32"), 25);
00405
00406         if (ILCombine)
00407                 return (*ILCombine)(parent_pidl, _p);
00408
00409          // create a new item id list with _p append behind parent_pidl
00410         int l1 = ILGetSize(parent_pidl) - sizeof(USHORT/*SHITEMID::cb*/);
00411         int l2 = ILGetSize(_p);
00412
00413         LPITEMIDLIST p = (LPITEMIDLIST) _malloc->Alloc(l1+l2);
00414
00415         memcpy(p, parent_pidl, l1);
00416         memcpy((LPBYTE)p+l1, _p, l2);
00417
00418         return p;
00419 }
00420
00421 #endif
00422
00423  // local implementation of ILGetSize() to replace missing export on Windows 2000
00424 UINT ILGetSize_local(LPCITEMIDLIST pidl)
00425 {
00426         if (!pidl)
00427                 return 0;
00428
00429         int l = sizeof(USHORT/*SHITEMID::cb*/);
00430
00431         while(pidl->mkid.cb) {
00432                 l += pidl->mkid.cb;
00433                 pidl = LPCITEMIDLIST((LPBYTE)pidl+pidl->mkid.cb);
00434         }
00435
00436         return l;
00437 }
00438
00439
00440 #ifndef _SHFOLDER_H_
00441 #define CSIDL_FLAG_CREATE       0x8000
00442 #endif
00443
00445 SpecialFolderFSPath::SpecialFolderFSPath(int folder, HWND hwnd)
00446 {
00447         _fullpath[0] = '\0';
00448
00449 #ifdef UNICODE
00450         static DynamicFct<BOOL (__stdcall*)(HWND hwnd, LPTSTR pszPath, int csidl, BOOL fCreate)> s_pSHGetSpecialFolderPath(TEXT("shell32"), "SHGetSpecialFolderPathW");
00451 #else
00452         static DynamicFct<BOOL (__stdcall*)(HWND hwnd, LPTSTR pszPath, int csidl, BOOL fCreate)> s_pSHGetSpecialFolderPath(TEXT("shell32"), "SHGetSpecialFolderPathA");
00453 #endif
00454         if (*s_pSHGetSpecialFolderPath)
00455                 (*s_pSHGetSpecialFolderPath)(hwnd, _fullpath, folder, TRUE);
00456         else {
00457                  // SHGetSpecialFolderPath() is not compatible to WIN95/NT4
00458 #ifdef UNICODE
00459                 static DynamicFct<HRESULT (__stdcall*)(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)> s_pSHGetFolderPath_shell32(TEXT("shell32"), "SHGetFolderPathW");
00460 #else
00461                 static DynamicFct<HRESULT (__stdcall*)(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)> s_pSHGetFolderPath_shell32(TEXT("shell32"), "SHGetFolderPathA");
00462 #endif
00463                 if (*s_pSHGetFolderPath_shell32)
00464                         (*s_pSHGetFolderPath_shell32)(hwnd, folder|CSIDL_FLAG_CREATE, 0, 0, _fullpath);
00465                 else {
00466                          // SHGetFolderPath() is only present in shfolder.dll on some platforms.
00467 #ifdef UNICODE
00468                         static DynamicLoadLibFct<HRESULT (__stdcall*)(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)> s_pSHGetFolderPath_shfolder(TEXT("shfolder"), "SHGetFolderPathW");
00469 #else
00470                         static DynamicLoadLibFct<HRESULT (__stdcall*)(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)> s_pSHGetFolderPath_shfolder(TEXT("shfolder"), "SHGetFolderPathA");
00471 #endif
00472                         if (*s_pSHGetFolderPath_shfolder)
00473                                 (*s_pSHGetFolderPath_shfolder)(hwnd, folder|CSIDL_FLAG_CREATE, 0, 0, _fullpath);
00474                 }
00475         }
00476 }
00477
00478
00479 void CtxMenuInterfaces::reset()
00480 {
00481         _pctxmenu2 = NULL;
00482
00483 #ifndef __MINGW32__     // IContextMenu3 missing in MinGW (as of 6.2.2005)
00484         _pctxmenu3 = NULL;
00485 #endif
00486 }
00487
00488 bool CtxMenuInterfaces::HandleMenuMsg(UINT nmsg, WPARAM wparam, LPARAM lparam)
00489 {
00490 #ifndef __MINGW32__     // IContextMenu3 missing in MinGW (as of 6.2.2005)
00491         if (_pctxmenu3) {
00492                 if (SUCCEEDED(_pctxmenu3->HandleMenuMsg(nmsg, wparam, lparam)))
00493                         return true;
00494         }
00495 #endif
00496
00497         if (_pctxmenu2)
00498                 if (SUCCEEDED(_pctxmenu2->HandleMenuMsg(nmsg, wparam, lparam)))
00499                         return true;
00500
00501         return false;
00502 }
00503
00504 IContextMenu* CtxMenuInterfaces::query_interfaces(IContextMenu* pcm1)
00505 {
00506         IContextMenu* pcm = NULL;
00507
00508         reset();
00509
00510          // Get the higher version context menu interfaces.
00511 #ifndef __MINGW32__     // IContextMenu3 missing in MinGW (as of 6.2.2005)
00512         if (pcm1->QueryInterface(IID_IContextMenu3, (void**)&pcm) == NOERROR)
00513                 _pctxmenu3 = (LPCONTEXTMENU3)pcm;
00514         else
00515 #endif
00516         if (pcm1->QueryInterface(IID_IContextMenu2, (void**)&pcm) == NOERROR)
00517                 _pctxmenu2 = (LPCONTEXTMENU2)pcm;
00518
00519         if (pcm) {
00520                 pcm1->Release();
00521                 return pcm;
00522         } else
00523                 return pcm1;
00524 }
00525
00526
00527 HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParent, int cidl,
00528                                                                 LPCITEMIDLIST* apidl, int x, int y, CtxMenuInterfaces& cm_ifs)
00529 {
00530         IContextMenu* pcm;
00531
00532         HRESULT hr = shell_folder->GetUIObjectOf(hwndParent, cidl, apidl, IID_IContextMenu, NULL, (LPVOID*)&pcm);
00533 //      HRESULT hr = CDefFolderMenu_Create2(dir?dir->_pidl:DesktopFolder(), hwndParent, 1, &pidl, shell_folder, NULL, 0, NULL, &pcm);
00534
00535         if (SUCCEEDED(hr)) {
00536                 pcm = cm_ifs.query_interfaces(pcm);
00537
00538                 HMENU hmenu = CreatePopupMenu();
00539
00540                 if (hmenu) {
00541                         hr = pcm->QueryContextMenu(hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL|CMF_EXPLORE);
00542
00543                         if (SUCCEEDED(hr)) {
00544                                 UINT idCmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN|TPM_RETURNCMD|TPM_RIGHTBUTTON, x, y, 0, hwndParent, NULL);
00545
00546                                 cm_ifs.reset();
00547
00548                                 if (idCmd) {
00549                                   CMINVOKECOMMANDINFO cmi;
00550
00551                                   cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
00552                                   cmi.fMask = 0;
00553                                   cmi.hwnd = hwndParent;
00554                                   cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - FCIDM_SHVIEWFIRST);
00555                                   cmi.lpParameters = NULL;
00556                                   cmi.lpDirectory = NULL;
00557                                   cmi.nShow = SW_SHOWNORMAL;
00558                                   cmi.dwHotKey = 0;
00559                                   cmi.hIcon = 0;
00560
00561                                   hr = pcm->InvokeCommand(&cmi);
00562                                 }
00563                         } else
00564                                 cm_ifs.reset();
00565                 }
00566
00567                 pcm->Release();
00568         }
00569
00570         return hr;
00571 }


ROS Explorer: shellclasses.h File Reference

  • File List
  • File Members
utility

shellclasses.h File Reference

#include <shellapi.h>
#include <shlobj.h>

Include dependency graph for shellclasses.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | COMExceptionBase
COM ExceptionBase class as replacement for _com_error. More...
struct | COMException
Exception with context information. More...
struct | ComInit
COM Initialisation. More...
struct | OleInit
OLE initialisation for drag drop support. More...
struct | CommonShellMalloc
We use a common IMalloc object for all shell memory allocations. More...
struct | ShellMalloc
wrapper class for IMalloc with usage of common allocator More...
struct | SShellPtr< T >
wrapper template class for pointers to shell objects managed by IMalloc More...
struct | SIfacePtr< T >
wrapper class for COM interface pointers More...
struct | ComSrvObject
struct | SimpleComObject
struct | IComSrvQI< BASE >
struct | IComSrvQI< IUnknown >
class | IComSrvBase< BASE, OBJ >
struct | CommonDesktop
caching of desktop ShellFolder object More...
struct | ShellFolder
IShellFolder smart pointer. More...
struct | ShellLinkPtr
IShellLink smart pointer. More...
struct | ShellPath
wrapper class for item ID lists More...
struct | StrRetA
easy retrieval of multi byte strings out of STRRET structures More...
struct | StrRetW
easy retrieval of wide char strings out of STRRET structures More...
class | FileSysShellPath
Retrieval of file system paths of ShellPath objects. More...
struct | FolderBrowser
Browse dialog operating on shell namespace. More...
struct | SpecialFolderPath
Retrieval of special shell folder paths. More...
struct | DesktopFolderPath
Shell folder path of the desktop. More...
struct | SpecialFolder
Retrieval of special shell folder. More...
struct | DesktopFolder
Shell folder of the desktop. More...
struct | SpecialFolderFSPath
file system path of special folder More...
struct | ShellItemEnumerator
wrapper class for enumerating shell namespace objects More...
struct | PIDList
list of PIDLs More...
struct | CtxMenuInterfaces
struct | ExtContextMenuHandlerT< BASE >

Defines

#define | NOVTABLE
#define | ANSUNC
#define | THROW_EXCEPTION(hr) throw COMException(hr, __FILE__, __LINE__)
#define | CHECKERROR(hr) ((void)(FAILED(hr)? THROW_EXCEPTION(hr): 0))
#define | path_from_pidl path_from_pidlA
#define | ILGetSize ILGetSize_local
#define | UNION_MEMBER(x) x
#define | StrRet StrRetA

Functions

void | CheckError (HRESULT hr)
void | HandleException (COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
ShellFolder & GetDesktopFolder ()
HRESULT | path_from_pidlA (IShellFolder *folder, LPCITEMIDLIST pidl, LPSTR buffer, int len)
HRESULT | path_from_pidlW (IShellFolder *folder, LPCITEMIDLIST pidl, LPWSTR buffer, int len)
HRESULT | name_from_pidl (IShellFolder *folder, LPCITEMIDLIST pidl, LPTSTR buffer, int len, SHGDNF flags)
UINT | ILGetSize_local (LPCITEMIDLIST pidl)
HRESULT | ShellFolderContextMenu (IShellFolder *shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST *ppidl, int x, int y, CtxMenuInterfaces &cm_ifs)

Define Documentation

#define ANSUNC

Definition at line 60 of file shellclasses.h.

#define CHECKERROR ( hr ) ((void)(FAILED(hr)? THROW_EXCEPTION(hr): 0))

Definition at line 162 of file shellclasses.h.

Referenced by ShellFolder::attach(), ComInit::ComInit(), DesktopShellView::DoContextMenu(), ShellFolder::get_name(), ShellPath::GetUIObjectOf(), CommonShellMalloc::init(), OleInit::OleInit(), ShellBrowser::OnTreeItemRClick(), ShellFolder::ShellFolder(), ShellItemEnumerator::ShellItemEnumerator(), ShellPath::ShellPath(), SIfacePtr< IShellLink >::SIfacePtr(), and SpecialFolderPath::SpecialFolderPath().

#define ILGetSize ILGetSize_local

Definition at line 638 of file shellclasses.h.

Referenced by ShellPath::assign(), ShellPath::create_absolute_pidl(), ShellPath::operator+=(), ShellPath::operator=(), and ShellPath::ShellPath().

#define NOVTABLE

Definition at line 58 of file shellclasses.h.

#define path_from_pidl path_from_pidlA

Definition at line 628 of file shellclasses.h.

Referenced by ShellDirectory::get_path().

#define StrRet StrRetA

Definition at line 859 of file shellclasses.h.

Referenced by ShellFolder::get_name(), and name_from_pidl().

#define THROW_EXCEPTION ( hr ) throw COMException(hr, __FILE__, __LINE__)

Definition at line 161 of file shellclasses.h.

Referenced by BStr::assign(), ScanNTFSStreams(), and WebChildWindow::WndProc().

#define UNION_MEMBER ( x ) x

Definition at line 849 of file shellclasses.h.

Referenced by StrRetW::GetString(), and StrRetA::GetString().

Function Documentation

void CheckError ( HRESULT hr ) [inline]

Definition at line 167 of file shellclasses.h.

References COMException::COMException().

Referenced by BStr::assign(), ConnectionPoint< T >::ConnectionPoint(), EventConnection::EventConnection(), Variant::operator bool(), Variant::operator IDispatch *(), Variant::operator long(), Variant::operator VARIANT_BOOL(), and Variant::Variant().

00168 {
00169         if (FAILED(hr))
00170                 throw COMException(hr);
00171 }

Here is the call graph for this function:

ShellFolder& GetDesktopFolder ( )

Definition at line 113 of file shellclasses.cpp.

References CommonDesktop::init().

Referenced by QuickLaunchBar::AddShortcuts(), CollectProgramsThread::collect_programs(), Entry::do_context_menu(), ShellEntry::do_context_menu(), FileChildWindow::FileChildWindow(), ShellEntry::get_parent_folder(), BookmarkList::import_IE_favorites(), Favorites::import_IE_favorites(), DesktopWindow::Init(), ShellBrowser::Init(), main(), ShellFolder::ShellFolder(), ShellPath::ShellPath(), StartMenu::StartMenu(), and StartMenuRoot::StartMenuRoot().

00114 {
00115         static CommonDesktop s_desktop;
00116
00117          // initialize s_desktop
00118         s_desktop.init();
00119
00120         return s_desktop;
00121 }

Here is the call graph for this function:

void HandleException | ( | COMException & | e,
 |  | HWND | hwnd
 | ) |

Exception Handler for COM exceptions.

Definition at line 89 of file shellclasses.cpp.

References COMException::toString().

Referenced by PropertySheetDialog::DoModal(), explorer_main(), ShellBrowser::InsertSubitems(), Window::MessageLoop(), MainFrameBase::OpenShellFolders(), and ShellDirectory::read_directory().

00090 {
00091         String msg = e.toString();
00092
00093         SetLastError(0);
00094
00095         if (hwnd && !IsWindowVisible(hwnd))
00096                 hwnd = 0;
00097
00098         MessageBox(hwnd, msg, TEXT("ShellClasses Exception"), MB_ICONHAND|MB_OK);
00099
00100          // If displaying the error message box _with_ parent was not successfull, display it now without a parent window.
00101         if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
00102                 MessageBox(0, msg, TEXT("ShellClasses Exception"), MB_ICONHAND|MB_OK);
00103 }

Here is the call graph for this function:

UINT ILGetSize_local ( LPCITEMIDLIST pidl )

Definition at line 424 of file shellclasses.cpp.

00425 {
00426         if (!pidl)
00427                 return 0;
00428
00429         int l = sizeof(USHORT/*SHITEMID::cb*/);
00430
00431         while(pidl->mkid.cb) {
00432                 l += pidl->mkid.cb;
00433                 pidl = LPCITEMIDLIST((LPBYTE)pidl+pidl->mkid.cb);
00434         }
00435
00436         return l;
00437 }

HRESULT name_from_pidl | ( | IShellFolder * | folder,
 |  | LPCITEMIDLIST | pidl,
 |  | LPTSTR | buffer,
 |  | int | len,
 |  | SHGDNF | flags
 | ) |

Definition at line 171 of file shellclasses.cpp.

References CONTEXT, and StrRet.

Referenced by ShellDirectory::read_directory().

00172 {
00173         CONTEXT("name_from_pidl()");
00174
00175         StrRet str;
00176
00177         HRESULT hr = folder->GetDisplayNameOf(pidl, flags, &str);
00178
00179         if (SUCCEEDED(hr))
00180                 str.GetString(pidl->mkid, buffer, len);
00181         else
00182                 buffer[0] = '\0';
00183
00184         return hr;
00185 }

HRESULT path_from_pidlA | ( | IShellFolder * | folder,
 |  | LPCITEMIDLIST | pidl,
 |  | LPSTR | buffer,
 |  | int | len
 | ) |

Definition at line 139 of file shellclasses.cpp.

References CONTEXT, and StrRetA::GetString().

00140 {
00141         CONTEXT("path_from_pidlA()");
00142
00143         StrRetA str;
00144
00145         HRESULT hr = folder->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &str);
00146
00147         if (SUCCEEDED(hr))
00148                 str.GetString(pidl->mkid, buffer, len);
00149         else
00150                 buffer[0] = '\0';
00151
00152         return hr;
00153 }

Here is the call graph for this function:

HRESULT path_from_pidlW | ( | IShellFolder * | folder,
 |  | LPCITEMIDLIST | pidl,
 |  | LPWSTR | buffer,
 |  | int | len
 | ) |

Definition at line 155 of file shellclasses.cpp.

References CONTEXT, and StrRetW::GetString().

00156 {
00157         CONTEXT("path_from_pidlW()");
00158
00159         StrRetW str;
00160
00161         HRESULT hr = folder->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &str);
00162
00163         if (SUCCEEDED(hr))
00164                 str.GetString(pidl->mkid, buffer, len);
00165         else
00166                 buffer[0] = '\0';
00167
00168         return hr;
00169 }

Here is the call graph for this function:

HRESULT ShellFolderContextMenu | ( | IShellFolder * | shell_folder,
 |  | HWND | hwndParent,
 |  | int | cidl,
 |  | LPCITEMIDLIST * | ppidl,
 |  | int | x,
 |  | int | y,
 |  | CtxMenuInterfaces & | cm_ifs
 | ) |

Definition at line 527 of file shellclasses.cpp.

References CtxMenuInterfaces::query_interfaces(), and CtxMenuInterfaces::reset().

Referenced by Entry::do_context_menu(), ShellEntry::do_context_menu(), and DesktopShellView::DoContextMenu().

00529 {
00530         IContextMenu* pcm;
00531
00532         HRESULT hr = shell_folder->GetUIObjectOf(hwndParent, cidl, apidl, IID_IContextMenu, NULL, (LPVOID*)&pcm);
00533 //      HRESULT hr = CDefFolderMenu_Create2(dir?dir->_pidl:DesktopFolder(), hwndParent, 1, &pidl, shell_folder, NULL, 0, NULL, &pcm);
00534
00535         if (SUCCEEDED(hr)) {
00536                 pcm = cm_ifs.query_interfaces(pcm);
00537
00538                 HMENU hmenu = CreatePopupMenu();
00539
00540                 if (hmenu) {
00541                         hr = pcm->QueryContextMenu(hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL|CMF_EXPLORE);
00542
00543                         if (SUCCEEDED(hr)) {
00544                                 UINT idCmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN|TPM_RETURNCMD|TPM_RIGHTBUTTON, x, y, 0, hwndParent, NULL);
00545
00546                                 cm_ifs.reset();
00547
00548                                 if (idCmd) {
00549                                   CMINVOKECOMMANDINFO cmi;
00550
00551                                   cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
00552                                   cmi.fMask = 0;
00553                                   cmi.hwnd = hwndParent;
00554                                   cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - FCIDM_SHVIEWFIRST);
00555                                   cmi.lpParameters = NULL;
00556                                   cmi.lpDirectory = NULL;
00557                                   cmi.nShow = SW_SHOWNORMAL;
00558                                   cmi.dwHotKey = 0;
00559                                   cmi.hIcon = 0;
00560
00561                                   hr = pcm->InvokeCommand(&cmi);
00562                                 }
00563                         } else
00564                                 cm_ifs.reset();
00565                 }
00566
00567                 pcm->Release();
00568         }
00569
00570         return hr;
00571 }

Here is the call graph for this function:


ROS Explorer: shellclasses.h Source File

  • File List
  • File Members
utility

shellclasses.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // shellclasses.h
00024  //
00025  // C++ wrapper classes for COM interfaces and shell objects
00026  //
00027  // Martin Fuchs, 20.07.2003
00028  //
00029
00030
00031  // windows shell headers
00032 #include <shellapi.h>
00033 #include <shlobj.h>
00034
00035 /*@@
00036 #if _MSC_VER>=1300      // VS.Net
00037 #include <comdefsp.h>
00038 using namespace _com_util;
00039 #endif
00040 */
00041
00042 #ifndef _INC_COMUTIL    // is comutil.h of MS headers not available?
00043 #ifndef _NO_COMUTIL
00044 #define _NO_COMUTIL
00045 #endif
00046 #endif
00047
00048  // work around GCC's wide string constant bug when compiling inline functions
00049 #ifdef __GNUC__
00050 extern const LPCTSTR sCFSTR_SHELLIDLIST;
00051 #undef CFSTR_SHELLIDLIST
00052 #define CFSTR_SHELLIDLIST sCFSTR_SHELLIDLIST
00053 #endif
00054
00055 #ifdef _MSC_VER
00056 #define NOVTABLE __declspec(novtable)
00057 #else
00058 #define NOVTABLE
00059 #endif
00060 #define ANSUNC
00061
00062
00063  // Exception Handling
00064
00065 #ifndef _NO_COMUTIL
00066
00067 #define COMExceptionBase _com_error
00068
00069 #else
00070
00072 struct COMExceptionBase
00073 {
00074         COMExceptionBase(HRESULT hr)
00075          :      _hr(hr)
00076         {
00077         }
00078
00079         HRESULT Error() const
00080         {
00081                 return _hr;
00082         }
00083
00084         LPCTSTR ErrorMessage() const
00085         {
00086                 if (_msg.empty()) {
00087                         LPTSTR pBuf;
00088
00089                         if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
00090                                 0, _hr, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPTSTR)&pBuf, 0, NULL)) {
00091                                 _msg = pBuf;
00092                                 LocalFree(pBuf);
00093                          } else {
00094                                 TCHAR buffer[128];
00095                                 _sntprintf(buffer, COUNTOF(buffer), TEXT("unknown Exception: 0x%08lX"), _hr);
00096                                 _msg = buffer;
00097                          }
00098                 }
00099
00100                 return _msg;
00101         }
00102
00103 protected:
00104         HRESULT _hr;
00105         mutable String _msg;
00106 };
00107
00108 #endif
00109
00110
00112
00113 struct COMException : public COMExceptionBase
00114 {
00115         typedef COMExceptionBase super;
00116
00117         COMException(HRESULT hr)
00118          :      super(hr),
00119                 _context(CURRENT_CONTEXT),
00120                 _file(NULL), _line(0)
00121         {
00122                 LOG(toString());
00123                 LOG(CURRENT_CONTEXT.getStackTrace());
00124         }
00125
00126         COMException(HRESULT hr, const char* file, int line)
00127          :      super(hr),
00128                 _context(CURRENT_CONTEXT),
00129                 _file(file), _line(line)
00130         {
00131                 LOG(toString());
00132                 LOG(CURRENT_CONTEXT.getStackTrace());
00133         }
00134
00135         COMException(HRESULT hr, const String& obj)
00136          :      super(hr),
00137                 _context(CURRENT_CONTEXT),
00138                 _file(NULL), _line(0)
00139         {
00140                 LOG(toString());
00141                 LOG(CURRENT_CONTEXT.getStackTrace());
00142         }
00143
00144         COMException(HRESULT hr, const String& obj, const char* file, int line)
00145          :      super(hr),
00146                 _context(CURRENT_CONTEXT),
00147                 _file(file), _line(line)
00148         {
00149                 LOG(toString());
00150                 LOG(CURRENT_CONTEXT.getStackTrace());
00151         }
00152
00153         String toString() const;
00154
00155         Context _context;
00156
00157         const char* _file;
00158         int _line;
00159 };
00160
00161 #define THROW_EXCEPTION(hr) throw COMException(hr, __FILE__, __LINE__)
00162 #define CHECKERROR(hr) ((void)(FAILED(hr)? THROW_EXCEPTION(hr): 0))
00163
00164
00165 #ifdef _NO_COMUTIL
00166
00167 inline void CheckError(HRESULT hr)
00168 {
00169         if (FAILED(hr))
00170                 throw COMException(hr);
00171 }
00172
00173 #endif
00174
00175
00177
00178 struct ComInit
00179 {
00180         ComInit()
00181         {
00182                 CHECKERROR(CoInitialize(0));
00183         }
00184
00185 #if (_WIN32_WINNT>=0x0400) || defined(_WIN32_DCOM)
00186         ComInit(DWORD flag)
00187         {
00188                 CHECKERROR(CoInitializeEx(0, flag));
00189         }
00190 #endif
00191
00192         ~ComInit()
00193         {
00194                 CoUninitialize();
00195         }
00196 };
00197
00198
00200
00201 struct OleInit
00202 {
00203         OleInit()
00204         {
00205                 CHECKERROR(OleInitialize(0));
00206         }
00207
00208         ~OleInit()
00209         {
00210                 OleUninitialize();
00211         }
00212 };
00213
00214
00216
00217 extern void HandleException(COMException& e, HWND hwnd);
00218
00219
00221
00222 struct CommonShellMalloc
00223 {
00224         CommonShellMalloc()
00225         {
00226                 _p = NULL;
00227         }
00228
00229         void init()
00230         {
00231                 if (!_p)
00232                         CHECKERROR(SHGetMalloc(&_p));
00233         }
00234
00235         ~CommonShellMalloc()
00236         {
00237                 if (_p)
00238                         _p->Release();
00239         }
00240
00241         operator IMalloc*()
00242         {
00243                 return _p;
00244         }
00245
00246         IMalloc* _p;
00247 };
00248
00249
00251
00252 struct ShellMalloc
00253 {
00254         ShellMalloc()
00255         {
00256                  // initialize s_cmn_shell_malloc
00257                 s_cmn_shell_malloc.init();
00258         }
00259
00260         IMalloc* operator->()
00261         {
00262                 return s_cmn_shell_malloc;
00263         }
00264
00265         static CommonShellMalloc s_cmn_shell_malloc;
00266 };
00267
00268
00270
00271 template<typename T> struct SShellPtr
00272 {
00273         ~SShellPtr()
00274         {
00275                 _malloc->Free(_p);
00276         }
00277
00278         T* operator->()
00279         {
00280                 return _p;
00281         }
00282
00283         T const* operator->() const
00284         {
00285                 return _p;
00286         }
00287
00288         operator T const *() const
00289         {
00290                 return _p;
00291         }
00292
00293         const T& operator*() const
00294         {
00295                 return *_p;
00296         }
00297
00298         T& operator*()
00299         {
00300                 return *_p;
00301         }
00302
00303 protected:
00304         SShellPtr()
00305          :      _p(0)
00306         {
00307         }
00308
00309         SShellPtr(T* p)
00310          :      _p(p)
00311         {
00312         }
00313
00314         void Free()
00315         {
00316                 _malloc->Free(_p);
00317                 _p = NULL;
00318         }
00319
00320         T* _p;
00321         mutable ShellMalloc _malloc;    // IMalloc memory management object
00322
00323 private:
00324          // disallow copying of SShellPtr objects
00325         SShellPtr(const SShellPtr&) {}
00326         void operator=(SShellPtr const&) {}
00327 };
00328
00329
00331
00332 template<typename T> struct SIfacePtr
00333 {
00334         SIfacePtr()
00335          :      _p(0)
00336         {
00337         }
00338
00339         SIfacePtr(T* p)
00340          :      _p(p)
00341         {
00342                 if (p)
00343                         p->AddRef();
00344         }
00345
00346         SIfacePtr(IUnknown* unknown, REFIID riid)
00347         {
00348                 CHECKERROR(unknown->QueryInterface(riid, (LPVOID*)&_p));
00349         }
00350
00351         ~SIfacePtr()
00352         {
00353                 Free();
00354         }
00355
00356         T* operator->()
00357         {
00358                 return _p;
00359         }
00360
00361         const T* operator->() const
00362         {
00363                 return _p;
00364         }
00365
00366 /* not GCC compatible
00367         operator const T*() const
00368         {
00369                 return _p;
00370         } */
00371
00372         operator T*()
00373         {
00374                 return _p;
00375         }
00376
00377         T** operator&()
00378         {
00379                 return &_p;
00380         }
00381
00382         bool empty() const      //NOTE: GCC seems not to work correctly when defining operator bool() AND operator T*() at one time
00383         {
00384                 return !_p;
00385         }
00386
00387         SIfacePtr& operator=(T* p)
00388         {
00389                 Free();
00390
00391                 if (p) {
00392                         p->AddRef();
00393                         _p = p;
00394                 }
00395
00396                 return *this;
00397         }
00398
00399         void operator=(SIfacePtr const& o)
00400         {
00401                 T* h = _p;
00402
00403                 if (o._p)
00404                         o._p->AddRef();
00405
00406                 _p = o._p;
00407
00408                 if (h)
00409                         h->Release();
00410         }
00411
00412         HRESULT CreateInstance(REFIID clsid, REFIID riid)
00413         {
00414                 return CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, riid, (LPVOID*)&_p);
00415         }
00416
00417         template<typename I> HRESULT QueryInterface(REFIID riid, I* p)
00418         {
00419                 return _p->QueryInterface(riid, (LPVOID*)p);
00420         }
00421
00422         T* get()
00423         {
00424                 return _p;
00425         }
00426
00427         void Free()
00428         {
00429                 T* h = _p;
00430                 _p = NULL;
00431
00432                 if (h)
00433                         h->Release();
00434         }
00435
00436 protected:
00437         SIfacePtr(const SIfacePtr& o)
00438          :      _p(o._p)
00439         {
00440                 if (_p)
00441                         _p->AddRef();
00442         }
00443
00444         T* _p;
00445 };
00446
00447
00448 struct NOVTABLE ComSrvObject    // NOVTABLE erlaubt, da protected Destruktor
00449 {
00450 protected:
00451         ComSrvObject() : _ref(1) {}
00452         virtual ~ComSrvObject() {}
00453
00454         ULONG   _ref;
00455 };
00456
00457 struct SimpleComObject : public ComSrvObject
00458 {
00459         ULONG IncRef() {return ++_ref;}
00460         ULONG DecRef() {ULONG ref=--_ref; if (!ref) {_ref++; delete this;} return ref;}
00461 };
00462
00463
00464  // server object interfaces
00465
00466 template<typename BASE> struct IComSrvQI : public BASE
00467 {
00468         IComSrvQI(REFIID uuid_base)
00469          :      _uuid_base(uuid_base)
00470         {
00471         }
00472
00473         STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv)
00474         {
00475                 *ppv = NULL;
00476
00477                 if (IsEqualIID(riid, _uuid_base) || IsEqualIID(riid, IID_IUnknown))
00478                         {*ppv=static_cast<BASE*>(this); this->AddRef(); return S_OK;}
00479
00480                 return E_NOINTERFACE;
00481         }
00482
00483 protected:
00484         IComSrvQI() {}
00485         virtual ~IComSrvQI() {}
00486
00487         REFIID  _uuid_base;
00488 };
00489
00490 template<> struct IComSrvQI<IUnknown> : public IUnknown
00491 {
00492         STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv)
00493         {
00494                 *ppv = NULL;
00495
00496                 if (IsEqualIID(riid, IID_IUnknown))
00497                         {*ppv=this; AddRef(); return S_OK;}
00498
00499                 return E_NOINTERFACE;
00500         }
00501
00502 protected:
00503         IComSrvQI<IUnknown>() {}
00504         virtual ~IComSrvQI<IUnknown>() {}
00505 };
00506
00507
00508 template<typename BASE, typename OBJ>
00509         class IComSrvBase : public IComSrvQI<BASE>
00510 {
00511         typedef IComSrvQI<BASE> super;
00512
00513 protected:
00514         IComSrvBase(REFIID uuid_base)
00515          :      super(uuid_base)
00516         {
00517         }
00518
00519 public:
00520         STDMETHODIMP_(ULONG) AddRef() {return static_cast<OBJ*>(this)->IncRef();}
00521         STDMETHODIMP_(ULONG) Release() {return static_cast<OBJ*>(this)->DecRef();}
00522 };
00523
00524
00525
00526 struct ShellFolder;
00527
00528
00530
00531 struct CommonDesktop
00532 {
00533         CommonDesktop()
00534         {
00535                 _desktop = 0;
00536         }
00537
00538         ~CommonDesktop();
00539
00540         void init();
00541
00542         operator ShellFolder&()
00543         {
00544                 return *_desktop;
00545         }
00546
00547 protected:
00548         ShellFolder* _desktop;
00549 };
00550
00551
00552 #ifndef _NO_COMUTIL     // _com_ptr available?
00553
00555 struct ShellFolder : public IShellFolderPtr     // IShellFolderPtr uses intrinsic extensions of the VC++ compiler.
00556 {
00557         typedef IShellFolderPtr super;
00558
00559         ShellFolder();  // desktop folder
00560         ShellFolder(IShellFolder* p);
00561         ShellFolder(IShellFolder* parent, LPCITEMIDLIST pidl);
00562         ShellFolder(LPCITEMIDLIST pidl);
00563
00564         void    attach(IShellFolder* parent, LPCITEMIDLIST pidl);
00565         String  get_name(LPCITEMIDLIST pidl=NULL, SHGDNF flags=SHGDN_NORMAL) const;
00566
00567         bool    empty() const {return !operator bool();}        //NOTE: see SIfacePtr::empty()
00568 };
00569
00570 #ifdef UNICODE
00571 #define IShellLinkPtr IShellLinkWPtr
00572 #else
00573 #define IShellLinkPtr IShellLinkAPtr
00574 #endif
00575
00577 struct ShellLinkPtr : public IShellLinkPtr
00578 {
00579         typedef IShellLinkPtr super;
00580
00581         ShellLinkPtr(IShellLink* p)
00582          :      super(p)
00583         {
00584                 p->AddRef();
00585         }
00586
00587         bool    empty() const {return !operator bool();}        //NOTE: see SIfacePtr::empty()
00588 };
00589
00590 #else // _com_ptr not available -> use SIfacePtr
00591
00593 struct ShellFolder : public SIfacePtr<IShellFolder>
00594 {
00595         typedef SIfacePtr<IShellFolder> super;
00596
00597         ShellFolder();
00598         ShellFolder(IShellFolder* p);
00599         ShellFolder(IShellFolder* parent, LPCITEMIDLIST pidl);
00600         ShellFolder(LPCITEMIDLIST pidl);
00601
00602         void    attach(IShellFolder* parent, LPCITEMIDLIST pidl);
00603         String  get_name(LPCITEMIDLIST pidl, SHGDNF flags=SHGDN_NORMAL) const;
00604 };
00605
00607 struct ShellLinkPtr : public SIfacePtr<IShellLink>
00608 {
00609         typedef SIfacePtr<IShellLink> super;
00610
00611         ShellLinkPtr(IShellLink* p)
00612          :      super(p)
00613         {
00614                 _p->AddRef();
00615         }
00616
00617 };
00618
00619 #endif
00620
00621
00622 extern ShellFolder& GetDesktopFolder();
00623
00624
00625 #ifdef UNICODE
00626 #define path_from_pidl path_from_pidlW
00627 #else
00628 #define path_from_pidl path_from_pidlA
00629 #endif
00630
00631 extern HRESULT path_from_pidlA(IShellFolder* folder, LPCITEMIDLIST pidl, LPSTR buffer, int len);
00632 extern HRESULT path_from_pidlW(IShellFolder* folder, LPCITEMIDLIST pidl, LPWSTR buffer, int len);
00633 extern HRESULT name_from_pidl(IShellFolder* folder, LPCITEMIDLIST pidl, LPTSTR buffer, int len, SHGDNF flags);
00634
00635
00636  // ILGetSize() was missing in previous versions of MinGW and is not exported from shell32.dll on Windows 2000.
00637 extern "C" UINT ILGetSize_local(LPCITEMIDLIST pidl);
00638 #define ILGetSize ILGetSize_local
00639
00640 #if 0
00641 #ifdef UNICODE          // CFSTR_FILENAME was defined wrong in previous versions of MinGW.
00642 #define CFSTR_FILENAMEW TEXT("FileNameW")
00643 #undef CFSTR_FILENAME
00644 #define CFSTR_FILENAME CFSTR_FILENAMEW
00645 #endif
00646 #endif
00647
00648
00650
00651 struct ShellPath : public SShellPtr<ITEMIDLIST>
00652 {
00653         typedef SShellPtr<ITEMIDLIST> super;
00654
00655         ShellPath()
00656         {
00657         }
00658
00659         ShellPath(IShellFolder* folder, LPCWSTR path)
00660         {
00661                 CONTEXT("ShellPath::ShellPath(IShellFolder*, LPCWSTR)");
00662
00663                 if (path)
00664                         CHECKERROR(folder->ParseDisplayName(0, NULL, (LPOLESTR)path, NULL, &_p, NULL));
00665                 else
00666                         _p = NULL;
00667         }
00668
00669         ShellPath(LPCWSTR path)
00670         {
00671                 OBJ_CONTEXT("ShellPath::ShellPath(LPCWSTR)", path);
00672
00673                 if (path)
00674                         CHECKERROR(GetDesktopFolder()->ParseDisplayName(0, NULL, (LPOLESTR)path, NULL, &_p, NULL));
00675                 else
00676                         _p = NULL;
00677         }
00678
00679         ShellPath(IShellFolder* folder, LPCSTR path)
00680         {
00681                 CONTEXT("ShellPath::ShellPath(IShellFolder*, LPCSTR)");
00682
00683                 WCHAR b[MAX_PATH];
00684
00685                 if (path) {
00686                         MultiByteToWideChar(CP_ACP, 0, path, -1, b, COUNTOF(b));
00687                         CHECKERROR(folder->ParseDisplayName(0, NULL, b, NULL, &_p, NULL));
00688                 } else
00689                         _p = NULL;
00690         }
00691
00692         ShellPath(LPCSTR path)
00693         {
00694                 CONTEXT("ShellPath::ShellPath(LPCSTR)");
00695
00696                 WCHAR b[MAX_PATH];
00697
00698                 if (path) {
00699                         MultiByteToWideChar(CP_ACP, 0, path, -1, b, COUNTOF(b));
00700                         CHECKERROR(GetDesktopFolder()->ParseDisplayName(0, NULL, b, NULL, &_p, NULL));
00701                 } else
00702                         _p = NULL;
00703         }
00704
00705         ShellPath(const ShellPath& o)
00706          :      super(NULL)
00707         {
00708                 //CONTEXT("ShellPath::ShellPath(const ShellPath&)");
00709
00710                 if (o._p) {
00711                         int l = ILGetSize(o._p);
00712                         _p = (ITEMIDLIST*) _malloc->Alloc(l);
00713                         if (_p) memcpy(_p, o._p, l);
00714                 }
00715         }
00716
00717         explicit ShellPath(LPITEMIDLIST p)
00718          :      super(p)
00719         {
00720         }
00721
00722         ShellPath(LPCITEMIDLIST p)
00723         {
00724                 //CONTEXT("ShellPath::ShellPath(LPCITEMIDLIST)");
00725
00726                 if (p) {
00727                         int l = ILGetSize(p);
00728                         _p = (ITEMIDLIST*) _malloc->Alloc(l);
00729                         if (_p) memcpy(_p, p, l);
00730                 }
00731         }
00732
00733         void operator=(const ShellPath& o)
00734         {
00735                 //CONTEXT("ShellPath::operator=(const ShellPath&)");
00736
00737                 ITEMIDLIST* h = _p;
00738
00739                 if (o._p) {
00740                         int l = ILGetSize(o._p);
00741
00742                         _p = (ITEMIDLIST*) _malloc->Alloc(l);
00743                         if (_p) memcpy(_p, o._p, l);
00744                 }
00745                 else
00746                         _p = NULL;
00747
00748                 _malloc->Free(h);
00749         }
00750
00751         void operator=(ITEMIDLIST* p)
00752         {
00753                 //CONTEXT("ShellPath::operator=(ITEMIDLIST*)");
00754
00755                 ITEMIDLIST* h = _p;
00756
00757                 if (p) {
00758                         int l = ILGetSize(p);
00759                         _p = (ITEMIDLIST*) _malloc->Alloc(l);
00760                         if (_p) memcpy(_p, p, l);
00761                 }
00762                 else
00763                         _p = NULL;
00764
00765                 _malloc->Free(h);
00766         }
00767
00768         void operator=(const SHITEMID& o)
00769         {
00770                 ITEMIDLIST* h = _p;
00771
00772                 LPBYTE p = (LPBYTE)_malloc->Alloc(o.cb+2);
00773                 if (p) *(PWORD)((LPBYTE)memcpy(p, &o, o.cb)+o.cb) = 0;
00774                 _p = (ITEMIDLIST*)p;
00775
00776                 _malloc->Free(h);
00777         }
00778
00779         void operator+=(const SHITEMID& o)
00780         {
00781                 int l0 = ILGetSize(_p);
00782                 LPBYTE p = (LPBYTE)_malloc->Alloc(l0+o.cb);
00783                 int l = l0 - 2;
00784
00785                 if (p) {
00786                         memcpy(p, _p, l);
00787                         *(PWORD)((LPBYTE)memcpy(p+l, &o, o.cb)+o.cb) = 0;
00788                 }
00789
00790                 _malloc->Free(_p);
00791                 _p = (ITEMIDLIST*)p;
00792         }
00793
00794         void assign(LPCITEMIDLIST pidl, size_t size)
00795         {
00796                 //CONTEXT("ShellPath::assign(LPCITEMIDLIST, size_t)");
00797
00798                 ITEMIDLIST* h = _p;
00799
00800                 _p = (ITEMIDLIST*) _malloc->Alloc(size+sizeof(USHORT/*SHITEMID::cb*/));
00801
00802                 if (_p) {
00803                         memcpy(_p, pidl, size);
00804                         ((ITEMIDLIST*)((LPBYTE)_p+size))->mkid.cb = 0; // terminator
00805                 }
00806
00807                 _malloc->Free(h);
00808         }
00809
00810         void assign(LPCITEMIDLIST pidl)
00811         {
00812                 //CONTEXT("ShellPath::assign(LPCITEMIDLIST)");
00813
00814                 ITEMIDLIST* h = _p;
00815
00816                 if (pidl) {
00817                         int l = ILGetSize(pidl);
00818                         _p = (ITEMIDLIST*) _malloc->Alloc(l);
00819                         if (_p) memcpy(_p, pidl, l);
00820                 } else
00821                         _p = NULL;
00822
00823                 _malloc->Free(h);
00824         }
00825
00826         void split(ShellPath& parent, ShellPath& obj) const;
00827
00828         void GetUIObjectOf(REFIID riid, LPVOID* ppvOut, HWND hWnd=0, ShellFolder& sf=GetDesktopFolder());
00829
00830         ShellFolder get_folder()
00831         {
00832                 return ShellFolder(_p);
00833         }
00834
00835         ShellFolder get_folder(IShellFolder* parent)
00836         {
00837                 CONTEXT("ShellPath::get_folder()");
00838                 return ShellFolder(parent, _p);
00839         }
00840
00841          // convert an item id list from relative to absolute (=relative to the desktop) format
00842         ShellPath create_absolute_pidl(LPCITEMIDLIST parent_pidl) const;
00843 };
00844
00845
00846 #if defined(__WINE__) && defined(NONAMELESSUNION)       // Wine doesn't know of unnamed union members and uses some macros instead.
00847 #define UNION_MEMBER(x) DUMMYUNIONNAME.##x
00848 #else
00849 #define UNION_MEMBER(x) x
00850 #endif
00851
00852
00853  // encapsulation of STRRET structure for easy string retrieval with conversion
00854
00855 #ifdef UNICODE
00856 #define StrRet StrRetW
00857 //#define       tcscpyn wcscpyn
00858 #else
00859 #define StrRet StrRetA
00860 //#define       tcscpyn strcpyn
00861 #endif
00862
00863 //extern LPSTR strcpyn(LPSTR dest, LPCSTR source, size_t count);
00864 //extern LPWSTR wcscpyn(LPWSTR dest, LPCWSTR source, size_t count);
00865
00867 struct StrRetA : public STRRET
00868 {
00869         ~StrRetA()
00870         {
00871                 if (uType == STRRET_WSTR)
00872                         ShellMalloc()->Free(pOleStr);
00873         }
00874
00875         void GetString(const SHITEMID& shiid, LPSTR b, int l)
00876         {
00877                 switch(uType) {
00878                   case STRRET_WSTR:
00879                         WideCharToMultiByte(CP_ACP, 0, UNION_MEMBER(pOleStr), -1, b, l, NULL, NULL);
00880                         break;
00881
00882                   case STRRET_OFFSET:
00883                         lstrcpynA(b, (LPCSTR)&shiid+UNION_MEMBER(uOffset), l);
00884                         break;
00885
00886                   case STRRET_CSTR:
00887                         lstrcpynA(b, UNION_MEMBER(cStr), l);
00888                 }
00889         }
00890 };
00891
00893 struct StrRetW : public STRRET
00894 {
00895         ~StrRetW()
00896         {
00897                 if (uType == STRRET_WSTR)
00898                         ShellMalloc()->Free(pOleStr);
00899         }
00900
00901         void GetString(const SHITEMID& shiid, LPWSTR b, int l)
00902         {
00903                 switch(uType) {
00904                   case STRRET_WSTR:
00905                         lstrcpynW(b, UNION_MEMBER(pOleStr), l);
00906                         break;
00907
00908                   case STRRET_OFFSET:
00909                         MultiByteToWideChar(CP_ACP, 0, (LPCSTR)&shiid+UNION_MEMBER(uOffset), -1, b, l);
00910                         break;
00911
00912                   case STRRET_CSTR:
00913                         MultiByteToWideChar(CP_ACP, 0, UNION_MEMBER(cStr), -1, b, l);
00914                 }
00915         }
00916 };
00917
00918
00920 class FileSysShellPath : public ShellPath
00921 {
00922         TCHAR   _fullpath[MAX_PATH];
00923
00924 protected:
00925         FileSysShellPath() {_fullpath[0] = '\0';}
00926
00927 public:
00928         FileSysShellPath(const ShellPath& o) : ShellPath(o) {_fullpath[0] = '\0';}
00929
00930         operator LPCTSTR() {if (!SHGetPathFromIDList(_p, _fullpath)) return NULL; return _fullpath;}
00931 };
00932
00933
00935 struct FolderBrowser : public FileSysShellPath
00936 {
00937         FolderBrowser(HWND owner, UINT flags, LPCTSTR title, LPCITEMIDLIST root=0)
00938         {
00939                 _displayname[0] = '\0';
00940                 _browseinfo.hwndOwner = owner;
00941                 _browseinfo.pidlRoot = root;
00942                 _browseinfo.pszDisplayName = _displayname;
00943                 _browseinfo.lpszTitle = title;
00944                 _browseinfo.ulFlags = flags;
00945                 _browseinfo.lpfn = 0;
00946                 _browseinfo.lParam = 0;
00947                 _browseinfo.iImage = 0;
00948
00949                 _p = SHBrowseForFolder(&_browseinfo);
00950         }
00951
00952         LPCTSTR GetDisplayName()
00953         {
00954                 return _displayname;
00955         }
00956
00957         bool IsOK()
00958         {
00959                 return _p != 0;
00960         }
00961
00962 private:
00963         BROWSEINFO _browseinfo;
00964         TCHAR   _displayname[MAX_PATH];
00965 };
00966
00967
00969 struct SpecialFolderPath : public ShellPath
00970 {
00971         SpecialFolderPath(int folder, HWND hwnd)
00972         {
00973                 HRESULT hr = SHGetSpecialFolderLocation(hwnd, folder, &_p);
00974                 CHECKERROR(hr);
00975         }
00976 };
00977
00979 struct DesktopFolderPath : public SpecialFolderPath
00980 {
00981         DesktopFolderPath()
00982          :      SpecialFolderPath(CSIDL_DESKTOP, 0)
00983         {
00984         }
00985 };
00986
00988 struct SpecialFolder : public ShellFolder
00989 {
00990         SpecialFolder(int folder, HWND hwnd)
00991          :      ShellFolder(GetDesktopFolder(), SpecialFolderPath(folder, hwnd))
00992         {
00993         }
00994 };
00995
00997 struct DesktopFolder : public ShellFolder
00998 {
00999 };
01000
01001
01003 struct SpecialFolderFSPath
01004 {
01005         SpecialFolderFSPath(int folder/*e.g. CSIDL_DESKTOP*/, HWND hwnd);
01006
01007         operator LPCTSTR()
01008         {
01009                 return _fullpath;
01010         }
01011
01012 protected:
01013         TCHAR   _fullpath[MAX_PATH];
01014 };
01015
01016 /*
01018 struct SpecialFolderFSPath : public FileSysShellPath
01019 {
01020         SpecialFolderFSPath(int folder, HWND hwnd)
01021         {
01022                 CONTEXT("SpecialFolderFSPath::SpecialFolderFSPath()");
01023
01024                 HRESULT hr = SHGetSpecialFolderLocation(hwnd, folder, &_p);
01025                 CHECKERROR(hr);
01026         }
01027 };
01028 */
01029
01030
01032
01033 struct ShellItemEnumerator : public SIfacePtr<IEnumIDList>
01034 {
01035         ShellItemEnumerator(IShellFolder* folder, DWORD flags=SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN)
01036         {
01037                 CONTEXT("ShellItemEnumerator::ShellItemEnumerator()");
01038
01039                 CHECKERROR(folder->EnumObjects(0, flags, &_p));
01040         }
01041 };
01042
01043
01045 struct PIDList
01046 {
01047         PIDList()
01048         {
01049                 memset(&_stgm, 0, sizeof(STGMEDIUM));
01050         }
01051
01052         ~PIDList()
01053         {
01054                 if (_stgm.hGlobal) {
01055                         GlobalUnlock(_stgm.hGlobal);
01056                         ReleaseStgMedium(&_stgm);
01057                 }
01058         }
01059
01060         HRESULT GetData(IDataObject* selection)
01061         {
01062                 static UINT CF_IDLIST = RegisterClipboardFormat(CFSTR_SHELLIDLIST);
01063
01064                 FORMATETC fetc;
01065                 fetc.cfFormat = CF_IDLIST;
01066                 fetc.ptd = NULL;
01067                 fetc.dwAspect = DVASPECT_CONTENT;
01068                 fetc.lindex = -1;
01069                 fetc.tymed = TYMED_HGLOBAL;
01070
01071                 HRESULT hr = selection->QueryGetData(&fetc);
01072                 if (FAILED(hr))
01073                         return hr;
01074
01075                 hr = selection->GetData(&fetc, &_stgm);
01076                 if (FAILED(hr))
01077                         return hr;
01078
01079                 _pIDList = (LPIDA)GlobalLock(_stgm.hGlobal);
01080
01081                 return hr;
01082         }
01083
01084         operator LPIDA() {return _pIDList;}
01085
01086 protected:
01087         STGMEDIUM _stgm;
01088         LPIDA _pIDList;
01089 };
01090
01091
01092 struct CtxMenuInterfaces
01093 {
01094         CtxMenuInterfaces()
01095         {
01096                 reset();
01097         }
01098
01099         void    reset();
01100         bool    HandleMenuMsg(UINT nmsg, WPARAM wparam, LPARAM lparam);
01101         IContextMenu* query_interfaces(IContextMenu* pcm1);
01102
01103         IContextMenu2*  _pctxmenu2;
01104
01105 #ifndef __MINGW32__     // IContextMenu3 missing in MinGW (as of 6.2.2005)
01106         IContextMenu3*  _pctxmenu3;
01107 #endif
01108 };
01109
01110 template<typename BASE> struct ExtContextMenuHandlerT
01111  : public BASE
01112 {
01113         typedef BASE super;
01114
01115         ExtContextMenuHandlerT(HWND hwnd)
01116          :      super(hwnd)
01117         {
01118         }
01119
01120         template<typename PARA> ExtContextMenuHandlerT(HWND hwnd, const PARA& info)
01121          :      super(hwnd, info)
01122         {
01123         }
01124
01125         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
01126         {
01127                 switch(nmsg) {
01128                   case WM_DRAWITEM:
01129                   case WM_MEASUREITEM:
01130                         if (!wparam)    // Is the message menu-related?
01131                                 if (_cm_ifs.HandleMenuMsg(nmsg, wparam, lparam))
01132                                         return TRUE;
01133
01134                         break;
01135
01136                   case WM_INITMENUPOPUP:
01137                         if (_cm_ifs.HandleMenuMsg(nmsg, wparam, lparam))
01138                                 return 0;
01139
01140                         break;
01141
01142 #ifndef __MINGW32__     // IContextMenu3 missing in MinGW (as of 6.2.2005)
01143                   case WM_MENUCHAR:     // only supported by IContextMenu3
01144                    if (_cm_ifs._pctxmenu3) {
01145                            LRESULT lResult = 0;
01146
01147                            _cm_ifs._pctxmenu3->HandleMenuMsg2(nmsg, wparam, lparam, &lResult);
01148
01149                            return lResult;
01150                    }
01151
01152                    return 0;
01153 #endif
01154                 }
01155
01156                 return super::WndProc(nmsg, wparam, lparam);
01157         }
01158
01159 protected:
01160         CtxMenuInterfaces _cm_ifs;
01161 };
01162
01163
01164 extern HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParent, int cidl,
01165                                                                                 LPCITEMIDLIST* ppidl, int x, int y, CtxMenuInterfaces& cm_ifs);


ROS Explorer: shellfs.cpp File Reference

  • File List
  • File Members
shell

shellfs.cpp File Reference

#include <precomp.h>
#include <shlwapi.h>

Include dependency graph for shellfs.cpp:

Go to the source code of this file.

Defines

#define FETCH_ITEM_COUNT 32

Define Documentation

#define FETCH_ITEM_COUNT 32

Referenced by ShellDirectory::read_directory().


ROS Explorer: shellfs.cpp Source File

  • File List
  • File Members
shell

shellfs.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // shellfs.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 //#include "shellfs.h"
00032 //#include "winfs.h"
00033
00034 #include <shlwapi.h>
00035
00036
00037 bool ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA* pw32fdata, BY_HANDLE_FILE_INFORMATION* pbhfi, bool do_access)
00038 {
00039         CONTEXT("ShellDirectory::fill_w32fdata_shell()");
00040
00041         bool bhfi_valid = false;
00042
00043         if (do_access && !( (attribs&SFGAO_FILESYSTEM) && SUCCEEDED(
00044                                 SHGetDataFromIDList(_folder, pidl, SHGDFIL_FINDDATA, pw32fdata, sizeof(WIN32_FIND_DATA))) )) {
00045                 WIN32_FILE_ATTRIBUTE_DATA fad;
00046                 IDataObject* pDataObj;
00047
00048                 STGMEDIUM medium = {0, {0}, 0};
00049                 FORMATETC fmt = {g_Globals._cfStrFName, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
00050
00051                 HRESULT hr = _folder->GetUIObjectOf(0, 1, &pidl, IID_IDataObject, 0, (LPVOID*)&pDataObj);
00052
00053                 if (SUCCEEDED(hr)) {
00054                         hr = pDataObj->GetData(&fmt, &medium);
00055
00056                         pDataObj->Release();
00057
00058                         if (SUCCEEDED(hr)) {
00059                                 LPCTSTR path = (LPCTSTR)GlobalLock(medium.UNION_MEMBER(hGlobal));
00060
00061                                 if (path) {
00062                                          // fill with drive names "C:", ...
00063                                         assert(_tcslen(path) < GlobalSize(medium.UNION_MEMBER(hGlobal)));
00064                                         _tcscpy(pw32fdata->cFileName, path);
00065
00066                                         UINT sem_org = SetErrorMode(SEM_FAILCRITICALERRORS);
00067
00068                                         if (GetFileAttributesEx(path, GetFileExInfoStandard, &fad)) {
00069                                                 pw32fdata->dwFileAttributes = fad.dwFileAttributes;
00070                                                 pw32fdata->ftCreationTime = fad.ftCreationTime;
00071                                                 pw32fdata->ftLastAccessTime = fad.ftLastAccessTime;
00072                                                 pw32fdata->ftLastWriteTime = fad.ftLastWriteTime;
00073
00074                                                 if (!(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
00075                                                         pw32fdata->nFileSizeLow = fad.nFileSizeLow;
00076                                                         pw32fdata->nFileSizeHigh = fad.nFileSizeHigh;
00077                                                 }
00078                                         }
00079
00080                                         HANDLE hFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
00081                                                                                                 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
00082
00083                                         if (hFile != INVALID_HANDLE_VALUE) {
00084                                                 if (GetFileInformationByHandle(hFile, pbhfi))
00085                                                         bhfi_valid = true;
00086
00087                                                 CloseHandle(hFile);
00088                                         }
00089
00090                                         SetErrorMode(sem_org);
00091
00092                                         GlobalUnlock(medium.UNION_MEMBER(hGlobal));
00093                                         GlobalFree(medium.UNION_MEMBER(hGlobal));
00094                                 }
00095                         }
00096                 }
00097         }
00098
00099         if (!do_access || !(attribs&SFGAO_FILESYSTEM))  // Archiv files should not be displayed as folders in explorer view.
00100                 if (attribs & (SFGAO_FOLDER|SFGAO_HASSUBFOLDER))
00101                         pw32fdata->dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00102
00103         if (attribs & SFGAO_READONLY)
00104                 pw32fdata->dwFileAttributes |= FILE_ATTRIBUTE_READONLY;
00105
00106         if (attribs & SFGAO_COMPRESSED)
00107                 pw32fdata->dwFileAttributes |= FILE_ATTRIBUTE_COMPRESSED;
00108
00109         return bhfi_valid;
00110 }
00111
00112
00113 ShellPath ShellEntry::create_absolute_pidl() const
00114 {
00115         CONTEXT("ShellEntry::create_absolute_pidl()");
00116
00117         if (_up)
00118                 if (_up->_etype == ET_SHELL) {
00119                         ShellDirectory* dir = static_cast<ShellDirectory*>(_up);
00120
00121                         if (dir->_pidl->mkid.cb)        // Caching of absolute PIDLs could enhance performance.
00122                                 return _pidl.create_absolute_pidl(dir->create_absolute_pidl());
00123                 } else
00124                         return _pidl.create_absolute_pidl(_up->create_absolute_pidl());
00125
00126         return _pidl;
00127 }
00128
00129
00130  // get full path of a shell entry
00131 bool ShellEntry::get_path(PTSTR path, size_t path_count) const
00132 {
00133         if (!path || path_count==0)
00134                 return false;
00135 /*
00136         path[0] = TEXT('\0');
00137
00138         if (FAILED(path_from_pidl(get_parent_folder(), &*_pidl, path, path_count)))
00139                 return false;
00140 */
00141         FileSysShellPath fs_path(create_absolute_pidl());
00142         LPCTSTR ret = fs_path;
00143
00144         if (ret) {
00145                 lstrcpyn(path, ret, path_count);
00146                 return true;
00147         } else
00148                 return false;
00149 }
00150
00151
00152  // get full path of a shell folder
00153 bool ShellDirectory::get_path(PTSTR path, size_t path_count) const
00154 {
00155         CONTEXT("ShellDirectory::get_path()");
00156
00157         if (!path || path_count==0)
00158                 return false;
00159
00160         path[0] = TEXT('\0');
00161
00162         if (_folder.empty())
00163                 return false;
00164
00165         SFGAOF attribs = SFGAO_FILESYSTEM;
00166
00167         if (FAILED(const_cast<ShellFolder&>(_folder)->GetAttributesOf(1, (LPCITEMIDLIST*)&_pidl, &attribs)))
00168                 return false;
00169
00170         if (!(attribs & SFGAO_FILESYSTEM))
00171                 return false;
00172
00173         if (FAILED(path_from_pidl(get_parent_folder(), &*_pidl, path, path_count)))
00174                 return false;
00175
00176         return true;
00177 }
00178
00179
00180 BOOL ShellEntry::launch_entry(HWND hwnd, UINT nCmdShow)
00181 {
00182         CONTEXT("ShellEntry::launch_entry()");
00183
00184         SHELLEXECUTEINFO shexinfo;
00185
00186         shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
00187         shexinfo.fMask = SEE_MASK_INVOKEIDLIST; // SEE_MASK_IDLIST is also possible.
00188         shexinfo.hwnd = hwnd;
00189         shexinfo.lpVerb = NULL;
00190         shexinfo.lpFile = NULL;
00191         shexinfo.lpParameters = NULL;
00192         shexinfo.lpDirectory = NULL;
00193         shexinfo.nShow = nCmdShow;
00194
00195         ShellPath shell_path = create_absolute_pidl();
00196         shexinfo.lpIDList = &*shell_path;
00197
00198          // add PIDL to the recent file list
00199         SHAddToRecentDocs(SHARD_PIDL, shexinfo.lpIDList);
00200
00201         BOOL ret = TRUE;
00202
00203         if (!ShellExecuteEx(&shexinfo)) {
00204                 display_error(hwnd, GetLastError());
00205                 ret = FALSE;
00206         }
00207
00208         return ret;
00209 }
00210
00211
00212 HRESULT ShellEntry::do_context_menu(HWND hwnd, LPPOINT pptScreen, CtxMenuInterfaces& cm_ifs)
00213 {
00214         ShellDirectory* dir = static_cast<ShellDirectory*>(_up);
00215
00216         ShellFolder folder = dir? dir->_folder: GetDesktopFolder();
00217         LPCITEMIDLIST pidl = _pidl;
00218
00219         return ShellFolderContextMenu(folder, hwnd, 1, &pidl, pptScreen->x, pptScreen->y, cm_ifs);
00220 }
00221
00222
00223 HRESULT ShellEntry::GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut)
00224 {
00225         LPCITEMIDLIST pidl = _pidl;
00226
00227         return get_parent_folder()->GetUIObjectOf(hWnd, 1, &pidl, riid, NULL, ppvOut);
00228 }
00229
00230
00231 void ShellDirectory::read_directory(int scan_flags)
00232 {
00233         CONTEXT("ShellDirectory::read_directory()");
00234
00235         int level = _level + 1;
00236
00237         Entry* first_entry = NULL;
00238         Entry* last = NULL;
00239
00240         /*if (_folder.empty())
00241                 return;*/
00242
00243         TCHAR buffer[MAX_PATH];
00244
00245         if ((scan_flags&SCAN_FILESYSTEM) && get_path(buffer, COUNTOF(buffer)) && _tcsncmp(buffer,TEXT("::{"),3)) {
00246                 Entry* entry = NULL;    // eliminate useless GCC warning by initializing entry
00247
00248                 LPTSTR p = buffer + _tcslen(buffer);
00249
00250                 // TODO FIXME - this can overflow
00251                 lstrcpy(p, TEXT("\\*"));
00252
00253                 WIN32_FIND_DATA w32fd;
00254                 HANDLE hFind = FindFirstFile(buffer, &w32fd);
00255
00256                 if (hFind != INVALID_HANDLE_VALUE) {
00257                         do {
00258                                  // ignore hidden files (usefull in the start menu)
00259                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
00260                                         continue;
00261
00262                                  // ignore directory entries "." and ".."
00263                                 if ((w32fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) &&
00264                                         w32fd.cFileName[0]==TEXT('.') &&
00265                                         (w32fd.cFileName[1]==TEXT('\0') ||
00266                                         (w32fd.cFileName[1]==TEXT('.') && w32fd.cFileName[2]==TEXT('\0'))))
00267                                         continue;
00268
00269                                 lstrcpy(p+1, w32fd.cFileName);
00270
00271                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00272                                         entry = new WinDirectory(this, buffer);
00273                                 else
00274                                         entry = new WinEntry(this);
00275
00276                                 if (!first_entry)
00277                                         first_entry = entry;
00278
00279                                 if (last)
00280                                         last->_next = entry;
00281
00282                                 memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00283
00284                                 entry->_level = level;
00285
00286                                 if (scan_flags & SCAN_DO_ACCESS) {
00287                                         HANDLE hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
00288                                                                                                 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
00289
00290                                         if (hFile != INVALID_HANDLE_VALUE) {
00291                                                 if (GetFileInformationByHandle(hFile, &entry->_bhfi))
00292                                                         entry->_bhfi_valid = true;
00293
00294                                                 if (ScanNTFSStreams(entry, hFile))
00295                                                         entry->_scanned = true; // There exist named NTFS sub-streams in this file.
00296
00297                                                 CloseHandle(hFile);
00298                                         }
00299                                 }
00300
00301                                  // set file type name
00302                                 LPCTSTR ext = g_Globals._ftype_mgr.set_type(entry);
00303
00304                                 DWORD attribs = SFGAO_FILESYSTEM;
00305
00306                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00307                                         attribs |= SFGAO_FOLDER;
00308
00309                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
00310                                         attribs |= SFGAO_READONLY;
00311
00312                                 //if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
00313                                 //      attribs |= SFGAO_HIDDEN;
00314
00315                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_COMPRESSED)
00316                                         attribs |= SFGAO_COMPRESSED;
00317
00318                                 if (ext && !_tcsicmp(ext, _T(".lnk"))) {
00319                                         attribs |= SFGAO_LINK;
00320                                         w32fd.dwFileAttributes |= ATTRIBUTE_SYMBOLIC_LINK;
00321                                 }
00322
00323                                 entry->_shell_attribs = attribs;
00324
00325                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00326                                         entry->_icon_id = ICID_FOLDER;
00327 /*                              else if (scan_flags & SCAN_EXTRACT_ICONS)
00328                                         entry->safe_extract_icon(large_icons);
00329 */
00330                                 last = entry;
00331                         } while(FindNextFile(hFind, &w32fd));
00332
00333                         FindClose(hFind);
00334                 }
00335
00336         } else { // !SCAN_FILESYSTEM
00337
00338                 ShellItemEnumerator enumerator(_folder, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE);
00339
00340                 TCHAR name[MAX_PATH];
00341                 HRESULT hr_next = S_OK;
00342
00343                 do {
00344 #define FETCH_ITEM_COUNT        32
00345                         LPITEMIDLIST pidls[FETCH_ITEM_COUNT];
00346                         ULONG cnt = 0;
00347
00348                         memset(pidls, 0, sizeof(pidls));
00349
00350                         hr_next = enumerator->Next(FETCH_ITEM_COUNT, pidls, &cnt);
00351
00352                         /* don't break yet now: Registry Explorer Plugin returns E_FAIL!
00353                         if (!SUCCEEDED(hr_next))
00354                                 break; */
00355
00356                         if (hr_next == S_FALSE)
00357                                 break;
00358
00359                         for(ULONG n=0; n<cnt; ++n) {
00360                                 WIN32_FIND_DATA w32fd;
00361                                 BY_HANDLE_FILE_INFORMATION bhfi;
00362                                 bool bhfi_valid = false;
00363
00364                                 memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00365
00366                                 SFGAOF attribs_before = ~SFGAO_READONLY & ~SFGAO_VALIDATE;
00367                                 SFGAOF attribs = attribs_before;
00368                                 HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs);
00369                                 bool removeable = false;
00370
00371                                 if (SUCCEEDED(hr) && attribs!=attribs_before) {
00372                                          // avoid accessing floppy drives when browsing "My Computer"
00373                                         if (attribs & SFGAO_REMOVABLE) {
00374                                                 attribs |= SFGAO_HASSUBFOLDER;
00375                                                 removeable = true;
00376                                         } else if (scan_flags & SCAN_DO_ACCESS) {
00377                                                 DWORD attribs2 = SFGAO_READONLY;
00378
00379                                                 HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs2);
00380
00381                                                 if (SUCCEEDED(hr))
00382                                                         attribs |= attribs2;
00383                                         }
00384                                 } else
00385                                         attribs = 0;
00386
00387                                 bhfi_valid = fill_w32fdata_shell(pidls[n], attribs, &w32fd, &bhfi,
00388                                                                                                  (scan_flags&SCAN_DO_ACCESS) && !removeable);
00389
00390                                 try {
00391                                         Entry* entry = NULL;    // eliminate useless GCC warning by initializing entry
00392
00393                                         if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00394                                                 entry = new ShellDirectory(this, pidls[n], _hwnd);
00395                                         else
00396                                                 entry = new ShellEntry(this, pidls[n]);
00397
00398                                         if (!first_entry)
00399                                                 first_entry = entry;
00400
00401                                         if (last)
00402                                                 last->_next = entry;
00403
00404                                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00405
00406                                         if (bhfi_valid)
00407                                                 memcpy(&entry->_bhfi, &bhfi, sizeof(BY_HANDLE_FILE_INFORMATION));
00408
00409                                         if (SUCCEEDED(name_from_pidl(_folder, pidls[n], name, COUNTOF(name), SHGDN_INFOLDER|0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/))) {
00410                                                 if (!entry->_data.cFileName[0])
00411                                                         _tcscpy(entry->_data.cFileName, name);
00412                                                 else if (_tcscmp(entry->_display_name, name))
00413                                                         entry->_display_name = _tcsdup(name);   // store display name separate from file name; sort display by file name
00414                                         }
00415
00416                                         if (attribs & SFGAO_LINK)
00417                                                 w32fd.dwFileAttributes |= ATTRIBUTE_SYMBOLIC_LINK;
00418
00419                                         entry->_level = level;
00420                                         entry->_shell_attribs = attribs;
00421                                         entry->_bhfi_valid = bhfi_valid;
00422
00423                                          // set file type name
00424                                         g_Globals._ftype_mgr.set_type(entry);
00425
00426                                          // get icons for files and virtual objects
00427                                         if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
00428                                                 !(attribs & SFGAO_FILESYSTEM)) {
00429 /*                                              if (scan_flags & SCAN_EXTRACT_ICONS)
00430                                                         entry->extract_icon(large_icons);
00431 */                                      } else if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00432                                                 entry->_icon_id = ICID_FOLDER;
00433                                         else
00434                                                 entry->_icon_id = ICID_NONE;    // don't try again later
00435
00436                                         last = entry;
00437                                 } catch(COMException& e) {
00438                                         HandleException(e, _hwnd);
00439                                 }
00440                         }
00441                 } while(SUCCEEDED(hr_next));
00442         }
00443
00444         if (last)
00445                 last->_next = NULL;
00446
00447         _down = first_entry;
00448         _scanned = true;
00449 }
00450
00451 const void* ShellDirectory::get_next_path_component(const void* p) const
00452 {
00453         LPITEMIDLIST pidl = (LPITEMIDLIST)p;
00454
00455         if (!pidl || !pidl->mkid.cb)
00456                 return NULL;
00457
00458          // go to next element
00459         pidl = (LPITEMIDLIST)((LPBYTE)pidl+pidl->mkid.cb);
00460
00461         return pidl;
00462 }
00463
00464 Entry* ShellDirectory::find_entry(const void* p)
00465 {
00466         LPITEMIDLIST pidl = (LPITEMIDLIST) p;
00467
00468          // handle special case of empty trailing id list entry
00469         if (!pidl->mkid.cb)
00470                 return this;
00471
00472         for(Entry*entry=_down; entry; entry=entry->_next)
00473                 if (entry->_etype == ET_SHELL) {
00474                         ShellEntry* se = static_cast<ShellEntry*>(entry);
00475
00476                         if (se->_pidl && se->_pidl->mkid.cb==pidl->mkid.cb && !memcmp(se->_pidl, pidl, se->_pidl->mkid.cb))
00477                                 return entry;
00478                 }
00479
00480         return NULL;
00481 }
00482
00483 int ShellDirectory::extract_icons(ICONCACHE_FLAGS flags)
00484 {
00485         int cnt = 0;
00486
00487         for(Entry*entry=_down; entry; entry=entry->_next)
00488                 if (entry->_icon_id == ICID_UNKNOWN) {
00489                         entry->_icon_id = entry->extract_icon(flags);
00490
00491                         if (entry->_icon_id != ICID_NONE)
00492                                 ++cnt;
00493                 }
00494
00495         return cnt;
00496 }


ROS Explorer: shellfs.h File Reference

  • File List
  • File Members
shell

shellfs.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | ShellEntry
shell file/directory entry More...
struct | ShellDirectory
shell folder entry More...


ROS Explorer: shellfs.h Source File

  • File List
  • File Members
shell

shellfs.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // shellfs.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00030 struct ShellEntry : public Entry
00031 {
00032         ShellEntry(Entry* parent, LPITEMIDLIST shell_path) : Entry(parent, ET_SHELL), _pidl(shell_path) {}
00033         ShellEntry(Entry* parent, const ShellPath& shell_path) : Entry(parent, ET_SHELL), _pidl(shell_path) {}
00034
00035         virtual bool            get_path(PTSTR path, size_t path_count) const;
00036         virtual ShellPath       create_absolute_pidl() const;
00037         virtual HRESULT         GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut);
00038         virtual BOOL            launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL);
00039         virtual HRESULT         do_context_menu(HWND hwnd, LPPOINT pptScreen, CtxMenuInterfaces& cm_ifs);
00040
00041         IShellFolder*           get_parent_folder() const;
00042
00043         ShellPath       _pidl;  // parent relative PIDL
00044
00045 protected:
00046         ShellEntry(LPITEMIDLIST shell_path) : Entry(ET_SHELL), _pidl(shell_path) {}
00047         ShellEntry(const ShellPath& shell_path) : Entry(ET_SHELL), _pidl(shell_path) {}
00048 };
00049
00050
00052 struct ShellDirectory : public ShellEntry, public Directory
00053 {
00054         ShellDirectory(ShellFolder& root_folder, const ShellPath& shell_path, HWND hwnd)
00055          :      ShellEntry(shell_path),
00056                 _folder(root_folder, shell_path),
00057                 _hwnd(hwnd)
00058         {
00059                 CONTEXT("ShellDirectory::ShellDirectory()");
00060
00061                 lstrcpy(_data.cFileName, root_folder.get_name(shell_path, SHGDN_FORADDRESSBAR));
00062                 _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
00063                 _shell_attribs = SFGAO_FOLDER;
00064
00065                 ShellFolder subfolder(root_folder, shell_path);
00066                 IShellFolder* pFolder = subfolder;
00067                 pFolder->AddRef();
00068                 _path = pFolder;
00069         }
00070
00071         explicit ShellDirectory(ShellDirectory* parent, LPITEMIDLIST shell_path, HWND hwnd)
00072          :      ShellEntry(parent, shell_path),
00073                 _folder(parent->_folder, shell_path),
00074                 _hwnd(hwnd)
00075         {
00076                 /* not neccessary - the caller will fill the info
00077                 lstrcpy(_data.cFileName, _folder.get_name(shell_path));
00078                 _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
00079                 _shell_attribs = SFGAO_FOLDER; */
00080
00081                 _folder->AddRef();
00082                 _path = _folder;
00083         }
00084
00085         ShellDirectory(const ShellDirectory& other)
00086          :      ShellEntry(other),
00087                 Directory(other),
00088                 _folder(other._folder),
00089                 _hwnd(other._hwnd)
00090         {
00091                 IShellFolder* pFolder = (IShellFolder*)_path;
00092                 pFolder->AddRef();
00093         }
00094
00095         ~ShellDirectory()
00096         {
00097                 IShellFolder* pFolder = (IShellFolder*)_path;
00098                 _path = NULL;
00099                 pFolder->Release();
00100         }
00101
00102         virtual void read_directory(int scan_flags=SCAN_ALL);
00103         virtual const void* get_next_path_component(const void*) const;
00104         virtual Entry* find_entry(const void*);
00105
00106         virtual bool get_path(PTSTR path, size_t path_count) const;
00107
00108         int     extract_icons(ICONCACHE_FLAGS flags);
00109
00110         ShellFolder _folder;
00111         HWND    _hwnd;
00112
00113 protected:
00114         bool    fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA*, BY_HANDLE_FILE_INFORMATION*, bool do_access=true);
00115 };
00116
00117
00118 inline IShellFolder* ShellEntry::get_parent_folder() const
00119 {
00120         if (_up)
00121                 return static_cast<ShellDirectory*>(_up)->_folder;
00122         else
00123                 return GetDesktopFolder();
00124 }


ROS Explorer: shelltests.cpp File Reference

  • File List
  • File Members
utility

shelltests.cpp File Reference

#include "utility.h"
#include "shellclasses.h"

Include dependency graph for shelltests.cpp:

Go to the source code of this file.

Functions

int main ()

Function Documentation

int main ( )

Definition at line 78 of file shelltests.cpp.

References GetDesktopFolder(), HWND, and FolderBrowser::IsOK().

00079 {
00080          // initialize COM
00081         ComInit usingCOM;
00082
00083
00084         HWND hwnd = 0;
00085
00086
00087         try {
00088
00089                  // example for retrieval of special folder paths
00090
00091                 SpecialFolderFSPath programs(CSIDL_PROGRAM_FILES, hwnd);
00092                 SpecialFolderFSPath autostart(CSIDL_STARTUP, hwnd);
00093
00094                 cout << "program files path = " << (LPCTSTR)programs << endl;
00095                 cout << "autostart folder path = " << (LPCTSTR)autostart << endl;
00096
00097                 cout << endl;
00098
00099
00100                  // example for enumerating shell namespace objects
00101
00102                 cout << "Desktop:\n";
00103                 dump_shell_namespace(GetDesktopFolder());
00104                 cout << endl;
00105
00106                 cout << "C:\\\n";
00107                 dump_shell_namespace(ShellPath("C:\\").get_folder());
00108                 cout << endl;
00109
00110
00111                  // example for calling a browser dialog for the whole desktop
00112
00113                 FolderBrowser desktop_browser(hwnd,
00114                                                                           BIF_RETURNONLYFSDIRS|BIF_EDITBOX|BIF_NEWDIALOGSTYLE,
00115                                                                           TEXT("Please select the path:"));
00116
00117                 if (desktop_browser.IsOK())
00118                         MessageBox(hwnd, desktop_browser, TEXT("Your selected path"), MB_OK);
00119
00120
00121                  // example for calling a rooted browser dialog
00122
00123                 ShellPath browseRoot("C:\\");
00124                 FolderBrowser rooted_browser(hwnd,
00125                                                                          BIF_RETURNONLYFSDIRS|BIF_EDITBOX|BIF_VALIDATE,
00126                                                                          TEXT("Please select the path:"),
00127                                                                          browseRoot);
00128
00129                 if (rooted_browser.IsOK())
00130                         MessageBox(hwnd, rooted_browser, TEXT("Your selected path"), MB_OK);
00131
00132         } catch(COMException& e) {
00133
00134                 //HandleException(e, hwnd);
00135                 cerr << e.ErrorMessage() << endl;
00136
00137         }
00138
00139         return 0;
00140 }

Here is the call graph for this function:


ROS Explorer: shelltests.cpp Source File

  • File List
  • File Members
utility

shelltests.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // shelltests.cpp
00022  //
00023  // Examples for usage of shellclasses.cpp, shellclasses.h
00024  //
00025  // Martin Fuchs, 20.07.2003
00026  //
00027
00028
00029 //#define WIN32_LEAN_AND_MEAN
00030 //#define WIN32_EXTRA_LEAN
00031 //#include <windows.h>
00032
00033 #include "utility.h" // for String
00034 #include "shellclasses.h"
00035
00036
00037 static void dump_shell_namespace(ShellFolder& folder)
00038 {
00039         ShellItemEnumerator enumerator(folder, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE);
00040
00041         LPITEMIDLIST pidl;
00042         HRESULT hr = S_OK;
00043
00044         do {
00045                 ULONG cnt = 0;
00046
00047                 HRESULT hr = enumerator->Next(1, &pidl, &cnt);
00048
00049                 if (!SUCCEEDED(hr))
00050                         break;
00051
00052                 if (hr == S_FALSE)      // no more entries?
00053                         break;
00054
00055                  if (pidl) {
00056                         ULONG attribs = -1;
00057
00058                         HRESULT hr = folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidl, &attribs);
00059
00060                         if (SUCCEEDED(hr)) {
00061                                 if (attribs == -1)
00062                                         attribs = 0;
00063
00064                                 const String& name = folder.get_name(pidl);
00065
00066                                 if (attribs & (SFGAO_FOLDER|SFGAO_HASSUBFOLDER))
00067                                         cout << "folder: ";
00068                                  else
00069                                         cout << "file: ";
00070
00071                                 cout << "\"" << name << "\"\n attribs=" << hex << attribs << endl;
00072                         }
00073                 }
00074         } while(SUCCEEDED(hr));
00075 }
00076
00077
00078 int main()
00079 {
00080          // initialize COM
00081         ComInit usingCOM;
00082
00083
00084         HWND hwnd = 0;
00085
00086
00087         try {
00088
00089                  // example for retrieval of special folder paths
00090
00091                 SpecialFolderFSPath programs(CSIDL_PROGRAM_FILES, hwnd);
00092                 SpecialFolderFSPath autostart(CSIDL_STARTUP, hwnd);
00093
00094                 cout << "program files path = " << (LPCTSTR)programs << endl;
00095                 cout << "autostart folder path = " << (LPCTSTR)autostart << endl;
00096
00097                 cout << endl;
00098
00099
00100                  // example for enumerating shell namespace objects
00101
00102                 cout << "Desktop:\n";
00103                 dump_shell_namespace(GetDesktopFolder());
00104                 cout << endl;
00105
00106                 cout << "C:\\\n";
00107                 dump_shell_namespace(ShellPath("C:\\").get_folder());
00108                 cout << endl;
00109
00110
00111                  // example for calling a browser dialog for the whole desktop
00112
00113                 FolderBrowser desktop_browser(hwnd,
00114                                                                           BIF_RETURNONLYFSDIRS|BIF_EDITBOX|BIF_NEWDIALOGSTYLE,
00115                                                                           TEXT("Please select the path:"));
00116
00117                 if (desktop_browser.IsOK())
00118                         MessageBox(hwnd, desktop_browser, TEXT("Your selected path"), MB_OK);
00119
00120
00121                  // example for calling a rooted browser dialog
00122
00123                 ShellPath browseRoot("C:\\");
00124                 FolderBrowser rooted_browser(hwnd,
00125                                                                          BIF_RETURNONLYFSDIRS|BIF_EDITBOX|BIF_VALIDATE,
00126                                                                          TEXT("Please select the path:"),
00127                                                                          browseRoot);
00128
00129                 if (rooted_browser.IsOK())
00130                         MessageBox(hwnd, rooted_browser, TEXT("Your selected path"), MB_OK);
00131
00132         } catch(COMException& e) {
00133
00134                 //HandleException(e, hwnd);
00135                 cerr << e.ErrorMessage() << endl;
00136
00137         }
00138
00139         return 0;
00140 }


ROS Explorer: splitpath.c File Reference

  • File List
  • File Members
utility

splitpath.c File Reference

#include "utility.h"

Include dependency graph for splitpath.c:

Go to the source code of this file.

Functions

void _splitpath (const CHAR *path, CHAR *drv, CHAR *dir, CHAR *name, CHAR *ext)

Function Documentation

void _splitpath | ( | const CHAR * | path,
 |  | CHAR * | drv,
 |  | CHAR * | dir,
 |  | CHAR * | name,
 |  | CHAR * | ext
 | ) |

Definition at line 78 of file splitpath.c.

00079 {
00080         const CHAR* end; /* end of processed string */
00081         const CHAR* p;   /* search pointer */
00082         const CHAR* s;   /* copy pointer */
00083
00084         /* extract drive name */
00085         if (path[0] && path[1]==':') {
00086                 if (drv) {
00087                         *drv++ = *path++;
00088                         *drv++ = *path++;
00089                         *drv = '\0';
00090                 }
00091         } else if (drv)
00092                 *drv = '\0';
00093
00094         /* search for end of string or stream separator */
00095         for(end=path; *end && *end!=':'; )
00096                 end++;
00097
00098         /* search for begin of file extension */
00099         for(p=end; p>path && *--p!='\\' && *p!='/'; )
00100                 if (*p == '.') {
00101                         end = p;
00102                         break;
00103                 }
00104
00105         if (ext)
00106                 for(s=end; (*ext=*s++); )
00107                         ext++;
00108
00109         /* search for end of directory name */
00110         for(p=end; p>path; )
00111                 if (*--p=='\\' || *p=='/') {
00112                         p++;
00113                         break;
00114                 }
00115
00116         if (name) {
00117                 for(s=p; s<end; )
00118                         *name++ = *s++;
00119
00120                 *name = '\0';
00121         }
00122
00123         if (dir) {
00124                 for(s=path; s<p; )
00125                         *dir++ = *s++;
00126
00127                 *dir = '\0';
00128         }
00129 }


ROS Explorer: splitpath.c Source File

  • File List
  • File Members
utility

splitpath.c

Go to the documentation of this file.
00001 /*
00002  * Copyright 2000 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019 #include "utility.h"
00020
00021 #ifdef UNICODE
00022
00023 void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext)
00024 {
00025         const WCHAR* end; /* end of processed string */
00026         const WCHAR* p;   /* search pointer */
00027         const WCHAR* s;   /* copy pointer */
00028
00029         /* extract drive name */
00030         if (path[0] && path[1]==':') {
00031                 if (drv) {
00032                         *drv++ = *path++;
00033                         *drv++ = *path++;
00034                         *drv = L'\0';
00035                 }
00036         } else if (drv)
00037                 *drv = L'\0';
00038
00039         /* search for end of string or stream separator */
00040         for(end=path; *end && *end!=L':'; )
00041                 end++;
00042
00043         /* search for begin of file extension */
00044         for(p=end; p>path && *--p!=L'\\' && *p!=L'/'; )
00045                 if (*p == L'.') {
00046                         end = p;
00047                         break;
00048                 }
00049
00050         if (ext)
00051                 for(s=end; *ext=*s++; )
00052                         ext++;
00053
00054         /* search for end of directory name */
00055         for(p=end; p>path; )
00056                 if (*--p=='\\' || *p=='/') {
00057                         p++;
00058                         break;
00059                 }
00060
00061         if (name) {
00062                 for(s=p; s<end; )
00063                         *name++ = *s++;
00064
00065                 *name = L'\0';
00066         }
00067
00068         if (dir) {
00069                 for(s=path; s<p; )
00070                         *dir++ = *s++;
00071
00072                 *dir = L'\0';
00073         }
00074 }
00075
00076 #else
00077
00078 void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext)
00079 {
00080         const CHAR* end; /* end of processed string */
00081         const CHAR* p;   /* search pointer */
00082         const CHAR* s;   /* copy pointer */
00083
00084         /* extract drive name */
00085         if (path[0] && path[1]==':') {
00086                 if (drv) {
00087                         *drv++ = *path++;
00088                         *drv++ = *path++;
00089                         *drv = '\0';
00090                 }
00091         } else if (drv)
00092                 *drv = '\0';
00093
00094         /* search for end of string or stream separator */
00095         for(end=path; *end && *end!=':'; )
00096                 end++;
00097
00098         /* search for begin of file extension */
00099         for(p=end; p>path && *--p!='\\' && *p!='/'; )
00100                 if (*p == '.') {
00101                         end = p;
00102                         break;
00103                 }
00104
00105         if (ext)
00106                 for(s=end; (*ext=*s++); )
00107                         ext++;
00108
00109         /* search for end of directory name */
00110         for(p=end; p>path; )
00111                 if (*--p=='\\' || *p=='/') {
00112                         p++;
00113                         break;
00114                 }
00115
00116         if (name) {
00117                 for(s=p; s<end; )
00118                         *name++ = *s++;
00119
00120                 *name = '\0';
00121         }
00122
00123         if (dir) {
00124                 for(s=path; s<p; )
00125                         *dir++ = *s++;
00126
00127                 *dir = '\0';
00128         }
00129 }
00130
00131 #endif
00132
00133 /*
00134 void main()     // test splipath()
00135 {
00136         TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
00137
00138         _tsplitpath(L"x\\y", drv, dir, name, ext);
00139         _tsplitpath(L"x\\", drv, dir, name, ext);
00140         _tsplitpath(L"\\x", drv, dir, name, ext);
00141         _tsplitpath(L"x", drv, dir, name, ext);
00142         _tsplitpath(L"", drv, dir, name, ext);
00143         _tsplitpath(L".x", drv, dir, name, ext);
00144         _tsplitpath(L":x", drv, dir, name, ext);
00145         _tsplitpath(L"a:x", drv, dir, name, ext);
00146         _tsplitpath(L"a.b:x", drv, dir, name, ext);
00147         _tsplitpath(L"W:\\/\\abc/Z:~", drv, dir, name, ext);
00148         _tsplitpath(L"abc.EFGH:12345", drv, dir, name, ext);
00149         _tsplitpath(L"C:/dos/command.com", drv, dir, name, ext);
00150 }
00151 */


ROS Explorer: startmenu.cpp File Reference

  • File List
  • File Members
taskbar

startmenu.cpp File Reference

#include <precomp.h>
#include "../resource.h"
#include "desktopbar.h"
#include "startmenu.h"
#include "../dialogs/searchprogram.h"
#include "../dialogs/settings.h"

Include dependency graph for startmenu.cpp:

Go to the source code of this file.

Defines

#define | SHELLPATH_CONTROL_PANEL TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}")
#define | SHELLPATH_PRINTERS TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}")
#define | SHELLPATH_NET_CONNECTIONS TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}")

Functions

int | GetStartMenuBtnTextWidth (HDC hdc, LPCTSTR title, HWND hwnd)
void | DrawStartMenuButton (HDC hdc, const RECT &rect, LPCTSTR title, const SMBtnInfo &btn, bool has_focus, bool pushed, bool large_icons)
void | ShowExitWindowsDialog (HWND hwndOwner)

Define Documentation

#define SHELLPATH_CONTROL_PANEL TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}")

Definition at line 44 of file startmenu.cpp.

Referenced by StartMenuHandler::Command().

#define SHELLPATH_NET_CONNECTIONS TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}")

Definition at line 46 of file startmenu.cpp.

Referenced by StartMenuHandler::Command().

#define SHELLPATH_PRINTERS TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}")

Definition at line 45 of file startmenu.cpp.

Referenced by StartMenuHandler::Command().

Function Documentation

void DrawStartMenuButton | ( | HDC | hdc,
 |  | const RECT & | rect,
 |  | LPCTSTR | title,
 |  | const SMBtnInfo & | btn,
 |  | bool | has_focus,
 |  | bool | pushed,
 |  | bool | large_icons
 | ) |

Definition at line 1367 of file startmenu.cpp.

Referenced by StartMenu::Paint(), and StartMenu::UpdateIcons().

01372 {
01373         UINT style = DFCS_BUTTONPUSH;
01374
01375         if (!btn._enabled)
01376                 style |= DFCS_INACTIVE;
01377
01378         POINT iconPos = {rect.left+2, (rect.top+rect.bottom-ICON_SIZE_Y)/2};
01379         RECT textRect = {rect.left+ICON_SIZE_X+4, rect.top+2, rect.right-4, rect.bottom-4};
01380
01381         if (pushed) {
01382                 style |= DFCS_PUSHED;
01383                 ++iconPos.x;            ++iconPos.y;
01384                 ++textRect.left;        ++textRect.top;
01385                 ++textRect.right;       ++textRect.bottom;
01386         }
01387
01388         int bk_color_idx = COLOR_BTNFACE;
01389         int text_color_idx = COLOR_BTNTEXT;
01390
01391         if (has_focus) {
01392                 bk_color_idx = COLOR_HIGHLIGHT;
01393                 text_color_idx = COLOR_HIGHLIGHTTEXT;
01394         }
01395
01396         COLORREF bk_color = GetSysColor(bk_color_idx);
01397         HBRUSH bk_brush = GetSysColorBrush(bk_color_idx);
01398
01399         if (title)
01400                 FillRect(hdc, &rect, bk_brush);
01401
01402         if (btn._icon_id > ICID_NONE)
01403                 g_Globals._icon_cache.get_icon(btn._icon_id).draw(hdc, iconPos.x, iconPos.y, ICON_SIZE_X, ICON_SIZE_Y, bk_color, bk_brush/*, large_icons*/);
01404
01405          // draw submenu arrow at the right
01406         if (btn._hasSubmenu) {
01407                 ResIconEx arrowIcon(IDI_ARROW, ICON_SIZE_X, ICON_SIZE_Y);
01408                 ResIconEx selArrowIcon(IDI_ARROW_SELECTED, ICON_SIZE_X, ICON_SIZE_Y);
01409
01410                 DrawIconEx(hdc, rect.right-ICON_SIZE_X, iconPos.y,
01411                                         has_focus? selArrowIcon: arrowIcon,
01412                                         ICON_SIZE_X, ICON_SIZE_Y, 0, bk_brush, DI_NORMAL);
01413         }
01414
01415         if (title) {
01416                 BkMode bk_mode(hdc, TRANSPARENT);
01417
01418                 if (!btn._enabled)      // dis->itemState & (ODS_DISABLED|ODS_GRAYED)
01419                         DrawGrayText(hdc, &textRect, title, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
01420                 else {
01421                         TextColor lcColor(hdc, GetSysColor(text_color_idx));
01422                         DrawText(hdc, title, -1, &textRect, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
01423                 }
01424         }
01425 }

int GetStartMenuBtnTextWidth | ( | HDC | hdc,
 |  | LPCTSTR | title,
 |  | HWND | hwnd
 | ) |

Definition at line 1358 of file startmenu.cpp.

Referenced by StartMenu::AddButton(), and StartMenu::ResizeToButtons().

01359 {
01360         RECT rect = {0, 0, 0, 0};
01361         DrawText(hdc, title, -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
01362
01363         return rect.right-rect.left;
01364 }

void ShowExitWindowsDialog ( HWND hwndOwner )

Definition at line 2131 of file startmenu.cpp.

References IDS_TITLE.

Referenced by StartMenuHandler::Command(), and DesktopWindow::WndProc().

02132 {
02133         static DynamicFct<EXITWINDOWSDLG> ExitWindowsDialog(TEXT("SHELL32"), 60);
02134
02135         if (ExitWindowsDialog)
02136                 (*ExitWindowsDialog)(hwndOwner);
02137         else
02138                 MessageBox(hwndOwner, TEXT("ExitWindowsDialog() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02139 }


ROS Explorer: startmenu.cpp Source File

  • File List
  • File Members
taskbar

startmenu.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // startmenu.cpp
00024  //
00025  // Explorer start menu
00026  //
00027  // Martin Fuchs, 19.08.2003
00028  //
00029  // Credits: Thanks to Everaldo (http://www.everaldo.com) for his nice looking icons.
00030  //
00031
00032
00033 #include <precomp.h>
00034
00035 #include "../resource.h"
00036
00037 #include "desktopbar.h"
00038 #include "startmenu.h"
00039
00040 #include "../dialogs/searchprogram.h"
00041 #include "../dialogs/settings.h"
00042
00043
00044 #define SHELLPATH_CONTROL_PANEL         TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}")
00045 #define SHELLPATH_PRINTERS                      TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}")
00046 #define SHELLPATH_NET_CONNECTIONS       TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}")
00047
00048
00049 StartMenu::StartMenu(HWND hwnd, bool large_icons)
00050  :      super(hwnd),
00051         _large_icons(large_icons)
00052 {
00053         _next_id = IDC_FIRST_MENU;
00054         _submenu_id = 0;
00055
00056         _border_left = 0;
00057         _border_top = 0;
00058         _bottom_max = INT_MAX;
00059
00060         _floating_btn = false;
00061         _arrow_btns = false;
00062         _scroll_mode = SCROLL_NOT;
00063         _scroll_pos = 0;
00064         _invisible_lines = 0;
00065
00066         _last_pos = WindowRect(hwnd).pos();
00067 #ifdef _LIGHT_STARTMENU
00068         _selected_id = -1;
00069         _last_mouse_pos = 0;
00070 #endif
00071 }
00072
00073 StartMenu::StartMenu(HWND hwnd, const StartMenuCreateInfo& create_info, bool large_icons)
00074  :      super(hwnd),
00075         _create_info(create_info),
00076         _large_icons(large_icons)
00077 {
00078         for(StartMenuFolders::const_iterator it=create_info._folders.begin(); it!=create_info._folders.end(); ++it)
00079                 if (*it)
00080                         _dirs.push_back(ShellDirectory(GetDesktopFolder(), *it, _hwnd));
00081
00082         _next_id = IDC_FIRST_MENU;
00083         _submenu_id = 0;
00084
00085         _border_left = 0;
00086         _border_top = create_info._border_top;
00087         _bottom_max = INT_MAX;
00088
00089         _floating_btn = create_info._border_top? true: false;
00090         _arrow_btns = false;
00091         _scroll_mode = SCROLL_NOT;
00092         _scroll_pos = 0;
00093         _invisible_lines = 0;
00094
00095         _last_pos = WindowRect(hwnd).pos();
00096 #ifdef _LIGHT_STARTMENU
00097         _selected_id = -1;
00098         _last_mouse_pos = 0;
00099 #endif
00100 }
00101
00102 StartMenu::~StartMenu()
00103 {
00104         SendParent(PM_STARTMENU_CLOSED);
00105 }
00106
00107
00108  // We need this wrapper function for s_wcStartMenu, it calls the WIN32 API,
00109  // though static C++ initializers are not allowed for Winelib applications.
00110 BtnWindowClass& StartMenu::GetWndClasss()
00111 {
00112         static BtnWindowClass s_wcStartMenu(CLASSNAME_STARTMENU);
00113
00114         return s_wcStartMenu;
00115 }
00116
00117
00118 Window::CREATORFUNC_INFO StartMenu::s_def_creator = STARTMENU_CREATOR(StartMenu);
00119
00120 HWND StartMenu::Create(int x, int y, const StartMenuFolders& folders, HWND hwndParent, LPCTSTR title,
00121                                                 CREATORFUNC_INFO creator, void* info, const String& filter)
00122 {
00123         UINT style, ex_style;
00124         int top_height;
00125
00126         if (hwndParent) {
00127                 style = WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN|WS_VISIBLE;
00128                 ex_style = 0;
00129                 top_height = STARTMENU_TOP_BTN_SPACE;
00130         } else {
00131                 style = WS_POPUP|WS_CAPTION|WS_SYSMENU|WS_CLIPCHILDREN|WS_VISIBLE;
00132                 ex_style = WS_EX_TOOLWINDOW;
00133                 top_height = 0;
00134         }
00135
00136         bool large_icons = false;
00137         RECT rect = {x, y-STARTMENU_LINE_HEIGHT-top_height, x+STARTMENU_WIDTH_MIN, y};
00138
00139 #ifndef _LIGHT_STARTMENU
00140         rect.top += STARTMENU_LINE_HEIGHT;
00141 #endif
00142
00143         AdjustWindowRectEx(&rect, style, FALSE, ex_style);
00144
00145         StartMenuCreateInfo create_info;
00146
00147         create_info._folders = folders;
00148         create_info._border_top = top_height;
00149         create_info._creator = creator;
00150         create_info._info = info;
00151         create_info._filter = filter;
00152
00153         if (title)
00154                 create_info._title = title;
00155
00156         HWND hwnd = Window::Create(creator, &create_info, ex_style, GetWndClasss(), title,
00157                                                                 style, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, hwndParent);
00158
00159          // make sure the window is not off the screen
00160         MoveVisible(hwnd);
00161
00162         return hwnd;
00163 }
00164
00165
00166 LRESULT StartMenu::Init(LPCREATESTRUCT pcs)
00167 {
00168         try {
00169                 AddEntries();
00170
00171                 if (super::Init(pcs))
00172                         return 1;
00173
00174                  // create buttons for registered entries in _entries
00175                 for(ShellEntryMap::const_iterator it=_entries.begin(); it!=_entries.end(); ++it) {
00176                         const StartMenuEntry& sme = it->second;
00177                         bool hasSubmenu = false;
00178
00179                         for(ShellEntrySet::const_iterator it=sme._entries.begin(); it!=sme._entries.end(); ++it)
00180                                 if ((*it)->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00181                                         hasSubmenu = true;
00182
00183 #ifdef _LIGHT_STARTMENU
00184                         _buttons.push_back(SMBtnInfo(sme, it->first, hasSubmenu));
00185 #else
00186                         AddButton(sme._title, sme._hIcon, hasSubmenu, it->first);
00187 #endif
00188                 }
00189
00190 #ifdef _LIGHT_STARTMENU
00191                 if (_buttons.empty())
00192 #else
00193                 if (!GetWindow(_hwnd, GW_CHILD))
00194 #endif
00195                         AddButton(ResString(IDS_EMPTY), ICID_NONE, false, 0, false);
00196
00197 #ifdef _LIGHT_STARTMENU
00198                 ResizeToButtons();
00199 #endif
00200
00201 #ifdef _LAZY_ICONEXTRACT
00202                 PostMessage(_hwnd, PM_UPDATE_ICONS, 0, 0);
00203 #endif
00204         } catch(COMException& e) {
00205                 HandleException(e, pcs->hwndParent);    // destroys the start menu window while switching focus
00206         }
00207
00208         return 0;
00209 }
00210
00211 void StartMenu::AddEntries()
00212 {
00213         for(StartMenuShellDirs::iterator it=_dirs.begin(); it!=_dirs.end(); ++it) {
00214                 StartMenuDirectory& smd = *it;
00215                 ShellDirectory& dir = smd._dir;
00216
00217                 if (!dir._scanned) {
00218                         WaitCursor wait;
00219
00220 #ifdef _LAZY_ICONEXTRACT
00221                         dir.smart_scan(SORT_NAME, SCAN_FILESYSTEM);     // lazy icon extraction, try to read directly from filesystem
00222 #else
00223                         dir.smart_scan(SORT_NAME, SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM);
00224 #endif
00225                 }
00226
00227                 AddShellEntries(dir, -1, smd._ignore);
00228         }
00229 }
00230
00231
00232 static LPTSTR trim_path_slash(LPTSTR path)
00233 {
00234         LPTSTR p = path;
00235
00236         while(*p)
00237                 ++p;
00238
00239         if (p>path && (p[-1]=='\\' || p[-1]=='/'))
00240                 *--p = '\0';
00241
00242         return path;
00243 }
00244
00245 void StartMenu::AddShellEntries(const ShellDirectory& dir, int max, const String& ignore)
00246 {
00247         TCHAR ignore_path[MAX_PATH], ignore_dir[MAX_PATH], ignore_name[_MAX_FNAME], ignore_ext[_MAX_EXT];
00248         TCHAR dir_path[MAX_PATH];
00249
00250         if (!ignore.empty()) {
00251                 _tsplitpath_s(ignore, ignore_path, COUNTOF(ignore_path), ignore_dir, COUNTOF(ignore_dir), ignore_name, COUNTOF(ignore_name), ignore_ext, COUNTOF(ignore_ext));
00252
00253                 _tcscat(ignore_path, ignore_dir);
00254                 _tcscat(ignore_name, ignore_ext);
00255
00256                 dir.get_path(dir_path, COUNTOF(dir_path));
00257
00258                 if (_tcsicmp(trim_path_slash(dir_path), trim_path_slash(ignore_path)))
00259                         *ignore_name = '\0';
00260         } else
00261                 *ignore_name = '\0';
00262
00263         String lwr_filter = _create_info._filter;
00264         lwr_filter.toLower();
00265
00266         int cnt = 0;
00267         for(Entry*entry=dir._down; entry; entry=entry->_next) {
00268                  // hide files like "desktop.ini"
00269                 if (entry->_shell_attribs & SFGAO_HIDDEN)
00270                 //not appropriate for drive roots: if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
00271                         continue;
00272
00273                  // hide "Programs" subfolders if requested
00274                 if (*ignore_name && !_tcsicmp(entry->_data.cFileName, ignore_name))
00275                         continue;
00276
00277                  // only 'max' entries shall be added.
00278                 if (++cnt == max)
00279                         break;
00280
00281                  // filter only non-directory entries
00282                 if (!(entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && !lwr_filter.empty()) {
00283                         String lwr_name = entry->_data.cFileName;
00284                         String lwr_disp = entry->_display_name;
00285
00286                         lwr_name.toLower();
00287                         lwr_disp.toLower();
00288
00289                         if (!_tcsstr(lwr_name,lwr_filter) && !_tcsstr(lwr_disp,lwr_filter))
00290                                 continue;
00291                 }
00292
00293                 if (entry->_etype == ET_SHELL)
00294                         AddEntry(dir._folder, static_cast<ShellEntry*>(entry));
00295                 else
00296                         AddEntry(dir._folder, entry);
00297         }
00298 }
00299
00300
00301 LRESULT StartMenu::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00302 {
00303         switch(nmsg) {
00304           case WM_PAINT: {
00305                 PaintCanvas canvas(_hwnd);
00306                 Paint(canvas);
00307                 break;}
00308
00309           case WM_SIZE:
00310                 ResizeButtons(LOWORD(lparam)-_border_left);
00311                 break;
00312
00313           case WM_MOVE: {
00314                 const POINTS& pos = MAKEPOINTS(lparam);
00315
00316                  // move open submenus of floating menus
00317                 if (_submenu) {
00318                         int dx = pos.x - _last_pos.x;
00319                         int dy = pos.y - _last_pos.y;
00320
00321                         if (dx || dy) {
00322                                 WindowRect rt(_submenu);
00323                                 SetWindowPos(_submenu, 0, rt.left+dx, rt.top+dy, 0, 0, SWP_NOSIZE|SWP_NOACTIVATE);
00324                                 //MoveVisible(_submenu);
00325                         }
00326                 }
00327
00328                 _last_pos.x = pos.x;
00329                 _last_pos.y = pos.y;
00330                 goto def;}
00331
00332           case WM_NCHITTEST: {
00333                 LRESULT res = super::WndProc(nmsg, wparam, lparam);
00334
00335                 if (res>=HTSIZEFIRST && res<=HTSIZELAST)
00336                         return HTCLIENT;        // disable window resizing
00337
00338                 return res;}
00339
00340           case WM_LBUTTONDOWN: {
00341                 RECT rect;
00342
00343                  // check mouse cursor for coordinates of floating button
00344                 GetFloatingButtonRect(&rect);
00345
00346                 if (PtInRect(&rect, Point(lparam))) {
00347                          // create a floating copy of the current start menu
00348                         WindowRect pos(_hwnd);
00349
00351                         StartMenu::Create(pos.left+3, pos.bottom-3, _create_info._folders, 0, _create_info._title, _create_info._creator, _create_info._info);
00352                         CloseStartMenu();
00353                 }
00354
00355 #ifdef _LIGHT_STARTMENU
00356                 int id = ButtonHitTest(Point(lparam));
00357
00358                 if (id)
00359                         Command(id, BN_CLICKED);
00360 #endif
00361                 break;}
00362
00363           case WM_SYSCOMMAND:
00364                 if ((wparam&0xFFF0) == SC_SIZE)
00365                         return 0;                       // disable window resizing
00366                 goto def;
00367
00368           case WM_ACTIVATEAPP:
00369                  // close start menu when activating another application
00370                 if (!wparam)
00371                         CloseStartMenu();
00372                 break;  // don't call super::WndProc in case "this" has been deleted
00373
00374           case WM_CANCELMODE:
00375                 CloseStartMenu();
00376
00377 #ifdef _LIGHT_STARTMENU
00378                 if (_scroll_mode != SCROLL_NOT) {
00379                         ReleaseCapture();
00380                         KillTimer(_hwnd, 0);
00381                 }
00382 #endif
00383                 break;
00384
00385 #ifdef _LIGHT_STARTMENU
00386           case WM_MOUSEMOVE: {
00387                  // automatically set the focus to startmenu entries when moving the mouse over them
00388                 if (lparam != _last_mouse_pos) { // don't process WM_MOUSEMOVE when opening submenus using keyboard navigation
00389                         Point pt(lparam);
00390
00391                         if (_arrow_btns) {
00392                                 RECT rect_up, rect_down;
00393
00394                                 GetArrowButtonRects(&rect_up, &rect_down, _large_icons);
00395
00396                                 SCROLL_MODE scroll_mode = SCROLL_NOT;
00397
00398                                 if (PtInRect(&rect_up, pt))
00399                                         scroll_mode = SCROLL_UP;
00400                                 else if (PtInRect(&rect_down, pt))
00401                                         scroll_mode = SCROLL_DOWN;
00402
00403                                 if (scroll_mode != _scroll_mode) {
00404                                         if (scroll_mode == SCROLL_NOT) {
00405                                                 ReleaseCapture();
00406                                                 KillTimer(_hwnd, 0);
00407                                         } else {
00408                                                 CloseSubmenus();
00409                                                 SetTimer(_hwnd, 0, 150, NULL);  // 150 ms scroll interval
00410                                                 SetCapture(_hwnd);
00411                                         }
00412
00413                                         _scroll_mode = scroll_mode;
00414                                 }
00415                         }
00416
00417                         int new_id = ButtonHitTest(pt);
00418
00419                         if (new_id > 0 && new_id != _selected_id)
00420                                 SelectButton(new_id);
00421
00422                         _last_mouse_pos = lparam;
00423                 }
00424                 break;}
00425
00426           case WM_TIMER:
00427                 if (_scroll_mode == SCROLL_UP) {
00428                         if (_scroll_pos > 0) {
00429                                 --_scroll_pos;
00430                                 InvalidateRect(_hwnd, NULL, TRUE);
00431                         }
00432                 } else {
00433                         if (_scroll_pos <= _invisible_lines) {
00434                                 ++_scroll_pos;
00435                                 InvalidateRect(_hwnd, NULL, TRUE);
00436                         }
00437                 }
00438                 break;
00439
00440           case WM_KEYDOWN:
00441                 ProcessKey(wparam);
00442                 break;
00443 #else
00444           case PM_STARTENTRY_FOCUSED: {
00445                 BOOL hasSubmenu = wparam;
00446                 HWND hctrl = (HWND)lparam;
00447
00448                  // automatically open submenus
00449                 if (hasSubmenu) {
00450                         UpdateWindow(_hwnd);    // draw focused button before waiting on submenu creation
00451                         //SendMessage(_hwnd, WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hctrl),BN_CLICKED), (LPARAM)hctrl);
00452                         Command(GetDlgCtrlID(hctrl), BN_CLICKED);
00453                 } else {
00454                          // close any open submenu
00455                         CloseOtherSubmenus();
00456                 }
00457                 break;}
00458 #endif
00459
00460 #ifdef _LAZY_ICONEXTRACT
00461           case PM_UPDATE_ICONS:
00462                 UpdateIcons(/*wparam*/);
00463                 break;
00464 #endif
00465
00466           case PM_STARTENTRY_LAUNCHED:
00467                 if (GetWindowStyle(_hwnd) & WS_CAPTION) // don't automatically close floating menus
00468                         return 0;
00469
00470                  // route message to the parent menu and close menus after launching an entry
00471                 if (!SendParent(nmsg, wparam, lparam))
00472                         CloseStartMenu();
00473                 return 1;       // signal that we have received and processed the message
00474
00475           case PM_STARTMENU_CLOSED:
00476                 _submenu = 0;
00477                 break;
00478
00479           case PM_SELECT_ENTRY:
00480                 SelectButtonIndex(0, wparam!=0);
00481                 break;
00482
00483 #ifdef _LIGHT_STARTMENU
00484           case WM_CONTEXTMENU: {
00485                 Point screen_pt(lparam), clnt_pt=screen_pt;
00486                 ScreenToClient(_hwnd, &clnt_pt);
00487
00488                 int id = ButtonHitTest(clnt_pt);
00489
00490                 if (id) {
00491                         StartMenuEntry& sme = _entries[id];
00492
00493                         for(ShellEntrySet::iterator it=sme._entries.begin(); it!=sme._entries.end(); ++it) {
00494                                 Entry* entry = *it;
00495
00496                                 if (entry) {
00497                                         CHECKERROR(entry->do_context_menu(_hwnd, screen_pt, _cm_ifs));  // may close start menu because of focus loss
00498                                         break;
00499                                 }
00500                         }
00501                 }
00502                 break;}
00503 #endif
00504
00505           default: def:
00506                 return super::WndProc(nmsg, wparam, lparam);
00507         }
00508
00509         return 0;
00510 }
00511
00512
00513 #ifdef _LIGHT_STARTMENU
00514
00515 int StartMenu::ButtonHitTest(POINT pt)
00516 {
00517         ClientRect clnt(_hwnd);
00518         const bool large_icons = _large_icons;
00519         RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT};
00520
00521         if (pt.x<rect.left || pt.x>rect.right)
00522                 return 0;
00523
00524         for(SMBtnVector::const_iterator it=_buttons.begin()+_scroll_pos; it!=_buttons.end(); ++it) {
00525                 const SMBtnInfo& info = *it;
00526
00527                 if (rect.top > pt.y)
00528                         break;
00529
00530                 rect.bottom = rect.top + (info._id==-1? STARTMENU_SEP_HEIGHT: STARTMENU_LINE_HEIGHT);
00531
00532                 if (rect.bottom > _bottom_max)
00533                         break;
00534
00535                 if (pt.y < rect.bottom) // PtInRect(&rect, pt)
00536                         return info._id;
00537
00538                 rect.top = rect.bottom;
00539         }
00540
00541         return 0;
00542 }
00543
00544 void StartMenu::InvalidateSelection()
00545 {
00546         if (_selected_id <= 0)
00547                 return;
00548
00549         ClientRect clnt(_hwnd);
00550         const bool large_icons = _large_icons;
00551         RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT};
00552
00553         for(SMBtnVector::const_iterator it=_buttons.begin()+_scroll_pos; it!=_buttons.end(); ++it) {
00554                 const SMBtnInfo& info = *it;
00555
00556                 rect.bottom = rect.top + (info._id==-1? STARTMENU_SEP_HEIGHT: STARTMENU_LINE_HEIGHT);
00557
00558                 if (info._id == _selected_id) {
00559                         InvalidateRect(_hwnd, &rect, TRUE);
00560                         break;
00561                 }
00562
00563                 rect.top = rect.bottom;
00564         }
00565 }
00566
00567 const SMBtnInfo* StartMenu::GetButtonInfo(int id) const
00568 {
00569         for(SMBtnVector::const_iterator it=_buttons.begin(); it!=_buttons.end(); ++it)
00570                 if (it->_id == id)
00571                         return &*it;
00572
00573         return NULL;
00574 }
00575
00576 bool StartMenu::SelectButton(int id, bool open_sub)
00577 {
00578         if (id == -1)
00579                 return false;
00580
00581         if (id == _selected_id)
00582                 return true;
00583
00584         InvalidateSelection();
00585
00586         const SMBtnInfo* btn = GetButtonInfo(id);
00587
00588         if (btn && btn->_enabled) {
00589                 _selected_id = id;
00590
00591                 InvalidateSelection();
00592
00593                  // automatically open submenus
00594                 if (btn->_hasSubmenu) {
00595                         if (open_sub)
00596                                 OpenSubmenu();
00597                 } else
00598                         CloseOtherSubmenus();   // close any open submenu
00599
00600                 return true;
00601         } else {
00602                 _selected_id = -1;
00603                 return false;
00604         }
00605 }
00606
00607 bool StartMenu::OpenSubmenu(bool select_first)
00608 {
00609         if (_selected_id == -1)
00610                 return false;
00611
00612         InvalidateSelection();
00613
00614         const SMBtnInfo* btn = GetButtonInfo(_selected_id);
00615
00616          // automatically open submenus
00617         if (btn->_hasSubmenu) {
00618                 //@@ allows destroying of startmenu when processing PM_UPDATE_ICONS -> GPF
00619                 UpdateWindow(_hwnd);    // draw focused button before waiting on submenu creation
00620                 Command(_selected_id, BN_CLICKED);
00621
00622                 if (select_first && _submenu)
00623                         SendMessage(_submenu, PM_SELECT_ENTRY, (WPARAM)false, 0);
00624
00625                 return true;
00626         } else
00627                 return false;
00628 }
00629
00630
00631 int StartMenu::GetSelectionIndex()
00632 {
00633         if (_selected_id == -1)
00634                 return -1;
00635
00636         for(int i=0; i<(int)_buttons.size(); ++i)
00637                 if (_buttons[i]._id == _selected_id)
00638                         return i;
00639
00640         return -1;
00641 }
00642
00643 bool StartMenu::SelectButtonIndex(int idx, bool open_sub)
00644 {
00645         if (idx>=0 && idx<(int)_buttons.size())
00646                 return SelectButton(_buttons[idx]._id, open_sub);
00647         else
00648                 return false;
00649 }
00650
00651 void StartMenu::ProcessKey(int vk)
00652 {
00653         switch(vk) {
00654           case VK_RETURN:
00655                 if (_selected_id)
00656                         Command(_selected_id, BN_CLICKED);
00657                 break;
00658
00659           case VK_UP:
00660                 Navigate(-1);
00661                 break;
00662
00663           case VK_DOWN:
00664                 Navigate(+1);
00665                 break;
00666
00667           case VK_HOME:
00668                 SelectButtonIndex(0, false);
00669                 break;
00670
00671           case VK_END:
00672                 SelectButtonIndex(_buttons.size()-1, false);
00673                 break;
00674
00675           case VK_LEFT:
00676                 if (_submenu)
00677                         CloseOtherSubmenus();
00678                 else if (!(GetWindowStyle(_hwnd) & WS_CAPTION)) // don't automatically close floating menus
00679                         DestroyWindow(_hwnd);
00680                 break;
00681
00682           case VK_RIGHT:
00683                 OpenSubmenu(true);
00684                 break;
00685
00686           case VK_ESCAPE:
00687                 CloseStartMenu();
00688                 break;
00689
00690           default:
00691                 if (vk>='0' && vk<='Z')
00692                         JumpToNextShortcut(vk);
00693         }
00694 }
00695
00696 bool StartMenu::Navigate(int step)
00697 {
00698         int idx = GetSelectionIndex();
00699
00700         if (idx == -1)
00701                 if (step > 0)
00702                         idx = 0 - step;
00703                 else
00704                         idx = _buttons.size() - step;
00705
00706         for(;;) {
00707                 idx += step;
00708
00709                 if (idx<0 || idx>(int)_buttons.size())
00710                         break;
00711
00712                 if (SelectButtonIndex(idx, false))
00713                         return true;
00714         }
00715
00716         return false;
00717 }
00718
00719 bool StartMenu::JumpToNextShortcut(char c)
00720 {
00721         int cur_idx = GetSelectionIndex();
00722
00723         if (cur_idx == -1)
00724                 cur_idx = 0;
00725
00726         int first_found = 0;
00727         int found_more = 0;
00728
00729         SMBtnVector::const_iterator cur_it = _buttons.begin();
00730         cur_it += cur_idx + 1;
00731
00732          // first search down from current item...
00733         SMBtnVector::const_iterator it = cur_it;
00734         for(; it!=_buttons.end(); ++it) {
00735                 const SMBtnInfo& btn = *it;
00736
00737                 if (!btn._title.empty() && toupper((TBYTE)btn._title.at(0)) == c) {
00738                         if (!first_found)
00739                                 first_found = btn._id;
00740                         else
00741                                 ++found_more;
00742                 }
00743         }
00744
00745          // ...now search from top to the current item
00746         it = _buttons.begin();
00747         for(; it!=_buttons.end() && it!=cur_it; ++it) {
00748                 const SMBtnInfo& btn = *it;
00749
00750                 if (!btn._title.empty() && toupper((TBYTE)btn._title.at(0)) == c) {
00751                         if (!first_found)
00752                                 first_found = btn._id;
00753                         else
00754                                 ++found_more;
00755                 }
00756         }
00757
00758         if (first_found) {
00759                 SelectButton(first_found);
00760
00761                 if (!found_more)
00762                         Command(first_found, BN_CLICKED);
00763
00764                 return true;
00765         } else
00766                 return false;
00767 }
00768
00769 #endif // _LIGHT_STARTMENU
00770
00771
00772 bool StartMenu::GetButtonRect(int id, PRECT prect) const
00773 {
00774 #ifdef _LIGHT_STARTMENU
00775         ClientRect clnt(_hwnd);
00776         const bool large_icons = _large_icons;
00777         RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT};
00778
00779         for(SMBtnVector::const_iterator it=_buttons.begin()+_scroll_pos; it!=_buttons.end(); ++it) {
00780                 const SMBtnInfo& info = *it;
00781
00782                 rect.bottom = rect.top + (info._id==-1? STARTMENU_SEP_HEIGHT: STARTMENU_LINE_HEIGHT);
00783
00784                 if (info._id == id) {
00785                         *prect = rect;
00786                         return true;
00787                 }
00788
00789                 rect.top = rect.bottom;
00790         }
00791
00792         return false;
00793 #else
00794         HWND btn = GetDlgItem(_hwnd, id);
00795
00796         if (btn) {
00797                 GetWindowRect(btn, prect);
00798                 ScreenToClient(_hwnd, prect);
00799
00800                 return true;
00801         } else
00802                 return false;
00803 #endif
00804 }
00805
00806
00807 void StartMenu::DrawFloatingButton(HDC hdc)
00808 {
00809         static ResIconEx floatingIcon(IDI_FLOATING, 8, 4);
00810
00811         ClientRect clnt(_hwnd);
00812
00813         DrawIconEx(hdc, clnt.right-12, 0, floatingIcon, 8, 4, 0, 0, DI_NORMAL);
00814 }
00815
00816 void StartMenu::GetFloatingButtonRect(LPRECT prect)
00817 {
00818         GetClientRect(_hwnd, prect);
00819
00820         prect->right -= 4;
00821         prect->left = prect->right - 8;
00822         prect->bottom = 4;
00823 }
00824
00825
00826 void StartMenu::DrawArrows(HDC hdc, bool large_icons)
00827 {
00828         int cx = large_icons? 16: 8;
00829         int cy = large_icons? 8: 4;
00830
00831         ResIconEx arrowUpIcon(IDI_ARROW_UP, cx, cy);
00832         ResIconEx arrowDownIcon(IDI_ARROW_DOWN, cx, cy);
00833
00834         ClientRect clnt(_hwnd);
00835
00836         DrawIconEx(hdc, clnt.right/2-cx/2, _floating_btn?3:1, arrowUpIcon, cx, cy, 0, 0, DI_NORMAL);
00837         DrawIconEx(hdc, clnt.right/2-cx/2, clnt.bottom-cy-1, arrowDownIcon, cx, cy, 0, 0, DI_NORMAL);
00838 }
00839
00840 void StartMenu::GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down, bool large_icons)
00841 {
00842         int cx = large_icons? 16: 8;
00843         int cy = large_icons? 8: 4;
00844
00845         GetClientRect(_hwnd, prect_up);
00846         *prect_down = *prect_up;
00847
00848 //      prect_up->left = prect_up->right/2 - cx/2;
00849 //      prect_up->right = prect_up->left + cy;
00850         prect_up->right -= cx;
00851         prect_up->top = _floating_btn? cy-1: 1;
00852         prect_up->bottom = prect_up->top + cy;
00853
00854 //      prect_down->left = prect_down->right/2 - cx/2;
00855 //      prect_down->right = prect_down->left + cy;
00856         prect_down->right -= cx;
00857         prect_down->top = prect_down->bottom - cy - 1;
00858 }
00859
00860
00861 void StartMenu::Paint(PaintCanvas& canvas)
00862 {
00863         if (_floating_btn)
00864                 DrawFloatingButton(canvas);
00865
00866 #ifdef _LIGHT_STARTMENU
00867         if (_arrow_btns)
00868                 DrawArrows(canvas, _large_icons);
00869
00870         ClientRect clnt(_hwnd);
00871         const bool large_icons = _large_icons;
00872         RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT};
00873
00874         int sep_width = rect.right-rect.left - 4;
00875
00876         FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
00877         BkMode bk_mode(canvas, TRANSPARENT);
00878
00879         for(SMBtnVector::const_iterator it=_buttons.begin()+_scroll_pos; it!=_buttons.end(); ++it) {
00880                 const SMBtnInfo& btn = *it;
00881
00882                 if (rect.top > canvas.rcPaint.bottom)
00883                         break;
00884
00885                 if (btn._id == -1) {    // a separator?
00886                         rect.bottom = rect.top + STARTMENU_SEP_HEIGHT;
00887
00888                         if (rect.bottom > _bottom_max)
00889                                 break;
00890
00891                         BrushSelection brush_sel(canvas, GetSysColorBrush(COLOR_BTNSHADOW));
00892                         PatBlt(canvas, rect.left+2, rect.top+STARTMENU_SEP_HEIGHT/2-1, sep_width, 1, PATCOPY);
00893
00894                         SelectBrush(canvas, GetSysColorBrush(COLOR_BTNHIGHLIGHT));
00895                         PatBlt(canvas, rect.left+2, rect.top+STARTMENU_SEP_HEIGHT/2, sep_width, 1, PATCOPY);
00896                 } else {
00897                         rect.bottom = rect.top + STARTMENU_LINE_HEIGHT;
00898
00899                         if (rect.bottom > _bottom_max)
00900                                 break;
00901
00902                         if (rect.top >= canvas.rcPaint.top)
00903                                 DrawStartMenuButton(canvas, rect, btn._title, btn, btn._id==_selected_id, false, _large_icons);
00904                 }
00905
00906                 rect.top = rect.bottom;
00907         }
00908 #endif
00909 }
00910
00911 #ifdef _LAZY_ICONEXTRACT
00912 void StartMenu::UpdateIcons(/*int idx*/)
00913 {
00914         UpdateWindow(_hwnd);
00915
00916 #ifdef _SINGLE_ICONEXTRACT
00917
00918         //if (idx >= 0)
00919         int idx = _scroll_pos;
00920
00921         for(; idx<(int)_buttons.size(); ++idx) {
00922                 SMBtnInfo& btn = _buttons[idx];
00923
00924                 if (btn._icon_id==ICID_UNKNOWN && btn._id>0) {
00925                         StartMenuEntry& sme = _entries[btn._id];
00926
00927                         btn._icon_id = ICID_NONE;
00928
00929                         for(ShellEntrySet::iterator it=sme._entries.begin(); it!=sme._entries.end(); ++it) {
00930                                 Entry* entry = *it;
00931
00932                                 if (entry->_icon_id == ICID_UNKNOWN)
00933                                         entry->_icon_id = entry->safe_extract_icon(_large_icons? ICF_LARGE: ICF_NORMAL);
00934
00935                                 if (entry->_icon_id > ICID_NONE) {
00936                                         btn._icon_id = (ICON_ID)/*@@*/ entry->_icon_id;
00937
00938                                         RECT rect;
00939
00940                                         GetButtonRect(btn._id, &rect);
00941
00942                                         if (rect.bottom > _bottom_max)
00943                                                 break;
00944
00945                                         WindowCanvas canvas(_hwnd);
00946                                         DrawStartMenuButton(canvas, rect, NULL, btn, btn._id==_selected_id, false, _large_icons);
00947
00948                                         //InvalidateRect(_hwnd, &rect, FALSE);
00949                                         //UpdateWindow(_hwnd);
00950                                         //break;
00951
00952                                         break;
00953                                 }
00954                         }
00955                 }
00956         }
00957
00958 //      if (++idx < (int)_buttons.size())
00959 //              PostMessage(_hwnd, PM_UPDATE_ICONS, idx, 0);
00960
00961 #else
00962
00963         int icons_extracted = 0;
00964         int icons_updated = 0;
00965
00966         for(StartMenuShellDirs::iterator it=_dirs.begin(); it!=_dirs.end(); ++it) {
00967                 ShellDirectory& dir = it->_dir;
00968
00969                 icons_extracted += dir.extract_icons();
00970         }
00971
00972         if (icons_extracted) {
00973                 for(ShellEntryMap::iterator it1=_entries.begin(); it1!=_entries.end(); ++it1) {
00974                         StartMenuEntry& sme = it1->second;
00975
00976                         if (!sme._hIcon) {
00977                                 sme._hIcon = (HICON)-1;
00978
00979                                 for(ShellEntrySet::const_iterator it2=sme._entries.begin(); it2!=sme._entries.end(); ++it2) {
00980                                         const Entry* sm_entry = *it2;
00981
00982                                         if (sm_entry->_hIcon) {
00983                                                 sme._hIcon = sm_entry->_hIcon;
00984                                                 break;
00985                                         }
00986                                 }
00987                         }
00988                 }
00989
00990                 for(SMBtnVector::iterator it=_buttons.begin(); it!=_buttons.end(); ++it) {
00991                         SMBtnInfo& info = *it;
00992
00993                         if (info._id>0 && !info._hIcon) {
00994                                 info._hIcon = _entries[info._id]._hIcon;
00995                                 ++icons_updated;
00996                         }
00997                 }
00998         }
00999
01000         if (icons_updated) {
01001                 InvalidateRect(_hwnd, NULL, FALSE);
01002                 UpdateWindow(_hwnd);
01003         }
01004 #endif
01005 }
01006 #endif
01007
01008
01009  // resize child button controls to accomodate for new window size
01010 void StartMenu::ResizeButtons(int cx)
01011 {
01012         HDWP hdwp = BeginDeferWindowPos(10);
01013
01014         for(HWND ctrl=GetWindow(_hwnd,GW_CHILD); ctrl; ctrl=GetNextWindow(ctrl,GW_HWNDNEXT)) {
01015                 ClientRect rt(ctrl);
01016
01017                 if (rt.right != cx) {
01018                         int height = rt.bottom - rt.top;
01019
01020                          // special handling for separator controls
01021                         if (!height && (GetWindowStyle(ctrl)&SS_TYPEMASK)==SS_ETCHEDHORZ)
01022                                 height = 2;
01023
01024                         hdwp = DeferWindowPos(hdwp, ctrl, 0, 0, 0, cx, height, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
01025                 }
01026         }
01027
01028         EndDeferWindowPos(hdwp);
01029 }
01030
01031
01032 int StartMenu::Command(int id, int code)
01033 {
01034 #ifndef _LIGHT_STARTMENU
01035         switch(id) {
01036           case IDCANCEL:
01037                 CloseStartMenu(id);
01038                 break;
01039
01040           default: {
01041 #endif
01042                 ShellEntryMap::iterator found = _entries.find(id);
01043
01044                 if (found != _entries.end()) {
01045                         ActivateEntry(id, found->second._entries);
01046                         return 0;
01047                 }
01048
01049                 return super::Command(id, code);
01050 #ifndef _LIGHT_STARTMENU
01051           }
01052         }
01053
01054         return 0;
01055 #endif
01056 }
01057
01058
01059 ShellEntryMap::iterator StartMenu::AddEntry(const String& title, ICON_ID icon_id, Entry* entry)
01060 {
01061          // search for an already existing subdirectory entry with the same name
01062         if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
01063                 for(ShellEntryMap::iterator it=_entries.begin(); it!=_entries.end(); ++it) {
01064                         StartMenuEntry& sme = it->second;
01065
01066                         if (!_tcsicmp(sme._title, title))
01067                                 for(ShellEntrySet::iterator it2=sme._entries.begin(); it2!=sme._entries.end(); ++it2) {
01068                                         if ((*it2)->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01069                                                  // merge the new shell entry with the existing of the same name
01070                                                 sme._entries.insert(entry);
01071
01072                                                 return it;
01073                                         }
01074                                 }
01075                 }
01076
01077         ShellEntryMap::iterator sme = AddEntry(title, icon_id);
01078
01079         sme->second._entries.insert(entry);
01080
01081         return sme;
01082 }
01083
01084 ShellEntryMap::iterator StartMenu::AddEntry(const String& title, ICON_ID icon_id, int id)
01085 {
01086         if (id == -1)
01087                 id = ++_next_id;
01088
01089         StartMenuEntry sme;
01090
01091         sme._title = title;
01092         sme._icon_id = icon_id;
01093
01094         ShellEntryMap::iterator it = _entries.insert(make_pair(id, sme)).first;
01095
01096         return it;
01097 }
01098
01099 ShellEntryMap::iterator StartMenu::AddEntry(const ShellFolder folder, ShellEntry* entry)
01100 {
01101         ICON_ID icon_id;
01102
01103         if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
01104                 icon_id = ICID_FOLDER;
01105         else
01106                 icon_id = (ICON_ID)/*@@*/ entry->_icon_id;
01107
01108         return AddEntry(folder.get_name(entry->_pidl), icon_id, entry);
01109 }
01110
01111 ShellEntryMap::iterator StartMenu::AddEntry(const ShellFolder folder, Entry* entry)
01112 {
01113         ICON_ID icon_id;
01114
01115         if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
01116                 icon_id = ICID_FOLDER;
01117         else
01118                 icon_id = (ICON_ID)/*@@*/ entry->_icon_id;
01119
01120         return AddEntry(entry->_display_name, icon_id, entry);
01121 }
01122
01123
01124 void StartMenu::AddButton(LPCTSTR title, ICON_ID icon_id, bool hasSubmenu, int id, bool enabled)
01125 {
01126 #ifdef _LIGHT_STARTMENU
01127         _buttons.push_back(SMBtnInfo(title, icon_id, id, hasSubmenu, enabled));
01128 #else
01129         DWORD style = enabled? WS_VISIBLE|WS_CHILD|BS_OWNERDRAW: WS_VISIBLE|WS_CHILD|BS_OWNERDRAW|WS_DISABLED;
01130
01131         WindowRect rect(_hwnd);
01132         ClientRect clnt(_hwnd);
01133
01134          // increase window height to make room for the new button
01135         rect.top -= STARTMENU_LINE_HEIGHT;
01136
01137          // move down if we are too high now
01138         if (rect.top < 0) {
01139                 rect.top += STARTMENU_LINE_HEIGHT;
01140                 rect.bottom += STARTMENU_LINE_HEIGHT;
01141         }
01142
01143         WindowCanvas canvas(_hwnd);
01144         FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
01145
01146          // widen window, if it is too small
01147         int text_width = GetStartMenuBtnTextWidth(canvas, title, _hwnd) + ICON_SIZE_X + 10/*placeholder*/ + 16/*arrow*/;
01148
01149         int cx = clnt.right - _border_left;
01150         if (text_width > cx)
01151                 rect.right += text_width-cx;
01152
01153         MoveWindow(_hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, TRUE);
01154
01155         StartMenuCtrl(_hwnd, _border_left, clnt.bottom, rect.right-rect.left-_border_left,
01156                                         title, id, g_Globals._icon_cache.get_icon(icon_id)._hIcon, hasSubmenu, style);
01157 #endif
01158 }
01159
01160 void StartMenu::AddSeparator()
01161 {
01162 #ifdef _LIGHT_STARTMENU
01163         _buttons.push_back(SMBtnInfo(NULL, ICID_NONE, -1, false));
01164 #else
01165         WindowRect rect(_hwnd);
01166         ClientRect clnt(_hwnd);
01167
01168          // increase window height to make room for the new separator
01169         rect.top -= STARTMENU_SEP_HEIGHT;
01170
01171          // move down if we are too high now
01172         if (rect.top < 0) {
01173                 rect.top += STARTMENU_LINE_HEIGHT;
01174                 rect.bottom += STARTMENU_LINE_HEIGHT;
01175         }
01176
01177         MoveWindow(_hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, TRUE);
01178
01179         StartMenuSeparator(_hwnd, _border_left, clnt.bottom, rect.right-rect.left-_border_left);
01180 #endif
01181 }
01182
01183
01184 bool StartMenu::CloseOtherSubmenus(int id)
01185 {
01186         if (_submenu) {
01187                 if (IsWindow(_submenu)) {
01188                         if (_submenu_id == id)
01189                                 return false;
01190                         else {
01191                                 _submenu_id = 0;
01192                                 DestroyWindow(_submenu);
01193                                 // _submenu should be reset automatically by PM_STARTMENU_CLOSED, but safety first...
01194                         }
01195                 }
01196
01197                 _submenu = 0;
01198         }
01199
01200         return true;
01201 }
01202
01203
01204 void StartMenu::CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator, void* info)
01205 {
01206         CreateSubmenu(id, StartMenuFolders(), title, creator, info);
01207 }
01208
01209 bool StartMenu::CreateSubmenu(int id, int folder_id, LPCTSTR title, CREATORFUNC_INFO creator, void* info)
01210 {
01211         try {
01212                 SpecialFolderPath folder(folder_id, _hwnd);
01213
01214                 StartMenuFolders new_folders;
01215                 new_folders.push_back(folder);
01216
01217                 CreateSubmenu(id, new_folders, title, creator, info);
01218
01219                 return true;
01220         } catch(COMException&) {
01221                 // ignore Exception and don't display anything
01222                 CloseOtherSubmenus(id);
01223                 _buttons[GetSelectionIndex()]._enabled = false; // disable entries for non-existing folders
01224                 return false;
01225         }
01226 }
01227
01228 bool StartMenu::CreateSubmenu(int id, int folder_id1, int folder_id2, LPCTSTR title, CREATORFUNC_INFO creator, void* info)
01229 {
01230         StartMenuFolders new_folders;
01231
01232         try {
01233                 new_folders.push_back(SpecialFolderPath(folder_id1, _hwnd));
01234         } catch(COMException&) {
01235         }
01236
01237         try {
01238                 new_folders.push_back(SpecialFolderPath(folder_id2, _hwnd));
01239         } catch(COMException&) {
01240         }
01241
01242         if (!new_folders.empty()) {
01243                 CreateSubmenu(id, new_folders, title, creator, info);
01244                 return true;
01245         } else {
01246                 CloseOtherSubmenus(id);
01247                 _buttons[GetSelectionIndex()]._enabled = false; // disable entries for non-existing folders
01248                 return false;
01249         }
01250 }
01251
01252 void StartMenu::CreateSubmenu(int id, const StartMenuFolders& new_folders, LPCTSTR title, CREATORFUNC_INFO creator, void* info)
01253 {
01254          // Only open one submenu at a time.
01255         if (!CloseOtherSubmenus(id))
01256                 return;
01257
01258         RECT rect;
01259         int x, y;
01260
01261         if (GetButtonRect(id, &rect)) {
01262                 ClientToScreen(_hwnd, &rect);
01263
01264                 x = rect.right; // Submenus should overlap their parent a bit.
01265                 const bool large_icons = _large_icons;
01266                 y = rect.top+STARTMENU_LINE_HEIGHT +_border_top/*own border*/ -STARTMENU_TOP_BTN_SPACE/*border of new submenu*/;
01267         } else {
01268                 WindowRect pos(_hwnd);
01269
01270                 x = pos.right;
01271                 y = pos.top;
01272         }
01273
01274         _submenu_id = id;
01275         _submenu = StartMenu::Create(x, y, new_folders, _hwnd, title, creator, info, _create_info._filter);
01276 }
01277
01278
01279 void StartMenu::ActivateEntry(int id, const ShellEntrySet& entries)
01280 {
01281         StartMenuFolders new_folders;
01282         String title;
01283
01284         for(ShellEntrySet::const_iterator it=entries.begin(); it!=entries.end(); ++it) {
01285                 Entry* entry = const_cast<Entry*>(*it);
01286
01287                 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01288
01290
01291                         if (entry->_etype == ET_SHELL)
01292                                 new_folders.push_back(entry->create_absolute_pidl());
01293                         else {
01294                                 TCHAR path[MAX_PATH];
01295
01296                                 if (entry->get_path(path, COUNTOF(path)))
01297                                         new_folders.push_back(path);
01298                         }
01299
01300                         if (title.empty())
01301                                 title = entry->_display_name;
01302                 } else {
01303                          // The entry is no subdirectory, so there can only be one shell entry.
01304                         assert(entries.size()==1);
01305
01306                         HWND hparent = GetParent(_hwnd);
01307                         ShellPath shell_path = entry->create_absolute_pidl();
01308
01309                          // close start menus when launching the selected entry
01310                         CloseStartMenu(id);
01311
01313                         SHELLEXECUTEINFO shexinfo;
01314
01315                         shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
01316                         shexinfo.fMask = SEE_MASK_IDLIST;       // SEE_MASK_INVOKEIDLIST is also possible.
01317                         shexinfo.hwnd = hparent;
01318                         shexinfo.lpVerb = NULL;
01319                         shexinfo.lpFile = NULL;
01320                         shexinfo.lpParameters = NULL;
01321                         shexinfo.lpDirectory = NULL;
01322                         shexinfo.nShow = SW_SHOWNORMAL;
01323
01324                         shexinfo.lpIDList = &*shell_path;
01325
01326                          // add PIDL to the recent file list
01327                         SHAddToRecentDocs(SHARD_PIDL, shexinfo.lpIDList);
01328
01329                         if (!ShellExecuteEx(&shexinfo))
01330                                 display_error(hparent, GetLastError());
01331
01332                          // we may have deleted 'this' - ensure we leave the loop and function
01333                         return;
01334                 }
01335         }
01336
01337         if (!new_folders.empty()) {
01338                  // Only open one submenu at a time.
01339                 if (!CloseOtherSubmenus(id))
01340                         return;
01341
01342                 CreateSubmenu(id, new_folders, title);
01343         }
01344 }
01345
01346
01348 void StartMenu::CloseStartMenu(int id)
01349 {
01350         if (!(GetWindowStyle(_hwnd) & WS_CAPTION)) {    // don't automatically close floating menus
01351                 if (!SendParent(PM_STARTENTRY_LAUNCHED, id, (LPARAM)_hwnd))
01352                         DestroyWindow(_hwnd);
01353         } else if (_submenu)    // instead close submenus of floating parent menus
01354                 CloseSubmenus();
01355 }
01356
01357
01358 int GetStartMenuBtnTextWidth(HDC hdc, LPCTSTR title, HWND hwnd)
01359 {
01360         RECT rect = {0, 0, 0, 0};
01361         DrawText(hdc, title, -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
01362
01363         return rect.right-rect.left;
01364 }
01365
01366 #ifdef _LIGHT_STARTMENU
01367 void DrawStartMenuButton(HDC hdc, const RECT& rect, LPCTSTR title, const SMBtnInfo& btn, bool has_focus, bool pushed, bool large_icons)
01368 #else
01369 void DrawStartMenuButton(HDC hdc, const RECT& rect, LPCTSTR title, HICON hIcon,
01370                                                                 bool hasSubmenu, bool enabled, bool has_focus, bool pushed, bool large_icons);
01371 #endif
01372 {
01373         UINT style = DFCS_BUTTONPUSH;
01374
01375         if (!btn._enabled)
01376                 style |= DFCS_INACTIVE;
01377
01378         POINT iconPos = {rect.left+2, (rect.top+rect.bottom-ICON_SIZE_Y)/2};
01379         RECT textRect = {rect.left+ICON_SIZE_X+4, rect.top+2, rect.right-4, rect.bottom-4};
01380
01381         if (pushed) {
01382                 style |= DFCS_PUSHED;
01383                 ++iconPos.x;            ++iconPos.y;
01384                 ++textRect.left;        ++textRect.top;
01385                 ++textRect.right;       ++textRect.bottom;
01386         }
01387
01388         int bk_color_idx = COLOR_BTNFACE;
01389         int text_color_idx = COLOR_BTNTEXT;
01390
01391         if (has_focus) {
01392                 bk_color_idx = COLOR_HIGHLIGHT;
01393                 text_color_idx = COLOR_HIGHLIGHTTEXT;
01394         }
01395
01396         COLORREF bk_color = GetSysColor(bk_color_idx);
01397         HBRUSH bk_brush = GetSysColorBrush(bk_color_idx);
01398
01399         if (title)
01400                 FillRect(hdc, &rect, bk_brush);
01401
01402         if (btn._icon_id > ICID_NONE)
01403                 g_Globals._icon_cache.get_icon(btn._icon_id).draw(hdc, iconPos.x, iconPos.y, ICON_SIZE_X, ICON_SIZE_Y, bk_color, bk_brush/*, large_icons*/);
01404
01405          // draw submenu arrow at the right
01406         if (btn._hasSubmenu) {
01407                 ResIconEx arrowIcon(IDI_ARROW, ICON_SIZE_X, ICON_SIZE_Y);
01408                 ResIconEx selArrowIcon(IDI_ARROW_SELECTED, ICON_SIZE_X, ICON_SIZE_Y);
01409
01410                 DrawIconEx(hdc, rect.right-ICON_SIZE_X, iconPos.y,
01411                                         has_focus? selArrowIcon: arrowIcon,
01412                                         ICON_SIZE_X, ICON_SIZE_Y, 0, bk_brush, DI_NORMAL);
01413         }
01414
01415         if (title) {
01416                 BkMode bk_mode(hdc, TRANSPARENT);
01417
01418                 if (!btn._enabled)      // dis->itemState & (ODS_DISABLED|ODS_GRAYED)
01419                         DrawGrayText(hdc, &textRect, title, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
01420                 else {
01421                         TextColor lcColor(hdc, GetSysColor(text_color_idx));
01422                         DrawText(hdc, title, -1, &textRect, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
01423                 }
01424         }
01425 }
01426
01427
01428 #ifdef _LIGHT_STARTMENU
01429
01430 void StartMenu::ResizeToButtons()
01431 {
01432         WindowRect rect(_hwnd);
01433
01434         WindowCanvas canvas(_hwnd);
01435         FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
01436
01437         const bool large_icons = _large_icons;
01438
01439         int max_width = STARTMENU_WIDTH_MIN;
01440         int height = 0;
01441
01442         for(SMBtnVector::const_iterator it=_buttons.begin(); it!=_buttons.end(); ++it) {
01443                 int w = GetStartMenuBtnTextWidth(canvas, it->_title, _hwnd);
01444
01445                 if (w > max_width)
01446                         max_width = w;
01447
01448                 if (it->_id == -1)
01449                         height += STARTMENU_SEP_HEIGHT;
01450                 else
01451                         height += STARTMENU_LINE_HEIGHT;
01452         }
01453
01454          // calculate new window size
01455         int text_width = max_width + ICON_SIZE_X + 10/*placeholder*/ + 16/*arrow*/;
01456
01457         RECT rt_hgt = {rect.left, rect.bottom-_border_top-height, rect.left+_border_left+text_width, rect.bottom};
01458         AdjustWindowRectEx(&rt_hgt, GetWindowStyle(_hwnd), FALSE, GetWindowExStyle(_hwnd));
01459
01460          // ignore movement, only look at the size change
01461         rect.right = rect.left + (rt_hgt.right-rt_hgt.left);
01462         rect.top = rect.bottom - (rt_hgt.bottom-rt_hgt.top);
01463
01464          // move down if we are too high
01465         if (rect.top < 0) {
01466                 int dy = -rect.top;
01467                 rect.top += dy;
01468                 rect.bottom += dy;
01469         }
01470
01471          // enable scroll mode for long start menus, which span more than the whole screen height
01472         int cyscreen = GetSystemMetrics(SM_CYSCREEN);
01473         int bottom_max = 0;
01474
01475         if (rect.bottom > cyscreen) {
01476                 _arrow_btns = true;
01477
01478                 _invisible_lines = (rect.bottom-cyscreen+(STARTMENU_LINE_HEIGHT-1))/STARTMENU_LINE_HEIGHT + 1;
01479                 rect.bottom -= _invisible_lines * STARTMENU_LINE_HEIGHT;
01480
01481                 bottom_max = rect.bottom;
01482
01483                 if (_floating_btn)
01484                         rect.bottom += 6;       // lower scroll arrow
01485                 else {
01486                         _border_top += 6;       // upper scroll arrow
01487                         rect.bottom += 2*6;     // upper+lower scroll arrow
01488                 }
01489         }
01490
01491         MoveWindow(_hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, TRUE);
01492
01493         if (bottom_max) {
01494                 POINT pt = {0, bottom_max};
01495
01496                 ScreenToClient(_hwnd, &pt);
01497
01498                 _bottom_max = pt.y;
01499         }
01500 }
01501
01502 #else // _LIGHT_STARTMENU
01503
01504 LRESULT StartMenuButton::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
01505 {
01506         switch(nmsg) {
01507           case WM_MOUSEMOVE:
01508                  // automatically set the focus to startmenu entries when moving the mouse over them
01509                 if (GetFocus()!=_hwnd && !(GetWindowStyle(_hwnd)&WS_DISABLED))
01510                         SetFocus(_hwnd);
01511                 break;
01512
01513           case WM_SETFOCUS:
01514                 PostParent(PM_STARTENTRY_FOCUSED, _hasSubmenu, (LPARAM)_hwnd);
01515                 goto def;
01516
01517           case WM_CANCELMODE:
01518                  // route WM_CANCELMODE to the startmenu window
01519                 return SendParent(nmsg, wparam, lparam);
01520
01521           default: def:
01522                 return super::WndProc(nmsg, wparam, lparam);
01523         }
01524
01525         return 0;
01526 }
01527
01528 void StartMenuButton::DrawItem(LPDRAWITEMSTRUCT dis)
01529 {
01530         TCHAR title[BUFFER_LEN];
01531
01532         GetWindowText(_hwnd, title, BUFFER_LEN);
01533
01534         DrawStartMenuButton(dis->hDC, dis->rcItem, title, _hIcon,
01535                                                 _hasSubmenu,
01536                                                 !(dis->itemState & ODS_DISABLED),
01537                                                 dis->itemState&ODS_FOCUS? true: false,
01538                                                 dis->itemState&ODS_SELECTED? true: false);
01539 }
01540
01541 #endif
01542
01543
01544 StartMenuRoot::StartMenuRoot(HWND hwnd)
01545  :      super(hwnd, false)
01546 {
01547 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01548         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCOMMONGROUPS))
01549 #endif
01550                 try {
01551                          // insert directory "All Users\Start Menu"
01552                         ShellDirectory cmn_startmenu(GetDesktopFolder(), SpecialFolderPath(CSIDL_COMMON_STARTMENU, _hwnd), _hwnd);
01553                         _dirs.push_back(StartMenuDirectory(cmn_startmenu, (LPCTSTR)SpecialFolderFSPath(CSIDL_COMMON_PROGRAMS, _hwnd)));
01554                 } catch(COMException&) {
01555                         // ignore exception and don't show additional shortcuts
01556                 }
01557
01558         try {
01559                  // insert directory "<user name>\Start Menu"
01560                 ShellDirectory usr_startmenu(GetDesktopFolder(), SpecialFolderPath(CSIDL_STARTMENU, _hwnd), _hwnd);
01561                 _dirs.push_back(StartMenuDirectory(usr_startmenu, (LPCTSTR)SpecialFolderFSPath(CSIDL_PROGRAMS, _hwnd)));
01562         } catch(COMException&) {
01563                 // ignore exception and don't show additional shortcuts
01564         }
01565
01566         ReadLogoSize();
01567 }
01568
01569 void StartMenuRoot::ReadLogoSize()
01570 {
01571          // read size of logo bitmap
01572         BITMAP bmp_hdr;
01573         GetObject(ResBitmap(GetLogoResId()), sizeof(BITMAP), &bmp_hdr);
01574         _logo_size.cx = bmp_hdr.bmWidth;
01575         _logo_size.cy = bmp_hdr.bmHeight;
01576
01577          // cache logo width
01578         _border_left = _logo_size.cx + 1;
01579 }
01580
01581
01582 static void CalculateStartPos(HWND hwndOwner, RECT& rect, bool large_icons)
01583 {
01584         WindowRect pos(hwndOwner);
01585
01586         rect.left = pos.left;
01587         rect.top = pos.top-STARTMENU_LINE_HEIGHT-4;
01588         rect.right = pos.left+STARTMENU_WIDTH_MIN;
01589         rect.bottom = pos.top;
01590
01591 #ifndef _LIGHT_STARTMENU
01592         rect.top += STARTMENU_LINE_HEIGHT;
01593 #endif
01594
01595         AdjustWindowRectEx(&rect, WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN|WS_VISIBLE, FALSE, 0);
01596 }
01597
01598 HWND StartMenuRoot::Create(HWND hwndOwner, bool large_icons)
01599 {
01600         RECT rect;
01601
01602         CalculateStartPos(hwndOwner, rect, large_icons);
01603
01604         return Window::Create(WINDOW_CREATOR(StartMenuRoot), 0, GetWndClasss(), TITLE_STARTMENU,
01605                                                         WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN,
01606                                                         rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, hwndOwner);
01607 }
01608
01609
01610 void StartMenuRoot::TrackStartmenu()
01611 {
01612         MSG msg;
01613         HWND hwnd = _hwnd;
01614
01615 #ifdef _LIGHT_STARTMENU
01616         _selected_id = -1;
01617 #endif
01618
01619 #ifdef _LIGHT_STARTMENU
01620          // recalculate start menu root position
01621         RECT rect;
01622
01623         CalculateStartPos(GetParent(hwnd), rect, _large_icons);
01624
01625         SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, 0);
01626
01627         ResizeToButtons();
01628 #endif
01629
01630          // show previously hidden start menu
01631         ShowWindow(hwnd, SW_SHOW);
01632         SetForegroundWindow(hwnd);
01633
01634         while(IsWindow(hwnd) && IsWindowVisible(hwnd)) {
01635                 if (!GetMessage(&msg, 0, 0, 0)) {
01636                         PostQuitMessage(msg.wParam);
01637                         break;
01638                 }
01639
01640                  // Check for a mouse click on any window, that is not part of the start menu
01641                 if (msg.message==WM_LBUTTONDOWN || msg.message==WM_MBUTTONDOWN || msg.message==WM_RBUTTONDOWN) {
01642                         StartMenu* menu_wnd = NULL;
01643
01644                         for(HWND hwnd=msg.hwnd; hwnd; hwnd=GetParent(hwnd)) {
01645                                 menu_wnd = WINDOW_DYNAMIC_CAST(StartMenu, hwnd);
01646
01647                                 if (menu_wnd)
01648                                         break;
01649                         }
01650
01651                         if (!menu_wnd) {
01652                                 CloseStartMenu();
01653                                 break;
01654                         }
01655                 }
01656
01657                 try {
01658                         if (pretranslate_msg(&msg))
01659                                 continue;
01660
01661                         if (dispatch_dialog_msg(&msg))
01662                                 continue;
01663
01664                         TranslateMessage(&msg);
01665
01666                         try {
01667                                 DispatchMessage(&msg);
01668                         } catch(COMException& e) {
01669                                 HandleException(e, _hwnd);
01670                         }
01671                 } catch(COMException& e) {
01672                         HandleException(e, _hwnd);
01673                 }
01674         }
01675 }
01676
01677
01678 LRESULT StartMenuRoot::Init(LPCREATESTRUCT pcs)
01679 {
01680          // add buttons for entries in _entries
01681         if (super::Init(pcs))
01682                 return 1;
01683
01684         AddSeparator();
01685
01686
01687 #ifdef __MINGW32__
01688         HKEY hkey, hkeyAdv;
01689         DWORD value, len;
01690
01691         if (RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"), &hkey))
01692                 hkey = 0;
01693
01694         if (RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"), &hkeyAdv))
01695                 hkeyAdv = 0;
01696
01697 #define IS_VALUE_ZERO(hk, name) \
01698         (!hk || (len=sizeof(value),RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE)&value, &len) || !value))
01699
01700 #define IS_VALUE_NOT_ZERO(hk, name) \
01701         (!hk || (len=sizeof(value),RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE)&value, &len) || value>0))
01702 #endif
01703
01704
01705          // insert hard coded start entries
01706         AddButton(ResString(IDS_PROGRAMS),              ICID_APPS, true, IDC_PROGRAMS);
01707
01708         AddButton(ResString(IDS_DOCUMENTS),             ICID_DOCUMENTS, true, IDC_DOCUMENTS);
01709
01710 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01711         if (!g_Globals._SHRestricted || !SHRestricted(REST_NORECENTDOCSMENU))
01712 #else
01713         if (IS_VALUE_ZERO(hkey, _T("NoRecentDocsMenu")))
01714 #endif
01715                 AddButton(ResString(IDS_RECENT),        ICID_DOCUMENTS, true, IDC_RECENT);
01716
01717         AddButton(ResString(IDS_FAVORITES),             ICID_FAVORITES, true, IDC_FAVORITES);
01718
01719         AddButton(ResString(IDS_SETTINGS),              ICID_CONFIG, true, IDC_SETTINGS);
01720
01721         AddButton(ResString(IDS_BROWSE),                ICID_FOLDER, true, IDC_BROWSE);
01722
01723 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01724         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOFIND))
01725 #else
01726         if (IS_VALUE_ZERO(hkey, _T("NoFind")))
01727 #endif
01728                 AddButton(ResString(IDS_SEARCH),        ICID_SEARCH, true, IDC_SEARCH);
01729
01730         AddButton(ResString(IDS_START_HELP),    ICID_INFO, false, IDC_START_HELP);
01731
01732 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01733         if (!g_Globals._SHRestricted || !SHRestricted(REST_NORUN))
01734 #else
01735         if (IS_VALUE_ZERO(hkey, _T("NoRun")))
01736 #endif
01737                 AddButton(ResString(IDS_LAUNCH),        ICID_ACTION, false, IDC_LAUNCH);
01738
01739
01740         AddSeparator();
01741
01742
01743 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01744         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCLOSE))
01745 #else
01746         if (IS_VALUE_NOT_ZERO(hkeyAdv, _T("StartMenuLogoff")))
01747 #endif
01748                 AddButton(ResString(IDS_LOGOFF),        ICID_LOGOFF, false, IDC_LOGOFF);
01749
01750
01751 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01752         if (!g_Globals._SHRestricted || SHRestricted(REST_STARTMENULOGOFF) != 1)
01753 #else
01754         if (IS_VALUE_ZERO(hkey, _T("NoClose")))
01755 #endif
01756                 AddButton(ResString(IDS_SHUTDOWN),      ICID_LOGOFF, false, IDC_SHUTDOWN);
01757
01758
01759 #ifndef _ROS_
01760         AddButton(ResString(IDS_TERMINATE),     ICID_LOGOFF, false, IDC_TERMINATE);
01761 #endif
01762
01763
01764 #ifdef __MINGW32__
01765         RegCloseKey(hkeyAdv);
01766         RegCloseKey(hkey);
01767 #endif
01768
01769
01770 #ifdef _LIGHT_STARTMENU
01771          // set the window size to fit all buttons
01772         ResizeToButtons();
01773 #endif
01774
01775         return 0;
01776 }
01777
01778
01779 void StartMenuRoot::AddEntries()
01780 {
01781         super::AddEntries();
01782
01783         AddButton(ResString(IDS_EXPLORE),       ICID_EXPLORER, false, IDC_EXPLORE);
01784 }
01785
01786
01787 LRESULT StartMenuRoot::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
01788 {
01789         switch(nmsg) {
01790           case WM_PAINT: {
01791                 PaintCanvas canvas(_hwnd);
01792                 Paint(canvas);
01793                 break;}
01794
01795           case WM_DISPLAYCHANGE:
01796                  // re-evaluate logo size using the correct color depth
01797                 ReadLogoSize();
01798                 break;
01799
01800           default:
01801                 return super::WndProc(nmsg, wparam, lparam);
01802         }
01803
01804         return 0;
01805 }
01806
01807 void StartMenuRoot::Paint(PaintCanvas& canvas)
01808 {
01809         MemCanvas mem_dc;
01810         ResBitmap bmp(GetLogoResId());
01811         BitmapSelection sel(mem_dc, bmp);
01812
01813         ClientRect clnt(_hwnd);
01814         int h = min(_logo_size.cy, clnt.bottom);
01815
01816         RECT rect = {0, 0, _logo_size.cx, clnt.bottom-h};
01817         HBRUSH hbr = CreateSolidBrush(GetPixel(mem_dc, 0, 0));
01818         FillRect(canvas, &rect, hbr);
01819         DeleteObject(hbr);
01820
01821         PatBlt(canvas, _logo_size.cx, 0, 1, clnt.bottom, WHITENESS);
01822
01823     BitBlt(canvas, 0, clnt.bottom-h, _logo_size.cx, h, mem_dc, 0, ( h<_logo_size.cy ? _logo_size.cy-h : 0) , SRCCOPY);
01824
01825         super::Paint(canvas);
01826 }
01827
01828 UINT StartMenuRoot::GetLogoResId()
01829 {
01830         WindowCanvas dc(_hwnd);
01831
01832         int clr_bits = GetDeviceCaps(dc, BITSPIXEL);
01833
01834         if (clr_bits > 8)
01835                 return IDB_LOGOV;
01836         else if (clr_bits > 4)
01837                 return IDB_LOGOV256;
01838         else
01839                 return IDB_LOGOV16;
01840 }
01841
01842
01843 void StartMenuRoot::CloseStartMenu(int id)
01844 {
01845         if (_submenu)
01846                 CloseSubmenus();
01847
01848         ShowWindow(_hwnd, SW_HIDE);
01849 }
01850
01851 void StartMenuRoot::ProcessKey(int vk)
01852 {
01853         switch(vk) {
01854           case VK_LEFT:
01855                 if (_submenu)
01856                         CloseOtherSubmenus();
01857                 // don't close start menu root
01858                 break;
01859
01860           default:
01861                 super::ProcessKey(vk);
01862         }
01863 }
01864
01865
01866 int StartMenuHandler::Command(int id, int code)
01867 {
01868         switch(id) {
01869
01870         // start menu root
01871
01872           case IDC_PROGRAMS:
01873                 CreateSubmenu(id, CSIDL_COMMON_PROGRAMS, CSIDL_PROGRAMS, ResString(IDS_PROGRAMS));
01874                 break;
01875
01876           case IDC_EXPLORE:
01877                 CloseStartMenu(id);
01878                 explorer_show_frame(SW_SHOWNORMAL);
01879                 break;
01880
01881           case IDC_LAUNCH:
01882                 CloseStartMenu(id);
01883                 ShowLaunchDialog(g_Globals._hwndDesktopBar);
01884                 break;
01885
01886           case IDC_DOCUMENTS:
01887                 CreateSubmenu(id, CSIDL_PERSONAL, ResString(IDS_DOCUMENTS));
01888                 break;
01889
01890           case IDC_RECENT:
01891                 CreateSubmenu(id, CSIDL_RECENT, ResString(IDS_RECENT), STARTMENU_CREATOR(RecentStartMenu));
01892                 break;
01893
01894           case IDC_FAVORITES:
01895 #ifndef _SHELL32_FAVORITES
01896                 CreateSubmenu(id, ResString(IDS_FAVORITES), STARTMENU_CREATOR(FavoritesMenu), &static_cast<BookmarkList&>(g_Globals._favorites));
01897 #else
01898                 CreateSubmenu(id, CSIDL_COMMON_FAVORITES, CSIDL_FAVORITES, ResString(IDS_FAVORITES));
01899 #endif
01900                 break;
01901
01902           case IDC_BROWSE:
01903                 CreateSubmenu(id, ResString(IDS_BROWSE), STARTMENU_CREATOR(BrowseMenu));
01904                 break;
01905
01906           case IDC_SETTINGS:
01907                 CreateSubmenu(id, ResString(IDS_SETTINGS), STARTMENU_CREATOR(SettingsMenu));
01908                 break;
01909
01910           case IDC_SEARCH:
01911                 CreateSubmenu(id, ResString(IDS_SEARCH), STARTMENU_CREATOR(SearchMenu));
01912                 break;
01913
01914           case IDC_START_HELP:
01915                 CloseStartMenu(id);
01916                 MessageBox(g_Globals._hwndDesktopBar, TEXT("Help not yet implemented"), ResString(IDS_TITLE), MB_OK);
01917                 break;
01918
01919           case IDC_LOGOFF:
01920                 CloseStartMenu(id);
01921                 ShowLogoffDialog(g_Globals._hwndDesktopBar);
01922                 break;
01923
01924 #ifndef _ROS_
01925           case IDC_TERMINATE:
01926                 DestroyWindow(GetParent(_hwnd));
01927                 break;
01928 #endif
01929
01930           case IDC_SHUTDOWN:
01931                 CloseStartMenu(id);
01932                 ShowExitWindowsDialog(g_Globals._hwndDesktopBar);
01933                 break;
01934
01935
01936         // settings menu
01937
01938           case ID_DESKTOPBAR_SETTINGS:
01939                 CloseStartMenu(id);
01940                 ExplorerPropertySheet(g_Globals._hwndDesktopBar);
01941                 break;
01942
01943           case IDC_CONTROL_PANEL: {
01944                 CloseStartMenu(id);
01945 #ifndef ROSSHELL
01946 #ifndef _NO_MDI
01947                 XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
01948                 bool mdi = XMLBool(explorer_options, "mdi", true);
01949
01950                 if (mdi)
01951                         MDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0);
01952                 else
01953 #endif
01954                         SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0);
01955 #else
01956                 launch_file(_hwnd, SHELLPATH_CONTROL_PANEL);
01957 #endif
01958                 break;}
01959
01960           case IDC_SETTINGS_MENU:
01961                 CreateSubmenu(id, CSIDL_CONTROLS, ResString(IDS_SETTINGS_MENU));
01962                 break;
01963
01964           case IDC_PRINTERS: {
01965                 CloseStartMenu(id);
01966
01967 #ifndef ROSSHELL
01968 #ifdef _ROS_    // to be removed when printer folder will be implemented
01969                 MessageBox(0, TEXT("printer folder not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
01970 #else
01971 #ifndef _NO_MDI
01972                 XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
01973                 bool mdi = XMLBool(explorer_options, "mdi", true);
01974
01975                 if (mdi)
01976                         MDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}"), 0);
01977                 else
01978 #endif
01979                         SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}"), 0);
01980 #endif
01981 #else
01982                 launch_file(_hwnd, SHELLPATH_PRINTERS);
01983 #endif
01984                 break;}
01985
01986 #if 0
01987           case IDC_PRINTERS_MENU:
01988                 CreateSubmenu(id, CSIDL_PRINTERS, CSIDL_PRINTHOOD, ResString(IDS_PRINTERS));
01989 /*              StartMenuFolders new_folders;
01990
01991                 try {
01992                         new_folders.push_back(ShellPath(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}")));
01993                 } catch(COMException&) {
01994                 }
01995
01996                 CreateSubmenu(id, new_folders, ResString(IDS_PRINTERS));*/
01997                 break;
01998 #endif
01999
02000           case IDC_ADMIN:
02001 #ifndef ROSSHELL
02002                 CreateSubmenu(id, CSIDL_COMMON_ADMINTOOLS, CSIDL_ADMINTOOLS, ResString(IDS_ADMIN));
02003                 //CloseStartMenu(id);
02004                 //MainFrame::Create(SpecialFolderPath(CSIDL_COMMON_ADMINTOOLS, _hwnd), OWM_PIDL);
02005 #else
02006                 launch_file(_hwnd, SpecialFolderFSPath(CSIDL_COMMON_ADMINTOOLS, _hwnd));
02007 #endif
02008                 break;
02009
02010           case IDC_CONNECTIONS:
02011 #ifndef ROSSHELL
02012 #ifdef _ROS_    // to be removed when RAS will be implemented
02013                 MessageBox(0, TEXT("RAS folder not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02014 #else
02015                 CreateSubmenu(id, CSIDL_CONNECTIONS, ResString(IDS_CONNECTIONS));
02016                 //CloseStartMenu(id);
02017                 //MainFrame::Create(SpecialFolderPath(CSIDL_CONNECTIONS, _hwnd), OWM_PIDL);
02018 #endif
02019 #else
02020                 launch_file(_hwnd, SHELLPATH_NET_CONNECTIONS);
02021 #endif
02022                 break;
02023
02024
02025         // browse menu
02026
02027           case IDC_NETWORK:
02028 #ifdef _ROS_
02029                 MessageBox(0, TEXT("network not yet implemented"), ResString(IDS_TITLE), MB_OK);
02030 #else
02031                 CreateSubmenu(id, CSIDL_NETWORK, ResString(IDS_NETWORK));
02032 #endif
02033                 break;
02034
02035           case IDC_DRIVES:
02037                 CreateSubmenu(id, CSIDL_DRIVES, ResString(IDS_DRIVES));
02038                 break;
02039
02040
02041         // search menu
02042
02043           case IDC_SEARCH_PROGRAM:
02044                 CloseStartMenu(id);
02045                 Dialog::DoModal(IDD_SEARCH_PROGRAM, WINDOW_CREATOR(FindProgramDlg));
02046                 break;
02047
02048           case IDC_SEARCH_FILES:
02049                 CloseStartMenu(id);
02050                 ShowSearchDialog();
02051                 break;
02052
02053           case IDC_SEARCH_COMPUTER:
02054                 CloseStartMenu(id);
02055                 ShowSearchComputer();
02056                 break;
02057
02058
02059           default:
02060                 return super::Command(id, code);
02061         }
02062
02063         return 0;
02064 }
02065
02066
02067 void StartMenuHandler::ShowSearchDialog()
02068 {
02069 #ifndef _ROS_
02070         static DynamicFct<SHFINDFILES> SHFindFiles(TEXT("SHELL32"), 90);
02071
02072         if (SHFindFiles)
02073                 (*SHFindFiles)(NULL, NULL);
02074         else
02075 #endif
02076                 MessageBox(0, TEXT("SHFindFiles() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02077 }
02078
02079 void StartMenuHandler::ShowSearchComputer()
02080 {
02081 #ifndef _ROS_
02082         static DynamicFct<SHFINDCOMPUTER> SHFindComputer(TEXT("SHELL32"), 91);
02083
02084         if (SHFindComputer)
02085                 (*SHFindComputer)(NULL, NULL);
02086         else
02087 #endif
02088                 MessageBox(0, TEXT("SHFindComputer() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02089 }
02090
02091 void StartMenuHandler::ShowLaunchDialog(HWND hwndOwner)
02092 {
02094         static LPCSTR szTitle = "Run";
02095         static LPCSTR szText = "Type the name of a program, folder, document, or Internet resource, and Explorer will open it for you.";
02096
02097         static DynamicFct<RUNFILEDLG> RunFileDlg(TEXT("SHELL32"), 61);
02098
02099          // Show "Run..." dialog
02100         if (RunFileDlg) {
02101 #ifndef _ROS_ /* FIXME: our shell32 always expects Ansi strings */
02102                 if ((HIWORD(GetVersion())>>14) == W_VER_NT) {
02103                         WCHAR wTitle[40], wText[256];
02104
02105                         MultiByteToWideChar(CP_ACP, 0, szTitle, -1, wTitle, 40);
02106                         MultiByteToWideChar(CP_ACP, 0, szText, -1, wText, 256);
02107
02108                         (*RunFileDlg)(hwndOwner, 0, NULL, (LPCSTR)wTitle, (LPCSTR)wText, RFF_CALCDIRECTORY);
02109                 }
02110                 else
02111 #endif
02112                         (*RunFileDlg)(hwndOwner, 0, NULL, szTitle, szText, RFF_CALCDIRECTORY);
02113         }
02114 }
02115
02116 void StartMenuHandler::ShowLogoffDialog(HWND hwndOwner)
02117 {
02118         static DynamicFct<LOGOFFWINDOWSDIALOG> LogoffWindowsDialog(TEXT("SHELL32"), 54);
02119 //      static DynamicFct<RESTARTWINDOWSDLG> RestartDialog(TEXT("SHELL32"), 59);
02120
02121         if (LogoffWindowsDialog)
02122                 (*LogoffWindowsDialog)(0);
02123 /* The RestartDialog function prompts about some system setting change. This is not what we want to display here.
02124         else if (RestartDialog)
02125                 return (*RestartDialog)(hwndOwner, (LPWSTR)L"You selected <Log Off>.\n\n", EWX_LOGOFF) == 1;    ///@todo ANSI string conversion if needed
02126 */
02127         else
02128                 MessageBox(hwndOwner, TEXT("LogoffWindowsDialog() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02129 }
02130
02131 void ShowExitWindowsDialog(HWND hwndOwner)
02132 {
02133         static DynamicFct<EXITWINDOWSDLG> ExitWindowsDialog(TEXT("SHELL32"), 60);
02134
02135         if (ExitWindowsDialog)
02136                 (*ExitWindowsDialog)(hwndOwner);
02137         else
02138                 MessageBox(hwndOwner, TEXT("ExitWindowsDialog() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02139 }
02140
02141
02142 void SettingsMenu::AddEntries()
02143 {
02144         super::AddEntries();
02145
02146 #if defined(ROSSHELL) || defined(_ROS_) // _ROS_ to be removed when printer/network will be implemented
02147 //TODO  AddButton(ResString(IDS_PRINTERS),                      ICID_PRINTER, false, IDC_PRINTERS_MENU);
02148         AddButton(ResString(IDS_CONNECTIONS),           ICID_NETWORK, false, IDC_CONNECTIONS);
02149 #else
02150 //TODO  AddButton(ResString(IDS_PRINTERS),                      ICID_PRINTER, true, IDC_PRINTERS_MENU);
02151         AddButton(ResString(IDS_CONNECTIONS),           ICID_NETWORK, true, IDC_CONNECTIONS);
02152 #endif
02153         AddButton(ResString(IDS_ADMIN),                         ICID_CONFIG, true, IDC_ADMIN);
02154
02155 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
02156         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCONTROLPANEL))
02157 #endif
02158                 AddButton(ResString(IDS_SETTINGS_MENU), ICID_CONFIG, true, IDC_SETTINGS_MENU);
02159
02160         AddButton(ResString(IDS_DESKTOPBAR_SETTINGS), ICID_CONFIG, false, ID_DESKTOPBAR_SETTINGS);
02161
02162         AddButton(ResString(IDS_PRINTERS),                      ICID_PRINTER, false, IDC_PRINTERS);
02163
02164 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
02165         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCONTROLPANEL))
02166 #endif
02167                 AddButton(ResString(IDS_CONTROL_PANEL), ICID_CONFIG, false, IDC_CONTROL_PANEL);
02168 }
02169
02170 void BrowseMenu::AddEntries()
02171 {
02172         super::AddEntries();
02173
02174 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
02175         if (!g_Globals._SHRestricted || !SHRestricted(REST_NONETHOOD))  // or REST_NOENTIRENETWORK ?
02176 #endif
02177 #if defined(ROSSHELL) || defined(_ROS_) // _ROS_ to be removed when printer/network will be implemented
02178                 AddButton(ResString(IDS_NETWORK),               ICID_NETWORK, false, IDC_NETWORK);
02179 #else
02180                 AddButton(ResString(IDS_NETWORK),               ICID_NETWORK, true, IDC_NETWORK);
02181 #endif
02182
02183         AddButton(ResString(IDS_DRIVES),                        ICID_FOLDER, true, IDC_DRIVES);
02184 }
02185
02186 void SearchMenu::AddEntries()
02187 {
02188         super::AddEntries();
02189
02190         AddButton(ResString(IDS_SEARCH_FILES),          ICID_SEARCH_DOC, false, IDC_SEARCH_FILES);
02191
02192 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
02193         if (!g_Globals._SHRestricted || !SHRestricted(REST_HASFINDCOMPUTERS))
02194 #endif
02195                 AddButton(ResString(IDS_SEARCH_COMPUTER),ICID_COMPUTER, false, IDC_SEARCH_COMPUTER);
02196
02197         AddButton(ResString(IDS_SEARCH_PRG),            ICID_APPS, false, IDC_SEARCH_PROGRAM);
02198 }
02199
02200
02201 void RecentStartMenu::AddEntries()
02202 {
02203         for(StartMenuShellDirs::iterator it=_dirs.begin(); it!=_dirs.end(); ++it) {
02204                 StartMenuDirectory& smd = *it;
02205                 ShellDirectory& dir = smd._dir;
02206
02207                 if (!dir._scanned) {
02208                         WaitCursor wait;
02209
02210 #ifdef _LAZY_ICONEXTRACT
02211                         dir.smart_scan(SORT_NAME, SCAN_FILESYSTEM);
02212 #else
02213                         dir.smart_scan(SORT_NAME, SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM);
02214 #endif
02215                 }
02216
02217                 dir.sort_directory(SORT_DATE);
02218                 AddShellEntries(dir, RECENT_DOCS_COUNT, smd._ignore);
02219         }
02220 }
02221
02222
02223 #ifndef _SHELL32_FAVORITES
02224
02225 void FavoritesMenu::AddEntries()
02226 {
02227         super::AddEntries();
02228
02229         String lwr_filter = _create_info._filter;
02230         lwr_filter.toLower();
02231
02232         for(BookmarkList::iterator it=_bookmarks.begin(); it!=_bookmarks.end(); ++it) {
02233                 BookmarkNode& node = *it;
02234
02235                 int id = ++_next_id;
02236
02237                 _entries[id] = node;
02238
02239                 if (node._type == BookmarkNode::BMNT_FOLDER) {
02240                         BookmarkFolder& folder = *node._pfolder;
02241
02242                         AddButton(folder._name, ICID_FOLDER, true, id);
02243                 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
02244                         Bookmark& bookmark = *node._pbookmark;
02245
02246                         ICON_ID icon = ICID_NONE;
02247
02248                         if (!bookmark._icon_path.empty())
02249                                 icon = g_Globals._icon_cache.extract(bookmark._icon_path, bookmark._icon_idx);
02250
02251                          // filter non-directory entries
02252                         if (!lwr_filter.empty()) {
02253                                 String lwr_name = bookmark._name;
02254                                 String lwr_desc = bookmark._description;
02255                                 String lwr_url = bookmark._url;
02256
02257                                 lwr_name.toLower();
02258                                 lwr_desc.toLower();
02259                                 lwr_url.toLower();
02260
02261                                 if (!_tcsstr(lwr_name,lwr_filter) && !_tcsstr(lwr_desc,lwr_filter) && !_tcsstr(lwr_url,lwr_filter))
02262                                         continue;
02263                         }
02264
02265                         AddButton(bookmark._name, icon!=ICID_NONE?icon:ICID_BOOKMARK, false, id);
02266                 }
02267         }
02268 }
02269
02270 int FavoritesMenu::Command(int id, int code)
02271 {
02272         BookmarkMap::iterator found = _entries.find(id);
02273
02274         if (found != _entries.end()) {
02275                 BookmarkNode& node = found->second;
02276
02277                 if (node._type == BookmarkNode::BMNT_FOLDER) {
02278                         BookmarkFolder& folder = *node._pfolder;
02279
02280                         if (CloseOtherSubmenus(id))
02281                                 CreateSubmenu(id, folder._name, STARTMENU_CREATOR(FavoritesMenu), &static_cast<BookmarkList&>(folder._bookmarks));
02282                 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
02283                         Bookmark& bookmark = *node._pbookmark;
02284
02285                         String url = bookmark._url;
02286                         HWND hparent = GetParent(_hwnd);
02287
02288                         CloseStartMenu(id);
02289
02290                         launch_file(hparent, url, SW_SHOWNORMAL);
02291                 }
02292
02293                 return 0;
02294         }
02295
02296         return super::Command(id, code);
02297 }
02298
02299 #endif


ROS Explorer: startmenu.h File Reference

  • File List
  • File Members
taskbar

startmenu.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | StartMenuDirectory
StartMenuDirectory is used to store the base directory of start menus. More...
struct | StartMenuEntry
structure holding information about one start menu entry More...
struct | StartMenuCreateInfo
structor containing information for creating of start menus More...
struct | SMBtnInfo
struct | StartMenu
Startmenu window. More...
struct | StartMenuHandler
Handling of standard start menu commands. More...
struct | StartMenuRoot
Startmenu root window. More...
struct | SettingsMenu
Settings sub-startmenu. More...
struct | BrowseMenu
"Browse Files..." sub-start menu More...
struct | SearchMenu
Search sub-startmenu. More...
struct | RecentStartMenu
"Recent Files" sub-start menu More...
struct | FavoritesMenu
Bookmarks sub-startmenu. More...

Defines

#define | _LIGHT_STARTMENU
#define | _LAZY_ICONEXTRACT
#define | _SINGLE_ICONEXTRACT
#define | CLASSNAME_STARTMENU TEXT("ReactosStartmenuClass")
#define | TITLE_STARTMENU TEXT("Start Menu")
#define | STARTMENU_WIDTH_MIN 120
#define | STARTMENU_LINE_HEIGHT (ICON_SIZE_X+4)
#define | STARTMENU_SEP_HEIGHT (STARTMENU_LINE_HEIGHT/2)
#define | STARTMENU_TOP_BTN_SPACE 8
#define | PM_STARTMENU_CLOSED (WM_APP+0x11)
#define | PM_STARTENTRY_LAUNCHED (WM_APP+0x12)
#define | PM_UPDATE_ICONS (WM_APP+0x14)
#define | PM_SELECT_ENTRY (WM_APP+0x15)
#define | STARTMENU_CREATOR(WND_CLASS) WINDOW_CREATOR_INFO(WND_CLASS, StartMenuCreateInfo)
#define | RFF_NOBROWSE 0x01
#define | RFF_NODEFAULT 0x02
#define | RFF_CALCDIRECTORY 0x04
#define | RFF_NOLABEL 0x08
#define | RFF_NOSEPARATEMEM 0x20
#define | RECENT_DOCS_COUNT 20

Typedefs

typedef list< StartMenuDirectory > | StartMenuShellDirs
typedef set< Entry * > | ShellEntrySet
typedef list< ShellPath > | StartMenuFolders
typedef map< int, StartMenuEntry > | ShellEntryMap
typedef vector< SMBtnInfo > | SMBtnVector
typedef void(WINAPI * | RUNFILEDLG )(HWND hwndOwner, HICON hIcon, LPCSTR lpstrDirectory, LPCSTR lpstrTitle, LPCSTR lpstrDescription, UINT uFlags)
typedef void(WINAPI * | EXITWINDOWSDLG )(HWND hwndOwner)
typedef int(WINAPI * | LOGOFFWINDOWSDIALOG )(UINT flags)
typedef int(WINAPI * | RESTARTWINDOWSDLG )(HWND hwndOwner, LPCWSTR reason, UINT flags)
typedef int(WINAPI * | RESTARTWINDOWSDLGEX )(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, DWORD uReason)
typedef BOOL(WINAPI * | SHFINDFILES )(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
typedef BOOL(WINAPI * | SHFINDCOMPUTER )(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
typedef map< int, BookmarkNode > | BookmarkMap

Functions

int | GetStartMenuBtnTextWidth (HDC hdc, LPCTSTR title, HWND hwnd)
void | DrawStartMenuButton (HDC hdc, const RECT &rect, LPCTSTR title, const SMBtnInfo &btn, bool has_focus, bool pushed, bool large_icons)

Define Documentation

#define _LAZY_ICONEXTRACT

Definition at line 30 of file startmenu.h.

#define _LIGHT_STARTMENU

Definition at line 29 of file startmenu.h.

#define _SINGLE_ICONEXTRACT

Definition at line 31 of file startmenu.h.

#define CLASSNAME_STARTMENU TEXT("ReactosStartmenuClass")

Definition at line 34 of file startmenu.h.

Referenced by StartMenu::GetWndClasss().

#define PM_SELECT_ENTRY (WM_APP+0x15)

Definition at line 53 of file startmenu.h.

Referenced by StartMenu::OpenSubmenu().

#define PM_STARTENTRY_LAUNCHED (WM_APP+0x12)

Definition at line 46 of file startmenu.h.

Referenced by StartMenu::CloseStartMenu().

#define PM_STARTMENU_CLOSED (WM_APP+0x11)

Definition at line 45 of file startmenu.h.

Referenced by StartMenu::~StartMenu().

#define PM_UPDATE_ICONS (WM_APP+0x14)

Definition at line 52 of file startmenu.h.

Referenced by StartMenu::Init().

#define RECENT_DOCS_COUNT 20

Definition at line 433 of file startmenu.h.

Referenced by RecentStartMenu::AddEntries().

#define RFF_CALCDIRECTORY 0x04

Definition at line 322 of file startmenu.h.

Referenced by StartMenuHandler::ShowLaunchDialog().

#define RFF_NOBROWSE 0x01

Definition at line 320 of file startmenu.h.

#define RFF_NODEFAULT 0x02

Definition at line 321 of file startmenu.h.

#define RFF_NOLABEL 0x08

Definition at line 323 of file startmenu.h.

#define RFF_NOSEPARATEMEM 0x20

Definition at line 324 of file startmenu.h.

#define STARTMENU_CREATOR ( WND_CLASS ) WINDOW_CREATOR_INFO(WND_CLASS, StartMenuCreateInfo)

Definition at line 154 of file startmenu.h.

Referenced by FavoritesMenu::Command(), and StartMenuHandler::Command().

#define STARTMENU_LINE_HEIGHT (ICON_SIZE_X+4)

Definition at line 39 of file startmenu.h.

Referenced by StartMenu::AddButton(), StartMenu::AddSeparator(), StartMenu::ButtonHitTest(), StartMenu::GetButtonRect(), StartMenu::InvalidateSelection(), StartMenu::Paint(), and StartMenu::ResizeToButtons().

#define STARTMENU_SEP_HEIGHT (STARTMENU_LINE_HEIGHT/2)

Definition at line 40 of file startmenu.h.

Referenced by StartMenu::AddSeparator(), StartMenu::ButtonHitTest(), StartMenu::Paint(), and StartMenu::ResizeToButtons().

#define STARTMENU_TOP_BTN_SPACE 8

Definition at line 41 of file startmenu.h.

#define STARTMENU_WIDTH_MIN 120

Definition at line 38 of file startmenu.h.

Referenced by StartMenu::ResizeToButtons().

#define TITLE_STARTMENU TEXT("Start Menu")

Definition at line 35 of file startmenu.h.

Referenced by StartMenuRoot::Create().

Typedef Documentation

typedef map<int, BookmarkNode> BookmarkMap

Definition at line 452 of file startmenu.h.

typedef void(WINAPI* EXITWINDOWSDLG)(HWND hwndOwner)

Definition at line 328 of file startmenu.h.

typedef int(WINAPI* LOGOFFWINDOWSDIALOG)(UINT flags)

Definition at line 329 of file startmenu.h.

typedef int(WINAPI* RESTARTWINDOWSDLG)(HWND hwndOwner, LPCWSTR reason, UINT flags)

Definition at line 330 of file startmenu.h.

typedef int(WINAPI* RESTARTWINDOWSDLGEX)(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, DWORD uReason)

Definition at line 331 of file startmenu.h.

typedef void(WINAPI* RUNFILEDLG)(HWND hwndOwner, HICON hIcon, LPCSTR lpstrDirectory, LPCSTR lpstrTitle, LPCSTR lpstrDescription, UINT uFlags)

Definition at line 314 of file startmenu.h.

typedef map<int, StartMenuEntry> ShellEntryMap

Definition at line 156 of file startmenu.h.

typedef set<Entry*> ShellEntrySet

Definition at line 74 of file startmenu.h.

typedef BOOL(WINAPI* SHFINDCOMPUTER)(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)

Definition at line 333 of file startmenu.h.

typedef BOOL(WINAPI* SHFINDFILES)(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)

Definition at line 332 of file startmenu.h.

typedef vector<SMBtnInfo> SMBtnVector

Definition at line 188 of file startmenu.h.

typedef list<ShellPath> StartMenuFolders

Definition at line 139 of file startmenu.h.

typedef list<StartMenuDirectory> StartMenuShellDirs

Definition at line 73 of file startmenu.h.

Function Documentation

void DrawStartMenuButton | ( | HDC | hdc,
 |  | const RECT & | rect,
 |  | LPCTSTR | title,
 |  | const SMBtnInfo & | btn,
 |  | bool | has_focus,
 |  | bool | pushed,
 |  | bool | large_icons
 | ) |

Definition at line 1367 of file startmenu.cpp.

Referenced by StartMenu::Paint(), and StartMenu::UpdateIcons().

01372 {
01373         UINT style = DFCS_BUTTONPUSH;
01374
01375         if (!btn._enabled)
01376                 style |= DFCS_INACTIVE;
01377
01378         POINT iconPos = {rect.left+2, (rect.top+rect.bottom-ICON_SIZE_Y)/2};
01379         RECT textRect = {rect.left+ICON_SIZE_X+4, rect.top+2, rect.right-4, rect.bottom-4};
01380
01381         if (pushed) {
01382                 style |= DFCS_PUSHED;
01383                 ++iconPos.x;            ++iconPos.y;
01384                 ++textRect.left;        ++textRect.top;
01385                 ++textRect.right;       ++textRect.bottom;
01386         }
01387
01388         int bk_color_idx = COLOR_BTNFACE;
01389         int text_color_idx = COLOR_BTNTEXT;
01390
01391         if (has_focus) {
01392                 bk_color_idx = COLOR_HIGHLIGHT;
01393                 text_color_idx = COLOR_HIGHLIGHTTEXT;
01394         }
01395
01396         COLORREF bk_color = GetSysColor(bk_color_idx);
01397         HBRUSH bk_brush = GetSysColorBrush(bk_color_idx);
01398
01399         if (title)
01400                 FillRect(hdc, &rect, bk_brush);
01401
01402         if (btn._icon_id > ICID_NONE)
01403                 g_Globals._icon_cache.get_icon(btn._icon_id).draw(hdc, iconPos.x, iconPos.y, ICON_SIZE_X, ICON_SIZE_Y, bk_color, bk_brush/*, large_icons*/);
01404
01405          // draw submenu arrow at the right
01406         if (btn._hasSubmenu) {
01407                 ResIconEx arrowIcon(IDI_ARROW, ICON_SIZE_X, ICON_SIZE_Y);
01408                 ResIconEx selArrowIcon(IDI_ARROW_SELECTED, ICON_SIZE_X, ICON_SIZE_Y);
01409
01410                 DrawIconEx(hdc, rect.right-ICON_SIZE_X, iconPos.y,
01411                                         has_focus? selArrowIcon: arrowIcon,
01412                                         ICON_SIZE_X, ICON_SIZE_Y, 0, bk_brush, DI_NORMAL);
01413         }
01414
01415         if (title) {
01416                 BkMode bk_mode(hdc, TRANSPARENT);
01417
01418                 if (!btn._enabled)      // dis->itemState & (ODS_DISABLED|ODS_GRAYED)
01419                         DrawGrayText(hdc, &textRect, title, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
01420                 else {
01421                         TextColor lcColor(hdc, GetSysColor(text_color_idx));
01422                         DrawText(hdc, title, -1, &textRect, DT_SINGLELINE|DT_NOPREFIX|DT_VCENTER);
01423                 }
01424         }
01425 }

int GetStartMenuBtnTextWidth | ( | HDC | hdc,
 |  | LPCTSTR | title,
 |  | HWND | hwnd
 | ) |

Definition at line 1358 of file startmenu.cpp.

Referenced by StartMenu::AddButton(), and StartMenu::ResizeToButtons().

01359 {
01360         RECT rect = {0, 0, 0, 0};
01361         DrawText(hdc, title, -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
01362
01363         return rect.right-rect.left;
01364 }


ROS Explorer: startmenu.h Source File

  • File List
  • File Members
taskbar

startmenu.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer and Desktop clone
00022  //
00023  // startmenu.h
00024  //
00025  // Martin Fuchs, 16.08.2003
00026  //
00027
00028
00029 #define _LIGHT_STARTMENU
00030 #define _LAZY_ICONEXTRACT
00031 #define _SINGLE_ICONEXTRACT
00032
00033
00034 #define CLASSNAME_STARTMENU             TEXT("ReactosStartmenuClass")
00035 #define TITLE_STARTMENU                 TEXT("Start Menu")
00036
00037
00038 #define STARTMENU_WIDTH_MIN             120
00039 #define STARTMENU_LINE_HEIGHT   (ICON_SIZE_X+4)
00040 #define STARTMENU_SEP_HEIGHT    (STARTMENU_LINE_HEIGHT/2)
00041 #define STARTMENU_TOP_BTN_SPACE 8
00042
00043
00044  // private message constants
00045 #define PM_STARTMENU_CLOSED             (WM_APP+0x11)
00046 #define PM_STARTENTRY_LAUNCHED  (WM_APP+0x12)
00047
00048 #ifndef _LIGHT_STARTMENU
00049 #define PM_STARTENTRY_FOCUSED   (WM_APP+0x13)
00050 #endif
00051
00052 #define PM_UPDATE_ICONS                 (WM_APP+0x14)
00053 #define PM_SELECT_ENTRY                 (WM_APP+0x15)
00054
00055
00057 struct StartMenuDirectory
00058 {
00059         StartMenuDirectory(const ShellDirectory& dir, const String& ignore="")
00060          :      _dir(dir), _ignore(ignore)
00061         {
00062         }
00063
00064         ~StartMenuDirectory()
00065         {
00066                 _dir.free_subentries();
00067         }
00068
00069         ShellDirectory _dir;
00070         String  _ignore;
00071 };
00072
00073 typedef list<StartMenuDirectory> StartMenuShellDirs;
00074 typedef set<Entry*> ShellEntrySet;
00075
00077 struct StartMenuEntry
00078 {
00079         StartMenuEntry() : _icon_id(ICID_UNKNOWN) {}
00080
00081         String  _title;
00082         ICON_ID _icon_id;
00083         ShellEntrySet _entries;
00084 };
00085
00086
00087 extern int GetStartMenuBtnTextWidth(HDC hdc, LPCTSTR title, HWND hwnd);
00088
00089
00090 #ifndef _LIGHT_STARTMENU
00091
00095 struct StartMenuButton : public OwnerdrawnButton
00096 {
00097         typedef OwnerdrawnButton super;
00098
00099         StartMenuButton(HWND hwnd, ICON_ID icon_id, bool hasSubmenu)
00100          :      super(hwnd), _hIcon(hIcon), _hasSubmenu(hasSubmenu) {}
00101
00102 protected:
00103         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00104         virtual void DrawItem(LPDRAWITEMSTRUCT dis);
00105
00106         ICON_ID _icon_id;
00107         bool    _hasSubmenu;
00108 };
00109
00110
00114 struct StartMenuCtrl : public Button
00115 {
00116         StartMenuCtrl(HWND parent, int x, int y, int w, LPCTSTR title,
00117                                         UINT id, HICON hIcon=0, bool hasSubmenu=false, DWORD style=WS_VISIBLE|WS_CHILD|BS_OWNERDRAW, DWORD exStyle=0)
00118          :      Button(parent, title, x, y, w, STARTMENU_LINE_HEIGHT, id, style, exStyle)
00119         {
00120                 *new StartMenuButton(_hwnd, hIcon, hasSubmenu);
00121
00122                 SetWindowFont(_hwnd, GetStockFont(DEFAULT_GUI_FONT), FALSE);
00123         }
00124 };
00125
00126
00128 struct StartMenuSeparator : public Static
00129 {
00130         StartMenuSeparator(HWND parent, int x, int y, int w, DWORD style=WS_VISIBLE|WS_CHILD|WS_DISABLED|SS_ETCHEDHORZ, DWORD exStyle=0)
00131          :      Static(parent, NULL, x, y+STARTMENU_SEP_HEIGHT/2-1, w, 2, -1, style, exStyle)
00132         {
00133         }
00134 };
00135
00136 #endif
00137
00138
00139 typedef list<ShellPath> StartMenuFolders;
00140
00142 struct StartMenuCreateInfo
00143 {
00144         StartMenuCreateInfo() : _border_top(0) {}
00145
00146         StartMenuFolders _folders;
00147         int             _border_top;
00148         String  _title;
00149         Window::CREATORFUNC_INFO _creator;
00150         void*   _info;
00151         String  _filter;
00152 };
00153
00154 #define STARTMENU_CREATOR(WND_CLASS) WINDOW_CREATOR_INFO(WND_CLASS, StartMenuCreateInfo)
00155
00156 typedef map<int, StartMenuEntry> ShellEntryMap;
00157
00158
00159 #ifdef _LIGHT_STARTMENU
00160
00161 struct SMBtnInfo
00162 {
00163         SMBtnInfo(const StartMenuEntry& entry, int id, bool hasSubmenu=false, bool enabled=true)
00164          :      _title(entry._title),
00165                 _icon_id(entry._icon_id),
00166                 _id(id),
00167                 _hasSubmenu(hasSubmenu),
00168                 _enabled(enabled)
00169         {
00170         }
00171
00172         SMBtnInfo(LPCTSTR title, ICON_ID icon_id, int id, bool hasSubmenu=false, bool enabled=true)
00173          :      _title(title),
00174                 _icon_id(icon_id),
00175                 _id(id),
00176                 _hasSubmenu(hasSubmenu),
00177                 _enabled(enabled)
00178         {
00179         }
00180
00181         String  _title;
00182         ICON_ID _icon_id;
00183         int             _id;
00184         bool    _hasSubmenu;
00185         bool    _enabled;
00186 };
00187
00188 typedef vector<SMBtnInfo> SMBtnVector;
00189
00190 extern void DrawStartMenuButton(HDC hdc, const RECT& rect, LPCTSTR title, const SMBtnInfo& btn, bool has_focus, bool pushed, bool large_icons);
00191
00192 #else
00193
00194 extern void DrawStartMenuButton(HDC hdc, const RECT& rect, LPCTSTR title, HICON hIcon,
00195                                                                 bool hasSubmenu, bool enabled, bool has_focus, bool pushed, bool large_icons);
00196
00197 #endif
00198
00199
00204 struct StartMenu :
00205 #ifdef _LIGHT_STARTMENU
00206         public ExtContextMenuHandlerT<OwnerDrawParent<Window> >
00207 #else
00208         public ExtContextMenuHandlerT<OwnerDrawParent<DialogWindow> >
00209 #endif
00210 {
00211 #ifdef _LIGHT_STARTMENU
00212         typedef ExtContextMenuHandlerT<OwnerDrawParent<Window> > super;
00213 #else
00214         typedef ExtContextMenuHandlerT<OwnerDrawParent<DialogWindow> > super;
00215 #endif
00216
00217         StartMenu(HWND hwnd, bool large_icons=false);
00218         StartMenu(HWND hwnd, const StartMenuCreateInfo& create_info, bool large_icons=false);
00219         ~StartMenu();
00220
00221         static HWND Create(int x, int y, const StartMenuFolders&, HWND hwndParent, LPCTSTR title,
00222                                                 CREATORFUNC_INFO creator=s_def_creator, void* info=NULL, const String& filter="");
00223         static CREATORFUNC_INFO s_def_creator;
00224
00225 protected:
00226          // overridden member functions
00227         LRESULT Init(LPCREATESTRUCT pcs);
00228         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00229         int             Command(int id, int code);
00230
00231          // window class
00232         static BtnWindowClass& GetWndClasss();
00233
00234          // data members
00235         int             _next_id;
00236         ShellEntryMap _entries;
00237         StartMenuShellDirs _dirs;
00238
00239         int             _submenu_id;
00240         WindowHandle _submenu;
00241
00242         int             _border_left;   // left border in pixels
00243         int             _border_top;    // top border in pixels
00244         int             _bottom_max;    // limit display area for long start menus
00245
00246         bool    _floating_btn;
00247         bool    _arrow_btns;
00248
00249         POINT   _last_pos;
00250         enum SCROLL_MODE {SCROLL_NOT, SCROLL_UP, SCROLL_DOWN} _scroll_mode;
00251         int             _scroll_pos;
00252         int             _invisible_lines;
00253
00254         StartMenuCreateInfo _create_info;       // copy of the original create info
00255
00256         bool    _large_icons;
00257
00258 #ifdef _LIGHT_STARTMENU
00259         SMBtnVector _buttons;
00260         int             _selected_id;
00261         LPARAM  _last_mouse_pos;
00262
00263         void    ResizeToButtons();
00264         int             ButtonHitTest(POINT pt);
00265         void    InvalidateSelection();
00266         const SMBtnInfo* GetButtonInfo(int id) const;
00267         bool    SelectButton(int id, bool open_sub=true);
00268         bool    SelectButtonIndex(int idx, bool open_sub=true);
00269         int             GetSelectionIndex();
00270         virtual void ProcessKey(int vk);
00271         bool    Navigate(int step);
00272         bool    OpenSubmenu(bool select_first=false);
00273         bool    JumpToNextShortcut(char c);
00274 #endif
00275
00276          // member functions
00277         void    ResizeButtons(int cx);
00278
00279         virtual void AddEntries();
00280
00281         ShellEntryMap::iterator AddEntry(const String& title, ICON_ID icon_id, Entry* entry);
00282         ShellEntryMap::iterator AddEntry(const String& title, ICON_ID icon_id=ICID_NONE, int id=-1);
00283         ShellEntryMap::iterator AddEntry(const ShellFolder folder, ShellEntry* entry);
00284         ShellEntryMap::iterator AddEntry(const ShellFolder folder, Entry* entry);
00285
00286         void    AddShellEntries(const ShellDirectory& dir, int max=-1, const String& ignore="");
00287
00288         void    AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true);
00289         void    AddSeparator();
00290
00291         bool    CloseSubmenus() {return CloseOtherSubmenus();}
00292         bool    CloseOtherSubmenus(int id=0);
00293         void    CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void*info=NULL);
00294         bool    CreateSubmenu(int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void*info=NULL);
00295         bool    CreateSubmenu(int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void*info=NULL);
00296         void    CreateSubmenu(int id, const StartMenuFolders& new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void*info=NULL);
00297         void    ActivateEntry(int id, const ShellEntrySet& entries);
00298         virtual void CloseStartMenu(int id=0);
00299
00300         bool    GetButtonRect(int id, PRECT prect) const;
00301
00302         void    DrawFloatingButton(HDC hdc);
00303         void    GetFloatingButtonRect(LPRECT prect);
00304         void    GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down, bool large_icons);
00305
00306         void    DrawArrows(HDC hdc, bool large_icons);
00307
00308         void    Paint(PaintCanvas& canvas);
00309         void    UpdateIcons(/*int idx*/);
00310 };
00311
00312
00313  // declare shell32's "Run..." dialog export function
00314 typedef void (WINAPI* RUNFILEDLG)(HWND hwndOwner, HICON hIcon, LPCSTR lpstrDirectory, LPCSTR lpstrTitle, LPCSTR lpstrDescription, UINT uFlags);
00315
00316  //
00317  // Flags for RunFileDlg
00318  //
00319
00320 #define RFF_NOBROWSE            0x01    // Removes the browse button.
00321 #define RFF_NODEFAULT           0x02    // No default item selected.
00322 #define RFF_CALCDIRECTORY       0x04    // Calculates the working directory from the file name.
00323 #define RFF_NOLABEL                     0x08    // Removes the edit box label.
00324 #define RFF_NOSEPARATEMEM       0x20    // Removes the Separate Memory Space check box (Windows NT only).
00325
00326
00327  // declare more previously undocumented shell32 functions
00328 typedef void (WINAPI* EXITWINDOWSDLG)(HWND hwndOwner);
00329 typedef int (WINAPI* LOGOFFWINDOWSDIALOG)(UINT flags);
00330 typedef int (WINAPI* RESTARTWINDOWSDLG)(HWND hwndOwner, LPCWSTR reason, UINT flags);
00331 typedef int (WINAPI* RESTARTWINDOWSDLGEX)(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, DWORD uReason);
00332 typedef BOOL (WINAPI* SHFINDFILES)(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch);
00333 typedef BOOL (WINAPI* SHFINDCOMPUTER)(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch);
00334
00335
00337 struct StartMenuHandler : public StartMenu
00338 {
00339         typedef StartMenu super;
00340
00341         StartMenuHandler(HWND hwnd, bool large_icons=false)
00342          :      super(hwnd, large_icons)
00343         {
00344         }
00345
00346         StartMenuHandler(HWND hwnd, const StartMenuCreateInfo& create_info, bool large_icons=false)
00347          :      super(hwnd, create_info, large_icons)
00348         {
00349         }
00350
00351 protected:
00352         int             Command(int id, int code);
00353
00354         static void     ShowLaunchDialog(HWND hwndOwner);
00355         static void     ShowLogoffDialog(HWND hwndOwner);
00356         static void     ShowSearchDialog();
00357         static void     ShowSearchComputer();
00358 };
00359
00360
00362 struct StartMenuRoot : public StartMenuHandler
00363 {
00364         typedef StartMenuHandler super;
00365
00366         StartMenuRoot(HWND hwnd);
00367
00368         static HWND Create(HWND hwndDesktopBar, bool large_icons);
00369         void    TrackStartmenu();
00370
00371 protected:
00372         LRESULT Init(LPCREATESTRUCT pcs);
00373         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00374
00375         SIZE    _logo_size;
00376
00377         virtual void AddEntries();
00378         virtual void ProcessKey(int vk);
00379
00380         void    Paint(PaintCanvas& canvas);
00381         void    CloseStartMenu(int id=0);
00382
00383         void    ReadLogoSize();
00384         UINT    GetLogoResId();
00385 };
00386
00387
00389 struct SettingsMenu : public StartMenuHandler
00390 {
00391         typedef StartMenuHandler super;
00392
00393         SettingsMenu(HWND hwnd, const StartMenuCreateInfo& create_info)
00394          :      super(hwnd, create_info)
00395         {
00396         }
00397
00398 protected:
00399         virtual void AddEntries();
00400 };
00401
00402
00404 struct BrowseMenu : public StartMenuHandler
00405 {
00406         typedef StartMenuHandler super;
00407
00408         BrowseMenu(HWND hwnd, const StartMenuCreateInfo& create_info)
00409          :      super(hwnd, create_info)
00410         {
00411         }
00412
00413 protected:
00414         virtual void AddEntries();
00415 };
00416
00417
00419 struct SearchMenu : public StartMenuHandler
00420 {
00421         typedef StartMenuHandler super;
00422
00423         SearchMenu(HWND hwnd, const StartMenuCreateInfo& create_info)
00424          :      super(hwnd, create_info)
00425         {
00426         }
00427
00428 protected:
00429         virtual void AddEntries();
00430 };
00431
00432
00433 #define RECENT_DOCS_COUNT       20
00434
00435
00436 struct RecentStartMenu : public StartMenu
00437 {
00438         typedef StartMenu super;
00439
00440         RecentStartMenu(HWND hwnd, const StartMenuCreateInfo& create_info)
00441          :      super(hwnd, create_info)
00442         {
00443         }
00444
00445 protected:
00446         virtual void AddEntries();
00447 };
00448
00449
00450 #ifndef _SHELL32_FAVORITES
00451
00452 typedef map<int, BookmarkNode> BookmarkMap;
00453
00455 struct FavoritesMenu : public StartMenu
00456 {
00457         typedef StartMenu super;
00458
00459         FavoritesMenu(HWND hwnd, const StartMenuCreateInfo& create_info)
00460          :      super(hwnd, create_info),
00461                 _bookmarks(*(BookmarkList*)create_info._info)
00462         {
00463         }
00464
00465 protected:
00466         virtual int Command(int id, int code);
00467         virtual void AddEntries();
00468
00469         BookmarkList _bookmarks;
00470         BookmarkMap     _entries;
00471 };
00472
00473 #endif


ROS Explorer: taskbar.cpp File Reference

  • File List
  • File Members
taskbar

taskbar.cpp File Reference

#include <precomp.h>
#include "taskbar.h"
#include "traynotify.h"

Include dependency graph for taskbar.cpp:

Go to the source code of this file.

Functions

HICON | get_window_icon_small (HWND hwnd)
retrieve icon from window
HICON | get_window_icon_big (HWND hwnd, bool allow_from_class)

Variables

DynamicFct< BOOL(WINAPI
*)(HWND hwnd)> 		g_SetTaskmanWindow (TEXT("user32"),"SetTaskmanWindow")
DynamicFct< BOOL(WINAPI
*)(HWND hwnd)> 		g_RegisterShellHookWindow (TEXT("user32"),"RegisterShellHookWindow")
DynamicFct< BOOL(WINAPI
*)(HWND hwnd)> 		g_DeregisterShellHookWindow (TEXT("user32"),"DeregisterShellHookWindow")

Function Documentation

HICON get_window_icon_big | ( | HWND | hwnd,
 |  | bool | allow_from_class
 | ) |

Definition at line 347 of file taskbar.cpp.

00348 {
00349         HICON hIcon = 0;
00350
00351         SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00352
00353         if (!hIcon)
00354                 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00355
00356         if (!hIcon)
00357                 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00358
00359         if (allow_from_class) {
00360                 if (!hIcon)
00361                         hIcon = (HICON)GetClassLong(hwnd, GCL_HICON);
00362
00363                 if (!hIcon)
00364                         hIcon = (HICON)GetClassLong(hwnd, GCL_HICONSM);
00365         }
00366
00367         if (!hIcon)
00368                 SendMessageTimeout(hwnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (LPDWORD)&hIcon);
00369
00370         return hIcon;
00371 }

HICON get_window_icon_small ( HWND hwnd )

retrieve icon from window

Definition at line 323 of file taskbar.cpp.

Referenced by TaskBar::EnumWndProc().

00324 {
00325         HICON hIcon = 0;
00326
00327         SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00328
00329         if (!hIcon)
00330                 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00331
00332         if (!hIcon)
00333                 SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00334
00335         if (!hIcon)
00336                 hIcon = (HICON)GetClassLong(hwnd, GCL_HICONSM);
00337
00338         if (!hIcon)
00339                 hIcon = (HICON)GetClassLong(hwnd, GCL_HICON);
00340
00341         if (!hIcon)
00342                 SendMessageTimeout(hwnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (LPDWORD)&hIcon);
00343
00344         return hIcon;
00345 }

Variable Documentation

DynamicFct<BOOL (WINAPI*)(HWND hwnd)> g_DeregisterShellHookWindow(TEXT("user32"),"DeregisterShellHookWindow")

Definition at line 37 of file taskbar.cpp.

Referenced by TaskBar::~TaskBar().

DynamicFct<BOOL (WINAPI*)(HWND hwnd)> g_RegisterShellHookWindow(TEXT("user32"),"RegisterShellHookWindow")

Definition at line 36 of file taskbar.cpp.

Referenced by TaskBar::Init().

DynamicFct<BOOL (WINAPI*)(HWND hwnd)> g_SetTaskmanWindow(TEXT("user32"),"SetTaskmanWindow")

Definition at line 35 of file taskbar.cpp.

Referenced by TaskBar::Init(), and TaskBar::~TaskBar().


ROS Explorer: taskbar.cpp Source File

  • File List
  • File Members
taskbar

taskbar.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // taskbar.cpp
00024  //
00025  // Martin Fuchs, 16.08.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "taskbar.h"
00032 #include "traynotify.h" // for NOTIFYAREA_WIDTH_DEF
00033
00034
00035 DynamicFct<BOOL (WINAPI*)(HWND hwnd)> g_SetTaskmanWindow(TEXT("user32"), "SetTaskmanWindow");
00036 DynamicFct<BOOL (WINAPI*)(HWND hwnd)> g_RegisterShellHookWindow(TEXT("user32"), "RegisterShellHookWindow");
00037 DynamicFct<BOOL (WINAPI*)(HWND hwnd)> g_DeregisterShellHookWindow(TEXT("user32"), "DeregisterShellHookWindow");
00038
00039 /*
00040 DynamicFct<BOOL (WINAPI*)(HWND hWnd, DWORD dwType)> g_RegisterShellHook(TEXT("shell32"), (LPCSTR)0xb5);
00041
00042  // constants for RegisterShellHook()
00043 #define RSH_UNREGISTER                  0
00044 #define RSH_REGISTER                    1
00045 #define RSH_REGISTER_PROGMAN    2
00046 #define RSH_REGISTER_TASKMAN    3
00047 */
00048
00049
00050 TaskBarEntry::TaskBarEntry()
00051 {
00052         _id = 0;
00053         _hbmp = 0;
00054         _bmp_idx = 0;
00055         _used = 0;
00056         _btn_idx = 0;
00057         _fsState = 0;
00058 }
00059
00060 TaskBarMap::~TaskBarMap()
00061 {
00062         while(!empty()) {
00063                 iterator it = begin();
00064                 DeleteBitmap(it->second._hbmp);
00065                 erase(it);
00066         }
00067 }
00068
00069
00070 TaskBar::TaskBar(HWND hwnd)
00071  :      super(hwnd),
00072         WM_SHELLHOOK(RegisterWindowMessage(WINMSG_SHELLHOOK))
00073 {
00074         _last_btn_width = 0;
00075
00076         _mmMetrics_org.cbSize = sizeof(MINIMIZEDMETRICS);
00077
00078         SystemParametersInfo(SPI_GETMINIMIZEDMETRICS, sizeof(_mmMetrics_org), &_mmMetrics_org, 0);
00079
00080          // configure the window manager to hide windows when they are minimized
00081          // This is neccessary to enable shell hook messages.
00082         if (!(_mmMetrics_org.iArrange & ARW_HIDE)) {
00083                 MINIMIZEDMETRICS _mmMetrics_new = _mmMetrics_org;
00084
00085                 _mmMetrics_new.iArrange |= ARW_HIDE;
00086
00087                 SystemParametersInfo(SPI_SETMINIMIZEDMETRICS, sizeof(_mmMetrics_new), &_mmMetrics_new, 0);
00088         }
00089 }
00090
00091 TaskBar::~TaskBar()
00092 {
00093 //      if (g_RegisterShellHook)
00094 //              (*g_RegisterShellHook)(_hwnd, RSH_UNREGISTER);
00095
00096         if (g_DeregisterShellHookWindow)
00097                 (*g_DeregisterShellHookWindow)(_hwnd);
00098         else
00099                 KillTimer(_hwnd, 0);
00100
00101         if (g_SetTaskmanWindow)
00102                 (*g_SetTaskmanWindow)(0);
00103
00104         SystemParametersInfo(SPI_GETMINIMIZEDMETRICS, sizeof(_mmMetrics_org), &_mmMetrics_org, 0);
00105 }
00106
00107 HWND TaskBar::Create(HWND hwndParent)
00108 {
00109         ClientRect clnt(hwndParent);
00110
00111         int taskbar_pos = 80;   // This start position will be adjusted in DesktopBar::Resize().
00112
00113         return Window::Create(WINDOW_CREATOR(TaskBar), 0,
00114                                                         BtnWindowClass(CLASSNAME_TASKBAR), TITLE_TASKBAR,
00115                                                         WS_CHILD|WS_VISIBLE | CCS_TOP|CCS_NODIVIDER|CCS_NORESIZE,
00116                                                         taskbar_pos, 0, clnt.right-taskbar_pos-(NOTIFYAREA_WIDTH_DEF+1), clnt.bottom, hwndParent);
00117 }
00118
00119 LRESULT TaskBar::Init(LPCREATESTRUCT pcs)
00120 {
00121         if (super::Init(pcs))
00122                 return 1;
00123
00124         /* FIXME: There's an internal padding for non-flat toolbar. Get rid of it somehow. */
00125         _htoolbar = CreateToolbarEx(_hwnd,
00126                                                                 WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
00127                                                                 CCS_TOP|CCS_NODIVIDER|TBSTYLE_LIST|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,//|TBSTYLE_AUTOSIZE
00128                                                                 IDW_TASKTOOLBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
00129
00130         SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(TASKBUTTONWIDTH_MAX,TASKBUTTONWIDTH_MAX));
00131         //SendMessage(_htoolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
00132         //SendMessage(_htoolbar, TB_SETDRAWTEXTFLAGS, DT_CENTER|DT_VCENTER, DT_CENTER|DT_VCENTER);
00133         //SetWindowFont(_htoolbar, GetStockFont(ANSI_VAR_FONT), FALSE);
00134         //SendMessage(_htoolbar, TB_SETPADDING, 0, MAKELPARAM(8,8));
00135
00136 #ifndef __MINGW32__     // TBMETRICS missing in MinGW (as of 20.09.2005)
00137          // set metrics for the Taskbar toolbar to enable button spacing
00138         TBMETRICS metrics;
00139
00140         metrics.cbSize = sizeof(TBMETRICS);
00141         metrics.dwMask = TBMF_BARPAD | TBMF_BUTTONSPACING;
00142         metrics.cxBarPad = 0;
00143         metrics.cyBarPad = 0;
00144         metrics.cxButtonSpacing = 3;
00145         metrics.cyButtonSpacing = 3;
00146
00147         SendMessage(_htoolbar, TB_SETMETRICS, 0, (LPARAM)&metrics);
00148 #endif
00149
00150         _next_id = IDC_FIRST_APP;
00151
00152          // register the taskbar window as task manager window to make the following call to RegisterShellHookWindow working
00153         if (g_SetTaskmanWindow)
00154                 (*g_SetTaskmanWindow)(_hwnd);
00155
00156         if (g_RegisterShellHookWindow) {
00157                 LOG(TEXT("Using shell hooks for notification of shell events."));
00158
00159                 (*g_RegisterShellHookWindow)(_hwnd);
00160         } else {
00161                 LOG(TEXT("Shell hooks not available."));
00162
00163                 SetTimer(_hwnd, 0, 200, NULL);
00164         }
00165
00166 /* Alternatively we could use the RegisterShellHook() function in SHELL32, but this is not yet implemented in the WINE code.
00167         if (g_RegisterShellHook) {
00168                 (*g_RegisterShellHook)(0, RSH_REGISTER);
00169
00170                 if ((HIWORD(GetVersion())>>14) == W_VER_NT)
00171                         (*g_RegisterShellHook)(_hwnd, RSH_REGISTER_TASKMAN);
00172                 else
00173                         (*g_RegisterShellHook)(_hwnd, RSH_REGISTER);
00174         }
00175 */
00176         Refresh();
00177
00178         return 0;
00179 }
00180
00181 LRESULT TaskBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00182 {
00183         switch(nmsg) {
00184           case WM_SIZE:
00185                 SendMessage(_htoolbar, WM_SIZE, 0, 0);
00186                 ResizeButtons();
00187                 break;
00188
00189           case WM_TIMER:
00190                 Refresh();
00191                 return 0;
00192
00193           case WM_CONTEXTMENU: {
00194                 Point pt(lparam);
00195                 ScreenToClient(_htoolbar, &pt);
00196
00197                 if ((HWND)wparam==_htoolbar && SendMessage(_htoolbar, TB_HITTEST, 0, (LPARAM)&pt)>=0)
00198                         break;  // avoid displaying context menu for application button _and_ desktop bar at the same time
00199
00200                 goto def;}
00201
00202           case PM_GET_LAST_ACTIVE:
00203                 return (LRESULT)(HWND)_last_foreground_wnd;
00204
00205           default: def:
00206                 if (nmsg == WM_SHELLHOOK) {
00207                         switch(wparam) {
00208                           case HSHELL_WINDOWCREATED:
00209                           case HSHELL_WINDOWDESTROYED:
00210                           case HSHELL_WINDOWACTIVATED:
00211                           case HSHELL_REDRAW:
00212 #ifdef HSHELL_FLASH
00213                           case HSHELL_FLASH:
00214 #endif
00215 #ifdef HSHELL_RUDEAPPACTIVATED
00216                           case HSHELL_RUDEAPPACTIVATED:
00217 #endif
00218                                 Refresh();
00219                                 break;
00220                         }
00221                 } else {
00222                         return super::WndProc(nmsg, wparam, lparam);
00223                 }
00224         }
00225
00226         return 0;
00227 }
00228
00229 int TaskBar::Command(int id, int code)
00230 {
00231         TaskBarMap::iterator found = _map.find_id(id);
00232
00233         if (found != _map.end()) {
00234                 ActivateApp(found);
00235                 return 0;
00236         }
00237
00238         return super::Command(id, code);
00239 }
00240
00241 int TaskBar::Notify(int id, NMHDR* pnmh)
00242 {
00243         if (pnmh->hwndFrom == _htoolbar)
00244                 switch(pnmh->code) {
00245                   case NM_RCLICK: {
00246                         TBBUTTONINFO btninfo;
00247                         TaskBarMap::iterator it;
00248                         Point pt(GetMessagePos());
00249                         ScreenToClient(_htoolbar, &pt);
00250
00251                         btninfo.cbSize = sizeof(TBBUTTONINFO);
00252                         btninfo.dwMask = TBIF_BYINDEX|TBIF_COMMAND;
00253
00254                         int idx = SendMessage(_htoolbar, TB_HITTEST, 0, (LPARAM)&pt);
00255
00256                         if (idx>=0 &&
00257                                 SendMessage(_htoolbar, TB_GETBUTTONINFO, idx, (LPARAM)&btninfo)!=-1 &&
00258                                 (it=_map.find_id(btninfo.idCommand))!=_map.end()) {
00259                                 //TaskBarEntry& entry = it->second;
00260
00261                                 ActivateApp(it, false, false);  // don't restore minimized windows on right button click
00262
00263 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
00264                                 static DynamicFct<DWORD(STDAPICALLTYPE*)(RESTRICTIONS)> pSHRestricted(TEXT("SHELL32"), "SHRestricted");
00265
00266                                 if (pSHRestricted && !(*pSHRestricted)(REST_NOTRAYCONTEXTMENU))
00267 #endif
00268                                         ShowAppSystemMenu(it);
00269                         }
00270                         break;}
00271
00272                   default:
00273                         return super::Notify(id, pnmh);
00274                 }
00275
00276         return 0;
00277 }
00278
00279
00280 void TaskBar::ActivateApp(TaskBarMap::iterator it, bool can_minimize, bool can_restore)
00281 {
00282         HWND hwnd = it->first;
00283
00284         bool minimize_it = can_minimize && !IsIconic(hwnd) &&
00285                                                 (hwnd==GetForegroundWindow() || hwnd==_last_foreground_wnd);
00286
00287          // switch to selected application window
00288         if (can_restore && !minimize_it)
00289                 if (IsIconic(hwnd))
00290                         PostMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
00291
00292          // In case minimize_it is true, we _have_ to switch to the app before
00293          // posting SW_MINIMIZE to be compatible with some applications (e.g. "Sleipnir")
00294         SetForegroundWindow(hwnd);
00295
00296         if (minimize_it) {
00297                 PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
00298                 _last_foreground_wnd = 0;
00299         } else
00300                 _last_foreground_wnd = hwnd;
00301
00302         Refresh();
00303 }
00304
00305 void TaskBar::ShowAppSystemMenu(TaskBarMap::iterator it)
00306 {
00307         HMENU hmenu = GetSystemMenu(it->first, FALSE);
00308
00309         if (hmenu) {
00310                 POINT pt;
00311
00312                 GetCursorPos(&pt);
00313                 int cmd = TrackPopupMenu(hmenu, TPM_LEFTBUTTON|TPM_RIGHTBUTTON|TPM_RETURNCMD, pt.x, pt.y, 0, _hwnd, NULL);
00314
00315                 if (cmd) {
00316                         ActivateApp(it, false, false);  // reactivate window after the context menu has closed
00317                         PostMessage(it->first, WM_SYSCOMMAND, cmd, 0);
00318                 }
00319         }
00320 }
00321
00322
00323 HICON get_window_icon_small(HWND hwnd)
00324 {
00325         HICON hIcon = 0;
00326
00327         SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00328
00329         if (!hIcon)
00330                 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00331
00332         if (!hIcon)
00333                 SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00334
00335         if (!hIcon)
00336                 hIcon = (HICON)GetClassLong(hwnd, GCL_HICONSM);
00337
00338         if (!hIcon)
00339                 hIcon = (HICON)GetClassLong(hwnd, GCL_HICON);
00340
00341         if (!hIcon)
00342                 SendMessageTimeout(hwnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (LPDWORD)&hIcon);
00343
00344         return hIcon;
00345 }
00346
00347 HICON get_window_icon_big(HWND hwnd, bool allow_from_class)
00348 {
00349         HICON hIcon = 0;
00350
00351         SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00352
00353         if (!hIcon)
00354                 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00355
00356         if (!hIcon)
00357                 SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon);
00358
00359         if (allow_from_class) {
00360                 if (!hIcon)
00361                         hIcon = (HICON)GetClassLong(hwnd, GCL_HICON);
00362
00363                 if (!hIcon)
00364                         hIcon = (HICON)GetClassLong(hwnd, GCL_HICONSM);
00365         }
00366
00367         if (!hIcon)
00368                 SendMessageTimeout(hwnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (LPDWORD)&hIcon);
00369
00370         return hIcon;
00371 }
00372
00373  // fill task bar with buttons for enumerated top level windows
00374 BOOL CALLBACK TaskBar::EnumWndProc(HWND hwnd, LPARAM lparam)
00375 {
00376         TaskBar* pThis = (TaskBar*)lparam;
00377
00378         DWORD style = GetWindowStyle(hwnd);
00379         DWORD ex_style = GetWindowExStyle(hwnd);
00380
00381         if ((style&WS_VISIBLE) && !(ex_style&WS_EX_TOOLWINDOW) &&
00382                 !GetParent(hwnd) && !GetWindow(hwnd,GW_OWNER)) {
00383                 TCHAR title[BUFFER_LEN];
00384
00385                 if (!GetWindowText(hwnd, title, BUFFER_LEN))
00386                         title[0] = '\0';
00387
00388                 TaskBarMap::iterator found = pThis->_map.find(hwnd);
00389                 int last_id = 0;
00390
00391                 if (found != pThis->_map.end()) {
00392                         last_id = found->second._id;
00393
00394                         if (!last_id)
00395                                 found->second._id = pThis->_next_id++;
00396                 } else {
00397                         HBITMAP hbmp;
00398                         HICON hIcon = get_window_icon_small(hwnd);
00399                         BOOL delete_icon = FALSE;
00400
00401                         if (!hIcon) {
00402                                 hIcon = LoadIcon(0, IDI_APPLICATION);
00403                                 delete_icon = TRUE;
00404                         }
00405
00406                         if (hIcon) {
00407                                 hbmp = create_bitmap_from_icon(hIcon, GetSysColorBrush(COLOR_BTNFACE), WindowCanvas(pThis->_htoolbar));
00408                                 if (delete_icon)
00409                                         DestroyIcon(hIcon); // some icons can be freed, some not - so ignore any error return of DestroyIcon()
00410                         } else
00411                                 hbmp = 0;
00412
00413                         TBADDBITMAP ab = {0, (UINT_PTR)hbmp};
00414                         int bmp_idx = SendMessage(pThis->_htoolbar, TB_ADDBITMAP, 1, (LPARAM)&ab);
00415
00416                         TaskBarEntry entry;
00417
00418                         entry._id = pThis->_next_id++;
00419                         entry._hbmp = hbmp;
00420                         entry._bmp_idx = bmp_idx;
00421                         entry._title = title;
00422
00423                         pThis->_map[hwnd] = entry;
00424                         found = pThis->_map.find(hwnd);
00425                 }
00426
00427                 TBBUTTON btn = {-2/*I_IMAGENONE*/, 0, TBSTATE_ENABLED/*|TBSTATE_ELLIPSES*/, BTNS_BUTTON, {0, 0}, 0, 0};
00428                 TaskBarEntry& entry = found->second;
00429
00430                 ++entry._used;
00431                 btn.idCommand = entry._id;
00432
00433                 HWND foreground = GetForegroundWindow();
00434                 HWND foreground_owner = GetWindow(foreground, GW_OWNER);
00435
00436                 if (hwnd==foreground || hwnd==foreground_owner) {
00437                         btn.fsState |= TBSTATE_PRESSED|TBSTATE_CHECKED;
00438                         pThis->_last_foreground_wnd = hwnd;
00439                 }
00440
00441                 if (!last_id) {
00442                          // create new toolbar buttons for new windows
00443                         if (title[0])
00444                                 btn.iString = (INT_PTR)title;
00445
00446                         btn.iBitmap = entry._bmp_idx;
00447                         entry._btn_idx = SendMessage(pThis->_htoolbar, TB_BUTTONCOUNT, 0, 0);
00448
00449                         SendMessage(pThis->_htoolbar, TB_INSERTBUTTON, entry._btn_idx, (LPARAM)&btn);
00450
00451                         pThis->ResizeButtons();
00452                 } else {
00453                          // refresh attributes of existing buttons
00454                         if (btn.fsState != entry._fsState)
00455                                 SendMessage(pThis->_htoolbar, TB_SETSTATE, entry._id, MAKELONG(btn.fsState,0));
00456
00457                         if (entry._title != title) {
00458                                 TBBUTTONINFO info;
00459
00460                                 info.cbSize = sizeof(TBBUTTONINFO);
00461                                 info.dwMask = TBIF_TEXT;
00462                                 info.pszText = title;
00463
00464                                 SendMessage(pThis->_htoolbar, TB_SETBUTTONINFO, entry._id, (LPARAM)&info);
00465
00466                                 entry._title = title;
00467                         }
00468                 }
00469
00470                 entry._fsState = btn.fsState;
00471
00472 #ifdef _ROS_    // now handled by activating the ARW_HIDE flag with SystemParametersInfo(SPI_SETMINIMIZEDMETRICS)
00473                  // move minimized windows out of sight
00474                 if (IsIconic(hwnd)) {
00475                         RECT rect;
00476
00477                         GetWindowRect(hwnd, &rect);
00478
00479                         if (rect.bottom > 0)
00480                                 SetWindowPos(hwnd, 0, -32000, -32000, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
00481                 }
00482 #endif
00483         }
00484
00485         return TRUE;
00486 }
00487
00488 void TaskBar::Refresh()
00489 {
00490         for(TaskBarMap::iterator it=_map.begin(); it!=_map.end(); ++it)
00491                 it->second._used = 0;
00492
00493         EnumWindows(EnumWndProc, (LPARAM)this);
00494         //EnumDesktopWindows(GetThreadDesktop(GetCurrentThreadId()), EnumWndProc, (LPARAM)_htoolbar);
00495
00496         set<int> btn_idx_to_delete;
00497         set<HBITMAP> hbmp_to_delete;
00498
00499         for(TaskBarMap::iterator it=_map.begin(); it!=_map.end(); ++it) {
00500                 TaskBarEntry& entry = it->second;
00501
00502                 if (!entry._used && entry._id) {
00503                          // store button indexes to remove
00504                         btn_idx_to_delete.insert(entry._btn_idx);
00505                         hbmp_to_delete.insert(entry._hbmp);
00506                         entry._id = 0;
00507                 }
00508         }
00509
00510         if (!btn_idx_to_delete.empty()) {
00511                  // remove buttons from right to left
00512                 for(set<int>::reverse_iterator it=btn_idx_to_delete.rbegin(); it!=btn_idx_to_delete.rend(); ++it) {
00513                         int idx = *it;
00514
00515                         SendMessage(_htoolbar, TB_DELETEBUTTON, idx, 0);
00516
00517                         for(TaskBarMap::iterator it=_map.begin(); it!=_map.end(); ++it) {
00518                                 TaskBarEntry& entry = it->second;
00519
00520                                  // adjust button indexes
00521                                 if (entry._btn_idx > idx) {
00522                                         --entry._btn_idx;
00523                                         --entry._bmp_idx;
00524
00525                                         TBBUTTONINFO info;
00526
00527                                         info.cbSize = sizeof(TBBUTTONINFO);
00528                                         info.dwMask = TBIF_IMAGE;
00529                                         info.iImage = entry._bmp_idx;
00530
00531                                         SendMessage(_htoolbar, TB_SETBUTTONINFO, entry._id, (LPARAM)&info);
00532                                 }
00533                         }
00534                 }
00535
00536                 for(set<HBITMAP>::iterator it=hbmp_to_delete.begin(); it!=hbmp_to_delete.end(); ++it) {
00537                         HBITMAP hbmp = *it;
00538
00539                         TBREPLACEBITMAP tbrepl = {0, (UINT_PTR)hbmp, 0, 0};
00540                         SendMessage(_htoolbar, TB_REPLACEBITMAP, 0, (LPARAM)&tbrepl);
00541
00542                         DeleteObject(hbmp);
00543
00544                         for(TaskBarMap::iterator it=_map.begin(); it!=_map.end(); ++it)
00545                                 if (it->second._hbmp == hbmp) {
00546                                         _map.erase(it);
00547                                         break;
00548                                 }
00549                 }
00550
00551                 ResizeButtons();
00552         }
00553 }
00554
00555 TaskBarMap::iterator TaskBarMap::find_id(int id)
00556 {
00557         for(iterator it=begin(); it!=end(); ++it)
00558                 if (it->second._id == id)
00559                         return it;
00560
00561         return end();
00562 }
00563
00564 void TaskBar::ResizeButtons()
00565 {
00566         int btns = _map.size();
00567
00568         if (btns > 0) {
00569                 int bar_width = ClientRect(_hwnd).right;
00570                 int btn_width = (bar_width / btns) - 3;
00571
00572                 if (btn_width < TASKBUTTONWIDTH_MIN)
00573                         btn_width = TASKBUTTONWIDTH_MIN;
00574                 else if (btn_width > TASKBUTTONWIDTH_MAX)
00575                         btn_width = TASKBUTTONWIDTH_MAX;
00576
00577                 if (btn_width != _last_btn_width) {
00578                         _last_btn_width = btn_width;
00579
00580                         SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(btn_width,btn_width));
00581                         SendMessage(_htoolbar, TB_AUTOSIZE, 0, 0);
00582                 }
00583         }
00584 }


ROS Explorer: taskbar.h File Reference

  • File List
  • File Members
taskbar

taskbar.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | TaskBarEntry
internal task bar button management entry More...
struct | TaskBarMap
map for managing the task bar buttons, mapped by application window handle More...
struct | TaskBar
Taskbar window. More...

Defines

#define | CLASSNAME_TASKBAR TEXT("MSTaskSwWClass")
#define | TITLE_TASKBAR TEXT("Running Applications")
#define | IDC_FIRST_APP 0x2000
#define | TASKBUTTONWIDTH_MIN 38
#define | TASKBUTTONWIDTH_MAX 160
#define | IDW_TASKTOOLBAR 100
#define | PM_GET_LAST_ACTIVE (WM_APP+0x1D)

Define Documentation

#define CLASSNAME_TASKBAR TEXT("MSTaskSwWClass")

Definition at line 32 of file taskbar.h.

Referenced by TaskBar::Create().

#define IDC_FIRST_APP 0x2000

Definition at line 35 of file taskbar.h.

Referenced by TaskBar::Init().

#define IDW_TASKTOOLBAR 100

Definition at line 43 of file taskbar.h.

Referenced by TaskBar::Init(), DesktopBar::Init(), and DesktopBar::Notify().

#define PM_GET_LAST_ACTIVE (WM_APP+0x1D)

Definition at line 46 of file taskbar.h.

Referenced by Desktops::SwitchToDesktop(), and TaskBar::WndProc().

#define TASKBUTTONWIDTH_MAX 160

Definition at line 40 of file taskbar.h.

Referenced by TaskBar::Init(), and TaskBar::ResizeButtons().

#define TASKBUTTONWIDTH_MIN 38

Definition at line 39 of file taskbar.h.

Referenced by TaskBar::ResizeButtons().

#define TITLE_TASKBAR TEXT("Running Applications")

Definition at line 33 of file taskbar.h.

Referenced by TaskBar::Create().


ROS Explorer: taskbar.h Source File

  • File List
  • File Members
taskbar

taskbar.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer and Desktop clone
00022  //
00023  // taskbar.h
00024  //
00025  // Martin Fuchs, 16.08.2003
00026  //
00027
00028
00029 //#include "shellhook.h"
00030
00031
00032 #define CLASSNAME_TASKBAR               TEXT("MSTaskSwWClass")
00033 #define TITLE_TASKBAR                   TEXT("Running Applications")
00034
00035 #define IDC_FIRST_APP   0x2000
00036
00037 //#define TASKBAR_AT_TOP
00038
00039 #define TASKBUTTONWIDTH_MIN             38
00040 #define TASKBUTTONWIDTH_MAX             160
00041
00042
00043 #define IDW_TASKTOOLBAR 100
00044
00045
00046 #define PM_GET_LAST_ACTIVE      (WM_APP+0x1D)
00047
00048
00050 struct TaskBarEntry
00051 {
00052         TaskBarEntry();
00053
00054         int             _id;    // ID for WM_COMMAND
00055         HBITMAP _hbmp;
00056         int             _bmp_idx;
00057         int             _used;
00058         int             _btn_idx;
00059         String  _title;
00060         BYTE    _fsState;
00061 };
00062
00064 struct TaskBarMap : public map<HWND, TaskBarEntry>
00065 {
00066         ~TaskBarMap();
00067
00068         iterator find_id(int id);
00069 };
00070
00071
00073 struct TaskBar : public Window
00074 {
00075         typedef Window super;
00076
00077         TaskBar(HWND hwnd);
00078         ~TaskBar();
00079
00080         static HWND Create(HWND hwndParent);
00081
00082 protected:
00083         WindowHandle _htoolbar;
00084         TaskBarMap      _map;
00085         int                     _next_id;
00086         WindowHandle _last_foreground_wnd;
00087         int                     _last_btn_width;
00088         MINIMIZEDMETRICS _mmMetrics_org;
00089
00090         const UINT WM_SHELLHOOK;
00091
00092         LRESULT Init(LPCREATESTRUCT pcs);
00093         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00094         int             Command(int id, int code);
00095         int             Notify(int id, NMHDR* pnmh);
00096
00097         void    ActivateApp(TaskBarMap::iterator it, bool can_minimize=true, bool can_restore=true);
00098         void    ShowAppSystemMenu(TaskBarMap::iterator it);
00099
00100         static BOOL CALLBACK EnumWndProc(HWND hwnd, LPARAM lparam);
00101
00102         void    Refresh();
00103         void    ResizeButtons();
00104 };


ROS Explorer: traynotify.cpp File Reference

  • File List
  • File Members
taskbar

traynotify.cpp File Reference

#include <precomp.h>
#include "../resource.h"
#include "traynotify.h"
#include "../notifyhook/notifyhook.h"

Include dependency graph for traynotify.cpp:

Go to the source code of this file.

Defines

#define | NID_SIZE_W6 sizeof(NOTIFYICONDATAW)
#define | NID_SIZE_W5 (sizeof(NOTIFYICONDATAW)-sizeof(GUID))
#define | NID_SIZE_W3 (sizeof(NOTIFYICONDATAW)-sizeof(GUID)-(128-64)*sizeof(WCHAR))
#define | NID_SIZE_A6 sizeof(NOTIFYICONDATAA)
#define | NID_SIZE_A5 (sizeof(NOTIFYICONDATAA)-sizeof(GUID))
#define | NID_SIZE_A3 (sizeof(NOTIFYICONDATAA)-sizeof(GUID)-(128-64)*sizeof(CHAR))

Functions

String | string_from_mode (NOTIFYICONMODE mode)

Define Documentation

#define NID_SIZE_A3 (sizeof(NOTIFYICONDATAA)-sizeof(GUID)-(128-64)*sizeof(CHAR))

Definition at line 105 of file traynotify.cpp.

Referenced by NotifyInfo::modify().

#define NID_SIZE_A5 (sizeof(NOTIFYICONDATAA)-sizeof(GUID))

Definition at line 104 of file traynotify.cpp.

Referenced by NotifyInfo::modify().

#define NID_SIZE_A6 sizeof(NOTIFYICONDATAA)

Definition at line 103 of file traynotify.cpp.

Referenced by NotifyInfo::modify().

#define NID_SIZE_W3 (sizeof(NOTIFYICONDATAW)-sizeof(GUID)-(128-64)*sizeof(WCHAR))

Definition at line 100 of file traynotify.cpp.

Referenced by NotifyInfo::modify().

#define NID_SIZE_W5 (sizeof(NOTIFYICONDATAW)-sizeof(GUID))

Definition at line 99 of file traynotify.cpp.

Referenced by NotifyInfo::modify().

#define NID_SIZE_W6 sizeof(NOTIFYICONDATAW)

Definition at line 98 of file traynotify.cpp.

Referenced by NotifyInfo::modify().

Function Documentation

String string_from_mode ( NOTIFYICONMODE mode )

Definition at line 876 of file traynotify.cpp.

References IDS_NOTIFY_AUTOHIDE, IDS_NOTIFY_HIDE, IDS_NOTIFY_SHOW, and NIM_HIDE.

Referenced by TrayNotifyDlg::InsertItem(), and NotifyArea::write_config().

00877 {
00878         switch(mode) {
00879           case NIM_SHOW:
00880                 return ResString(IDS_NOTIFY_SHOW);
00881
00882           case NIM_HIDE:
00883                 return ResString(IDS_NOTIFY_HIDE);
00884
00885           default:      //case NIM_AUTO
00886                 return ResString(IDS_NOTIFY_AUTOHIDE);
00887         }
00888 }


ROS Explorer: traynotify.cpp Source File

  • File List
  • File Members
taskbar

traynotify.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // traynotify.cpp
00024  //
00025  // Martin Fuchs, 22.08.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "../resource.h"
00032
00033 #include "traynotify.h"
00034
00035
00036 #include "../notifyhook/notifyhook.h"
00037
00038 NotifyHook::NotifyHook()
00039  :      WM_GETMODULEPATH(InstallNotifyHook())
00040 {
00041 }
00042
00043 NotifyHook::~NotifyHook()
00044 {
00045         DeinstallNotifyHook();
00046 }
00047
00048 void NotifyHook::GetModulePath(HWND hwnd, HWND hwndCallback)
00049 {
00050         PostMessage(hwnd, WM_GETMODULEPATH, (WPARAM)hwndCallback, 0);
00051 }
00052
00053 bool NotifyHook::ModulePathCopyData(LPARAM lparam, HWND* phwnd, String& path)
00054 {
00055         char buffer[MAX_PATH];
00056
00057         int l = GetWindowModulePathCopyData(lparam, phwnd, buffer, COUNTOF(buffer));
00058
00059         if (l) {
00060                 path.assign(buffer, l);
00061                 return true;
00062         } else
00063                 return false;
00064 }
00065
00066
00067 NotifyIconIndex::NotifyIconIndex(NOTIFYICONDATA* pnid)
00068 {
00069         _hWnd = pnid->hWnd;
00070         _uID = pnid->uID;
00071
00072          // special handling for windows task manager
00073         if ((int)_uID < 0)
00074                 _uID = 0;
00075 }
00076
00077 NotifyIconIndex::NotifyIconIndex()
00078 {
00079         _hWnd = 0;
00080         _uID = 0;
00081 }
00082
00083
00084 NotifyInfo::NotifyInfo()
00085 {
00086         _idx = -1;
00087         _hIcon = 0;
00088         _dwState = 0;
00089         _uCallbackMessage = 0;
00090         _version = 0;
00091
00092         _mode = NIM_AUTO;
00093         _lastChange = GetTickCount();
00094 }
00095
00096
00097  // WCHAR versions von NOTIFYICONDATA
00098 #define NID_SIZE_W6      sizeof(NOTIFYICONDATAW)                                                                                // _WIN32_IE = 0x600
00099 #define NID_SIZE_W5     (sizeof(NOTIFYICONDATAW)-sizeof(GUID))                                                  // _WIN32_IE = 0x500
00100 #define NID_SIZE_W3     (sizeof(NOTIFYICONDATAW)-sizeof(GUID)-(128-64)*sizeof(WCHAR))   // _WIN32_IE < 0x500
00101
00102  // CHAR versions von NOTIFYICONDATA
00103 #define NID_SIZE_A6      sizeof(NOTIFYICONDATAA)
00104 #define NID_SIZE_A5     (sizeof(NOTIFYICONDATAA)-sizeof(GUID))
00105 #define NID_SIZE_A3     (sizeof(NOTIFYICONDATAA)-sizeof(GUID)-(128-64)*sizeof(CHAR))
00106
00107 bool NotifyInfo::modify(NOTIFYICONDATA* pnid)
00108 {
00109         bool changes = false;
00110
00111         if (_hWnd!=pnid->hWnd || _uID!=pnid->uID) {
00112                 _hWnd = pnid->hWnd;
00113                 _uID = pnid->uID;
00114
00115                 changes = true;
00116         }
00117
00118         if (pnid->uFlags & NIF_MESSAGE) {
00119                 if (_uCallbackMessage != pnid->uCallbackMessage) {
00120                         _uCallbackMessage = pnid->uCallbackMessage;
00121                         changes = true;
00122                 }
00123         }
00124
00125         if (pnid->uFlags & NIF_ICON) {
00126                  // Some applications destroy the icon immediatelly after completing the
00127                  // NIM_ADD/MODIFY message, so we have to make a copy of it.
00128                 if (_hIcon)
00129                         DestroyIcon(_hIcon);
00130
00131                 _hIcon = (HICON) CopyImage(pnid->hIcon, IMAGE_ICON, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0);
00132
00133                 changes = true;
00134         }
00135
00136 #ifdef NIF_STATE        // as of 21.08.2003 missing in MinGW headers
00137         if (pnid->uFlags & NIF_STATE) {
00138                 DWORD new_state = (_dwState&~pnid->dwStateMask) | (pnid->dwState&pnid->dwStateMask);
00139
00140                 if (_dwState != new_state) {
00141                         _dwState = new_state;
00142                         changes = true;
00143                 }
00144         }
00145 #endif
00146
00147          // store tool tip text
00148         if (pnid->uFlags & NIF_TIP) {
00149                 String new_text;
00150
00151                 if (pnid->cbSize==NID_SIZE_W6 || pnid->cbSize==NID_SIZE_W5 || pnid->cbSize==NID_SIZE_W3) {
00152                          // UNICODE version of NOTIFYICONDATA structure
00153                         LPCWSTR txt = (LPCWSTR)pnid->szTip;
00154                         int max_len = pnid->cbSize==NID_SIZE_W3? 64: 128;
00155
00156                          // get tooltip string length
00157                         int l = 0;
00158                         for(; l<max_len; ++l)
00159                                 if (!txt[l])
00160                                         break;
00161
00162                         new_text.assign(txt, l);
00163
00164                         if (new_text != _tipText) {
00165                                 _tipText = new_text;
00166                                 changes = true;
00167                         }
00168                 } else if (pnid->cbSize==NID_SIZE_A6 || pnid->cbSize==NID_SIZE_A5 || pnid->cbSize==NID_SIZE_A3) {
00169                         LPCSTR txt = (LPCSTR)pnid->szTip;
00170                         int max_len = pnid->cbSize==NID_SIZE_A3? 64: 128;
00171
00172                         int l = 0;
00173                         for(int l=0; l<max_len; ++l)
00174                                 if (!txt[l])
00175                                         break;
00176
00177                         new_text.assign(txt, l);
00178
00179                         if (new_text != _tipText) {
00180                                 _tipText = new_text;
00181                                 changes = true;
00182                         }
00183                 }
00184         }
00185
00186         TCHAR title[MAX_PATH];
00187
00188         DWORD pid;
00189         GetWindowThreadProcessId(_hWnd, &pid);
00190
00191          // avoid to send WM_GETTEXT messages to the own process
00192         if (pid != GetCurrentProcessId())
00193                 if (GetWindowText(_hWnd, title, COUNTOF(title))) {
00194                         if (_windowTitle != title) {
00195                                 _windowTitle = title;
00196                                 changes = true;
00197                         }
00198                 }
00199
00200         if (changes) {
00201                 create_name();
00202                 _lastChange = GetTickCount();
00203         }
00204
00205         return changes;
00206 }
00207
00208
00209 NotifyArea::NotifyArea(HWND hwnd)
00210  :      super(hwnd),
00211         _tooltip(hwnd)
00212 {
00213         _next_idx = 0;
00214         _clock_width = 0;
00215         _last_icon_count = 0;
00216         _show_hidden = false;
00217         _hide_inactive = true;
00218         _show_button = true;
00219 }
00220
00221 NotifyArea::~NotifyArea()
00222 {
00223         KillTimer(_hwnd, 0);
00224
00225         write_config();
00226 }
00227
00228 static bool get_hide_clock_from_registry()
00229 {
00230         HKEY hkeyStuckRects = 0;
00231         DWORD buffer[10];
00232         DWORD len = sizeof(buffer);
00233
00234         bool hide_clock = false;
00235
00236          // check if the clock should be hidden
00237         if (!RegOpenKey(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StuckRects2"), &hkeyStuckRects) &&
00238                 !RegQueryValueEx(hkeyStuckRects, TEXT("Settings"), 0, NULL, (LPBYTE)buffer, &len) &&
00239                 len==sizeof(buffer) && buffer[0]==sizeof(buffer))
00240                 hide_clock = buffer[2] & 0x08? true: false;
00241
00242         if (hkeyStuckRects)
00243                 RegCloseKey(hkeyStuckRects);
00244
00245         return hide_clock;
00246 }
00247
00248 void NotifyArea::read_config()
00249 {
00250         bool clock_visible = true;
00251
00252          // read notification icon settings from XML configuration
00253         XMLPos cfg_pos = g_Globals.get_cfg();
00254
00255 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
00256         if (!g_Globals._SHRestricted || !SHRestricted(REST_HIDECLOCK))
00257 #endif
00258         {
00259                 if (cfg_pos.go_down("desktopbar")) {
00260                         clock_visible = XMLBoolRef(XMLPos(cfg_pos,"options"), "show-clock", !get_hide_clock_from_registry());
00261                         cfg_pos.back();
00262                 }
00263         }
00264
00265         if (cfg_pos.go_down("notify-icons")) {
00266                 XMLPos options(cfg_pos, "options");
00267
00268                 _hide_inactive = XMLBool(options, "hide-inactive", true);
00269                 _show_hidden = XMLBool(options, "show-hidden", false);
00270                 _show_button = XMLBool(options, "show-button", true);
00271
00272                 XMLChildrenFilter icons(cfg_pos, "icon");
00273
00274                 for(XMLChildrenFilter::iterator it=icons.begin(); it!=icons.end(); ++it) {
00275                         const XMLNode& node = **it;
00276
00277                         NotifyIconConfig cfg;
00278
00279                         cfg._name = node.get("name").c_str();
00280                         cfg._tipText = node.get("text").c_str();
00281                         cfg._windowTitle = node.get("window").c_str();
00282                         cfg._modulePath = node.get("module").c_str();
00283                         const string& mode = node.get("show");
00284
00285                         if (mode == "show")
00286                                 cfg._mode = NIM_SHOW;
00287                         else if (mode == "hide")
00288                                 cfg._mode = NIM_HIDE;
00289                         else //if (mode == "auto")
00290                                 cfg._mode = NIM_HIDE;
00291
00292                         _cfg.push_back(cfg);
00293                 }
00294
00295                 cfg_pos.back();
00296         }
00297
00298         show_clock(clock_visible);
00299 }
00300
00301 void NotifyArea::write_config()
00302 {
00303          // write notification icon settings to XML configuration file
00304         XMLPos cfg_pos = g_Globals.get_cfg();
00305
00306         cfg_pos.smart_create("desktopbar");
00307         XMLBoolRef boolRef(XMLPos(cfg_pos,"options"), "show-clock");
00308     boolRef = _hwndClock!=0;
00309         cfg_pos.back();
00310
00311         cfg_pos.smart_create("notify-icons");
00312
00313         XMLPos options(cfg_pos, "options");
00314         XMLBoolRef(options, "hide-inactive") = _hide_inactive;
00315         XMLBoolRef(options, "show-hidden") = _show_hidden;
00316         XMLBoolRef(options, "show-button") = _show_button;
00317
00318         for(NotifyIconCfgList::iterator it=_cfg.begin(); it!=_cfg.end(); ++it) {
00319                 NotifyIconConfig& cfg = *it;
00320
00321                  // search for the corresponding node using the original name
00322                 cfg_pos.smart_create("icon", "name", cfg._name);
00323
00324                  // refresh unique name
00325                 cfg.create_name();
00326
00327                 cfg_pos["name"] = cfg._name.c_str();
00328                 cfg_pos["text"] = cfg._tipText.c_str();
00329                 cfg_pos["window"] = cfg._windowTitle.c_str();
00330                 cfg_pos["module"] = cfg._modulePath.c_str();
00331                 cfg_pos["show"] = string_from_mode(cfg._mode).c_str();
00332
00333                 cfg_pos.back();
00334         }
00335
00336         cfg_pos.back(); // smart_create
00337 }
00338
00339 void NotifyArea::show_clock(bool flag)
00340 {
00341         bool vis = _hwndClock!=0;
00342
00343         if (vis != flag) {
00344                 if (flag) {
00345                          // create clock window
00346                         _hwndClock = ClockWindow::Create(_hwnd);
00347
00348                         if (_hwndClock) {
00349                                 ClientRect clock_size(_hwndClock);
00350                                 _clock_width = clock_size.right;
00351                         }
00352                 } else {
00353                         DestroyWindow(_hwndClock);
00354                         _hwndClock = 0;
00355                         _clock_width = 0;
00356                 }
00357
00358                 SendMessage(GetParent(_hwnd), PM_RESIZE_CHILDREN, 0, 0);
00359         }
00360 }
00361
00362 LRESULT NotifyArea::Init(LPCREATESTRUCT pcs)
00363 {
00364         if (super::Init(pcs))
00365                 return 1;
00366
00367         read_config();
00368
00369         SetTimer(_hwnd, 0, 1000, NULL);
00370
00371         return 0;
00372 }
00373
00374 HWND NotifyArea::Create(HWND hwndParent)
00375 {
00376         static BtnWindowClass wcTrayNotify(CLASSNAME_TRAYNOTIFY, CS_DBLCLKS);
00377
00378         ClientRect clnt(hwndParent);
00379
00380         return Window::Create(WINDOW_CREATOR(NotifyArea), WS_EX_STATICEDGE,
00381                                                         wcTrayNotify, TITLE_TRAYNOTIFY, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN,
00382                                                         clnt.right-(NOTIFYAREA_WIDTH_DEF+1), 1, NOTIFYAREA_WIDTH_DEF, clnt.bottom-2, hwndParent);
00383 }
00384
00385 LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00386 {
00387         switch(nmsg) {
00388           case WM_PAINT:
00389                 Paint();
00390                 break;
00391
00392           case WM_TIMER: {
00393                 Refresh();
00394
00395                 ClockWindow* clock_window = GET_WINDOW(ClockWindow, _hwndClock);
00396
00397                 if (clock_window)
00398                         clock_window->TimerTick();
00399                 break;}
00400
00401           case PM_REFRESH:
00402                 Refresh(true);
00403                 break;
00404
00405           case WM_SIZE: {
00406                 int cx = LOWORD(lparam);
00407                 SetWindowPos(_hwndClock, 0, cx-_clock_width, 0, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
00408                 break;}
00409
00410           case PM_GET_WIDTH: {
00411                 int w = _sorted_icons.size()*NOTIFYICON_DIST + NOTIFYAREA_SPACE + _clock_width;
00412                 if (_show_button)
00413                         w += NOTIFYICON_DIST;
00414                 return w;}
00415
00416           case PM_REFRESH_CONFIG:
00417                 read_config();
00418                 break;
00419
00420           case WM_CONTEXTMENU: {
00421                 Point pt(lparam);
00422                 ScreenToClient(_hwnd, &pt);
00423
00424                 if (IconHitTest(pt) == _sorted_icons.end()) { // display menu only when no icon clicked
00425                         PopupMenu menu(IDM_NOTIFYAREA);
00426                         SetMenuDefaultItem(menu, 0, MF_BYPOSITION);
00427                         CheckMenuItem(menu, ID_SHOW_HIDDEN_ICONS, MF_BYCOMMAND|(_show_hidden?MF_CHECKED:MF_UNCHECKED));
00428                         CheckMenuItem(menu, ID_SHOW_ICON_BUTTON, MF_BYCOMMAND|(_show_button?MF_CHECKED:MF_UNCHECKED));
00429                         menu.TrackPopupMenu(_hwnd, MAKEPOINTS(lparam));
00430                 }
00431                 break;}
00432
00433           case WM_COPYDATA: {   // receive NotifyHook answers
00434                 String path;
00435                 HWND hwnd;
00436
00437                 if (_hook.ModulePathCopyData(lparam, &hwnd, path))
00438                         _window_modules[hwnd] = path;
00439                 break;}
00440
00441           default:
00442                 if (nmsg>=WM_MOUSEFIRST && nmsg<=WM_MOUSELAST) {
00443                          // close startup menu and other popup menus
00444                          // This functionality is missing in MS Windows.
00445                         if (nmsg==WM_LBUTTONDOWN || nmsg==WM_MBUTTONDOWN || nmsg==WM_RBUTTONDOWN
00446 #ifdef WM_XBUTTONDOWN
00447                                 || nmsg==WM_XBUTTONDOWN
00448 #endif
00449                                 )
00450
00451                                 CancelModes();
00452
00453                         Point pt(lparam);
00454                         NotifyIconSet::const_iterator found = IconHitTest(pt);
00455
00456                         if (found != _sorted_icons.end()) {
00457                                 const NotifyInfo& entry = const_cast<NotifyInfo&>(*found);      // Why does GCC 3.3 need this additional const_cast ?!
00458
00459                                  // set activation time stamp
00460                                 if (nmsg == WM_LBUTTONDOWN ||   // Some programs need PostMessage() instead of SendMessage().
00461                                         nmsg == WM_MBUTTONDOWN ||       // So call SendMessage() only for BUTTONUP and BLCLK messages
00462 #ifdef WM_XBUTTONDOWN
00463                                         nmsg == WM_XBUTTONDOWN ||
00464 #endif
00465                                         nmsg == WM_RBUTTONDOWN) {
00466                                         _icon_map[entry]._lastChange = GetTickCount();
00467                                 }
00468
00469                                  // Notify the message if the owner is still alive
00470                                 if (IsWindow(entry._hWnd)) {
00471                                         if (nmsg == WM_MOUSEMOVE ||             // avoid to call blocking SendMessage() for merely moving the mouse over icons
00472                                                 nmsg == WM_LBUTTONDOWN ||       // Some programs need PostMessage() instead of SendMessage().
00473                                                 nmsg == WM_MBUTTONDOWN ||       // So call SendMessage() only for BUTTONUP and BLCLK messages
00474 #ifdef WM_XBUTTONDOWN
00475                                                 nmsg == WM_XBUTTONDOWN ||
00476 #endif
00477                                                 nmsg == WM_RBUTTONDOWN)
00478                                                 PostMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg);
00479                                         else {
00480                                                  // allow SetForegroundWindow() in client process
00481                                                 DWORD pid;
00482
00483                                                 if (GetWindowThreadProcessId(entry._hWnd, &pid)) {
00484                                                          // bind dynamically to AllowSetForegroundWindow() to be compatible to WIN98
00485                                                         static DynamicFct<BOOL(WINAPI*)(DWORD)> AllowSetForegroundWindow(TEXT("USER32"), "AllowSetForegroundWindow");
00486
00487                                                         if (AllowSetForegroundWindow)
00488                                                                 (*AllowSetForegroundWindow)(pid);
00489                                                 }
00490
00491                                                  // use PostMessage() for notifcation icons of Shell Service Objects in the own process
00492                                                 if (pid == GetCurrentProcessId())
00493                                                         PostMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg);
00494                                                 else
00495                                                         SendMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg);
00496                                         }
00497                                 }
00498                                 else if (_icon_map.erase(entry))        // delete icons without valid owner window
00499                                         UpdateIcons();
00500                         } else
00501                                  // handle clicks on notification area button "show hidden icons"
00502                                 if (_show_button)
00503                                         if (nmsg == WM_LBUTTONDOWN)
00504                                                 if (pt.x>=NOTIFYICON_X && pt.x<NOTIFYICON_X+NOTIFYICON_SIZE &&
00505                                                         pt.y>=NOTIFYICON_Y && pt.y<NOTIFYICON_Y+NOTIFYICON_SIZE)
00506                                                         PostMessage(_hwnd, WM_COMMAND, MAKEWPARAM(ID_SHOW_HIDDEN_ICONS,0), 0);
00507                 }
00508
00509                 return super::WndProc(nmsg, wparam, lparam);
00510         }
00511
00512         return 0;
00513 }
00514
00515 int NotifyArea::Command(int id, int code)
00516 {
00517         switch(id) {
00518           case ID_SHOW_HIDDEN_ICONS:
00519                 _show_hidden = !_show_hidden;
00520                 UpdateIcons();
00521                 break;
00522
00523           case ID_SHOW_ICON_BUTTON:
00524                 _show_button = !_show_button;
00525                 UpdateIcons();
00526                 break;
00527
00528           case ID_CONFIG_NOTIFYAREA:
00529                 Dialog::DoModal(IDD_NOTIFYAREA, WINDOW_CREATOR(TrayNotifyDlg), GetParent(_hwnd));
00530                 break;
00531
00532           case ID_CONFIG_TIME:
00533                 launch_cpanel(_hwnd, TEXT("timedate.cpl"));
00534                 break;
00535
00536           default:
00537                 SendParent(WM_COMMAND, MAKELONG(id,code), 0);
00538         }
00539
00540         return 0;
00541 }
00542
00543 int NotifyArea::Notify(int id, NMHDR* pnmh)
00544 {
00545         if (pnmh->code == TTN_GETDISPINFO) {
00546                 LPNMTTDISPINFO pdi = (LPNMTTDISPINFO)pnmh;
00547
00548                 Point pt(GetMessagePos());
00549                 ScreenToClient(_hwnd, &pt);
00550
00551                 if (_show_button &&
00552                         pt.x>=NOTIFYICON_X && pt.x<NOTIFYICON_X+NOTIFYICON_SIZE &&
00553                         pt.y>=NOTIFYICON_Y && pt.y<NOTIFYICON_Y+NOTIFYICON_SIZE)
00554                 {
00555                         static ResString sShowIcons(IDS_SHOW_HIDDEN_ICONS);
00556                         static ResString sHideIcons(IDS_HIDE_ICONS);
00557
00558                         pdi->lpszText = (_show_hidden? sHideIcons: sShowIcons).str();
00559                 } else {
00560                         NotifyIconSet::iterator found = IconHitTest(pt);
00561
00562                         if (found != _sorted_icons.end()) {
00563                                 NotifyInfo& entry = const_cast<NotifyInfo&>(*found);    // Why does GCC 3.3 need this additional const_cast ?!
00564
00565                                  // enable multiline tooltips (break at CR/LF and for very long one-line strings)
00566                                 SendMessage(pnmh->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 400);
00567
00568                                 pdi->lpszText = entry._tipText.str();
00569                         }
00570                 }
00571         }
00572
00573         return 0;
00574 }
00575
00576 void NotifyArea::CancelModes()
00577 {
00578         PostMessage(HWND_BROADCAST, WM_CANCELMODE, 0, 0);
00579
00580         for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it)
00581                 PostMessage(it->_hWnd, WM_CANCELMODE, 0, 0);
00582 }
00583
00584 LRESULT NotifyArea::ProcessTrayNotification(int notify_code, NOTIFYICONDATA* pnid)
00585 {
00586         switch(notify_code) {
00587           case NIM_ADD:
00588           case NIM_MODIFY:
00589                 if ((int)pnid->uID >= 0) {
00590                         NotifyInfo& entry = _icon_map[pnid];
00591
00592                          // a new entry?
00593                         if (entry._idx == -1)
00594                                 entry._idx = ++_next_idx;
00595                 /* equivalent code using iterator::find();
00596                         NotifyIconMap::iterator found = _icon_map.find(pnid);
00597                         NotifyInfo* pentry;
00598                          // a new entry?
00599                         if (found == _icon_map.end()) {
00600                                 pentry = &_icon_map[pnid];
00601                                 pentry->_idx = ++_next_idx;
00602                         } else {
00603                                 pentry = &found->second;
00604                         }
00605                         NotifyInfo& entry = *pentry;
00606                 */
00607                         bool changes = entry.modify(pnid);
00608
00609 #if NOTIFYICON_VERSION>=3       // as of 21.08.2003 missing in MinGW headers
00610                         if (DetermineHideState(entry) && entry._mode==NIM_HIDE) {
00611                                 entry._dwState |= NIS_HIDDEN;
00612                                 changes = true;
00613                         }
00614 #endif
00615
00616                         if (changes)
00617                                 UpdateIcons();
00618
00619                         return TRUE;
00620                 }
00621                 break;
00622
00623           case NIM_DELETE: {
00624                 NotifyIconMap::iterator found = _icon_map.find(pnid);
00625
00626                 if (found != _icon_map.end()) {
00627                         if (found->second._hIcon)
00628                                 DestroyIcon(found->second._hIcon);
00629                         _icon_map.erase(found);
00630                         UpdateIcons();
00631                         return TRUE;
00632                 }
00633                 break;}
00634
00635 #if NOTIFYICON_VERSION>=3       // as of 21.08.2003 missing in MinGW headers
00636           case NIM_SETFOCUS:
00637                 SetForegroundWindow(_hwnd);
00638                 return TRUE;
00639
00640           case NIM_SETVERSION:
00641                 NotifyIconMap::iterator found = _icon_map.find(pnid);
00642
00643                 if (found != _icon_map.end()) {
00644                         found->second._version = pnid->UNION_MEMBER(uVersion);
00645                         return TRUE;
00646                 } else
00647                         return FALSE;
00648 #endif
00649         }
00650
00651         return FALSE;
00652 }
00653
00654 void NotifyArea::UpdateIcons()
00655 {
00656         _sorted_icons.clear();
00657
00658          // sort icon infos by display index
00659         for(NotifyIconMap::const_iterator it=_icon_map.begin(); it!=_icon_map.end(); ++it) {
00660                 const NotifyInfo& entry = it->second;
00661
00662 #ifdef NIF_STATE        // as of 21.08.2003 missing in MinGW headers
00663                 if (_show_hidden || !(entry._dwState & NIS_HIDDEN))
00664 #endif
00665                         _sorted_icons.insert(entry);
00666         }
00667
00668          // sync tooltip areas to current icon number
00669         if (_sorted_icons.size() != _last_icon_count) {
00670                 RECT rect = {NOTIFYICON_X, NOTIFYICON_Y, NOTIFYICON_X+NOTIFYICON_SIZE, NOTIFYICON_Y+NOTIFYICON_SIZE};
00671
00672                 size_t tt_idx = 0;
00673
00674                 if (_show_button) {
00675                         _tooltip.add(_hwnd, tt_idx++, rect);
00676
00677                         rect.left += NOTIFYICON_DIST;
00678                         rect.right += NOTIFYICON_DIST;
00679                 }
00680
00681                 size_t icon_cnt = _sorted_icons.size();
00682                 while(tt_idx < icon_cnt) {
00683                         _tooltip.add(_hwnd, tt_idx++, rect);
00684
00685                         rect.left += NOTIFYICON_DIST;
00686                         rect.right += NOTIFYICON_DIST;
00687                 }
00688
00689                 while(tt_idx < _last_icon_count)
00690                         _tooltip.remove(_hwnd, tt_idx++);
00691
00692                 _last_icon_count = _sorted_icons.size();
00693         }
00694
00695         SendMessage(GetParent(_hwnd), PM_RESIZE_CHILDREN, 0, 0);
00696
00697         InvalidateRect(_hwnd, NULL, FALSE);     // refresh icon display
00698         UpdateWindow(_hwnd);
00699 }
00700
00701 #ifndef _NO_ALPHABLEND
00702 #ifdef _MSC_VER
00703 #pragma comment(lib, "msimg32") // for AlphaBlend()
00704 #endif
00705 #endif
00706
00707 void NotifyArea::Paint()
00708 {
00709         BufferedPaintCanvas canvas(_hwnd);
00710
00711          // first fill with the background color
00712         FillRect(canvas, &canvas.rcPaint, GetSysColorBrush(COLOR_BTNFACE));
00713
00714          // draw icons
00715         int x = NOTIFYICON_X;
00716         int y = NOTIFYICON_Y;
00717
00718         if (_show_button) {
00719                 static SmallIcon leftArrowIcon(IDI_NOTIFY_L);
00720                 static SmallIcon rightArrowIcon(IDI_NOTIFY_R);
00721
00722                 DrawIconEx(canvas, x, y, _show_hidden?rightArrowIcon:leftArrowIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL);
00723                 x += NOTIFYICON_DIST;
00724         }
00725
00726 #ifndef _NO_ALPHABLEND
00727         MemCanvas mem_dc;
00728         SelectedBitmap bmp(mem_dc, CreateCompatibleBitmap(canvas, NOTIFYICON_SIZE, NOTIFYICON_SIZE));
00729         RECT rect = {0, 0, NOTIFYICON_SIZE, NOTIFYICON_SIZE};
00730         BLENDFUNCTION blend = {AC_SRC_OVER, 0, 128, 0}; // 50 % visible
00731 #endif
00732
00733         for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it) {
00734 #ifndef _NO_ALPHABLEND
00735                 if (it->_dwState & NIS_HIDDEN) {
00736                         FillRect(mem_dc, &rect, GetSysColorBrush(COLOR_BTNFACE));
00737                         DrawIconEx(mem_dc, 0, 0, it->_hIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL);
00738                         AlphaBlend(canvas, x, y, NOTIFYICON_SIZE, NOTIFYICON_SIZE, mem_dc, 0, 0, NOTIFYICON_SIZE, NOTIFYICON_SIZE, blend);
00739                 } else
00740 #endif
00741                         DrawIconEx(canvas, x, y, it->_hIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL);
00742
00743                 x += NOTIFYICON_DIST;
00744         }
00745 }
00746
00747 void NotifyArea::Refresh(bool update)
00748 {
00749          // Look for task icons without valid owner window.
00750          // This is an extended feature missing in MS Windows.
00751         for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it) {
00752                 const NotifyInfo& entry = *it;
00753
00754                 if (!IsWindow(entry._hWnd))
00755                         if (_icon_map.erase(entry))     // delete icons without valid owner window
00756                                 ++update;
00757         }
00758
00759         DWORD now = GetTickCount();
00760
00761          // handle icon hiding
00762         for(NotifyIconMap::iterator it=_icon_map.begin(); it!=_icon_map.end(); ++it) {
00763                 NotifyInfo& entry = it->second;
00764
00765                 DetermineHideState(entry);
00766
00767                 switch(entry._mode) {
00768                   case NIM_HIDE:
00769                         if (!(entry._dwState & NIS_HIDDEN)) {
00770                                 entry._dwState |= NIS_HIDDEN;
00771                                 ++update;
00772                         }
00773                         break;
00774
00775                   case NIM_SHOW:
00776                         if (entry._dwState&NIS_HIDDEN) {
00777                                 entry._dwState &= ~NIS_HIDDEN;
00778                                 ++update;
00779                         }
00780                         break;
00781
00782                   case NIM_AUTO:
00783                          // automatically hide icons after long periods of inactivity
00784                         if (_hide_inactive)
00785                                 if (!(entry._dwState & NIS_HIDDEN))
00786                                         if (now-entry._lastChange > ICON_AUTOHIDE_SECONDS*1000) {
00787                                                 entry._dwState |= NIS_HIDDEN;
00788                                                 ++update;
00789                                         }
00790                         break;
00791                 }
00792         }
00793
00794         if (update)
00795                 UpdateIcons();
00796 }
00797
00799 NotifyIconSet::iterator NotifyArea::IconHitTest(const POINT& pos)
00800 {
00801         if (pos.y<NOTIFYICON_Y || pos.y>=NOTIFYICON_Y+NOTIFYICON_SIZE)
00802                 return _sorted_icons.end();
00803
00804         NotifyIconSet::iterator it = _sorted_icons.begin();
00805
00806         int x = NOTIFYICON_X;
00807
00808         if (_show_button)
00809                 x += NOTIFYICON_DIST;
00810
00811         for(; it!=_sorted_icons.end(); ++it) {
00812                 //NotifyInfo& entry = const_cast<NotifyInfo&>(*it);     // Why does GCC 3.3 need this additional const_cast ?!
00813
00814                 if (pos.x>=x && pos.x<x+NOTIFYICON_SIZE)
00815                         break;
00816
00817                 x += NOTIFYICON_DIST;
00818         }
00819
00820         return it;
00821 }
00822
00823
00824 void NotifyIconConfig::create_name()
00825 {
00826         _name = FmtString(TEXT("'%s' - '%s' - '%s'"), _tipText.c_str(), _windowTitle.c_str(), _modulePath.c_str());
00827 }
00828
00829
00830 #if NOTIFYICON_VERSION>=3       // as of 21.08.2003 missing in MinGW headers
00831
00832 bool NotifyIconConfig::match(const NotifyIconConfig& props) const
00833 {
00834         if (!_tipText.empty() && !props._tipText.empty())
00835                 if (props._tipText == _tipText)
00836                         return true;
00837
00838         if (!_windowTitle.empty() && !props._windowTitle.empty())
00839                 if (_tcsstr(props._windowTitle, _windowTitle))
00840                         return true;
00841
00842         if (!_modulePath.empty() && !props._modulePath.empty())
00843                 if (!_tcsicmp(props._modulePath, _modulePath))
00844                         return true;
00845
00846         return false;
00847 }
00848
00849 bool NotifyArea::DetermineHideState(NotifyInfo& entry)
00850 {
00851         if (entry._modulePath.empty()) {
00852                 const String& modulePath = _window_modules[entry._hWnd];
00853
00854                  // request module path for new windows (We will get an asynchronous answer by a WM_COPYDATA message.)
00855                 if (!modulePath.empty())
00856                         entry._modulePath = modulePath;
00857                 else
00858                         _hook.GetModulePath(entry._hWnd, _hwnd);
00859         }
00860
00861         for(NotifyIconCfgList::const_iterator it=_cfg.begin(); it!=_cfg.end(); ++it) {
00862                 const NotifyIconConfig& cfg = *it;
00863
00864                 if (cfg.match(entry)) {
00865                         entry._mode = cfg._mode;
00866                         return true;
00867                 }
00868         }
00869
00870         return false;
00871 }
00872
00873 #endif
00874
00875
00876 String string_from_mode(NOTIFYICONMODE mode)
00877 {
00878         switch(mode) {
00879           case NIM_SHOW:
00880                 return ResString(IDS_NOTIFY_SHOW);
00881
00882           case NIM_HIDE:
00883                 return ResString(IDS_NOTIFY_HIDE);
00884
00885           default:      //case NIM_AUTO
00886                 return ResString(IDS_NOTIFY_AUTOHIDE);
00887         }
00888 }
00889
00890
00891 TrayNotifyDlg::TrayNotifyDlg(HWND hwnd)
00892  :      super(hwnd),
00893         _tree_ctrl(GetDlgItem(hwnd, IDC_NOTIFY_ICONS)),
00894         _himl(ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR24, 3, 0)),
00895         _pNotifyArea(static_cast<NotifyArea*>(Window::get_window((HWND)SendMessage(g_Globals._hwndDesktopBar, PM_GET_NOTIFYAREA, 0, 0))))
00896 {
00897         _selectedItem = 0;
00898
00899         if (_pNotifyArea) {
00900                  // save original icon states and configuration data
00901                 for(NotifyIconMap::const_iterator it=_pNotifyArea->_icon_map.begin(); it!=_pNotifyArea->_icon_map.end(); ++it)
00902                         _icon_states_org[it->first] = IconStatePair(it->second._mode, it->second._dwState);
00903
00904                 _cfg_org = _pNotifyArea->_cfg;
00905                 _show_hidden_org = _pNotifyArea->_show_hidden;
00906         }
00907
00908         SetWindowIcon(hwnd, IDI_REACTOS);
00909
00910         _haccel = LoadAccelerators(g_Globals._hInstance, MAKEINTRESOURCE(IDA_TRAYNOTIFY));
00911
00912         {
00913         WindowCanvas canvas(_hwnd);
00914         HBRUSH hbkgnd = GetStockBrush(WHITE_BRUSH);
00915
00916         ImageList_AddAlphaIcon(_himl, SmallIcon(IDI_DOT), hbkgnd, canvas);
00917         ImageList_AddAlphaIcon(_himl, SmallIcon(IDI_DOT_TRANS), hbkgnd, canvas);
00918         ImageList_AddAlphaIcon(_himl, SmallIcon(IDI_DOT_RED), hbkgnd, canvas);
00919         }
00920
00921         (void)TreeView_SetImageList(_tree_ctrl, _himl, TVSIL_NORMAL);
00922
00923         _resize_mgr.Add(IDC_NOTIFY_ICONS,       RESIZE);
00924         _resize_mgr.Add(IDC_LABEL1,                     MOVE_Y);
00925         _resize_mgr.Add(IDC_NOTIFY_TOOLTIP,     RESIZE_X|MOVE_Y);
00926         _resize_mgr.Add(IDC_LABEL2,                     MOVE_Y);
00927         _resize_mgr.Add(IDC_NOTIFY_TITLE,       RESIZE_X|MOVE_Y);
00928         _resize_mgr.Add(IDC_LABEL3,                     MOVE_Y);
00929         _resize_mgr.Add(IDC_NOTIFY_MODULE,      RESIZE_X|MOVE_Y);
00930
00931         _resize_mgr.Add(IDC_LABEL4,                     MOVE_Y);
00932         _resize_mgr.Add(IDC_NOTIFY_SHOW,        MOVE_Y);
00933         _resize_mgr.Add(IDC_NOTIFY_HIDE,        MOVE_Y);
00934         _resize_mgr.Add(IDC_NOTIFY_AUTOHIDE,MOVE_Y);
00935
00936         _resize_mgr.Add(IDC_PICTURE,            MOVE);
00937         _resize_mgr.Add(ID_SHOW_HIDDEN_ICONS,MOVE_Y);
00938
00939         _resize_mgr.Add(IDC_LABEL6,                     MOVE_Y);
00940         _resize_mgr.Add(IDC_LAST_CHANGE,        MOVE_Y);
00941
00942         _resize_mgr.Add(IDOK,                           MOVE);
00943         _resize_mgr.Add(IDCANCEL,                       MOVE);
00944
00945         _resize_mgr.Resize(+150, +200);
00946
00947         Refresh();
00948
00949         SetTimer(_hwnd, 0, 3000, NULL);
00950         register_pretranslate(hwnd);
00951 }
00952
00953 TrayNotifyDlg::~TrayNotifyDlg()
00954 {
00955         KillTimer(_hwnd, 0);
00956         unregister_pretranslate(_hwnd);
00957         ImageList_Destroy(_himl);
00958 }
00959
00960 void TrayNotifyDlg::Refresh()
00961 {
00963
00964         HiddenWindow hide(_tree_ctrl);
00965
00966         TreeView_DeleteAllItems(_tree_ctrl);
00967
00968         TV_INSERTSTRUCT tvi;
00969
00970         tvi.hParent = 0;
00971         tvi.hInsertAfter = TVI_LAST;
00972
00973         TV_ITEM& tv = tvi.item;
00974         tv.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
00975
00976         ResString str_cur(IDS_ITEMS_CUR);
00977         tv.pszText = str_cur.str();
00978         tv.iSelectedImage = tv.iImage = 0;      // IDI_DOT
00979         _hitemCurrent = TreeView_InsertItem(_tree_ctrl, &tvi);
00980
00981         ResString str_conf(IDS_ITEMS_CONFIGURED);
00982         tv.pszText = str_conf.str();
00983         tv.iSelectedImage = tv.iImage = 2;      // IDI_DOT_RED
00984         _hitemConfig = TreeView_InsertItem(_tree_ctrl, &tvi);
00985
00986         tvi.hParent = _hitemCurrent;
00987
00988         ResString str_visible(IDS_ITEMS_VISIBLE);
00989         tv.pszText = str_visible.str();
00990         tv.iSelectedImage = tv.iImage = 0;      // IDI_DOT
00991         _hitemCurrent_visible = TreeView_InsertItem(_tree_ctrl, &tvi);
00992
00993         ResString str_hidden(IDS_ITEMS_HIDDEN);
00994         tv.pszText = str_hidden.str();
00995         tv.iSelectedImage = tv.iImage = 1;      // IDI_DOT_TRANS
00996         _hitemCurrent_hidden = TreeView_InsertItem(_tree_ctrl, &tvi);
00997
00998         if (_pNotifyArea) {
00999                 _info.clear();
01000
01001                 tv.mask |= TVIF_PARAM;
01002
01003                 WindowCanvas canvas(_hwnd);
01004
01005                  // insert current (visible and hidden) items
01006                 for(NotifyIconMap::const_iterator it=_pNotifyArea->_icon_map.begin(); it!=_pNotifyArea->_icon_map.end(); ++it) {
01007                         const NotifyInfo& entry = it->second;
01008
01009                         InsertItem(entry._dwState&NIS_HIDDEN? _hitemCurrent_hidden: _hitemCurrent_visible, TVI_LAST, entry, canvas);
01010                 }
01011
01012                  // insert configured items in tree view
01013                 const NotifyIconCfgList& cfg = _pNotifyArea->_cfg;
01014                 for(NotifyIconCfgList::const_iterator it=cfg.begin(); it!=cfg.end(); ++it) {
01015                         const NotifyIconConfig& cfg_entry = *it;
01016
01017                         HICON hicon = 0;
01018
01019                         if (!cfg_entry._modulePath.empty()) {
01020                                 if ((int)ExtractIconEx(cfg_entry._modulePath, 0, NULL, &hicon, 1) <= 0)
01021                                         hicon = 0;
01022
01023                                 if (!hicon) {
01024                                         SHFILEINFO sfi;
01025
01026                                         if (SHGetFileInfo(cfg_entry._modulePath, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_SMALLICON))
01027                                                 hicon = sfi.hIcon;
01028                                 }
01029                         }
01030
01031                         InsertItem(_hitemConfig, TVI_SORT, cfg_entry, canvas, hicon, cfg_entry._mode);
01032
01033                         if (hicon)
01034                                 DestroyIcon(hicon);
01035                 }
01036
01037                 CheckDlgButton(_hwnd, ID_SHOW_HIDDEN_ICONS, _pNotifyArea->_show_hidden? BST_CHECKED: BST_UNCHECKED);
01038         }
01039
01040         TreeView_Expand(_tree_ctrl, _hitemCurrent_visible, TVE_EXPAND);
01041         TreeView_Expand(_tree_ctrl, _hitemCurrent_hidden, TVE_EXPAND);
01042         TreeView_Expand(_tree_ctrl, _hitemCurrent, TVE_EXPAND);
01043         TreeView_Expand(_tree_ctrl, _hitemConfig, TVE_EXPAND);
01044
01045         TreeView_EnsureVisible(_tree_ctrl, _hitemCurrent_visible);
01046 }
01047
01048 void TrayNotifyDlg::InsertItem(HTREEITEM hparent, HTREEITEM after, const NotifyInfo& entry, HDC hdc)
01049 {
01050         InsertItem(hparent, after, entry, hdc, entry._hIcon, entry._mode);
01051 }
01052
01053 void TrayNotifyDlg::InsertItem(HTREEITEM hparent, HTREEITEM after, const NotifyIconDlgInfo& entry,
01054                                                                 HDC hdc, HICON hicon, NOTIFYICONMODE mode)
01055 {
01056         int idx = _info.size() + 1;
01057         _info[idx] = entry;
01058
01059         String mode_str = string_from_mode(mode);
01060
01061         switch(mode) {
01062           case NIM_SHOW:        mode_str = ResString(IDS_NOTIFY_SHOW);          break;
01063           case NIM_HIDE:        mode_str = ResString(IDS_NOTIFY_HIDE);          break;
01064           case NIM_AUTO:        mode_str = ResString(IDS_NOTIFY_AUTOHIDE);
01065         }
01066
01067         FmtString txt(TEXT("%s  -  %s  [%s]"), entry._tipText.c_str(), entry._windowTitle.c_str(), mode_str.c_str());
01068
01069         TV_INSERTSTRUCT tvi;
01070
01071         tvi.hParent = hparent;
01072         tvi.hInsertAfter = after;
01073
01074         TV_ITEM& tv = tvi.item;
01075         tv.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
01076
01077         tv.lParam = (LPARAM)idx;
01078         tv.pszText = txt.str();
01079         tv.iSelectedImage = tv.iImage = ImageList_AddAlphaIcon(_himl, hicon, GetStockBrush(WHITE_BRUSH), hdc);
01080         (void)TreeView_InsertItem(_tree_ctrl, &tvi);
01081 }
01082
01083 LRESULT TrayNotifyDlg::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
01084 {
01085         switch(nmsg) {
01086           case PM_TRANSLATE_MSG: {
01087                 MSG* pmsg = (MSG*) lparam;
01088
01089                 if (TranslateAccelerator(_hwnd, _haccel, pmsg))
01090                         return TRUE;
01091
01092                 return FALSE;}
01093
01094           case WM_TIMER:
01095                 Refresh();
01096                 break;
01097
01098           default:
01099                 return super::WndProc(nmsg, wparam, lparam);
01100         }
01101
01102         return 0;
01103 }
01104
01105 int TrayNotifyDlg::Command(int id, int code)
01106 {
01107         if (code == BN_CLICKED) {
01108                 switch(id) {
01109                   case ID_REFRESH:
01110                         Refresh();
01111                         break;
01112
01113                   case IDC_NOTIFY_SHOW:
01114                         SetIconMode(NIM_SHOW);
01115                         break;
01116
01117                   case IDC_NOTIFY_HIDE:
01118                         SetIconMode(NIM_HIDE);
01119                         break;
01120
01121                   case IDC_NOTIFY_AUTOHIDE:
01122                         SetIconMode(NIM_AUTO);
01123                         break;
01124
01125                   case ID_SHOW_HIDDEN_ICONS:
01126                         if (_pNotifyArea)
01127                                 SendMessage(*_pNotifyArea, WM_COMMAND, MAKEWPARAM(id,code), 0);
01128                         break;
01129
01130                   case IDOK:
01131                         EndDialog(_hwnd, id);
01132                         break;
01133
01134                   case IDCANCEL:
01135                          // rollback changes
01136                         if (_pNotifyArea) {
01137                                  // restore original icon states and configuration data
01138                                 _pNotifyArea->_cfg = _cfg_org;
01139                                 _pNotifyArea->_show_hidden = _show_hidden_org;
01140
01141                                 for(IconStateMap::const_iterator it=_icon_states_org.begin(); it!=_icon_states_org.end(); ++it) {
01142                                         NotifyInfo& info = _pNotifyArea->_icon_map[it->first];
01143
01144                                         info._mode = it->second.first;
01145                                         info._dwState = it->second.second;
01146                                 }
01147
01148                                 SendMessage(*_pNotifyArea, PM_REFRESH, 0, 0);
01149                         }
01150
01151                         EndDialog(_hwnd, id);
01152                         break;
01153                 }
01154
01155                 return 0;
01156         }
01157
01158         return 1;
01159 }
01160
01161 int TrayNotifyDlg::Notify(int id, NMHDR* pnmh)
01162 {
01163         switch(pnmh->code) {
01164           case TVN_SELCHANGED: {
01165                 NMTREEVIEW* pnmtv = (NMTREEVIEW*)pnmh;
01166                 int idx = pnmtv->itemNew.lParam;
01167
01168                 if (idx) {
01169                         RefreshProperties(_info[idx]);
01170                         _selectedItem = pnmtv->itemNew.hItem;
01171                 } else {
01172                         /*
01173                         SetDlgItemText(_hwnd, IDC_NOTIFY_TOOLTIP, NULL);
01174                         SetDlgItemText(_hwnd, IDC_NOTIFY_TITLE, NULL);
01175                         SetDlgItemText(_hwnd, IDC_NOTIFY_MODULE, NULL);
01176                         */
01177                         CheckRadioButton(_hwnd, IDC_NOTIFY_SHOW, IDC_NOTIFY_AUTOHIDE, 0);
01178                 }
01179                 break;}
01180         }
01181
01182         return 0;
01183 }
01184
01185 void TrayNotifyDlg::RefreshProperties(const NotifyIconDlgInfo& entry)
01186 {
01187         SetDlgItemText(_hwnd, IDC_NOTIFY_TOOLTIP, entry._tipText);
01188         SetDlgItemText(_hwnd, IDC_NOTIFY_TITLE, entry._windowTitle);
01189         SetDlgItemText(_hwnd, IDC_NOTIFY_MODULE, entry._modulePath);
01190
01191         CheckRadioButton(_hwnd, IDC_NOTIFY_SHOW, IDC_NOTIFY_AUTOHIDE, IDC_NOTIFY_SHOW+entry._mode);
01192
01193         String change_str;
01194         if (entry._lastChange)
01195                 change_str.printf(TEXT("before %d s"), (GetTickCount()-entry._lastChange+500)/1000);
01196         SetDlgItemText(_hwnd, IDC_LAST_CHANGE, change_str);
01197
01198         HICON hicon = 0; //get_window_icon_big(entry._hWnd, false);
01199
01200          // If we could not find an icon associated with the owner window, try to load one from the owning module.
01201         if (!hicon && !entry._modulePath.empty()) {
01202                 hicon = ExtractIcon(g_Globals._hInstance, entry._modulePath, 0);
01203
01204                 if (!hicon) {
01205                         SHFILEINFO sfi;
01206
01207                         if (SHGetFileInfo(entry._modulePath, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_LARGEICON))
01208                                 hicon = sfi.hIcon;
01209                 }
01210         }
01211
01212         if (hicon) {
01213                 SendMessage(GetDlgItem(_hwnd, IDC_PICTURE), STM_SETICON, (LPARAM)hicon, 0);
01214                 DestroyIcon(hicon);
01215         } else
01216                 SendMessage(GetDlgItem(_hwnd, IDC_PICTURE), STM_SETICON, 0, 0);
01217 }
01218
01219 void TrayNotifyDlg::SetIconMode(NOTIFYICONMODE mode)
01220 {
01221         int idx = TreeView_GetItemData(_tree_ctrl, _selectedItem);
01222
01223         if (!idx)
01224                 return;
01225
01226         NotifyIconConfig& entry = _info[idx];
01227
01228         if (entry._mode != mode) {
01229                 entry._mode = mode;
01230
01231                  // trigger refresh in notify area and this dialog
01232                 if (_pNotifyArea)
01233                         SendMessage(*_pNotifyArea, PM_REFRESH, 0, 0);
01234         }
01235
01236         if (_pNotifyArea) {
01237                 bool found = false;
01238
01239                 NotifyIconCfgList& cfg = _pNotifyArea->_cfg;
01240                 for(NotifyIconCfgList::iterator it=cfg.begin(); it!=cfg.end(); ++it) {
01241                         NotifyIconConfig& cfg_entry = *it;
01242
01243                         if (cfg_entry.match(entry)) {
01244                                 cfg_entry._mode = mode;
01245                                 ++found;
01246                                 break;
01247                         }
01248                 }
01249
01250                 if (!found) {
01251                          // insert new configuration entry
01252                         NotifyIconConfig cfg_entry = entry;
01253
01254                         cfg_entry._mode = mode;
01255
01256                         _pNotifyArea->_cfg.push_back(cfg_entry);
01257                 }
01258         }
01259
01260         Refresh();
01262 }
01263
01264
01265 ClockWindow::ClockWindow(HWND hwnd)
01266  :      super(hwnd),
01267         _tooltip(hwnd)
01268 {
01269         *_time = TEXT('\0');
01270         FormatTime();
01271
01272         _tooltip.add(_hwnd, _hwnd);
01273 }
01274
01275 HWND ClockWindow::Create(HWND hwndParent)
01276 {
01277         static BtnWindowClass wcClock(CLASSNAME_CLOCKWINDOW, CS_DBLCLKS);
01278
01279         ClientRect clnt(hwndParent);
01280
01281         WindowCanvas canvas(hwndParent);
01282         FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
01283
01284         RECT rect = {0, 0, 0, 0};
01285         TCHAR buffer[8];
01286
01287         if (!GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, buffer, sizeof(buffer)/sizeof(TCHAR)))
01288                 _tcscpy(buffer, TEXT("00:00"));
01289
01290         DrawText(canvas, buffer, -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
01291         int clockwindowWidth = rect.right-rect.left + 4;
01292
01293         return Window::Create(WINDOW_CREATOR(ClockWindow), 0,
01294                                                         wcClock, NULL, WS_CHILD|WS_VISIBLE,
01295                                                         clnt.right-(clockwindowWidth), 1, clockwindowWidth, clnt.bottom-2, hwndParent);
01296 }
01297
01298 LRESULT ClockWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
01299 {
01300         switch(nmsg) {
01301           case WM_PAINT:
01302                 Paint();
01303                 break;
01304
01305           case WM_LBUTTONDBLCLK:
01306                 launch_cpanel(_hwnd, TEXT("timedate.cpl"));
01307                 break;
01308
01309           default:
01310                 return super::WndProc(nmsg, wparam, lparam);
01311         }
01312
01313         return 0;
01314 }
01315
01316 int ClockWindow::Notify(int id, NMHDR* pnmh)
01317 {
01318         if (pnmh->code == TTN_GETDISPINFO) {
01319                 LPNMTTDISPINFO pdi = (LPNMTTDISPINFO)pnmh;
01320
01321                 SYSTEMTIME systime;
01322                 TCHAR buffer[64];
01323
01324                 GetLocalTime(&systime);
01325
01326                 if (GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &systime, NULL, buffer, 64))
01327                         _tcscpy(pdi->szText, buffer);
01328                 else
01329                         pdi->szText[0] = '\0';
01330         }
01331
01332         return 0;
01333 }
01334
01335 void ClockWindow::TimerTick()
01336 {
01337         if (FormatTime())
01338                 InvalidateRect(_hwnd, NULL, TRUE);      // refresh displayed time
01339 }
01340
01341 bool ClockWindow::FormatTime()
01342 {
01343         TCHAR buffer[16];
01344
01345         if (GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, buffer, sizeof(buffer)/sizeof(TCHAR)))
01346                 if (_tcscmp(buffer, _time)) {
01347                         _tcscpy(_time, buffer);
01348                         return true;    // The text to display has changed.
01349                 }
01350
01351         return false;   // no change
01352 }
01353
01354 void ClockWindow::Paint()
01355 {
01356         PaintCanvas canvas(_hwnd);
01357
01358         FillRect(canvas, &canvas.rcPaint, GetSysColorBrush(COLOR_BTNFACE));
01359
01360         BkMode bkmode(canvas, TRANSPARENT);
01361         FontSelection font(canvas, GetStockFont(ANSI_VAR_FONT));
01362
01363         DrawText(canvas, _time, -1, ClientRect(_hwnd), DT_SINGLELINE|DT_VCENTER|DT_NOPREFIX);
01364 }


ROS Explorer: traynotify.h File Reference

  • File List
  • File Members
taskbar

traynotify.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | NotifyIconIndex
NotifyIconIndex is used for maintaining the order of notification icons. More...
struct | NotifyIconConfig
configuration for the display mode of a notification icon More...
struct | NotifyInfo
structure for maintaining informations about one notification icon More...
struct | NotifyHook
struct | NotifyArea
tray notification area aka "tray" More...
struct | NotifyIconDlgInfo
struct | TrayNotifyDlg
configuration dialog for notification icons More...
struct | ClockWindow
window for displaying the time in the tray notification area More...

Defines

#define | CLASSNAME_TRAYNOTIFY TEXT("TrayNotifyWnd")
#define | TITLE_TRAYNOTIFY TEXT("")
#define | CLASSNAME_CLOCKWINDOW TEXT("TrayClockWClass")
#define | NOTIFYAREA_WIDTH_DEF 100
#define | NOTIFYICON_DIST 20
#define | NOTIFYAREA_SPACE 10
#define | NOTIFYICON_SIZE 16
#define | NOTIFYICON_X 2
#define | NOTIFYICON_Y 3
#define | ICON_AUTOHIDE_SECONDS 300
#define | PM_GETMODULEPATH_CB (WM_APP+0x21)
#define | PM_GET_NOTIFYAREA (WM_APP+0x22)

Typedefs

typedef list< NotifyIconConfig > | NotifyIconCfgList
list of NotifyIconConfig structures
typedef map< NotifyIconIndex,
NotifyInfo > 		NotifyIconMap
typedef set< NotifyInfo > | NotifyIconSet
typedef map< int, NotifyIconDlgInfo > | NotifyIconDlgInfoMap

Enumerations

enum | NOTIFYICONMODE { NIM_SHOW, NIM_HIDE, NIM_AUTO }

Functions

String | string_from_mode (NOTIFYICONMODE mode)

Define Documentation

#define CLASSNAME_CLOCKWINDOW TEXT("TrayClockWClass")

Definition at line 32 of file traynotify.h.

Referenced by ClockWindow::Create().

#define CLASSNAME_TRAYNOTIFY TEXT("TrayNotifyWnd")

Definition at line 29 of file traynotify.h.

Referenced by NotifyArea::Create().

#define ICON_AUTOHIDE_SECONDS 300

Definition at line 41 of file traynotify.h.

Referenced by NotifyArea::Refresh().

#define NOTIFYAREA_SPACE 10

Definition at line 36 of file traynotify.h.

Referenced by NotifyArea::WndProc().

#define NOTIFYAREA_WIDTH_DEF 100

Definition at line 34 of file traynotify.h.

Referenced by NotifyArea::Create(), and TaskBar::Create().

#define NOTIFYICON_DIST 20

Definition at line 35 of file traynotify.h.

Referenced by NotifyArea::IconHitTest(), NotifyArea::Paint(), and NotifyArea::WndProc().

#define NOTIFYICON_SIZE 16

Definition at line 37 of file traynotify.h.

Referenced by NotifyArea::IconHitTest(), NotifyInfo::modify(), NotifyArea::Notify(), and NotifyArea::Paint().

#define NOTIFYICON_X 2

Definition at line 38 of file traynotify.h.

Referenced by NotifyArea::IconHitTest(), NotifyArea::Notify(), and NotifyArea::Paint().

#define NOTIFYICON_Y 3

Definition at line 39 of file traynotify.h.

Referenced by NotifyArea::IconHitTest(), NotifyArea::Notify(), and NotifyArea::Paint().

#define PM_GET_NOTIFYAREA (WM_APP+0x22)

Definition at line 44 of file traynotify.h.

#define PM_GETMODULEPATH_CB (WM_APP+0x21)

Definition at line 43 of file traynotify.h.

#define TITLE_TRAYNOTIFY TEXT("")

Definition at line 30 of file traynotify.h.

Referenced by NotifyArea::Create().

Typedef Documentation

typedef list<NotifyIconConfig> NotifyIconCfgList

list of NotifyIconConfig structures

Definition at line 89 of file traynotify.h.

typedef map<int, NotifyIconDlgInfo> NotifyIconDlgInfoMap

Definition at line 194 of file traynotify.h.

typedef map<NotifyIconIndex, NotifyInfo> NotifyIconMap

Definition at line 112 of file traynotify.h.

typedef set<NotifyInfo> NotifyIconSet

Definition at line 113 of file traynotify.h.

Enumeration Type Documentation

enum NOTIFYICONMODE

Enumerator:
NIM_SHOW
NIM_HIDE
NIM_AUTO

Definition at line 64 of file traynotify.h.

00064                     {
00065         NIM_SHOW, NIM_HIDE, NIM_AUTO
00066 };

Function Documentation

String string_from_mode ( NOTIFYICONMODE mode )

Definition at line 876 of file traynotify.cpp.

References IDS_NOTIFY_AUTOHIDE, IDS_NOTIFY_HIDE, IDS_NOTIFY_SHOW, and NIM_HIDE.

Referenced by TrayNotifyDlg::InsertItem(), and NotifyArea::write_config().

00877 {
00878         switch(mode) {
00879           case NIM_SHOW:
00880                 return ResString(IDS_NOTIFY_SHOW);
00881
00882           case NIM_HIDE:
00883                 return ResString(IDS_NOTIFY_HIDE);
00884
00885           default:      //case NIM_AUTO
00886                 return ResString(IDS_NOTIFY_AUTOHIDE);
00887         }
00888 }


ROS Explorer: traynotify.h Source File

  • File List
  • File Members
taskbar

traynotify.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer and Desktop clone
00022  //
00023  // traynotify.h
00024  //
00025  // Martin Fuchs, 22.08.2003
00026  //
00027
00028
00029 #define CLASSNAME_TRAYNOTIFY    TEXT("TrayNotifyWnd")
00030 #define TITLE_TRAYNOTIFY                TEXT("")
00031
00032 #define CLASSNAME_CLOCKWINDOW   TEXT("TrayClockWClass")
00033
00034 #define NOTIFYAREA_WIDTH_DEF    100
00035 #define NOTIFYICON_DIST                 20
00036 #define NOTIFYAREA_SPACE                10
00037 #define NOTIFYICON_SIZE                 16
00038 #define NOTIFYICON_X                    2
00039 #define NOTIFYICON_Y                    3
00040
00041 #define ICON_AUTOHIDE_SECONDS   300
00042
00043 #define PM_GETMODULEPATH_CB             (WM_APP+0x21)
00044 #define PM_GET_NOTIFYAREA               (WM_APP+0x22)
00045
00046
00048 struct NotifyIconIndex
00049 {
00050         NotifyIconIndex(NOTIFYICONDATA* pnid);
00051
00052          // sort operator
00053         friend bool operator<(const NotifyIconIndex& a, const NotifyIconIndex& b)
00054                 {return a._hWnd<b._hWnd || (a._hWnd==b._hWnd && a._uID<b._uID);}
00055
00056         HWND    _hWnd;
00057         UINT    _uID;
00058
00059 protected:
00060         NotifyIconIndex();
00061 };
00062
00063
00064 enum NOTIFYICONMODE {
00065         NIM_SHOW, NIM_HIDE, NIM_AUTO
00066 };
00067
00068 extern String string_from_mode(NOTIFYICONMODE mode);
00069
00071 struct NotifyIconConfig
00072 {
00073         NotifyIconConfig() : _mode(NIM_AUTO) {}
00074
00075         void    create_name();
00076         bool    match(const NotifyIconConfig& props) const;
00077
00078          // properties used to identify a notification icon
00079         String  _tipText;
00080         String  _windowTitle;   // To look at the window title and at the window module path of the notify icon owner window
00081         String  _modulePath;    // to identify notification icons is an extension above XP's behaviour.
00082                                                         // (XP seems to store icon image data in the registry instead.)
00083         NOTIFYICONMODE _mode;
00084
00085         String  _name;
00086 };
00087
00089 typedef list<NotifyIconConfig> NotifyIconCfgList;
00090
00091
00093 struct NotifyInfo : public NotifyIconIndex, public NotifyIconConfig
00094 {
00095         NotifyInfo();
00096
00097          // sort operator
00098         friend bool operator<(const NotifyInfo& a, const NotifyInfo& b)
00099                 {return a._idx < b._idx;}
00100
00101         bool    modify(NOTIFYICONDATA* pnid);
00102
00103         int             _idx;   // display index
00104         HICON   _hIcon;
00105         DWORD   _dwState;
00106         UINT    _uCallbackMessage;
00107         UINT    _version;
00108
00109         DWORD   _lastChange;    // timer tick value of the last change
00110 };
00111
00112 typedef map<NotifyIconIndex, NotifyInfo> NotifyIconMap;
00113 typedef set<NotifyInfo> NotifyIconSet;
00114
00115
00116 struct NotifyHook
00117 {
00118         NotifyHook();
00119         ~NotifyHook();
00120
00121         void    GetModulePath(HWND hwnd, HWND hwndCallback);
00122         bool    ModulePathCopyData(LPARAM lparam, HWND* phwnd, String& path);
00123
00124 protected:
00125         const UINT WM_GETMODULEPATH;
00126 };
00127
00128
00130 struct NotifyArea : public Window
00131 {
00132         typedef Window super;
00133
00134         NotifyArea(HWND hwnd);
00135         ~NotifyArea();
00136
00137         static HWND Create(HWND hwndParent);
00138
00139         LRESULT ProcessTrayNotification(int notify_code, NOTIFYICONDATA* pnid);
00140
00141 protected:
00142         WindowHandle _hwndClock;
00143         int             _clock_width;
00144
00145         ToolTip _tooltip;
00146         NotifyHook _hook;
00147
00148         bool    _show_hidden;
00149         bool    _hide_inactive;
00150         bool    _show_button;
00151
00152         LRESULT Init(LPCREATESTRUCT pcs);
00153         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00154         int             Command(int id, int code);
00155         int             Notify(int id, NMHDR* pnmh);
00156
00157         void    UpdateIcons();
00158         void    Paint();
00159         void    Refresh(bool do_refresh=false);
00160         void    CancelModes();
00161
00162         NotifyIconSet::iterator IconHitTest(const POINT& pos);
00163         bool    DetermineHideState(NotifyInfo& entry);
00164
00165         void    read_config();
00166         void    write_config();
00167
00168         friend struct TrayNotifyDlg;
00169
00170         NotifyIconCfgList _cfg;
00171
00172         map<HWND, String> _window_modules;
00173
00174         NotifyIconMap _icon_map;
00175         NotifyIconSet _sorted_icons;
00176         int             _next_idx;
00177         size_t  _last_icon_count;
00178
00179         void    show_clock(bool flag);
00180 };
00181
00182
00183 struct NotifyIconDlgInfo : public NotifyIconConfig
00184 {
00185         typedef NotifyIconConfig super;
00186
00187         NotifyIconDlgInfo(const NotifyInfo& info) : super(info), _lastChange(info._lastChange) {}
00188         NotifyIconDlgInfo(const NotifyIconConfig& cfg) : super(cfg), _lastChange(0) {}
00189         NotifyIconDlgInfo() : _lastChange(0) {}
00190
00191         DWORD   _lastChange;
00192 };
00193
00194 typedef map<int, NotifyIconDlgInfo> NotifyIconDlgInfoMap;
00195
00196
00198 struct TrayNotifyDlg : public ResizeController<Dialog>
00199 {
00200         typedef ResizeController<Dialog> super;
00201
00202         TrayNotifyDlg(HWND hwnd);
00203         ~TrayNotifyDlg();
00204
00205 protected:
00206         HWND    _tree_ctrl;
00207         HACCEL  _haccel;
00208         HIMAGELIST      _himl;
00209         NotifyArea* _pNotifyArea;
00210         NotifyIconDlgInfoMap _info;
00211
00212         typedef pair<NOTIFYICONMODE, DWORD> IconStatePair;
00213         typedef map<NotifyIconIndex, IconStatePair> IconStateMap;
00214
00215         NotifyIconCfgList _cfg_org;
00216         IconStateMap _icon_states_org;
00217         bool    _show_hidden_org;
00218
00219         HTREEITEM _hitemCurrent;
00220         HTREEITEM _hitemCurrent_visible;
00221         HTREEITEM _hitemCurrent_hidden;
00222         HTREEITEM _hitemConfig;
00223         HTREEITEM _selectedItem;
00224
00225         virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00226         virtual int     Command(int id, int code);
00227         virtual int     Notify(int id, NMHDR* pnmh);
00228
00229         void    Refresh();
00230         void    InsertItem(HTREEITEM hparent, HTREEITEM after, const NotifyInfo&, HDC);
00231         void    InsertItem(HTREEITEM hparent, HTREEITEM after, const NotifyIconDlgInfo&, HDC, HICON, NOTIFYICONMODE);
00232         void    SetIconMode(NOTIFYICONMODE mode);
00233         void    RefreshProperties(const NotifyIconDlgInfo& entry);
00234 };
00235
00236
00238 struct ClockWindow : public Window
00239 {
00240         typedef Window super;
00241
00242         ClockWindow(HWND hwnd);
00243
00244         static HWND Create(HWND hwndParent);
00245
00246         void    TimerTick();
00247
00248 protected:
00249         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00250         int             Notify(int id, NMHDR* pnmh);
00251
00252         bool    FormatTime();
00253         void    Paint();
00254
00255         TCHAR   _time[16];
00256         ToolTip _tooltip;
00257 };


ROS Explorer: treedroptarget.h File Reference

  • File List
  • File Members
utility

treedroptarget.h File Reference

#include "dragdropimpl.h"

Include dependency graph for treedroptarget.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class TreeDropTarget
OLE drop target for tree controls. More...


ROS Explorer: treedroptarget.h Source File

  • File List
  • File Members
utility

treedroptarget.h

Go to the documentation of this file.
00001 /**************************************************************************
00002    THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
00003    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
00004    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00005    PARTICULAR PURPOSE.
00006    Author: Leon Finker  01/2001
00007    Modifications: removed ATL dependencies, Martin Fuchs 7/2003
00008 **************************************************************************/
00009
00010 #include "dragdropimpl.h"
00011
00013 class TreeDropTarget : public IDropTargetImpl
00014 {
00015 public:
00016         TreeDropTarget(HWND hTargetWnd) : IDropTargetImpl(hTargetWnd) {}
00017
00018         virtual bool OnDrop(FORMATETC* pFmtEtc, STGMEDIUM& medium, DWORD *pdwEffect)
00019         {
00020                 if (pFmtEtc->cfFormat == CF_HDROP && medium.tymed == TYMED_HGLOBAL)
00021                 {
00022                         HDROP hDrop = (HDROP)GlobalLock(medium.hGlobal);
00023                         if (hDrop != NULL)
00024                         {
00025                                 TCHAR szFileName[MAX_PATH];
00026
00027                                 UINT cFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
00028
00029                                 for(UINT i = 0; i < cFiles; ++i)
00030                                 {
00031                                         DragQueryFile(hDrop, i, szFileName, sizeof(szFileName));
00032
00033                                         if (DROPEFFECT_COPY & *pdwEffect)
00034                                         {
00035                                                  // copy the file or dir
00036
00038
00039                                         }
00040                                         else if (DROPEFFECT_MOVE & *pdwEffect)
00041                                         {
00042                                                  // move the file or dir
00043
00045
00046                                         }
00047                                 }
00048                                 //DragFinish(hDrop); // base class calls ReleaseStgMedium
00049                         }
00050                         GlobalUnlock(medium.hGlobal);
00051                 }
00052
00053                 TreeView_SelectDropTarget(m_hTargetWnd, NULL);
00054
00055                 return true; //let base free the medium
00056         }
00057
00058         virtual HRESULT STDMETHODCALLTYPE DragOver(
00059         /* [in] */ DWORD grfKeyState,
00060         /* [in] */ POINTL pt,
00061         /* [out][in] */ DWORD __RPC_FAR *pdwEffect)
00062         {
00063                 TVHITTESTINFO hit;
00064                 hit.pt = (POINT&)pt;
00065                 ScreenToClient(m_hTargetWnd, &hit.pt);
00066                 hit.flags = TVHT_ONITEM;
00067                 HTREEITEM hItem = TreeView_HitTest(m_hTargetWnd,&hit);
00068
00069                 if (hItem != NULL)
00070                         TreeView_SelectDropTarget(m_hTargetWnd, hItem);
00071
00072                 return IDropTargetImpl::DragOver(grfKeyState, pt, pdwEffect);
00073         }
00074
00075         virtual HRESULT STDMETHODCALLTYPE DragLeave(void)
00076         {
00077                 TreeView_SelectDropTarget(m_hTargetWnd, NULL);
00078
00079                 return IDropTargetImpl::DragLeave();
00080         }
00081 };


ROS Explorer: unixfs.cpp File Reference

  • File List
  • File Members
shell

unixfs.cpp File Reference

Go to the source code of this file.


ROS Explorer: unixfs.cpp Source File

  • File List
  • File Members
shell

unixfs.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // unixfs.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #ifdef __WINE__
00030
00031 #include <precomp.h>
00032
00033 //#include "unixfs.h"
00034
00035  // for UnixDirectory::read_directory()
00036 #include <dirent.h>
00037 #include <sys/stat.h>
00038 #include <time.h>
00039
00040
00041 void UnixDirectory::read_directory()
00042 {
00043         Entry* first_entry = NULL;
00044         Entry* last = NULL;
00045         Entry* entry;
00046
00047         int level = _level + 1;
00048
00049         LPCTSTR path = (LPCTSTR)_path;
00050         DIR* pdir = opendir(path);
00051
00052         if (pdir) {
00053                 struct stat st;
00054                 struct dirent* ent;
00055                 TCHAR buffer[MAX_PATH], *p;
00056
00057                 for(p=buffer; *path; )
00058                         *p++ = *path++;
00059
00060                 if (p==buffer || p[-1]!='/')
00061                         *p++ = '/';
00062
00063                 while((ent=readdir(pdir))) {
00064                         int statres = stat(buffer, &st);
00065
00066                         if (!statres && S_ISDIR(st.st_mode))
00067                                 entry = new UnixDirectory(this, buffer);
00068                         else
00069                                 entry = new UnixEntry(this);
00070
00071                         if (!first_entry)
00072                                 first_entry = entry;
00073
00074                         if (last)
00075                                 last->_next = entry;
00076
00077                         lstrcpy(entry->_data.cFileName, ent->d_name);
00078                         entry->_data.dwFileAttributes = ent->d_name[0]=='.'? FILE_ATTRIBUTE_HIDDEN: 0;
00079
00080                         strcpy(p, ent->d_name);
00081
00082                         if (!statres) {
00083                                 if (S_ISDIR(st.st_mode))
00084                                         entry->_data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00085
00086                                 entry->_data.nFileSizeLow = st.st_size & 0xFFFFFFFF;
00087                                 entry->_data.nFileSizeHigh = st.st_size >> 32;
00088
00089                                 memset(&entry->_data.ftCreationTime, 0, sizeof(FILETIME));
00090                                 time_to_filetime(&st.st_atime, &entry->_data.ftLastAccessTime);
00091                                 time_to_filetime(&st.st_mtime, &entry->_data.ftLastWriteTime);
00092
00093                                 entry->_bhfi.nFileIndexLow = ent->d_ino;
00094                                 entry->_bhfi.nFileIndexHigh = 0;
00095
00096                                 entry->_bhfi.nNumberOfLinks = st.st_nlink;
00097
00098                                 entry->_bhfi_valid = TRUE;
00099                         } else {
00100                                 entry->_data.nFileSizeLow = 0;
00101                                 entry->_data.nFileSizeHigh = 0;
00102                                 entry->_bhfi_valid = FALSE;
00103                         }
00104
00105                         entry->_up = this;
00106                         entry->_expanded = FALSE;
00107                         entry->_scanned = FALSE;
00108                         entry->_level = level;
00109
00110                         last = entry;
00111                 }
00112
00113                 last->_next = NULL;
00114
00115                 closedir(pdir);
00116         }
00117
00118         _down = first_entry;
00119         _scanned = true;
00120 }
00121
00122
00123 const void* UnixDirectory::get_next_path_component(const void* p)
00124 {
00125         LPCTSTR s = (LPCTSTR) p;
00126
00127         while(*s && *s!=TEXT('/'))
00128                 ++s;
00129
00130         while(*s == TEXT('/'))
00131                 ++s;
00132
00133         if (!*s)
00134                 return NULL;
00135
00136         return s;
00137 }
00138
00139
00140 Entry* UnixDirectory::find_entry(const void* p)
00141 {
00142         LPCTSTR name = (LPCTSTR)p;
00143
00144         for(Entry*entry=_down; entry; entry=entry->_next) {
00145                 LPCTSTR p = name;
00146                 LPCTSTR q = entry->_data.cFileName;
00147
00148                 do {
00149                         if (!*p || *p==TEXT('/'))
00150                                 return entry;
00151                 } while(*p++ == *q++);
00152         }
00153
00154         return NULL;
00155 }
00156
00157
00158  // get full path of specified directory entry
00159 bool UnixEntry::get_path(PTSTR path, size_t path_count) const
00160 {
00161         int level = 0;
00162         size_t len = 0;
00163
00164         if (!path || path_count==0)
00165                 return false;
00166
00167         if ( path_count > 1 )
00168         {
00169                 for(const Entry* entry=this; entry; level++) {
00170                         LPCTSTR name = entry->_data.cFileName;
00171                         size_t l = 0;
00172
00173                         for(LPCTSTR s=name; *s && *s!=TEXT('/'); s++)
00174                                 ++l;
00175
00176                         if (entry->_up) {
00177                                 if (l > 0) {
00178                                         if ( len+l+1 >= path_count )
00179                                         {
00180                                                 /* compare to 2 here because of terminator plus the '\\' we prepend */
00181                                                 if ( l + 2 > path_count )
00182                                                         len = 0;
00183                                                 else
00184                                                         len = path_count - l - 2;
00185                                         }
00186                                         memmove(path+l+1, path, len*sizeof(TCHAR));
00187                                         /* compare to 2 here because of terminator plus the '\\' we prepend */
00188                                         if ( l+2 >= path_count )
00189                                                 l = path_count - 2;
00190                                         memcpy(path+1, name, l*sizeof(TCHAR));
00191                                         len += l+1;
00192
00193                                         path[0] = TEXT('/');
00194                                 }
00195
00196                                 entry = entry->_up;
00197                         } else {
00198                                 if ( len+l >= path_count )
00199                                 {
00200                                         if ( l + 1 > path_count )
00201                                                 len = 0;
00202                                         else
00203                                                 len = path_count - l - 1;
00204                                 }
00205                                 memmove(path+l, path, len*sizeof(TCHAR));
00206                                 if ( l+1 >= path_count )
00207                                         l = path_count - 1;
00208                                 memcpy(path, name, l*sizeof(TCHAR));
00209                                 len += l;
00210                                 break;
00211                         }
00212                 }
00213
00214                 if ( !level && (len+1 < path_count) )
00215                         path[len++] = TEXT('/');
00216         }
00217
00218         path[len] = TEXT('\0');
00219
00220         return true;
00221 }
00222
00223 #endif // __WINE__


ROS Explorer: unixfs.h File Reference

  • File List
  • File Members
shell

unixfs.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


ROS Explorer: unixfs.h Source File

  • File List
  • File Members
shell

unixfs.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // unixfs.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #ifdef __WINE__
00030
00031 struct UnixEntry : public Entry
00032 {
00033         UnixEntry(Entry* parent) : Entry(parent) {}
00034
00035 protected:
00036         UnixEntry() : Entry(ET_UNIX) {}
00037
00038         virtual bool get_path(PTSTR path, size_t path_count) const;
00039 };
00040
00041 struct UnixDirectory : public UnixEntry, public Directory
00042 {
00043         UnixDirectory(LPCTSTR root_path)
00044          :      UnixEntry()
00045         {
00046                 _path = _tcsdup(root_path);
00047         }
00048
00049         UnixDirectory(UnixDirectory* parent, LPCTSTR path)
00050          :      UnixEntry(parent)
00051         {
00052                 _path = _tcsdup(path);
00053         }
00054
00055         ~UnixDirectory()
00056         {
00057                 free(_path);
00058                 _path = NULL;
00059         }
00060
00061         virtual void read_directory();
00062         virtual const void* get_next_path_component(const void*);
00063         virtual Entry* find_entry(const void*);
00064 };
00065
00066 #endif


ROS Explorer: utility.cpp File Reference

  • File List
  • File Members
utility

utility.cpp File Reference

#include <precomp.h>
#include <time.h>
#include <sstream>

Include dependency graph for utility.cpp:

Go to the source code of this file.

Defines

#define | CONTROL_RUNDLL "Control_RunDLLA"

Typedefs

typedef void(WINAPI * | RUNDLLPROC )(HWND hwnd, HINSTANCE hinst, LPCTSTR cmdline, DWORD nCmdShow)

Functions

void | CenterWindow (HWND hwnd)
void | MoveVisible (HWND hwnd)
void | display_error (HWND hwnd, DWORD error)
BOOL | time_to_filetime (const time_t *t, FILETIME *ftime)
BOOL | launch_file (HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters)
int | find_window_class (LPCTSTR classname)
String get_windows_version_str ()
BOOL | RunDLL (HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow)
BOOL | launch_cpanel (HWND hwnd, LPCTSTR applet)
BOOL | RecursiveCreateDirectory (LPCTSTR path_in)
DWORD | RegGetDWORDValue (HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD def)
BOOL | RegSetDWORDValue (HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD value)
BOOL | exists_path (LPCTSTR path)
bool | SplitFileSysURL (LPCTSTR url, String &dir_out, String &fname_out)

Define Documentation

#define CONTROL_RUNDLL "Control_RunDLLA"

Definition at line 380 of file utility.cpp.

Referenced by launch_cpanel().

Typedef Documentation

typedef void(WINAPI* RUNDLLPROC)(HWND hwnd, HINSTANCE hinst, LPCTSTR cmdline, DWORD nCmdShow)

Definition at line 347 of file utility.cpp.

Function Documentation

void CenterWindow ( HWND hwnd )

Definition at line 49 of file utility.cpp.

References HWND, and MoveVisible().

Referenced by ExplorerAboutDlg::ExplorerAboutDlg(), FindProgramDlg::FindProgramDlg(), and MdiSdiDlg::MdiSdiDlg().

00050 {
00051         RECT rt, prt;
00052         GetWindowRect(hwnd, &rt);
00053
00054         DWORD style;
00055         HWND owner = 0;
00056
00057         for(HWND wh=hwnd; (wh=GetWindow(wh,GW_OWNER))!=0; )
00058                 if (((style=GetWindowStyle(wh))&WS_VISIBLE) && !(style&WS_MINIMIZE))
00059                         {owner=wh; break;}
00060
00061         if (owner)
00062                 GetWindowRect(owner, &prt);
00063         else
00064                 SystemParametersInfo(SPI_GETWORKAREA, 0, &prt, 0);      //@@ GetDesktopWindow() wäre auch hilfreich.
00065
00066         SetWindowPos(hwnd, 0, (prt.left+prt.right+rt.left-rt.right)/2,
00067                                            (prt.top+prt.bottom+rt.top-rt.bottom)/2, 0,0, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
00068
00069         MoveVisible(hwnd);
00070 }

Here is the call graph for this function:

void display_error | ( | HWND | hwnd,
 |  | DWORD | error
 | ) |

Definition at line 98 of file utility.cpp.

References LOG.

Referenced by MDIMainFrame::Command(), MainFrameBase::Command(), MainFrameBase::ExecuteCommandbar(), ShellEntry::launch_entry(), and launch_file().

00099 {
00100         PTSTR msg;
00101
00102         if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
00103                 0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL)) {
00104                 LOG(FmtString(TEXT("display_error(%#x): %s"), error, msg));
00105
00106                 SetLastError(0);
00107                 MessageBox(hwnd, msg, TEXT("ROS Explorer"), MB_OK);
00108
00109                 if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
00110                         MessageBox(0, msg, TEXT("ROS Explorer"), MB_OK);
00111         } else {
00112                 LOG(FmtString(TEXT("Unknown Error %#x"), error));
00113
00114                 FmtString msg(TEXT("Unknown Error %#x"), error);
00115
00116                 SetLastError(0);
00117                 MessageBox(hwnd, msg, TEXT("ROS Explorer"), MB_OK);
00118
00119                 if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
00120                         MessageBox(0, msg, TEXT("ROS Explorer"), MB_OK);
00121         }
00122
00123         LocalFree(msg);
00124 }

BOOL exists_path ( LPCTSTR path )

Definition at line 487 of file utility.cpp.

Referenced by SplitFileSysURL().

00488 {
00489         WIN32_FIND_DATA fd;
00490
00491         HANDLE hfind = FindFirstFile(path, &fd);
00492
00493         if (hfind != INVALID_HANDLE_VALUE) {
00494                 FindClose(hfind);
00495
00496                 return TRUE;
00497         } else
00498                 return FALSE;
00499 }

int find_window_class ( LPCTSTR classname )

Definition at line 237 of file utility.cpp.

00238 {
00239         EnumWindows(EnumWndProc, (LPARAM)classname);
00240
00241         if (g_foundPrevInstance)
00242                 return 1;
00243
00244         return 0;
00245 }

String get_windows_version_str ( )

Definition at line 248 of file utility.cpp.

References String::printf().

Referenced by ExplorerAboutDlg::ExplorerAboutDlg().

00249 {
00250         OSVERSIONINFOEX osvi = {sizeof(OSVERSIONINFOEX)};
00251         BOOL osvie_val;
00252         String str;
00253
00254         if (!(osvie_val = GetVersionEx((OSVERSIONINFO*)&osvi))) {
00255                 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
00256
00257                 if (!GetVersionEx((OSVERSIONINFO*)&osvi))
00258                         return TEXT("???");
00259         }
00260
00261         switch(osvi.dwPlatformId) {
00262           case VER_PLATFORM_WIN32_NT:
00263 #ifdef _ROS_    // This work around can be removed if ReactOS gets a unique version number.
00264                 str = TEXT("ReactOS");
00265 #else
00266                 if (osvi.dwMajorVersion <= 4)
00267                         str = TEXT("Microsoft Windows NT");
00268                 else if (osvi.dwMajorVersion==5 && osvi.dwMinorVersion==0)
00269                         str = TEXT("Microsoft Windows 2000");
00270                 else if (osvi.dwMajorVersion==5 && osvi.dwMinorVersion==1)
00271                         str = TEXT("Microsoft Windows XP");
00272 #endif
00273
00274                 if (osvie_val) {
00275                         if (osvi.wProductType == VER_NT_WORKSTATION) {
00276                            if (osvi.wSuiteMask & VER_SUITE_PERSONAL)
00277                                   str += TEXT(" Personal");
00278                            else
00279                                   str += TEXT(" Professional");
00280                         } else if (osvi.wProductType == VER_NT_SERVER) {
00281                            if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
00282                                   str += TEXT(" DataCenter Server");
00283                            else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
00284                                   str += TEXT(" Advanced Server");
00285                            else
00286                                   str += TEXT(" Server");
00287                         } else if (osvi.wProductType == VER_NT_DOMAIN_CONTROLLER) {
00288                                 str += TEXT(" Domain Controller");
00289                         }
00290                 } else {
00291                         TCHAR type[80];
00292                         DWORD dwBufLen;
00293                         HKEY hkey;
00294
00295                         if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\CurrentControlSet\\Control\\ProductOptions"), 0, KEY_QUERY_VALUE, &hkey)) {
00296                                 RegQueryValueEx(hkey, TEXT("ProductType"), NULL, NULL, (LPBYTE)type, &dwBufLen);
00297                                 RegCloseKey(hkey);
00298
00299                                 if (!_tcsicmp(TEXT("WINNT"), type))
00300                                    str += TEXT(" Workstation");
00301                                 else if (!_tcsicmp(TEXT("LANMANNT"), type))
00302                                    str += TEXT(" Server");
00303                                 else if (!_tcsicmp(TEXT("SERVERNT"), type))
00304                                         str += TEXT(" Advanced Server");
00305                         }
00306                 }
00307                 break;
00308
00309           case VER_PLATFORM_WIN32_WINDOWS:
00310                 if (osvi.dwMajorVersion>4 ||
00311                         (osvi.dwMajorVersion==4 && osvi.dwMinorVersion>0)) {
00312                         if (osvi.dwMinorVersion == 90)
00313                                 str = TEXT("Microsoft Windows ME");
00314                         else
00315                                 str = TEXT("Microsoft Windows 98");
00316
00317             if (osvi.szCSDVersion[1] == 'A')
00318                                 str += TEXT(" SE");
00319                 } else {
00320                         str = TEXT("Microsoft Windows 95");
00321
00322             if (osvi.szCSDVersion[1]=='B' || osvi.szCSDVersion[1]=='C')
00323                                 str += TEXT(" OSR2");
00324                 }
00325                 break;
00326
00327           case VER_PLATFORM_WIN32s:
00328                 str = TEXT("Microsoft Win32s");
00329
00330           default:
00331                 return TEXT("???");
00332         }
00333
00334         String vstr;
00335
00336         if (osvi.dwMajorVersion <= 4)
00337                 vstr.printf(TEXT(" Version %d.%d %s Build %d"),
00338                                                 osvi.dwMajorVersion, osvi.dwMinorVersion,
00339                                                 osvi.szCSDVersion, osvi.dwBuildNumber&0xFFFF);
00340         else
00341                 vstr.printf(TEXT(" %s (Build %d)"), osvi.szCSDVersion, osvi.dwBuildNumber&0xFFFF);
00342
00343         return str + vstr;
00344 }

Here is the call graph for this function:

BOOL launch_cpanel | ( | HWND | hwnd,
 |  | LPCTSTR | applet
 | ) |

Definition at line 383 of file utility.cpp.

References CONTROL_RUNDLL, and RunDLL().

Referenced by NotifyArea::Command(), DesktopBar::Command(), and ClockWindow::WndProc().

00384 {
00385         //launch_file(_hwnd, applet, SW_SHOWNORMAL);    // This would be enough, but we want the to use the most direct and fastest call.
00386         //launch_file(_hwnd, String(TEXT("rundll32.exe /d shell32.dll,Control_RunDLL "))+applet, SW_SHOWNORMAL);
00387
00388         return RunDLL(hwnd, TEXT("shell32"), CONTROL_RUNDLL, applet, SW_SHOWNORMAL);
00389 }

Here is the call graph for this function:

BOOL launch_file | ( | HWND | hwnd,
 |  | LPCTSTR | cmd,
 |  | UINT | nCmdShow,
 |  | LPCTSTR | parameters
 | ) |

Definition at line 189 of file utility.cpp.

References CONTEXT, and display_error().

Referenced by FavoritesMenu::Command(), StartMenuHandler::Command(), MainFrameBase::Command(), DesktopBar::Command(), ExplorerCmd::IsValidPath(), and Entry::launch_entry().

00190 {
00191         CONTEXT("launch_file()");
00192
00193         HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, parameters, NULL/*dir*/, nCmdShow);
00194
00195         if ((int)hinst <= 32) {
00196                 display_error(hwnd, GetLastError());
00197                 return FALSE;
00198         }
00199
00200         return TRUE;
00201 }

Here is the call graph for this function:

void MoveVisible ( HWND hwnd )

Definition at line 72 of file utility.cpp.

Referenced by CenterWindow(), and ResizeManager::Resize().

00073 {
00074         RECT rc;
00075         GetWindowRect(hwnd, &rc);
00076         int left=rc.left, top=rc.top;
00077
00078         int xmax = GetSystemMetrics(SM_CXSCREEN);
00079         int ymax = GetSystemMetrics(SM_CYSCREEN);
00080
00081         if (rc.left < 0)
00082                 rc.left = 0;
00083         else if (rc.right > xmax)
00084                 if ((rc.left-=rc.right-xmax) < 0)
00085                         rc.left = 0;
00086
00087         if (rc.top < 0)
00088                 rc.top = 0;
00089         else if (rc.bottom > ymax)
00090                 if ((rc.top-=rc.bottom-ymax) < 0)
00091                         rc.top = 0;
00092
00093         if (rc.left!=left || rc.top!=top)
00094                 SetWindowPos(hwnd, 0, rc.left,rc.top, 0,0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE);
00095 }

BOOL RecursiveCreateDirectory ( LPCTSTR path_in )

Definition at line 392 of file utility.cpp.

Referenced by QuickLaunchBar::AddShortcuts(), and ExplorerGlobals::write_persistent().

00393 {
00394         TCHAR path[MAX_PATH], hole_path[MAX_PATH];
00395
00396         _tcscpy(hole_path, path_in);
00397
00398         int drv_len = 0;
00399         LPCTSTR d;
00400
00401         for(d=hole_path; *d && *d!='/' && *d!='\\'; ++d) {
00402                 ++drv_len;
00403
00404                 if (*d == ':')
00405                         break;
00406         }
00407
00408         LPTSTR dir = hole_path + drv_len;
00409
00410         int l;
00411         LPTSTR p = hole_path + (l=_tcslen(hole_path));
00412
00413         while(--p>=hole_path && (*p=='/' || *p=='\\'))
00414                 *p = '\0';
00415
00416         WIN32_FIND_DATA w32fd;
00417
00418         HANDLE hFind = FindFirstFile(hole_path, &w32fd);
00419
00420         if (hFind == INVALID_HANDLE_VALUE) {
00421                 _tcsncpy(path, hole_path, drv_len);
00422                 int i = drv_len;
00423
00424                 for(p=dir; *p=='/'||*p=='\\'; p++)
00425                         path[i++] = *p++;
00426
00427                 for(; i<l; i++) {
00428                         memcpy(path, hole_path, i*sizeof(TCHAR));
00429
00430                         for(; hole_path[i] && hole_path[i]!='/' && hole_path[i]!='\\'; i++)
00431                                 path[i] = hole_path[i];
00432
00433                         path[i] = '\0';
00434
00435                         hFind = FindFirstFile(path, &w32fd);
00436
00437                         if (hFind != INVALID_HANDLE_VALUE)
00438                                 FindClose(hFind);
00439                         else {
00440                                 LOG(FmtString(TEXT("CreateDirectory(\"%s\")"), path));
00441
00442                                 if (!CreateDirectory(path, 0))
00443                                         return FALSE;
00444                         }
00445                 }
00446         } else
00447                 FindClose(hFind);
00448
00449         return TRUE;
00450 }

DWORD RegGetDWORDValue | ( | HKEY | root,
 |  | LPCTSTR | path,
 |  | LPCTSTR | valueName,
 |  | DWORD | def
 | ) |

Definition at line 453 of file utility.cpp.

Referenced by BackgroundWindow::BackgroundWindow().

00454 {
00455         HKEY hkey;
00456         DWORD ret;
00457
00458         if (!RegOpenKey(root, path, &hkey)) {
00459                 DWORD len = sizeof(ret);
00460
00461                 if (RegQueryValueEx(hkey, valueName, 0, NULL, (LPBYTE)&ret, &len))
00462                         ret = def;
00463
00464                 RegCloseKey(hkey);
00465
00466                 return ret;
00467         } else
00468                 return def;
00469 }

BOOL RegSetDWORDValue | ( | HKEY | root,
 |  | LPCTSTR | path,
 |  | LPCTSTR | valueName,
 |  | DWORD | value
 | ) |

Definition at line 472 of file utility.cpp.

Referenced by BackgroundWindow::WndProc().

00473 {
00474         HKEY hkey;
00475         BOOL ret = FALSE;
00476
00477         if (!RegOpenKey(root, path, &hkey)) {
00478                 ret = RegSetValueEx(hkey, valueName, 0, REG_DWORD, (LPBYTE)&value, sizeof(value));
00479
00480                 RegCloseKey(hkey);
00481         }
00482
00483         return ret;
00484 }

BOOL RunDLL | ( | HWND | hwnd,
 |  | LPCTSTR | dllname,
 |  | LPCSTR | procname,
 |  | LPCTSTR | cmdline,
 |  | UINT | nCmdShow
 | ) |

Definition at line 349 of file utility.cpp.

Referenced by launch_cpanel().

00350 {
00351         HMODULE hmod = LoadLibrary(dllname);
00352         if (!hmod)
00353                 return FALSE;
00354
00355 /*TODO
00356         <Windows NT/2000>
00357         It is possible to create a Unicode version of the function.
00358         Rundll32 first tries to find a function named EntryPointW.
00359         If it cannot find this function, it tries EntryPointA, then EntryPoint.
00360         To create a DLL that supports ANSI on Windows 95/98/Me and Unicode otherwise,
00361         export two functions: EntryPointW and EntryPoint.
00362 */
00363         RUNDLLPROC proc = (RUNDLLPROC)GetProcAddress(hmod, procname);
00364         if (!proc) {
00365                 FreeLibrary(hmod);
00366                 return FALSE;
00367         }
00368
00369         proc(hwnd, hmod, cmdline, nCmdShow);
00370
00371         FreeLibrary(hmod);
00372
00373         return TRUE;
00374 }

bool SplitFileSysURL | ( | LPCTSTR | url,
 |  | String & | dir_out,
 |  | String & | fname_out
 | ) |

Definition at line 502 of file utility.cpp.

References _MAX_DIR, _MAX_DRIVE, _MAX_EXT, _MAX_FNAME, _MAX_PATH, _stprintf, _tsplitpath_s, COUNTOF, exists_path(), and String::printf().

Referenced by MDIShellBrowserChild::jump_to_int(), and FileChildWindow::jump_to_int().

00503 {
00504         if (!_tcsnicmp(url, TEXT("file://"), 7)) {
00505                 url += 7;
00506
00507                  // remove third slash in front of drive characters
00508                 if (*url == '/')
00509                         ++url;
00510         }
00511
00512         if (exists_path(url)) {
00513                 TCHAR path[_MAX_PATH];
00514
00515                  // convert slashes to back slashes
00516                 GetFullPathName(url, COUNTOF(path), path, NULL);
00517
00518                 if (GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY)
00519                         fname_out.erase();
00520                 else {
00521                         TCHAR drv[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
00522
00523                         _tsplitpath_s(path, drv, COUNTOF(drv), dir, COUNTOF(dir), fname, COUNTOF(fname), ext, COUNTOF(ext));
00524                         _stprintf(path, TEXT("%s%s"), drv, dir);
00525
00526                         fname_out.printf(TEXT("%s%s"), fname, ext);
00527                 }
00528
00529                 dir_out = path;
00530
00531                 return true;
00532         } else
00533                 return false;
00534 }

Here is the call graph for this function:

BOOL time_to_filetime | ( | const time_t * | t,
 |  | FILETIME * | ftime
 | ) |

Definition at line 159 of file utility.cpp.

00160 {
00161 #ifdef __STDC_WANT_SECURE_LIB__
00162         SYSTEMTIME stime;
00163         struct tm tm_;
00164         struct tm* tm = &tm_;
00165
00166         if (gmtime_s(tm, t) != 0)
00167                 return FALSE;
00168 #else
00169         struct tm* tm = gmtime(t);
00170         SYSTEMTIME stime;
00171
00172         if (!tm)
00173                 return FALSE;
00174 #endif
00175
00176         stime.wYear = tm->tm_year+1900;
00177         stime.wMonth = tm->tm_mon+1;
00178         stime.wDayOfWeek = (WORD)-1;
00179         stime.wDay = tm->tm_mday;
00180         stime.wHour = tm->tm_hour;
00181         stime.wMinute = tm->tm_min;
00182         stime.wSecond = tm->tm_sec;
00183         stime.wMilliseconds = 0;
00184
00185         return SystemTimeToFileTime(&stime, ftime);
00186 }


ROS Explorer: utility.cpp Source File

  • File List
  • File Members
utility

utility.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // utility.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 //#include <shellapi.h>
00032
00033 #include <time.h>
00034 #include <sstream>
00035
00036
00037 DWORD WINAPI Thread::ThreadProc(void* para)
00038 {
00039         Thread* pThis = (Thread*) para;
00040
00041         int ret = pThis->Run();
00042
00043         pThis->_alive = false;
00044
00045         return ret;
00046 }
00047
00048
00049 void CenterWindow(HWND hwnd)
00050 {
00051         RECT rt, prt;
00052         GetWindowRect(hwnd, &rt);
00053
00054         DWORD style;
00055         HWND owner = 0;
00056
00057         for(HWND wh=hwnd; (wh=GetWindow(wh,GW_OWNER))!=0; )
00058                 if (((style=GetWindowStyle(wh))&WS_VISIBLE) && !(style&WS_MINIMIZE))
00059                         {owner=wh; break;}
00060
00061         if (owner)
00062                 GetWindowRect(owner, &prt);
00063         else
00064                 SystemParametersInfo(SPI_GETWORKAREA, 0, &prt, 0);      //@@ GetDesktopWindow() wäre auch hilfreich.
00065
00066         SetWindowPos(hwnd, 0, (prt.left+prt.right+rt.left-rt.right)/2,
00067                                            (prt.top+prt.bottom+rt.top-rt.bottom)/2, 0,0, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
00068
00069         MoveVisible(hwnd);
00070 }
00071
00072 void MoveVisible(HWND hwnd)
00073 {
00074         RECT rc;
00075         GetWindowRect(hwnd, &rc);
00076         int left=rc.left, top=rc.top;
00077
00078         int xmax = GetSystemMetrics(SM_CXSCREEN);
00079         int ymax = GetSystemMetrics(SM_CYSCREEN);
00080
00081         if (rc.left < 0)
00082                 rc.left = 0;
00083         else if (rc.right > xmax)
00084                 if ((rc.left-=rc.right-xmax) < 0)
00085                         rc.left = 0;
00086
00087         if (rc.top < 0)
00088                 rc.top = 0;
00089         else if (rc.bottom > ymax)
00090                 if ((rc.top-=rc.bottom-ymax) < 0)
00091                         rc.top = 0;
00092
00093         if (rc.left!=left || rc.top!=top)
00094                 SetWindowPos(hwnd, 0, rc.left,rc.top, 0,0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE);
00095 }
00096
00097
00098 void display_error(HWND hwnd, DWORD error)      //@@ CONTEXT mit ausgeben -> display_error(HWND hwnd, const Exception& e)
00099 {
00100         PTSTR msg;
00101
00102         if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
00103                 0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL)) {
00104                 LOG(FmtString(TEXT("display_error(%#x): %s"), error, msg));
00105
00106                 SetLastError(0);
00107                 MessageBox(hwnd, msg, TEXT("ROS Explorer"), MB_OK);
00108
00109                 if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
00110                         MessageBox(0, msg, TEXT("ROS Explorer"), MB_OK);
00111         } else {
00112                 LOG(FmtString(TEXT("Unknown Error %#x"), error));
00113
00114                 FmtString msg(TEXT("Unknown Error %#x"), error);
00115
00116                 SetLastError(0);
00117                 MessageBox(hwnd, msg, TEXT("ROS Explorer"), MB_OK);
00118
00119                 if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
00120                         MessageBox(0, msg, TEXT("ROS Explorer"), MB_OK);
00121         }
00122
00123         LocalFree(msg);
00124 }
00125
00126
00127 Context Context::s_main("-NO-CONTEXT-");
00128 Context* Context::s_current = &Context::s_main;
00129
00130 String Context::toString() const
00131 {
00132         String str = _ctx;
00133
00134         if (!_obj.empty())
00135                 str.appendf(TEXT("\nObject: %s"), (LPCTSTR)_obj);
00136
00137         return str;
00138 }
00139
00140 String Context::getStackTrace() const
00141 {
00142         ostringstream str;
00143
00144         str << "Context Trace:\n";
00145
00146         for(const Context*p=this; p && p!=&s_main; p=p->_last) {
00147                 str << "- " << p->_ctx;
00148
00149                 if (!p->_obj.empty())
00150                         str << " obj=" << ANS(p->_obj);
00151
00152                 str << '\n';
00153         }
00154
00155         return str.str();
00156 }
00157
00158
00159 BOOL time_to_filetime(const time_t* t, FILETIME* ftime)
00160 {
00161 #ifdef __STDC_WANT_SECURE_LIB__
00162         SYSTEMTIME stime;
00163         struct tm tm_;
00164         struct tm* tm = &tm_;
00165
00166         if (gmtime_s(tm, t) != 0)
00167                 return FALSE;
00168 #else
00169         struct tm* tm = gmtime(t);
00170         SYSTEMTIME stime;
00171
00172         if (!tm)
00173                 return FALSE;
00174 #endif
00175
00176         stime.wYear = tm->tm_year+1900;
00177         stime.wMonth = tm->tm_mon+1;
00178         stime.wDayOfWeek = (WORD)-1;
00179         stime.wDay = tm->tm_mday;
00180         stime.wHour = tm->tm_hour;
00181         stime.wMinute = tm->tm_min;
00182         stime.wSecond = tm->tm_sec;
00183         stime.wMilliseconds = 0;
00184
00185         return SystemTimeToFileTime(&stime, ftime);
00186 }
00187
00188
00189 BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters)
00190 {
00191         CONTEXT("launch_file()");
00192
00193         HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, parameters, NULL/*dir*/, nCmdShow);
00194
00195         if ((int)hinst <= 32) {
00196                 display_error(hwnd, GetLastError());
00197                 return FALSE;
00198         }
00199
00200         return TRUE;
00201 }
00202
00203 #ifdef UNICODE
00204 BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow, LPCSTR parameters)
00205 {
00206         HINSTANCE hinst = ShellExecuteA(hwnd, NULL/*operation*/, cmd, parameters, NULL/*dir*/, nCmdShow);
00207
00208         if ((int)hinst <= 32) {
00209                 display_error(hwnd, GetLastError());
00210                 return FALSE;
00211         }
00212
00213         return TRUE;
00214 }
00215 #endif
00216
00217
00218 /* search for already running instance */
00219
00220 static int g_foundPrevInstance = 0;
00221
00222 static BOOL CALLBACK EnumWndProc(HWND hwnd, LPARAM lparam)
00223 {
00224         TCHAR cls[128];
00225
00226         GetClassName(hwnd, cls, 128);
00227
00228         if (!lstrcmp(cls, (LPCTSTR)lparam)) {
00229                 g_foundPrevInstance++;
00230                 return FALSE;
00231         }
00232
00233         return TRUE;
00234 }
00235
00236 /* search for window of given class name to allow only one running instance */
00237 int find_window_class(LPCTSTR classname)
00238 {
00239         EnumWindows(EnumWndProc, (LPARAM)classname);
00240
00241         if (g_foundPrevInstance)
00242                 return 1;
00243
00244         return 0;
00245 }
00246
00247
00248 String get_windows_version_str()
00249 {
00250         OSVERSIONINFOEX osvi = {sizeof(OSVERSIONINFOEX)};
00251         BOOL osvie_val;
00252         String str;
00253
00254         if (!(osvie_val = GetVersionEx((OSVERSIONINFO*)&osvi))) {
00255                 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
00256
00257                 if (!GetVersionEx((OSVERSIONINFO*)&osvi))
00258                         return TEXT("???");
00259         }
00260
00261         switch(osvi.dwPlatformId) {
00262           case VER_PLATFORM_WIN32_NT:
00263 #ifdef _ROS_    // This work around can be removed if ReactOS gets a unique version number.
00264                 str = TEXT("ReactOS");
00265 #else
00266                 if (osvi.dwMajorVersion <= 4)
00267                         str = TEXT("Microsoft Windows NT");
00268                 else if (osvi.dwMajorVersion==5 && osvi.dwMinorVersion==0)
00269                         str = TEXT("Microsoft Windows 2000");
00270                 else if (osvi.dwMajorVersion==5 && osvi.dwMinorVersion==1)
00271                         str = TEXT("Microsoft Windows XP");
00272 #endif
00273
00274                 if (osvie_val) {
00275                         if (osvi.wProductType == VER_NT_WORKSTATION) {
00276                            if (osvi.wSuiteMask & VER_SUITE_PERSONAL)
00277                                   str += TEXT(" Personal");
00278                            else
00279                                   str += TEXT(" Professional");
00280                         } else if (osvi.wProductType == VER_NT_SERVER) {
00281                            if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
00282                                   str += TEXT(" DataCenter Server");
00283                            else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
00284                                   str += TEXT(" Advanced Server");
00285                            else
00286                                   str += TEXT(" Server");
00287                         } else if (osvi.wProductType == VER_NT_DOMAIN_CONTROLLER) {
00288                                 str += TEXT(" Domain Controller");
00289                         }
00290                 } else {
00291                         TCHAR type[80];
00292                         DWORD dwBufLen;
00293                         HKEY hkey;
00294
00295                         if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\CurrentControlSet\\Control\\ProductOptions"), 0, KEY_QUERY_VALUE, &hkey)) {
00296                                 RegQueryValueEx(hkey, TEXT("ProductType"), NULL, NULL, (LPBYTE)type, &dwBufLen);
00297                                 RegCloseKey(hkey);
00298
00299                                 if (!_tcsicmp(TEXT("WINNT"), type))
00300                                    str += TEXT(" Workstation");
00301                                 else if (!_tcsicmp(TEXT("LANMANNT"), type))
00302                                    str += TEXT(" Server");
00303                                 else if (!_tcsicmp(TEXT("SERVERNT"), type))
00304                                         str += TEXT(" Advanced Server");
00305                         }
00306                 }
00307                 break;
00308
00309           case VER_PLATFORM_WIN32_WINDOWS:
00310                 if (osvi.dwMajorVersion>4 ||
00311                         (osvi.dwMajorVersion==4 && osvi.dwMinorVersion>0)) {
00312                         if (osvi.dwMinorVersion == 90)
00313                                 str = TEXT("Microsoft Windows ME");
00314                         else
00315                                 str = TEXT("Microsoft Windows 98");
00316
00317             if (osvi.szCSDVersion[1] == 'A')
00318                                 str += TEXT(" SE");
00319                 } else {
00320                         str = TEXT("Microsoft Windows 95");
00321
00322             if (osvi.szCSDVersion[1]=='B' || osvi.szCSDVersion[1]=='C')
00323                                 str += TEXT(" OSR2");
00324                 }
00325                 break;
00326
00327           case VER_PLATFORM_WIN32s:
00328                 str = TEXT("Microsoft Win32s");
00329
00330           default:
00331                 return TEXT("???");
00332         }
00333
00334         String vstr;
00335
00336         if (osvi.dwMajorVersion <= 4)
00337                 vstr.printf(TEXT(" Version %d.%d %s Build %d"),
00338                                                 osvi.dwMajorVersion, osvi.dwMinorVersion,
00339                                                 osvi.szCSDVersion, osvi.dwBuildNumber&0xFFFF);
00340         else
00341                 vstr.printf(TEXT(" %s (Build %d)"), osvi.szCSDVersion, osvi.dwBuildNumber&0xFFFF);
00342
00343         return str + vstr;
00344 }
00345
00346
00347 typedef void (WINAPI*RUNDLLPROC)(HWND hwnd, HINSTANCE hinst, LPCTSTR cmdline, DWORD nCmdShow);
00348
00349 BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow)
00350 {
00351         HMODULE hmod = LoadLibrary(dllname);
00352         if (!hmod)
00353                 return FALSE;
00354
00355 /*TODO
00356         <Windows NT/2000>
00357         It is possible to create a Unicode version of the function.
00358         Rundll32 first tries to find a function named EntryPointW.
00359         If it cannot find this function, it tries EntryPointA, then EntryPoint.
00360         To create a DLL that supports ANSI on Windows 95/98/Me and Unicode otherwise,
00361         export two functions: EntryPointW and EntryPoint.
00362 */
00363         RUNDLLPROC proc = (RUNDLLPROC)GetProcAddress(hmod, procname);
00364         if (!proc) {
00365                 FreeLibrary(hmod);
00366                 return FALSE;
00367         }
00368
00369         proc(hwnd, hmod, cmdline, nCmdShow);
00370
00371         FreeLibrary(hmod);
00372
00373         return TRUE;
00374 }
00375
00376
00377 #ifdef UNICODE
00378 #define CONTROL_RUNDLL "Control_RunDLLW"
00379 #else
00380 #define CONTROL_RUNDLL "Control_RunDLLA"
00381 #endif
00382
00383 BOOL launch_cpanel(HWND hwnd, LPCTSTR applet)
00384 {
00385         //launch_file(_hwnd, applet, SW_SHOWNORMAL);    // This would be enough, but we want the to use the most direct and fastest call.
00386         //launch_file(_hwnd, String(TEXT("rundll32.exe /d shell32.dll,Control_RunDLL "))+applet, SW_SHOWNORMAL);
00387
00388         return RunDLL(hwnd, TEXT("shell32"), CONTROL_RUNDLL, applet, SW_SHOWNORMAL);
00389 }
00390
00391
00392 BOOL RecursiveCreateDirectory(LPCTSTR path_in)
00393 {
00394         TCHAR path[MAX_PATH], hole_path[MAX_PATH];
00395
00396         _tcscpy(hole_path, path_in);
00397
00398         int drv_len = 0;
00399         LPCTSTR d;
00400
00401         for(d=hole_path; *d && *d!='/' && *d!='\\'; ++d) {
00402                 ++drv_len;
00403
00404                 if (*d == ':')
00405                         break;
00406         }
00407
00408         LPTSTR dir = hole_path + drv_len;
00409
00410         int l;
00411         LPTSTR p = hole_path + (l=_tcslen(hole_path));
00412
00413         while(--p>=hole_path && (*p=='/' || *p=='\\'))
00414                 *p = '\0';
00415
00416         WIN32_FIND_DATA w32fd;
00417
00418         HANDLE hFind = FindFirstFile(hole_path, &w32fd);
00419
00420         if (hFind == INVALID_HANDLE_VALUE) {
00421                 _tcsncpy(path, hole_path, drv_len);
00422                 int i = drv_len;
00423
00424                 for(p=dir; *p=='/'||*p=='\\'; p++)
00425                         path[i++] = *p++;
00426
00427                 for(; i<l; i++) {
00428                         memcpy(path, hole_path, i*sizeof(TCHAR));
00429
00430                         for(; hole_path[i] && hole_path[i]!='/' && hole_path[i]!='\\'; i++)
00431                                 path[i] = hole_path[i];
00432
00433                         path[i] = '\0';
00434
00435                         hFind = FindFirstFile(path, &w32fd);
00436
00437                         if (hFind != INVALID_HANDLE_VALUE)
00438                                 FindClose(hFind);
00439                         else {
00440                                 LOG(FmtString(TEXT("CreateDirectory(\"%s\")"), path));
00441
00442                                 if (!CreateDirectory(path, 0))
00443                                         return FALSE;
00444                         }
00445                 }
00446         } else
00447                 FindClose(hFind);
00448
00449         return TRUE;
00450 }
00451
00452
00453 DWORD RegGetDWORDValue(HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD def)
00454 {
00455         HKEY hkey;
00456         DWORD ret;
00457
00458         if (!RegOpenKey(root, path, &hkey)) {
00459                 DWORD len = sizeof(ret);
00460
00461                 if (RegQueryValueEx(hkey, valueName, 0, NULL, (LPBYTE)&ret, &len))
00462                         ret = def;
00463
00464                 RegCloseKey(hkey);
00465
00466                 return ret;
00467         } else
00468                 return def;
00469 }
00470
00471
00472 BOOL RegSetDWORDValue(HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD value)
00473 {
00474         HKEY hkey;
00475         BOOL ret = FALSE;
00476
00477         if (!RegOpenKey(root, path, &hkey)) {
00478                 ret = RegSetValueEx(hkey, valueName, 0, REG_DWORD, (LPBYTE)&value, sizeof(value));
00479
00480                 RegCloseKey(hkey);
00481         }
00482
00483         return ret;
00484 }
00485
00486
00487 BOOL exists_path(LPCTSTR path)
00488 {
00489         WIN32_FIND_DATA fd;
00490
00491         HANDLE hfind = FindFirstFile(path, &fd);
00492
00493         if (hfind != INVALID_HANDLE_VALUE) {
00494                 FindClose(hfind);
00495
00496                 return TRUE;
00497         } else
00498                 return FALSE;
00499 }
00500
00501
00502 bool SplitFileSysURL(LPCTSTR url, String& dir_out, String& fname_out)
00503 {
00504         if (!_tcsnicmp(url, TEXT("file://"), 7)) {
00505                 url += 7;
00506
00507                  // remove third slash in front of drive characters
00508                 if (*url == '/')
00509                         ++url;
00510         }
00511
00512         if (exists_path(url)) {
00513                 TCHAR path[_MAX_PATH];
00514
00515                  // convert slashes to back slashes
00516                 GetFullPathName(url, COUNTOF(path), path, NULL);
00517
00518                 if (GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY)
00519                         fname_out.erase();
00520                 else {
00521                         TCHAR drv[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
00522
00523                         _tsplitpath_s(path, drv, COUNTOF(drv), dir, COUNTOF(dir), fname, COUNTOF(fname), ext, COUNTOF(ext));
00524                         _stprintf(path, TEXT("%s%s"), drv, dir);
00525
00526                         fname_out.printf(TEXT("%s%s"), fname, ext);
00527                 }
00528
00529                 dir_out = path;
00530
00531                 return true;
00532         } else
00533                 return false;
00534 }


ROS Explorer: utility.h File Reference

  • File List
  • File Members
utility

utility.h File Reference

#include <windows.h>
#include <tchar.h>
#include <windowsx.h>
#include <commctrl.h>
#include <objbase.h>
#include <oleauto.h>
#include <malloc.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string>
#include <iostream>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <vector>

Include dependency graph for utility.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace | std

Classes

struct | CommonControlInit
initialization of windows common controls More...
struct | WaitCursor
struct | WindowHandle
base of all structures storing a window handle More...
struct | HiddenWindow
locally hide a window More...
struct | CritSect
critical section wrapper More...
struct | Lock
Lock protects a code section utilizing a critical section. More...
struct | Thread
Thread base class. More...
struct | ClientRect
ClientRect retreives the client area rectangle of a window. More...
struct | WindowRect
ClientRect retreives the window rectangle of a window. More...
struct | Point
PointL encapsulates the POINT structure into a C++ object. More...
struct | FullScreenParameters
structure containing information about full screen display of the frame window More...
struct | PaintCanvas
PaintCanvas is a encapsulation of device contexts managed by BeginPaint()/EndPaint(). More...
struct | Canvas
Canvas is a encapsulation of device contexts. More...
struct | WindowCanvas
WindowCanvas is a encapsulation of client area device contexts. More...
struct | MemCanvas
Memory Canvas creates and destroys memory devoce contexts. More...
struct | SelectedBitmap
SelectedBitmap is used to localy select bitmaps into device contexts. More...
struct | BufferCanvas
BufferCanvas manages offscreen bitmaps selected into memory device contexts. More...
struct | BufferedCanvas
BufferedCanvas enables double buffering for a device context. More...
struct | BufferedPaintCanvas
BufferedPaintCanvas extends PaintCanvas for double buffering. More...
struct | TextColor
TextColor locally selects a text color for drawing. More...
struct | BkMode
BkMode locally sets the background mode for drawing. More...
struct | FontSelection
FontSelection locally selects a font for drawing. More...
struct | BitmapSelection
BitmapSelection locally selects a bitmap into a device context. More...
struct | BrushSelection
BrushSelection locally selects a brush into a device context. More...
struct | PopupMenu
Popup Menus. More...
struct | Variant
struct | BStr
struct | String
string class for TCHAR strings More...
struct | FmtString
struct | UNC
struct | DynamicFct< FCT >
link dynamicly to functions by using GetModuleHandle() and GetProcAddress() More...
struct | DynamicLoadLibFct< FCT >
link dynamicly to functions by using LoadLibrary() and GetProcAddress() More...
struct | Context

Defines

#define | WIN32_LEAN_AND_MEAN
#define | WIN32_EXTRA_LEAN
#define | _MAX_DRIVE 3
#define | _MAX_FNAME 256
#define | _MAX_DIR _MAX_FNAME
#define | _MAX_EXT _MAX_FNAME
#define | _MAX_PATH 260
#define | W_VER_NT 0
#define | for if (0) {} else for
#define | COUNTOF(x) (sizeof(x)/sizeof(x[0]))
#define | BUFFER_LEN 2048
#define | LOG(txt) _log_(txt)
#define | LONGLONGARG TEXT("L")
#define | _tcsrchr strrchr
#define | _stprintf sprintf
#define | U2A(s, d, l) WideCharToMultiByte(CP_ACP, 0, s, -1, d, l, NULL, NULL)
#define | U2nA(s, d, l) WideCharToMultiByte(CP_ACP, 0, s, l, d, l, NULL, NULL)
#define | A2U(s, d, l) MultiByteToWideChar(CP_ACP, 0, s, -1, d, l)
#define | A2nU(s, d, l) MultiByteToWideChar(CP_ACP, 0, s, l, d, l)
#define | FILE_ATTRIBUTE_ENCRYPTED 0x00000040
#define | FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
#define | FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
#define | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
#define | SetDlgCtrlID(hwnd, id) SetWindowLong(hwnd, GWL_ID, id)
#define | SetWindowStyle(hwnd, val) (DWORD)SetWindowLong(hwnd, GWL_STYLE, val)
#define | SetWindowExStyle(h, val) (DWORD)SetWindowLong(hwnd, GWL_EXSTYLE, val)
#define | Window_SetIcon(hwnd, type, hicon) (HICON)SendMessage(hwnd, WM_SETICON, type, (LPARAM)(hicon))
#define | strcpy_s(d, l, s) strcpy(d, s)
#define | _tcscpy_s(d, l, s) _tcscpy(d, s)
#define | wcsncpy_s(d, l, s, n) wcsncpy(d, s, n)
#define | _stprintf_s1(b, l, f, p1) _stprintf(b, f, p1)
#define | _stprintf_s2(b, l, f, p1, p2) _stprintf(b, f, p1,p2)
#define | _tsplitpath_s(f, d, dl, p, pl, n, nl, e, el) _tsplitpath(f, d, p, n, e)
#define | launch_fileA launch_file
#define | _STRING_DEFINED
#define | ANS(x) ((LPCSTR)(x))
#define | CONTEXT_OBJ __ctx__._obj
#define | CONTEXT(c) Context __ctx__(c)
#define | CURRENT_CONTEXT Context::current()
#define | OBJ_CONTEXT(c, o) Context __ctx__(c, o)

Functions

void | _log_ (LPCTSTR txt)
void | CenterWindow (HWND hwnd)
void | MoveVisible (HWND hwnd)
void | display_error (HWND hwnd, DWORD error)
BOOL | time_to_filetime (const time_t *t, FILETIME *ftime)
int | find_window_class (LPCTSTR classname)
BOOL | RecursiveCreateDirectory (LPCTSTR path_in)
DWORD | RegGetDWORDValue (HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD def)
BOOL | RegSetDWORDValue (HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD value)
BOOL | exists_path (LPCTSTR path)
BOOL | launch_file (HWND hwnd, LPCTSTR cmd, UINT nCmdShow=SW_SHOWNORMAL, LPCTSTR parameters=NULL)
BOOL | RunDLL (HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow)
BOOL | launch_cpanel (HWND hwnd, LPCTSTR applet)
void | ClientToScreen (HWND hwnd, RECT *prect)
transform coordinates in a RECT from client to screen coordiantes
void | ScreenToClient (HWND hwnd, RECT *prect)
transform coordinates in a RECT from screen to client coordiantes
String get_windows_version_str ()
bool | SplitFileSysURL (LPCTSTR url, String &dir_out, String &fname_out)

Define Documentation

#define _MAX_DIR _MAX_FNAME

Definition at line 57 of file utility.h.

Referenced by SplitFileSysURL().

#define _MAX_DRIVE 3

Definition at line 55 of file utility.h.

Referenced by MDIMainFrame::activate_drive_window(), MDIMainFrame::Command(), FileChildWindow::FileChildWindow(), and SplitFileSysURL().

#define _MAX_EXT _MAX_FNAME

Definition at line 58 of file utility.h.

Referenced by StartMenu::AddShellEntries(), BookmarkList::import_IE_favorites(), FileTypeManager::is_exe_file(), and SplitFileSysURL().

#define _MAX_FNAME 256

Definition at line 56 of file utility.h.

Referenced by StartMenu::AddShellEntries(), ScanNTFSStreams(), and SplitFileSysURL().

#define _MAX_PATH 260

Definition at line 59 of file utility.h.

Referenced by NtObjDirectory::read_directory(), and SplitFileSysURL().

#define _stprintf sprintf

Definition at line 106 of file utility.h.

Referenced by QuickLaunchBar::AddShortcuts(), Pane::draw_item(), and SplitFileSysURL().

#define _stprintf_s1 | ( | b,
 |  | l,
 |  | f,
 |  | p1 | ) | _stprintf(b, f, p1)

Definition at line 184 of file utility.h.

#define _stprintf_s2 | ( | b,
 |  | l,
 |  | f,
 |  | p1,
 |  | p2 | ) | _stprintf(b, f, p1,p2)

Definition at line 185 of file utility.h.

Referenced by COMException::toString().

#define _STRING_DEFINED

Definition at line 876 of file utility.h.

#define _tcscpy_s | ( | d,
 |  | l,
 |  | s | ) | _tcscpy(d, s)

Definition at line 182 of file utility.h.

Referenced by RegDirectory::read_directory().

#define _tcsrchr strrchr

Definition at line 98 of file utility.h.

Referenced by FileTypeManager::set_type().

#define _tsplitpath_s | ( | f,
 |  | d,
 |  | dl,
 |  | p,
 |  | pl,
 |  | n,
 |  | nl,
 |  | e,
 |  | el | ) | _tsplitpath(f, d, p, n, e)

Definition at line 186 of file utility.h.

Referenced by MDIMainFrame::activate_drive_window(), StartMenu::AddShellEntries(), MDIMainFrame::Command(), BookmarkList::import_IE_favorites(), and SplitFileSysURL().

#define A2nU | ( | s,
 |  | d,
 |  | l | ) | MultiByteToWideChar(CP_ACP, 0, s, l, d, l)

Definition at line 113 of file utility.h.

#define A2U | ( | s,
 |  | d,
 |  | l | ) | MultiByteToWideChar(CP_ACP, 0, s, -1, d, l)

Definition at line 112 of file utility.h.

#define ANS ( x ) ((LPCSTR)(x))

Definition at line 920 of file utility.h.

Referenced by Context::getStackTrace().

#define BUFFER_LEN 2048

Definition at line 79 of file utility.h.

Referenced by XMLStorage::XS_String::appendf(), String::appendf(), String::assign(), BStr::BStr(), MainFrameBase::Command(), DecodeURLString(), Pane::draw_item(), FlatButton::DrawItem(), PictureButton::DrawItem(), TaskBar::EnumWndProc(), MainFrameBase::ExecuteCommandbar(), HyperlinkCtrl::init(), MDIMainFrame::MDIMainFrame(), String::operator wstring(), XMLStorage::XS_String::printf(), String::printf(), XMLStorage::XMLReaderBase::read(), Bookmark::read_url(), ResString::ResString(), COMException::toString(), XMLStorage::XS_String::vappendf(), String::vappendf(), XMLStorage::XS_String::vprintf(), and String::vprintf().

#define CONTEXT ( c ) Context __ctx__(c)

Definition at line 1063 of file utility.h.

Referenced by _tWinMain(), QuickLaunchBar::AddShortcuts(), ShellFolder::attach(), QuickLaunchBar::Command(), MDIMainFrame::Command(), MainFrameBase::Command(), QuickLaunchBar::Create(), FileChildWindow::create(), WinEntry::create_absolute_pidl(), ShellEntry::create_absolute_pidl(), ShellPath::create_absolute_pidl(), FATEntry::create_absolute_pidl(), MainFrameBase::ExecuteCommandbar(), explorer_main(), FileChildWindow::FileChildWindow(), ShellDirectory::fill_w32fdata_shell(), ShellPath::get_folder(), ShellFolder::get_name(), ShellDirectory::get_path(), ShellPath::GetUIObjectOf(), CommonDesktop::init(), MDIShellBrowserChild::Init(), ShellBrowser::Init(), ShellBrowser::InitDragDrop(), DesktopShellView::InitDragDrop(), ShellBrowser::InitializeTree(), ShellBrowser::InsertSubitems(), ShellEntry::launch_entry(), launch_file(), name_from_pidl(), ShellBrowser::OnDefaultCommand(), ShellBrowser::OnTreeGetDispInfo(), ShellBrowser::OnTreeItemExpanding(), ShellBrowser::OnTreeItemRClick(), ShellBrowser::OnTreeItemSelected(), path_from_pidlA(), path_from_pidlW(), QuickLaunchBar::QuickLaunchBar(), WinDirectory::read_directory(), ShellDirectory::read_directory(), RegDirectory::read_directory(), NtObjDirectory::read_directory(), FATDirectory::read_directory(), Entry::read_directory_base(), Entry::read_tree(), FileChildWindow::scan_entry(), ShellBrowser::select_entry(), FileChildWindow::set_curdir(), ShellDirectory::ShellDirectory(), ShellFolder::ShellFolder(), ShellItemEnumerator::ShellItemEnumerator(), ShellPath::ShellPath(), Entry::smart_scan(), ShellBrowser::UpdateFolderView(), MDIShellBrowserChild::WndProc(), SDIMainFrame::WndProc(), and MDIMainFrame::WndProc().

#define CONTEXT_OBJ __ctx__._obj

Definition at line 1062 of file utility.h.

#define COUNTOF ( x ) (sizeof(x)/sizeof(x[0]))

Definition at line 75 of file utility.h.

Referenced by _tWinMain(), MDIMainFrame::activate_drive_window(), StartMenu::ActivateEntry(), StartMenu::AddShellEntries(), XMLStorage::XS_String::appendf(), String::appendf(), XMLStorage::XMLIntRef::assign(), FindProgramDlg::collect_programs_callback(), MDIMainFrame::Command(), WinEntry::create_absolute_pidl(), MDIShellBrowserChild::entry_selected(), SDIMainFrame::entry_selected(), COMExceptionBase::ErrorMessage(), Entry::extract_icon(), ShellFolder::get_name(), Entry::get_path_base(), Entry::GetUIObjectOf(), BookmarkList::import_IE_favorites(), Entry::launch_entry(), NotifyInfo::modify(), NotifyHook::ModulePathCopyData(), XMLStorage::XMLInt::operator XS_String(), XMLStorage::XS_String::printf(), String::printf(), ShellDirectory::read_directory(), NtObjDirectory::read_directory(), FindProgramDlg::Refresh(), TrayIcon::Set(), FileChildWindow::set_curdir(), ShellPath::ShellPath(), SplitFileSysURL(), XMLStorage::XS_String::vappendf(), String::vappendf(), XMLStorage::XS_String::vprintf(), String::vprintf(), and ExecuteDialog::WndProc().

#define CURRENT_CONTEXT Context::current()

Definition at line 1064 of file utility.h.

Referenced by COMException::COMException().

#define FILE_ATTRIBUTE_ENCRYPTED 0x00000040

Definition at line 127 of file utility.h.

Referenced by Pane::draw_item().

#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000

Definition at line 130 of file utility.h.

Referenced by Pane::draw_item().

#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400

Definition at line 129 of file utility.h.

Referenced by Pane::draw_item().

#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200

Definition at line 128 of file utility.h.

Referenced by Pane::draw_item().

#define for if (0) {} else for

Definition at line 70 of file utility.h.

#define launch_fileA launch_file

Definition at line 230 of file utility.h.

#define LOG ( txt ) _log_(txt)

Definition at line 84 of file utility.h.

Referenced by _tWinMain(), COMException::COMException(), display_error(), TaskBar::Init(), MainFrameBase::OpenShellFolders(), SDIMainFrame::WndProc(), and MDIMainFrame::WndProc().

#define LONGLONGARG TEXT("L")

Definition at line 90 of file utility.h.

Referenced by Pane::draw_item().

#define OBJ_CONTEXT | ( | c,
 |  | o | ) | Context __ctx__(c, o)

Definition at line 1065 of file utility.h.

Referenced by ShellPath::ShellPath(), and MDIMainFrame::WndProc().

#define SetDlgCtrlID | ( | hwnd,
 |  | id | ) | SetWindowLong(hwnd, GWL_ID, id)

Definition at line 134 of file utility.h.

#define SetWindowExStyle | ( | h,
 |  | val | ) | (DWORD)SetWindowLong(hwnd, GWL_EXSTYLE, val)

Definition at line 136 of file utility.h.

#define SetWindowStyle | ( | hwnd,
 |  | val | ) | (DWORD)SetWindowLong(hwnd, GWL_STYLE, val)

Definition at line 135 of file utility.h.

Referenced by DesktopShellView::DesktopShellView(), and QuickLaunchBar::QuickLaunchBar().

#define strcpy_s | ( | d,
 |  | l,
 |  | s | ) | strcpy(d, s)

Definition at line 181 of file utility.h.

Referenced by handle_exception().

#define U2A | ( | s,
 |  | d,
 |  | l | ) | WideCharToMultiByte(CP_ACP, 0, s, -1, d, l, NULL, NULL)

Definition at line 110 of file utility.h.

#define U2nA | ( | s,
 |  | d,
 |  | l | ) | WideCharToMultiByte(CP_ACP, 0, s, l, d, l, NULL, NULL)

Definition at line 111 of file utility.h.

Referenced by NtObjDirectory::read_directory().

#define W_VER_NT 0

Definition at line 62 of file utility.h.

Referenced by MDIMainFrame::MDIMainFrame(), and StartMenuHandler::ShowLaunchDialog().

#define wcsncpy_s | ( | d,
 |  | l,
 |  | s,
 |  | n | ) | wcsncpy(d, s, n)

Definition at line 183 of file utility.h.

Referenced by NtObjDirectory::read_directory().

#define WIN32_EXTRA_LEAN

Definition at line 31 of file utility.h.

#define WIN32_LEAN_AND_MEAN

Definition at line 30 of file utility.h.

#define Window_SetIcon | ( | hwnd,
 |  | type,
 |  | hicon | ) | (HICON)SendMessage(hwnd, WM_SETICON, type, (LPARAM)(hicon))

Definition at line 137 of file utility.h.

Referenced by SetWindowIcon().

Function Documentation

void _log_ ( LPCTSTR txt )

Definition at line 143 of file explorer.cpp.

References ExplorerGlobals::_log.

00144 {
00145         FmtString msg(TEXT("%s\n"), txt);
00146
00147         if (g_Globals._log)
00148                 _fputts(msg, g_Globals._log);
00149
00150         OutputDebugString(msg);
00151 }

void CenterWindow ( HWND hwnd )

Definition at line 49 of file utility.cpp.

References HWND, and MoveVisible().

Referenced by ExplorerAboutDlg::ExplorerAboutDlg(), FindProgramDlg::FindProgramDlg(), and MdiSdiDlg::MdiSdiDlg().

00050 {
00051         RECT rt, prt;
00052         GetWindowRect(hwnd, &rt);
00053
00054         DWORD style;
00055         HWND owner = 0;
00056
00057         for(HWND wh=hwnd; (wh=GetWindow(wh,GW_OWNER))!=0; )
00058                 if (((style=GetWindowStyle(wh))&WS_VISIBLE) && !(style&WS_MINIMIZE))
00059                         {owner=wh; break;}
00060
00061         if (owner)
00062                 GetWindowRect(owner, &prt);
00063         else
00064                 SystemParametersInfo(SPI_GETWORKAREA, 0, &prt, 0);      //@@ GetDesktopWindow() wäre auch hilfreich.
00065
00066         SetWindowPos(hwnd, 0, (prt.left+prt.right+rt.left-rt.right)/2,
00067                                            (prt.top+prt.bottom+rt.top-rt.bottom)/2, 0,0, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
00068
00069         MoveVisible(hwnd);
00070 }

Here is the call graph for this function:

void ClientToScreen | ( | HWND | hwnd,
 |  | RECT * | prect
 | ) | [inline]

transform coordinates in a RECT from client to screen coordiantes

Definition at line 450 of file utility.h.

Referenced by MainFrameBase::fullscreen_move(), ShellBrowser::OnTreeItemRClick(), MainFrameBase::toggle_fullscreen(), PopupMenu::TrackPopupMenu(), and StartButton::WndProc().

00451  {::ClientToScreen(hwnd,(LPPOINT)&prect->left); ::ClientToScreen(hwnd,(LPPOINT)&prect->right);}

void display_error | ( | HWND | hwnd,
 |  | DWORD | error
 | ) |

Definition at line 98 of file utility.cpp.

References LOG.

Referenced by MainFrameBase::Command(), MDIMainFrame::Command(), MainFrameBase::ExecuteCommandbar(), ShellEntry::launch_entry(), and launch_file().

00099 {
00100         PTSTR msg;
00101
00102         if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
00103                 0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL)) {
00104                 LOG(FmtString(TEXT("display_error(%#x): %s"), error, msg));
00105
00106                 SetLastError(0);
00107                 MessageBox(hwnd, msg, TEXT("ROS Explorer"), MB_OK);
00108
00109                 if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
00110                         MessageBox(0, msg, TEXT("ROS Explorer"), MB_OK);
00111         } else {
00112                 LOG(FmtString(TEXT("Unknown Error %#x"), error));
00113
00114                 FmtString msg(TEXT("Unknown Error %#x"), error);
00115
00116                 SetLastError(0);
00117                 MessageBox(hwnd, msg, TEXT("ROS Explorer"), MB_OK);
00118
00119                 if (GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
00120                         MessageBox(0, msg, TEXT("ROS Explorer"), MB_OK);
00121         }
00122
00123         LocalFree(msg);
00124 }

BOOL exists_path ( LPCTSTR path )

Definition at line 487 of file utility.cpp.

Referenced by SplitFileSysURL().

00488 {
00489         WIN32_FIND_DATA fd;
00490
00491         HANDLE hfind = FindFirstFile(path, &fd);
00492
00493         if (hfind != INVALID_HANDLE_VALUE) {
00494                 FindClose(hfind);
00495
00496                 return TRUE;
00497         } else
00498                 return FALSE;
00499 }

int find_window_class ( LPCTSTR classname )

Definition at line 237 of file utility.cpp.

00238 {
00239         EnumWindows(EnumWndProc, (LPARAM)classname);
00240
00241         if (g_foundPrevInstance)
00242                 return 1;
00243
00244         return 0;
00245 }

String get_windows_version_str ( )

Definition at line 248 of file utility.cpp.

References String::printf().

Referenced by ExplorerAboutDlg::ExplorerAboutDlg().

00249 {
00250         OSVERSIONINFOEX osvi = {sizeof(OSVERSIONINFOEX)};
00251         BOOL osvie_val;
00252         String str;
00253
00254         if (!(osvie_val = GetVersionEx((OSVERSIONINFO*)&osvi))) {
00255                 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
00256
00257                 if (!GetVersionEx((OSVERSIONINFO*)&osvi))
00258                         return TEXT("???");
00259         }
00260
00261         switch(osvi.dwPlatformId) {
00262           case VER_PLATFORM_WIN32_NT:
00263 #ifdef _ROS_    // This work around can be removed if ReactOS gets a unique version number.
00264                 str = TEXT("ReactOS");
00265 #else
00266                 if (osvi.dwMajorVersion <= 4)
00267                         str = TEXT("Microsoft Windows NT");
00268                 else if (osvi.dwMajorVersion==5 && osvi.dwMinorVersion==0)
00269                         str = TEXT("Microsoft Windows 2000");
00270                 else if (osvi.dwMajorVersion==5 && osvi.dwMinorVersion==1)
00271                         str = TEXT("Microsoft Windows XP");
00272 #endif
00273
00274                 if (osvie_val) {
00275                         if (osvi.wProductType == VER_NT_WORKSTATION) {
00276                            if (osvi.wSuiteMask & VER_SUITE_PERSONAL)
00277                                   str += TEXT(" Personal");
00278                            else
00279                                   str += TEXT(" Professional");
00280                         } else if (osvi.wProductType == VER_NT_SERVER) {
00281                            if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
00282                                   str += TEXT(" DataCenter Server");
00283                            else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
00284                                   str += TEXT(" Advanced Server");
00285                            else
00286                                   str += TEXT(" Server");
00287                         } else if (osvi.wProductType == VER_NT_DOMAIN_CONTROLLER) {
00288                                 str += TEXT(" Domain Controller");
00289                         }
00290                 } else {
00291                         TCHAR type[80];
00292                         DWORD dwBufLen;
00293                         HKEY hkey;
00294
00295                         if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\CurrentControlSet\\Control\\ProductOptions"), 0, KEY_QUERY_VALUE, &hkey)) {
00296                                 RegQueryValueEx(hkey, TEXT("ProductType"), NULL, NULL, (LPBYTE)type, &dwBufLen);
00297                                 RegCloseKey(hkey);
00298
00299                                 if (!_tcsicmp(TEXT("WINNT"), type))
00300                                    str += TEXT(" Workstation");
00301                                 else if (!_tcsicmp(TEXT("LANMANNT"), type))
00302                                    str += TEXT(" Server");
00303                                 else if (!_tcsicmp(TEXT("SERVERNT"), type))
00304                                         str += TEXT(" Advanced Server");
00305                         }
00306                 }
00307                 break;
00308
00309           case VER_PLATFORM_WIN32_WINDOWS:
00310                 if (osvi.dwMajorVersion>4 ||
00311                         (osvi.dwMajorVersion==4 && osvi.dwMinorVersion>0)) {
00312                         if (osvi.dwMinorVersion == 90)
00313                                 str = TEXT("Microsoft Windows ME");
00314                         else
00315                                 str = TEXT("Microsoft Windows 98");
00316
00317             if (osvi.szCSDVersion[1] == 'A')
00318                                 str += TEXT(" SE");
00319                 } else {
00320                         str = TEXT("Microsoft Windows 95");
00321
00322             if (osvi.szCSDVersion[1]=='B' || osvi.szCSDVersion[1]=='C')
00323                                 str += TEXT(" OSR2");
00324                 }
00325                 break;
00326
00327           case VER_PLATFORM_WIN32s:
00328                 str = TEXT("Microsoft Win32s");
00329
00330           default:
00331                 return TEXT("???");
00332         }
00333
00334         String vstr;
00335
00336         if (osvi.dwMajorVersion <= 4)
00337                 vstr.printf(TEXT(" Version %d.%d %s Build %d"),
00338                                                 osvi.dwMajorVersion, osvi.dwMinorVersion,
00339                                                 osvi.szCSDVersion, osvi.dwBuildNumber&0xFFFF);
00340         else
00341                 vstr.printf(TEXT(" %s (Build %d)"), osvi.szCSDVersion, osvi.dwBuildNumber&0xFFFF);
00342
00343         return str + vstr;
00344 }

Here is the call graph for this function:

BOOL launch_cpanel | ( | HWND | hwnd,
 |  | LPCTSTR | applet
 | ) |

Definition at line 383 of file utility.cpp.

References CONTROL_RUNDLL, and RunDLL().

Referenced by DesktopBar::Command(), NotifyArea::Command(), and ClockWindow::WndProc().

00384 {
00385         //launch_file(_hwnd, applet, SW_SHOWNORMAL);    // This would be enough, but we want the to use the most direct and fastest call.
00386         //launch_file(_hwnd, String(TEXT("rundll32.exe /d shell32.dll,Control_RunDLL "))+applet, SW_SHOWNORMAL);
00387
00388         return RunDLL(hwnd, TEXT("shell32"), CONTROL_RUNDLL, applet, SW_SHOWNORMAL);
00389 }

Here is the call graph for this function:

BOOL launch_file | ( | HWND | hwnd,
 |  | LPCTSTR | cmd,
 |  | UINT | nCmdShow = SW_SHOWNORMAL,
 |  | LPCTSTR | parameters = NULL
 | ) |

Definition at line 189 of file utility.cpp.

References CONTEXT, and display_error().

Referenced by DesktopBar::Command(), MainFrameBase::Command(), StartMenuHandler::Command(), FavoritesMenu::Command(), ExplorerCmd::IsValidPath(), and Entry::launch_entry().

00190 {
00191         CONTEXT("launch_file()");
00192
00193         HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, parameters, NULL/*dir*/, nCmdShow);
00194
00195         if ((int)hinst <= 32) {
00196                 display_error(hwnd, GetLastError());
00197                 return FALSE;
00198         }
00199
00200         return TRUE;
00201 }

Here is the call graph for this function:

void MoveVisible ( HWND hwnd )

Definition at line 72 of file utility.cpp.

Referenced by CenterWindow(), and ResizeManager::Resize().

00073 {
00074         RECT rc;
00075         GetWindowRect(hwnd, &rc);
00076         int left=rc.left, top=rc.top;
00077
00078         int xmax = GetSystemMetrics(SM_CXSCREEN);
00079         int ymax = GetSystemMetrics(SM_CYSCREEN);
00080
00081         if (rc.left < 0)
00082                 rc.left = 0;
00083         else if (rc.right > xmax)
00084                 if ((rc.left-=rc.right-xmax) < 0)
00085                         rc.left = 0;
00086
00087         if (rc.top < 0)
00088                 rc.top = 0;
00089         else if (rc.bottom > ymax)
00090                 if ((rc.top-=rc.bottom-ymax) < 0)
00091                         rc.top = 0;
00092
00093         if (rc.left!=left || rc.top!=top)
00094                 SetWindowPos(hwnd, 0, rc.left,rc.top, 0,0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE);
00095 }

BOOL RecursiveCreateDirectory ( LPCTSTR path_in )

Definition at line 392 of file utility.cpp.

Referenced by QuickLaunchBar::AddShortcuts(), and ExplorerGlobals::write_persistent().

00393 {
00394         TCHAR path[MAX_PATH], hole_path[MAX_PATH];
00395
00396         _tcscpy(hole_path, path_in);
00397
00398         int drv_len = 0;
00399         LPCTSTR d;
00400
00401         for(d=hole_path; *d && *d!='/' && *d!='\\'; ++d) {
00402                 ++drv_len;
00403
00404                 if (*d == ':')
00405                         break;
00406         }
00407
00408         LPTSTR dir = hole_path + drv_len;
00409
00410         int l;
00411         LPTSTR p = hole_path + (l=_tcslen(hole_path));
00412
00413         while(--p>=hole_path && (*p=='/' || *p=='\\'))
00414                 *p = '\0';
00415
00416         WIN32_FIND_DATA w32fd;
00417
00418         HANDLE hFind = FindFirstFile(hole_path, &w32fd);
00419
00420         if (hFind == INVALID_HANDLE_VALUE) {
00421                 _tcsncpy(path, hole_path, drv_len);
00422                 int i = drv_len;
00423
00424                 for(p=dir; *p=='/'||*p=='\\'; p++)
00425                         path[i++] = *p++;
00426
00427                 for(; i<l; i++) {
00428                         memcpy(path, hole_path, i*sizeof(TCHAR));
00429
00430                         for(; hole_path[i] && hole_path[i]!='/' && hole_path[i]!='\\'; i++)
00431                                 path[i] = hole_path[i];
00432
00433                         path[i] = '\0';
00434
00435                         hFind = FindFirstFile(path, &w32fd);
00436
00437                         if (hFind != INVALID_HANDLE_VALUE)
00438                                 FindClose(hFind);
00439                         else {
00440                                 LOG(FmtString(TEXT("CreateDirectory(\"%s\")"), path));
00441
00442                                 if (!CreateDirectory(path, 0))
00443                                         return FALSE;
00444                         }
00445                 }
00446         } else
00447                 FindClose(hFind);
00448
00449         return TRUE;
00450 }

DWORD RegGetDWORDValue | ( | HKEY | root,
 |  | LPCTSTR | path,
 |  | LPCTSTR | valueName,
 |  | DWORD | def
 | ) |

Definition at line 453 of file utility.cpp.

Referenced by BackgroundWindow::BackgroundWindow().

00454 {
00455         HKEY hkey;
00456         DWORD ret;
00457
00458         if (!RegOpenKey(root, path, &hkey)) {
00459                 DWORD len = sizeof(ret);
00460
00461                 if (RegQueryValueEx(hkey, valueName, 0, NULL, (LPBYTE)&ret, &len))
00462                         ret = def;
00463
00464                 RegCloseKey(hkey);
00465
00466                 return ret;
00467         } else
00468                 return def;
00469 }

BOOL RegSetDWORDValue | ( | HKEY | root,
 |  | LPCTSTR | path,
 |  | LPCTSTR | valueName,
 |  | DWORD | value
 | ) |

Definition at line 472 of file utility.cpp.

Referenced by BackgroundWindow::WndProc().

00473 {
00474         HKEY hkey;
00475         BOOL ret = FALSE;
00476
00477         if (!RegOpenKey(root, path, &hkey)) {
00478                 ret = RegSetValueEx(hkey, valueName, 0, REG_DWORD, (LPBYTE)&value, sizeof(value));
00479
00480                 RegCloseKey(hkey);
00481         }
00482
00483         return ret;
00484 }

BOOL RunDLL | ( | HWND | hwnd,
 |  | LPCTSTR | dllname,
 |  | LPCSTR | procname,
 |  | LPCTSTR | cmdline,
 |  | UINT | nCmdShow
 | ) |

Definition at line 349 of file utility.cpp.

Referenced by launch_cpanel().

00350 {
00351         HMODULE hmod = LoadLibrary(dllname);
00352         if (!hmod)
00353                 return FALSE;
00354
00355 /*TODO
00356         <Windows NT/2000>
00357         It is possible to create a Unicode version of the function.
00358         Rundll32 first tries to find a function named EntryPointW.
00359         If it cannot find this function, it tries EntryPointA, then EntryPoint.
00360         To create a DLL that supports ANSI on Windows 95/98/Me and Unicode otherwise,
00361         export two functions: EntryPointW and EntryPoint.
00362 */
00363         RUNDLLPROC proc = (RUNDLLPROC)GetProcAddress(hmod, procname);
00364         if (!proc) {
00365                 FreeLibrary(hmod);
00366                 return FALSE;
00367         }
00368
00369         proc(hwnd, hmod, cmdline, nCmdShow);
00370
00371         FreeLibrary(hmod);
00372
00373         return TRUE;
00374 }

void ScreenToClient | ( | HWND | hwnd,
 |  | RECT * | prect
 | ) | [inline]

transform coordinates in a RECT from screen to client coordiantes

Definition at line 454 of file utility.h.

Referenced by TreeDropTarget::DragOver(), DesktopDropTarget::DragOver(), ResizeManager::HandleSize(), NotifyArea::Notify(), TaskBar::Notify(), ShellBrowser::OnTreeItemRClick(), NotifyArea::WndProc(), TaskBar::WndProc(), SDIMainFrame::WndProc(), and StartButton::WndProc().

00455  {::ScreenToClient(hwnd,(LPPOINT)&prect->left); ::ScreenToClient(hwnd,(LPPOINT)&prect->right);}

bool SplitFileSysURL | ( | LPCTSTR | url,
 |  | String & | dir_out,
 |  | String & | fname_out
 | ) |

Definition at line 502 of file utility.cpp.

References _MAX_DIR, _MAX_DRIVE, _MAX_EXT, _MAX_FNAME, _MAX_PATH, _stprintf, _tsplitpath_s, COUNTOF, exists_path(), and String::printf().

Referenced by FileChildWindow::jump_to_int(), and MDIShellBrowserChild::jump_to_int().

00503 {
00504         if (!_tcsnicmp(url, TEXT("file://"), 7)) {
00505                 url += 7;
00506
00507                  // remove third slash in front of drive characters
00508                 if (*url == '/')
00509                         ++url;
00510         }
00511
00512         if (exists_path(url)) {
00513                 TCHAR path[_MAX_PATH];
00514
00515                  // convert slashes to back slashes
00516                 GetFullPathName(url, COUNTOF(path), path, NULL);
00517
00518                 if (GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY)
00519                         fname_out.erase();
00520                 else {
00521                         TCHAR drv[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
00522
00523                         _tsplitpath_s(path, drv, COUNTOF(drv), dir, COUNTOF(dir), fname, COUNTOF(fname), ext, COUNTOF(ext));
00524                         _stprintf(path, TEXT("%s%s"), drv, dir);
00525
00526                         fname_out.printf(TEXT("%s%s"), fname, ext);
00527                 }
00528
00529                 dir_out = path;
00530
00531                 return true;
00532         } else
00533                 return false;
00534 }

Here is the call graph for this function:

BOOL time_to_filetime | ( | const time_t * | t,
 |  | FILETIME * | ftime
 | ) |

Definition at line 159 of file utility.cpp.

00160 {
00161 #ifdef __STDC_WANT_SECURE_LIB__
00162         SYSTEMTIME stime;
00163         struct tm tm_;
00164         struct tm* tm = &tm_;
00165
00166         if (gmtime_s(tm, t) != 0)
00167                 return FALSE;
00168 #else
00169         struct tm* tm = gmtime(t);
00170         SYSTEMTIME stime;
00171
00172         if (!tm)
00173                 return FALSE;
00174 #endif
00175
00176         stime.wYear = tm->tm_year+1900;
00177         stime.wMonth = tm->tm_mon+1;
00178         stime.wDayOfWeek = (WORD)-1;
00179         stime.wDay = tm->tm_mday;
00180         stime.wHour = tm->tm_hour;
00181         stime.wMinute = tm->tm_min;
00182         stime.wSecond = tm->tm_sec;
00183         stime.wMilliseconds = 0;
00184
00185         return SystemTimeToFileTime(&stime, ftime);
00186 }


ROS Explorer: utility.h Source File

  • File List
  • File Members
utility

utility.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // utility.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029  // standard windows headers
00030 #define WIN32_LEAN_AND_MEAN
00031 #define WIN32_EXTRA_LEAN
00032 #include <windows.h>
00033
00034  // Unicode support
00035 #ifdef UNICODE
00036 #define _UNICODE
00037 #endif
00038 #include <tchar.h>
00039
00040 #include <windowsx.h>   // for SelectBrush(), ListBox_SetSel(), SubclassWindow(), ...
00041 #include <commctrl.h>
00042
00043 #ifndef _MSC_VER
00044 #include <objbase.h>
00045 #endif
00046 #include <oleauto.h>    // for VARIANT
00047
00048 #include <malloc.h>             // for alloca()
00049 #include <assert.h>
00050 #include <stdlib.h>             // for _MAX_DIR, ...
00051 #include <stdio.h>              // for sprintf()
00052 #include <time.h>
00053
00054 #ifndef _MAX_PATH
00055 #define _MAX_DRIVE      3
00056 #define _MAX_FNAME      256
00057 #define _MAX_DIR        _MAX_FNAME
00058 #define _MAX_EXT        _MAX_FNAME
00059 #define _MAX_PATH       260
00060 #endif
00061
00062 #define W_VER_NT 0      // constant for HIWORD(GetVersion())>>14
00063
00064
00065 #ifdef __cplusplus
00066 extern "C" {
00067 #endif
00068
00069
00070 #define for if (0) {} else for
00071
00072 #ifdef _countof
00073 #define COUNTOF _countof
00074 #else
00075 #define COUNTOF(x)      (sizeof(x)/sizeof(x[0]))
00076 #endif
00077
00078
00079 #define BUFFER_LEN                              2048
00080
00081
00082 extern void _log_(LPCTSTR txt);
00083
00084 #define LOG(txt) _log_(txt)
00085
00086
00087 #ifdef _MSC_VER
00088 #define LONGLONGARG TEXT("I64")
00089 #else
00090 #define LONGLONGARG TEXT("L")
00091 #endif
00092
00093
00094 #ifndef _tcsrchr
00095 #ifdef UNICODE
00096 #define _tcsrchr wcsrchr
00097 #else
00098 #define _tcsrchr strrchr
00099 #endif
00100 #endif
00101
00102 #ifndef _stprintf
00103 #ifdef UNICODE
00104 #define _stprintf wcsprintf
00105 #else
00106 #define _stprintf sprintf
00107 #endif
00108 #endif
00109
00110 #define U2A(s, d, l) WideCharToMultiByte(CP_ACP, 0, s, -1, d, l, NULL, NULL)
00111 #define U2nA(s, d, l) WideCharToMultiByte(CP_ACP, 0, s, l, d, l, NULL, NULL)
00112 #define A2U(s, d, l) MultiByteToWideChar(CP_ACP, 0, s, -1, d, l)
00113 #define A2nU(s, d, l) MultiByteToWideChar(CP_ACP, 0, s, l, d, l)
00114
00115
00116 #ifdef __WINE__
00117 #ifdef UNICODE
00118 extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext);
00119 #else
00120 extern void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext);
00121 #endif
00122 #define _tcsnicmp strncasecmp
00123 #define _tcsicoll strcasecmp
00124 #endif
00125
00126 #ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
00127 #define FILE_ATTRIBUTE_ENCRYPTED            0x00000040
00128 #define FILE_ATTRIBUTE_SPARSE_FILE          0x00000200
00129 #define FILE_ATTRIBUTE_REPARSE_POINT        0x00000400
00130 #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED  0x00002000
00131 #endif
00132
00133
00134 #define SetDlgCtrlID(hwnd, id) SetWindowLong(hwnd, GWL_ID, id)
00135 #define SetWindowStyle(hwnd, val) (DWORD)SetWindowLong(hwnd, GWL_STYLE, val)
00136 #define SetWindowExStyle(h, val) (DWORD)SetWindowLong(hwnd, GWL_EXSTYLE, val)
00137 #define Window_SetIcon(hwnd, type, hicon) (HICON)SendMessage(hwnd, WM_SETICON, type, (LPARAM)(hicon))
00138
00139
00140  // center window in respect to its parent window
00141 extern void CenterWindow(HWND hwnd);
00142
00143  // move window into visibility
00144 extern void MoveVisible(HWND hwnd);
00145
00146  // display error message
00147 extern void display_error(HWND hwnd, DWORD error);
00148
00149  // convert time_t to WIN32 FILETIME
00150 extern BOOL time_to_filetime(const time_t* t, FILETIME* ftime);
00151
00152  // search for windows of a specific classname
00153 extern int find_window_class(LPCTSTR classname);
00154
00155  // create a directory with all missing parent directories
00156 BOOL RecursiveCreateDirectory(LPCTSTR path_in);
00157
00158  // read DWORD value from registry
00159 DWORD RegGetDWORDValue(HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD def);
00160
00161  // write DWORD value to registry
00162 BOOL RegSetDWORDValue(HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD value);
00163
00164  // test for existing directory
00165 BOOL exists_path(LPCTSTR path);
00166
00167
00168 #ifdef __cplusplus
00169 } // extern "C"
00170 #endif
00171
00172
00173  // secure CRT functions
00174 #ifdef __STDC_WANT_SECURE_LIB__ // for VS 2005: _MSC_VER>=1400
00175
00176 #define _stprintf_s1 _stprintf_s
00177 #define _stprintf_s2 _stprintf_s
00178
00179 #else   // __STDC_WANT_SECURE_LIB__
00180
00181 #define strcpy_s(d, l, s) strcpy(d, s)
00182 #define _tcscpy_s(d, l, s) _tcscpy(d, s)
00183 #define wcsncpy_s(d, l, s, n) wcsncpy(d, s, n)
00184 #define _stprintf_s1(b, l, f, p1) _stprintf(b, f, p1)
00185 #define _stprintf_s2(b, l, f, p1,p2) _stprintf(b, f, p1,p2)
00186 #define _tsplitpath_s(f, d,dl, p,pl, n,nl, e,el) _tsplitpath(f, d, p, n, e)
00187
00188 #endif  // __STDC_WANT_SECURE_LIB__
00189
00190
00191 #ifdef __cplusplus
00192
00193 #ifdef _MSC_VER
00194 #pragma warning(disable: 4786)  // disable warnings about too long debug information symbols
00195 #endif
00196
00197  // STL headers for strings and streams
00198 #include <string>
00199 #include <iostream>
00200 using namespace std;
00201
00202  // containers
00203 #include <map>
00204 #include <set>
00205 #include <list>
00206 #include <stack>
00207 #include <vector>
00208
00209
00210 /* not necessary with correct include file order for comdef.h ("<MS PSDK>\include" path first)
00211 #if _MSC_VER>=1300      // VS.Net
00212 #define _NO_COMUTIL
00213 #endif
00214 */
00215
00216 #if defined(_MSC_VER) && !defined(_NO_COMUTIL)
00217
00218  // COM utility headers
00219 #include <comdef.h>
00220 using namespace _com_util;
00221
00222 #endif  // _MSC_VER && !_NO_COMUTIL
00223
00224
00225  // launch a program or document file
00226 extern BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow=SW_SHOWNORMAL, LPCTSTR parameters=NULL);
00227 #ifdef UNICODE
00228 extern BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow=SW_SHOWNORMAL, LPCSTR parameters=NULL);
00229 #else
00230 #define launch_fileA launch_file
00231 #endif
00232
00233  // call an DLL export like rundll32
00234 extern BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow);
00235
00236  // launch control panel applet
00237 extern BOOL launch_cpanel(HWND hwnd, LPCTSTR applet);
00238
00239
00241 struct CommonControlInit
00242 {
00243         CommonControlInit(DWORD flags=ICC_LISTVIEW_CLASSES|ICC_TREEVIEW_CLASSES|ICC_BAR_CLASSES|ICC_PROGRESS_CLASS|ICC_COOL_CLASSES)
00244         {
00245                 INITCOMMONCONTROLSEX icc = {sizeof(INITCOMMONCONTROLSEX), flags};
00246
00247                 InitCommonControlsEx(&icc);
00248         }
00249 };
00250
00251
00253
00254 struct WaitCursor
00255 {
00256         WaitCursor()
00257         {
00258                 _old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
00259         }
00260
00261         ~WaitCursor()
00262         {
00263                 SetCursor(_old_cursor);
00264         }
00265
00266 protected:
00267         HCURSOR _old_cursor;
00268 };
00269
00270
00272 struct WindowHandle
00273 {
00274         WindowHandle(HWND hwnd=0)
00275          :      _hwnd(hwnd) {}
00276
00277         operator HWND() const {return _hwnd;}
00278         HWND* operator&() {return &_hwnd;}
00279
00280 protected:
00281         HWND    _hwnd;
00282 };
00283
00284
00286 struct HiddenWindow : public WindowHandle
00287 {
00288         HiddenWindow(HWND hwnd)
00289          :      WindowHandle(IsWindowVisible(hwnd)? hwnd: 0)
00290         {
00291                 if (_hwnd)
00292                         SetWindowPos(_hwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW|SWP_NOREDRAW|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER);
00293         }
00294
00295         ~HiddenWindow()
00296         {
00297                 if (_hwnd)
00298                         SetWindowPos(_hwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER);
00299         }
00300 };
00301
00302
00304
00305 struct CritSect : public CRITICAL_SECTION
00306 {
00307         CritSect()
00308         {
00309                 InitializeCriticalSection(this);
00310         }
00311
00312         ~CritSect()
00313         {
00314                 DeleteCriticalSection(this);
00315         }
00316 };
00317
00318
00320
00321 struct Lock
00322 {
00323         Lock(CritSect& crit_sect)
00324          :      _crit_sect(crit_sect)
00325         {
00326                 EnterCriticalSection(&crit_sect);
00327         }
00328
00329         ~Lock()
00330         {
00331                 LeaveCriticalSection(&_crit_sect);
00332         }
00333
00334 protected:
00335         CritSect&       _crit_sect;
00336 };
00337
00338
00340
00341 struct Thread
00342 {
00343         Thread()
00344          :      _alive(false),
00345                 _destroy(false)
00346         {
00347                 _hThread = INVALID_HANDLE_VALUE;
00348                 _evtFinish = CreateEvent(NULL, TRUE, FALSE, NULL);
00349         }
00350
00351         virtual ~Thread()
00352         {
00353                 Stop();
00354
00355                 CloseHandle(_evtFinish);
00356                 CloseHandle(_hThread);
00357
00358                 if (_destroy)
00359                         delete this;
00360         }
00361
00362         void Start()
00363         {
00364                 if (!_alive) {
00365                         _alive = true;
00366                         _hThread = CreateThread(NULL, 0, ThreadProc, this, 0, NULL);
00367                 }
00368         }
00369
00370         void Stop()
00371         {
00372                 SetEvent(_evtFinish);
00373
00374                 if (_alive) {
00375                         {
00376                         Lock lock(_crit_sect);
00377                         _alive = false;
00378                         }
00379
00380                          // wait for finishing
00381                         WaitForSingleObject(_hThread, INFINITE);
00382                 }
00383         }
00384
00385         virtual int Run() = 0;
00386
00387         bool    is_alive() const {return _alive;}
00388
00389         CritSect _crit_sect;
00390
00391 protected:
00392         static DWORD WINAPI ThreadProc(void* para);
00393
00394         HANDLE  _hThread;
00395         HANDLE  _evtFinish;
00396         bool    _alive;
00397         bool    _destroy;
00398 };
00399
00400
00401  // window utilities
00402
00404 struct ClientRect : public RECT
00405 {
00406         ClientRect(HWND hwnd)
00407         {
00408                 GetClientRect(hwnd, this);
00409         }
00410
00411         operator LPRECT() {return this;}
00412
00413         POINT& pos() {return *(LPPOINT)this;}
00414 };
00415
00417 struct WindowRect : public RECT
00418 {
00419         WindowRect(HWND hwnd)
00420         {
00421                 GetWindowRect(hwnd, this);
00422         }
00423
00424         operator LPRECT() {return this;}
00425
00426         POINT& pos() {return *(LPPOINT)this;}
00427 };
00428
00430 struct Point : public POINT
00431 {
00432         Point(LONG x_, LONG y_)
00433         {
00434                 x = x_;
00435                 y = y_;
00436         }
00437
00438          // constructor for being used in processing WM_MOUSEMOVE, WM_LBUTTONDOWN, ... messages
00439         Point(LPARAM lparam)
00440         {
00441                 x = GET_X_LPARAM(lparam);
00442                 y = GET_Y_LPARAM(lparam);
00443         }
00444
00445         operator LPPOINT() {return this;}
00446 };
00447
00448
00450 inline void ClientToScreen(HWND hwnd, RECT* prect)
00451  {::ClientToScreen(hwnd,(LPPOINT)&prect->left); ::ClientToScreen(hwnd,(LPPOINT)&prect->right);}
00452
00454 inline void ScreenToClient(HWND hwnd, RECT* prect)
00455  {::ScreenToClient(hwnd,(LPPOINT)&prect->left); ::ScreenToClient(hwnd,(LPPOINT)&prect->right);}
00456
00457
00459 struct FullScreenParameters
00460 {
00461         FullScreenParameters()
00462          :      _mode(FALSE)
00463         {
00464         }
00465
00466         BOOL    _mode;
00467         RECT    _orgPos;
00468         BOOL    _wasZoomed;
00469 };
00470
00471
00472  // drawing utilities
00473
00475 struct PaintCanvas : public PAINTSTRUCT
00476 {
00477         PaintCanvas(HWND hwnd)
00478          :      _hwnd(hwnd)
00479         {
00480                 BeginPaint(hwnd, this);
00481         }
00482
00483         ~PaintCanvas()
00484         {
00485                 EndPaint(_hwnd, this);
00486         }
00487
00488         operator HDC() const {return hdc;}
00489
00490 protected:
00491         HWND    _hwnd;
00492 };
00493
00495 struct Canvas
00496 {
00497         Canvas(HDC hdc) : _hdc(hdc) {}
00498
00499         operator HDC() {return _hdc;}
00500
00501 protected:
00502         HDC _hdc;
00503 };
00504
00506 struct WindowCanvas : public Canvas
00507 {
00508         WindowCanvas(HWND hwnd)
00509          :      Canvas(GetDC(hwnd)), _hwnd(hwnd) {}
00510
00511         ~WindowCanvas() {ReleaseDC(_hwnd, _hdc);}
00512
00513 protected:
00514         HWND    _hwnd;
00515 };
00516
00517
00518  // double buffering classes
00519
00521 struct MemCanvas : public Canvas
00522 {
00523         MemCanvas(HDC hdc=0)
00524          :      Canvas(CreateCompatibleDC(hdc)) {assert(_hdc);}
00525
00526         ~MemCanvas() {DeleteDC(_hdc);}
00527 };
00528
00530 struct SelectedBitmap
00531 {
00532         SelectedBitmap(HDC hdc, HBITMAP hbmp)
00533          :      _hdc(hdc), _old_hbmp(SelectBitmap(hdc, hbmp)) {}
00534
00535         ~SelectedBitmap() {DeleteObject(SelectBitmap(_hdc, _old_hbmp));}
00536
00537 protected:
00538         HDC             _hdc;
00539         HBITMAP _old_hbmp;
00540 };
00541
00543 struct BufferCanvas : public MemCanvas
00544 {
00545         BufferCanvas(HDC hdc, int x, int y, int w, int h)
00546          :      MemCanvas(hdc), _hdctarg(hdc),
00547                 _x(x), _y(y), _w(w), _h(h),
00548                 _bmp(_hdc, CreateCompatibleBitmap(hdc, w, h)) {}
00549
00550         BufferCanvas(HDC hdc, const RECT& rect)
00551          :      MemCanvas(hdc), _hdctarg(hdc),
00552                 _x(rect.left), _y(rect.top), _w(rect.right-rect.left), _h(rect.bottom-rect.top),
00553                 _bmp(_hdc, CreateCompatibleBitmap(hdc, _w, _h)) {}
00554
00555 protected:
00556         HDC     _hdctarg;
00557         int     _x, _y, _w, _h;
00558         SelectedBitmap _bmp;
00559 };
00560
00562 struct BufferedCanvas : public BufferCanvas
00563 {
00564         BufferedCanvas(HDC hdc, int x, int y, int w, int h, DWORD mode=SRCCOPY)
00565          :      BufferCanvas(hdc, x, y, w, h), _mode(mode) {}
00566
00567         BufferedCanvas(HDC hdc, const RECT& rect, DWORD mode=SRCCOPY)
00568          :      BufferCanvas(hdc, rect), _mode(mode) {}
00569
00570         ~BufferedCanvas() {BitBlt(_hdctarg, _x, _y, _w, _h, _hdc, 0, 0, _mode);}
00571
00572         DWORD   _mode;
00573 };
00574
00576 struct BufferedPaintCanvas : public PaintCanvas, public BufferedCanvas
00577 {
00578         BufferedPaintCanvas(HWND hwnd)
00579          :      PaintCanvas(hwnd),
00580                 BufferedCanvas(PAINTSTRUCT::hdc, 0, 0, rcPaint.right, rcPaint.bottom)
00581         {
00582         }
00583
00584         operator HDC() {return BufferedCanvas::_hdc;}
00585 };
00586
00587
00589 struct TextColor
00590 {
00591         TextColor(HDC hdc, COLORREF color)
00592          : _hdc(hdc), _old_color(SetTextColor(hdc, color)) {}
00593
00594         ~TextColor() {SetTextColor(_hdc, _old_color);}
00595
00596 protected:
00597         HDC              _hdc;
00598         COLORREF _old_color;
00599 };
00600
00602 struct BkMode
00603 {
00604         BkMode(HDC hdc, int bkmode)
00605          : _hdc(hdc), _old_bkmode(SetBkMode(hdc, bkmode)) {}
00606
00607         ~BkMode() {SetBkMode(_hdc, _old_bkmode);}
00608
00609 protected:
00610         HDC              _hdc;
00611         COLORREF _old_bkmode;
00612 };
00613
00615 struct FontSelection
00616 {
00617         FontSelection(HDC hdc, HFONT hFont)
00618          : _hdc(hdc), _old_hFont(SelectFont(hdc, hFont)) {}
00619
00620         ~FontSelection() {SelectFont(_hdc, _old_hFont);}
00621
00622 protected:
00623         HDC             _hdc;
00624         HFONT   _old_hFont;
00625 };
00626
00628 struct BitmapSelection
00629 {
00630         BitmapSelection(HDC hdc, HBITMAP hBmp)
00631          : _hdc(hdc), _old_hBmp(SelectBitmap(hdc, hBmp)) {}
00632
00633         ~BitmapSelection() {SelectBitmap(_hdc, _old_hBmp);}
00634
00635 protected:
00636         HDC             _hdc;
00637         HBITMAP _old_hBmp;
00638 };
00639
00641 struct BrushSelection
00642 {
00643         BrushSelection(HDC hdc, HBRUSH hBrush)
00644          : _hdc(hdc), _old_hBrush(SelectBrush(hdc, hBrush)) {}
00645
00646         ~BrushSelection() {SelectBrush(_hdc, _old_hBrush);}
00647
00648 protected:
00649         HDC             _hdc;
00650         HBRUSH  _old_hBrush;
00651 };
00652
00653
00655 struct PopupMenu
00656 {
00657         PopupMenu()
00658          :      _hmenu(CreatePopupMenu())
00659         {
00660         }
00661
00662         PopupMenu(UINT nid);
00663
00664         operator HMENU() {return _hmenu;}
00665
00666         void Append(UINT id, LPCTSTR str, UINT flags=MF_STRING)
00667         {
00668                 AppendMenu(_hmenu, flags, id, str);
00669         }
00670
00671         int TrackPopupMenu(HWND hwnd, const POINT& pt, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON, LPTPMPARAMS tpm=NULL) {
00672          return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, tpm);
00673         }
00674
00675         int PopupContextMenu(HWND hwnd, POINTS pos, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON) {
00676          POINT pt; POINTSTOPOINT(pt, pos);
00677          return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL);
00678         }
00679
00680         int TrackPopupMenu(HWND hwnd, POINTS pos, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON) {
00681          POINT pt; POINTSTOPOINT(pt, pos);
00682          ClientToScreen(hwnd, &pt);
00683          return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL);
00684         }
00685
00686         int TrackPopupMenuAtCursor(HWND hwnd, UINT flags=TPM_LEFTBUTTON) {
00687          POINT pt; GetCursorPos(&pt);
00688          return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL);
00689         }
00690
00691         int TrackPopupMenuAtPos(HWND hwnd, DWORD pos, UINT flags=TPM_LEFTBUTTON) {
00692          return TrackPopupMenuEx(_hmenu, flags, GET_X_LPARAM(pos), GET_Y_LPARAM(pos), hwnd, NULL);
00693         }
00694
00695 protected:
00696         HMENU _hmenu;
00697 };
00698
00699
00700 struct Variant : public VARIANT
00701 {
00702         Variant() {VariantInit(this);}
00703         Variant(const VARIANT& var);
00704         Variant(const VARIANT* var);
00705         ~Variant();
00706
00707         operator long() const;
00708         operator bool() const;
00709         operator VARIANT_BOOL() const;
00710         operator IDispatch*() const;
00711 };
00712
00713
00714 struct BStr
00715 {
00716         BStr()
00717         {
00718                 _p = NULL;
00719         }
00720
00721         BStr(const BSTR s)
00722         {
00723                 _p = SysAllocString(s);
00724         }
00725
00726         BStr(LPCSTR s)
00727         {
00728                 WCHAR b[BUFFER_LEN];
00729
00730                 if (s)
00731                         _p = SysAllocStringLen(b, MultiByteToWideChar(CP_ACP, 0, s, -1, b, BUFFER_LEN)-1);
00732                 else
00733                         _p = NULL;
00734         }
00735
00736         BStr(LPCWSTR s)
00737         {
00738                 _p = SysAllocString(s);
00739         }
00740
00741         BStr(const VARIANT& var)
00742          :      _p(NULL)
00743         {
00744                 assign(var);
00745         }
00746
00747         ~BStr()
00748         {
00749                 SysFreeString(_p);
00750         }
00751
00752         void assign(BSTR s);
00753         void assign(const VARIANT& var);
00754
00755         operator BSTR() const
00756         {
00757                 return _p? _p: (BSTR)L"";
00758         }
00759
00760         int length() const
00761         {
00762                 return _p? wcslen(_p): 0;
00763         }
00764
00765 protected:
00766         BSTR    _p;
00767 };
00768
00769
00771 struct String
00772 #ifdef UNICODE
00773  : public wstring
00774 #else
00775  : public string
00776 #endif
00777 {
00778 #ifdef UNICODE
00779         typedef wstring super;
00780 #else
00781         typedef string super;
00782 #endif
00783
00784         String() {}
00785
00786         String(LPCTSTR s) {if (s) super::assign(s);}
00787         String(LPCTSTR s, int l) : super(s, l) {}
00788
00789         String(const super& other) : super(other) {}
00790         String(const String& other) : super(other) {}
00791
00792 #ifdef UNICODE
00793         String(LPCSTR s) {assign(s);}
00794         String(LPCSTR s, int l) {assign(s, l);}
00795         String(const string& other) {assign(other.c_str());}
00796         String& operator=(LPCSTR s) {assign(s); return *this;}
00797         void assign(LPCSTR s) {if (s) {TCHAR b[BUFFER_LEN]; super::assign(b, MultiByteToWideChar(CP_ACP, 0, s, -1, b, BUFFER_LEN)-1);} else erase();}
00798         void assign(LPCSTR s, int l) {if (s) {TCHAR b[BUFFER_LEN]; super::assign(b, MultiByteToWideChar(CP_ACP, 0, s, l, b, BUFFER_LEN));} else erase();}
00799         void assign(const BStr& s) {int l = s.length(); super::assign(s, l);}
00800 #else
00801         String(LPCWSTR s) {assign(s);}
00802         String(LPCWSTR s, int l) {assign(s, l);}
00803         String(const wstring& other) {assign(other.c_str());}
00804         String& operator=(LPCWSTR s) {assign(s); return *this;}
00805         void assign(LPCWSTR s) {if (s) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, -1, b, BUFFER_LEN, 0, 0)-1);} else erase();}
00806         void assign(LPCWSTR s, int l) {if (s) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, l, b, BUFFER_LEN, 0, 0));} else erase();}
00807         void assign(const BStr& s) {int l = s.length(); if (l) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, l, b, BUFFER_LEN, 0, 0));} else erase();}
00808 #endif
00809         String(const BStr& s) {assign(s);}
00810         String& operator=(const BStr& s) {assign(s); return *this;}
00811
00812         String& operator=(LPCTSTR s) {if (s) super::assign(s); else erase(); return *this;}
00813         String& operator=(const super& s) {super::assign(s); return *this;}
00814         void assign(LPCTSTR s) {super::assign(s);}
00815         void assign(LPCTSTR s, int l) {super::assign(s, l);}
00816
00817         operator LPCTSTR() const {return c_str();}
00818
00819 #ifdef UNICODE
00820         operator string() const {char b[BUFFER_LEN]; return string(b, WideCharToMultiByte(CP_ACP, 0, c_str(), -1, b, BUFFER_LEN, 0, 0)-1);}
00821 #else
00822         operator wstring() const {WCHAR b[BUFFER_LEN]; return wstring(b, MultiByteToWideChar(CP_ACP, 0, c_str(), -1, b, BUFFER_LEN)-1);}
00823 #endif
00824
00825         LPTSTR str() {return (LPTSTR)data();}
00826
00827         String& printf(LPCTSTR fmt, ...)
00828         {
00829                 va_list l;
00830                 TCHAR b[BUFFER_LEN];
00831
00832                 va_start(l, fmt);
00833                 super::assign(b, _vsntprintf(b, COUNTOF(b), fmt, l));
00834                 va_end(l);
00835
00836                 return *this;
00837         }
00838
00839         String& vprintf(LPCTSTR fmt, va_list l)
00840         {
00841                 TCHAR b[BUFFER_LEN];
00842
00843                 super::assign(b, _vsntprintf(b, COUNTOF(b), fmt, l));
00844
00845                 return *this;
00846         }
00847
00848         String& appendf(LPCTSTR fmt, ...)
00849         {
00850                 va_list l;
00851                 TCHAR b[BUFFER_LEN];
00852
00853                 va_start(l, fmt);
00854                 super::append(b, _vsntprintf(b, COUNTOF(b), fmt, l));
00855                 va_end(l);
00856
00857                 return *this;
00858         }
00859
00860         String& vappendf(LPCTSTR fmt, va_list l)
00861         {
00862                 TCHAR b[BUFFER_LEN];
00863
00864                 super::append(b, _vsntprintf(b, COUNTOF(b), fmt, l));
00865
00866                 return *this;
00867         }
00868
00869         void toLower()
00870         {
00871                 if (!empty())
00872                         CharLower(str());
00873         }
00874 };
00875
00876 #define _STRING_DEFINED
00877
00878
00879 struct FmtString : public String
00880 {
00881         FmtString(LPCTSTR fmt, ...)
00882         {
00883                 va_list l;
00884
00885                 va_start(l, fmt);
00886                 vprintf(fmt, l);
00887                 va_end(l);
00888         }
00889 };
00890
00891
00892 #ifdef UNICODE
00893
00894 struct ANS
00895 {
00896         ANS(LPCWSTR s)
00897         {
00898                 int l = wcslen(s) + 1;
00899                 _str = (LPSTR) malloc(2*l);
00900
00901                 if (WideCharToMultiByte(CP_ACP, 0, s, -1, _str, 2*l, 0, 0) <= 0)
00902                         *_str = '\0';
00903         }
00904
00905         ~ANS()
00906         {
00907                 free(_str);
00908         }
00909
00910         operator LPCSTR() {return _str;}
00911
00912 protected:
00913         LPSTR   _str;
00914 };
00915
00916 #define UNC(x) ((LPCWSTR)(x))
00917
00918 #else
00919
00920 #define ANS(x) ((LPCSTR)(x))
00921
00922 struct UNC
00923 {
00924         UNC(LPCSTR s)
00925         {
00926                 int l = strlen(s) + 1;
00927                 _str = (LPWSTR) malloc(2*l);
00928
00929                 if (_str && MultiByteToWideChar(CP_ACP, 0, s, -1, _str, l) <= 0)
00930                         *_str = '\0';
00931         }
00932
00933         ~UNC()
00934         {
00935                 free(_str);
00936         }
00937
00938         operator LPCWSTR() {return _str;}
00939
00940 protected:
00941         LPWSTR  _str;
00942 };
00943
00944 #endif
00945
00946
00947  // determine windows version string
00948 String get_windows_version_str();
00949
00950
00952 template<typename FCT> struct DynamicFct
00953 {
00954         DynamicFct(LPCTSTR moduleName, UINT ordinal)
00955         {
00956                 HMODULE hModule = GetModuleHandle(moduleName);
00957
00958                 _fct = (FCT) GetProcAddress(hModule, (LPCSTR)ordinal);
00959         }
00960
00961         DynamicFct(LPCTSTR moduleName, LPCSTR name)
00962         {
00963                 HMODULE hModule = GetModuleHandle(moduleName);
00964
00965                 _fct = (FCT) GetProcAddress(hModule, name);
00966         }
00967
00968         FCT operator*() const {return _fct;}
00969         operator bool() const {return _fct? true: false;}
00970
00971 protected:
00972         FCT     _fct;
00973 };
00974
00975
00977 template<typename FCT> struct DynamicLoadLibFct
00978 {
00979         DynamicLoadLibFct(LPCTSTR moduleName, UINT ordinal)
00980         {
00981                 _hModule = LoadLibrary(moduleName);
00982
00983                 _fct = (FCT) GetProcAddress(_hModule, (LPCSTR)ordinal);
00984         }
00985
00986         DynamicLoadLibFct(LPCTSTR moduleName, LPCSTR name)
00987         {
00988                 _hModule = LoadLibrary(moduleName);
00989
00990                 _fct = (FCT) GetProcAddress(_hModule, name);
00991         }
00992
00993         ~DynamicLoadLibFct()
00994         {
00995                 FreeLibrary(_hModule);
00996         }
00997
00998         FCT operator*() const {return _fct;}
00999         operator bool() const {return _fct? true: false;}
01000
01001 protected:
01002         HMODULE _hModule;
01003         FCT     _fct;
01004 };
01005
01006
01007 struct Context
01008 {
01009         Context(const char* ctx)
01010          :      _ctx(ctx)
01011         {
01012                 _last = s_current;
01013                 s_current = this;
01014         }
01015
01016         Context(const char* ctx, LPCSTR obj)
01017          :      _ctx(ctx),
01018                 _obj(obj)
01019         {
01020                 _last = s_current;
01021                 s_current = this;
01022         }
01023
01024         Context(const char* ctx, LPCWSTR obj)
01025          :      _ctx(ctx),
01026                 _obj(obj)
01027         {
01028                 _last = s_current;
01029                 s_current = this;
01030         }
01031
01032         Context(const Context& other)
01033          :      _ctx(other._ctx),
01034                 _obj(other._obj)
01035         {
01036                 _last = NULL;
01037         }
01038
01039         ~Context()
01040         {
01041                 if (_last) {
01042                         s_current = _last;
01043                         _last = NULL;
01044                 }
01045         }
01046
01047         String toString() const;
01048         String getStackTrace() const;
01049
01050         const char* _ctx;
01051         String  _obj;
01052
01053         static Context& current() {return *s_current;}
01054
01055 protected:
01056         Context* _last;
01057
01058         static Context* s_current;
01059         static Context  s_main;
01060 };
01061
01062 #define CONTEXT_OBJ __ctx__._obj
01063 #define CONTEXT(c) Context __ctx__(c)
01064 #define CURRENT_CONTEXT Context::current()
01065 #define OBJ_CONTEXT(c, o) Context __ctx__(c, o)
01066
01067
01068 extern bool SplitFileSysURL(LPCTSTR url, String& dir_out, String& fname_out);
01069
01070
01071 #endif // __cplusplus


ROS Explorer: webchild.cpp File Reference

  • File List
  • File Members
shell

webchild.cpp File Reference

#include <precomp.h>
#include "../resource.h"
#include "webchild.h"

Include dependency graph for webchild.cpp:

Go to the source code of this file.

Functions

void | T2nA_binary (LPCTSTR s, LPSTR d, int len)
HWND | create_webchildwindow (const WebChildWndInfo &info)

Function Documentation

HWND create_webchildwindow ( const WebChildWndInfo & info )

Definition at line 195 of file webchild.cpp.

References WebChildWindow::create().

Referenced by MDIMainFrame::WndProc().

00196 {
00197         WebChildWindow* pWnd = WebChildWindow::create(info);
00198
00199         if (!pWnd)
00200                 return 0;
00201
00202         return *pWnd;
00203 }

Here is the call graph for this function:

void T2nA_binary | ( | LPCTSTR | s,
 |  | LPSTR | d,
 |  | int | len
 | ) |

Definition at line 147 of file webchild.cpp.

00148 {
00149         while(len-- > 0)
00150                 *d++ = (unsigned char)*s++;
00151 }


ROS Explorer: webchild.cpp Source File

  • File List
  • File Members
shell

webchild.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // webchild.cpp
00024  //
00025  // Martin Fuchs, 08.02.2004
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "../resource.h"
00032
00033 #include "webchild.h"
00034
00035
00036 #ifdef _MSC_VER
00037
00038 #if _MSC_VER>=1300      // vtMissing for VS.Net
00039 #include <comutil.h>
00040 #pragma comment(lib, "comsupp")
00041 #endif
00042
00043 #else
00044
00045 #ifdef __MINGW32__      // MinGW is lacking vtMissing (as of 07.02.2004)
00046 static Variant vtMissing;
00047 #endif
00048
00049 #endif
00050
00051 //#include <mshtml.h>
00052
00053
00054 Variant::Variant(const VARIANT& var)
00055 {
00056         VariantInit(this);
00057         CheckError(VariantCopy(this, const_cast<VARIANT*>(&var)));
00058 }
00059
00060 Variant::Variant(const VARIANT* var)
00061 {
00062         VariantInit(this);
00063         CheckError(VariantCopy(this, const_cast<VARIANT*>(var)));
00064 }
00065
00066 Variant::~Variant()
00067 {
00068         VariantClear(this);
00069 }
00070
00071
00072 Variant::operator long() const
00073 {
00074         Variant v;
00075         CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_I4));
00076         return V_I4(&v);
00077 }
00078
00079 Variant::operator bool() const
00080 {
00081         Variant v;
00082         CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_BOOL));
00083         return V_BOOL(&v)? true: false;
00084 }
00085
00086 Variant::operator IDispatch*() const
00087 {
00088         Variant v;
00089         CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_DISPATCH));
00090         return V_DISPATCH(&v);
00091 }
00092
00093 Variant::operator VARIANT_BOOL() const
00094 {
00095         Variant v;
00096         CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_BOOL));
00097         return V_BOOL(&v);
00098 }
00099
00100
00101 void BStr::assign(BSTR s)
00102 {
00103         if (!SysReAllocString(&_p, s))
00104                 THROW_EXCEPTION(E_OUTOFMEMORY);
00105 }
00106
00107 void BStr::assign(const VARIANT& var)
00108 {
00109         if (V_VT(&var) == VT_BSTR)
00110                 assign(V_BSTR(&var));
00111         else {
00112                 Variant v;
00113                 CheckError(VariantChangeType(&v, const_cast<VARIANT*>(&var), 0, VT_BSTR));
00114                 assign(V_BSTR(&v));
00115         }
00116 }
00117
00118
00119 BrowserNavigator::BrowserNavigator()
00120  :      _browser_initialized(false)
00121 {
00122 }
00123
00124 void BrowserNavigator::attach(IWebBrowser* browser)
00125 {
00126         _browser = browser;
00127 }
00128
00129 void BrowserNavigator::goto_url(LPCTSTR url)
00130 {
00131         if (_browser_initialized)
00132                 _browser->Navigate(BStr(url), NULL, NULL, NULL, NULL);
00133         else {
00134                 _new_url = url;
00135
00136                 _browser->Navigate(L"about:blank", NULL, NULL, NULL, NULL);
00137         }
00138 }
00139
00140 void BrowserNavigator::set_html_page(const String& html_txt)
00141 {
00142         _new_html_txt = html_txt;
00143
00144         goto_url(TEXT("about:blank"));
00145 }
00146
00147 void T2nA_binary(LPCTSTR s, LPSTR d, int len)
00148 {
00149         while(len-- > 0)
00150                 *d++ = (unsigned char)*s++;
00151 }
00152
00153 void BrowserNavigator::navigated(LPCTSTR url)
00154 {
00155         _browser_initialized = true;
00156
00157         bool nav = false;
00158
00159         if (!_new_url.empty()) {
00160                 if (!_tcscmp(url,TEXT("about:blank")) && _new_url!=TEXT("about:blank")) {
00161                         _browser->Navigate(BStr(_new_url), NULL, NULL, NULL, NULL);
00162                         ++nav;
00163                 }
00164
00165                 _new_url.erase();
00166         }
00167
00168         if (!nav && !_new_html_txt.empty()) {
00169                 int len = _new_html_txt.length();
00170                 HGLOBAL hHtmlText = GlobalAlloc(GPTR, len);
00171
00172                 if (!hHtmlText) {
00173                         T2nA_binary(_new_html_txt, (char*)hHtmlText, len);
00174                         _new_html_txt.erase();
00175
00176                         SIfacePtr<IStream> pStream;
00177                         HRESULT hr = CreateStreamOnHGlobal(hHtmlText, TRUE, &pStream);
00178
00179                         if (SUCCEEDED(hr)) {
00180                                 SIfacePtr<IDispatch> pHtmlDoc;
00181                                 CheckError(_browser->get_Document(&pHtmlDoc));
00182
00183                                 SIfacePtr<IPersistStreamInit> pPersistStreamInit;
00184                                 pHtmlDoc.QueryInterface(IID_IPersistStreamInit, &pPersistStreamInit);
00185
00186                                 CheckError(pPersistStreamInit->InitNew());
00187                                 CheckError(pPersistStreamInit->Load(pStream));
00188                         } else
00189                                 GlobalFree(hHtmlText);
00190                 }
00191         }
00192 }
00193
00194
00195 HWND create_webchildwindow(const WebChildWndInfo& info)
00196 {
00197         WebChildWindow* pWnd = WebChildWindow::create(info);
00198
00199         if (!pWnd)
00200                 return 0;
00201
00202         return *pWnd;
00203 }
00204
00205 static const CLSID CLSID_MozillaBrowser =
00206         {0x1339B54C, 0x3453, 0x11D2, {0x93, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
00207
00208
00209 WebChildWindow::WebChildWindow(HWND hwnd, const WebChildWndInfo& info)
00210  :      super(hwnd, info),
00211         web_super(_navigator)
00212 {
00213          // first try to create a web control with MS IE's CLASSID
00214         HRESULT hr = create_control(hwnd, CLSID_WebBrowser, IID_IWebBrowser2);
00215
00216          // If this failed, try to use Mozilla's web control
00217         if (FAILED(hr))
00218                 hr = create_control(hwnd, CLSID_MozillaBrowser, IID_IWebBrowser2);
00219
00220         if (SUCCEEDED(hr)) {
00221                 _navigator.attach(_control);
00222
00223                 _connector = auto_ptr<EventConnector>(new EventConnector(_control, DIID_DWebBrowserEvents2, this));
00224
00225                 _control->Navigate(BStr(info._path), &vtMissing, &vtMissing, &vtMissing, &vtMissing);
00226                 //browser->Navigate2(&Variant(info._path), &vtMissing, &vtMissing, &vtMissing, &vtMissing);
00227         }
00228 }
00229
00230 LRESULT WebChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00231 {
00232         try {
00233                 switch(nmsg) {
00234                   case WM_ERASEBKGND:
00235                         if (!_control) {
00236                                 HDC hdc = (HDC)wparam;
00237                                 ClientRect rect(_hwnd);
00238
00239                                 HBRUSH hbrush = CreateSolidBrush(RGB(200,200,235));
00240                                 BkMode mode(hdc, TRANSPARENT);
00241                                 TextColor color(hdc, RGB(200,40,40));
00242                                 FillRect(hdc, &rect, hbrush);
00243                                 DrawText(hdc, TEXT("Sorry - no web browser control could be loaded."), -1, &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
00244                                 DeleteObject(hbrush);
00245                         }
00246
00247                         return TRUE;
00248
00249                   case PM_DISPATCH_COMMAND: {
00250                         if (!_control)
00251                                 return FALSE;
00252
00253                         HRESULT hr = E_FAIL;
00254
00255                         switch(LOWORD(wparam)) {
00256                           case ID_GO_BACK:
00257                                 hr = _control->GoBack();
00258                                 break;
00259
00260                           case ID_GO_FORWARD:
00261                                 hr = _control->GoForward();
00262                                 break;
00263
00264                           case ID_GO_UP:
00266                                 break;
00267
00268                           case ID_GO_HOME:
00269                                 hr = _control->GoHome();
00270                                 break;
00271
00272                           case ID_GO_SEARCH:
00273                                 hr = _control->GoSearch();
00274                                 break;
00275
00276                           case ID_REFRESH:
00277                                 hr = _control->Refresh();
00278                                 break;
00279
00280                           case ID_STOP:
00281                                 hr = _control->Stop();
00282                                 break;
00283
00284                           default:
00285                                 return super::WndProc(nmsg, wparam, lparam);
00286                         }
00287
00288                         if (FAILED(hr) && hr!=E_FAIL)
00289                                 THROW_EXCEPTION(hr);
00290
00291                         return TRUE;}
00292
00293                   default:
00294                         return super::WndProc(nmsg, wparam, lparam);
00295                 }
00296         } catch(COMException& e) {
00297                 HandleException(e, _hwnd);
00298         }
00299
00300         return 0;
00301 }
00302
00303
00304 String WebChildWindow::jump_to_int(LPCTSTR url)
00305 {
00306         _navigator.goto_url(url);
00307
00308         return url;
00309 }


ROS Explorer: webchild.h File Reference

  • File List
  • File Members
shell

webchild.h File Reference

#include <exdisp.h>
#include <exdispid.h>

Include dependency graph for webchild.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | ConnectionPoint< T >
struct | EventConnection
struct | EventConnector
struct | OleInPlaceClient
struct | IPCtrlWindow< BASE, SMARTPTR >
struct | DWebBrowserEvents2IF
struct | BrowserNavigator
struct | DWebBrowserEvents2Impl
struct | WebChildWindow
encapsulation of Web control in MDI child windows More...

Defines

#define | DISPID_BEFORENAVIGATE 100
#define | DISPID_NAVIGATECOMPLETE 101
#define | DISPID_STATUSTEXTCHANGE 102
#define | DISPID_QUIT 103
#define | DISPID_DOWNLOADCOMPLETE 104
#define | DISPID_COMMANDSTATECHANGE 105
#define | DISPID_DOWNLOADBEGIN 106
#define | DISPID_NEWWINDOW 107
#define | DISPID_PROGRESSCHANGE 108
#define | DISPID_WINDOWMOVE 109
#define | DISPID_WINDOWRESIZE 110
#define | DISPID_WINDOWACTIVATE 111
#define | DISPID_PROPERTYCHANGE 112
#define | DISPID_TITLECHANGE 113
#define | DISPID_TITLEICONCHANGE 114
#define | DISPID_FRAMEBEFORENAVIGATE 200
#define | DISPID_FRAMENAVIGATECOMPLETE 201
#define | DISPID_FRAMENEWWINDOW 204
#define | DISPID_NAVIGATECOMPLETE2 252
#define | DISPID_ONQUIT 253
#define | DISPID_ONVISIBLE 254
#define | DISPID_ONTOOLBAR 255
#define | DISPID_ONMENUBAR 256
#define | DISPID_ONSTATUSBAR 257
#define | DISPID_ONFULLSCREEN 258
#define | DISPID_DOCUMENTCOMPLETE 259
#define | DISPID_ONTHEATERMODE 260
#define | DISPID_ONADDRESSBAR 261
#define | DISPID_WINDOWSETRESIZABLE 262
#define | DISPID_WINDOWCLOSING 263
#define | DISPID_WINDOWSETLEFT 264
#define | DISPID_WINDOWSETTOP 265
#define | DISPID_WINDOWSETWIDTH 266
#define | DISPID_WINDOWSETHEIGHT 267
#define | DISPID_CLIENTTOHOSTWINDOW 268
#define | DISPID_SETSECURELOCKICON 269
#define | DISPID_FILEDOWNLOAD 270
#define | DISPID_NAVIGATEERROR 271
#define | DISPID_PRIVACYIMPACTEDSTATECHANGE 272
#define | V_INT(x) V_UNION(x, intVal)

Define Documentation

#define DISPID_BEFORENAVIGATE 100

Definition at line 35 of file webchild.h.

#define DISPID_CLIENTTOHOSTWINDOW 268

Definition at line 70 of file webchild.h.

#define DISPID_COMMANDSTATECHANGE 105

Definition at line 40 of file webchild.h.

#define DISPID_DOCUMENTCOMPLETE 259

Definition at line 61 of file webchild.h.

#define DISPID_DOWNLOADBEGIN 106

Definition at line 41 of file webchild.h.

#define DISPID_DOWNLOADCOMPLETE 104

Definition at line 39 of file webchild.h.

#define DISPID_FILEDOWNLOAD 270

Definition at line 72 of file webchild.h.

#define DISPID_FRAMEBEFORENAVIGATE 200

Definition at line 50 of file webchild.h.

#define DISPID_FRAMENAVIGATECOMPLETE 201

Definition at line 51 of file webchild.h.

#define DISPID_FRAMENEWWINDOW 204

Definition at line 52 of file webchild.h.

#define DISPID_NAVIGATECOMPLETE 101

Definition at line 36 of file webchild.h.

#define DISPID_NAVIGATECOMPLETE2 252

Definition at line 54 of file webchild.h.

#define DISPID_NAVIGATEERROR 271

Definition at line 73 of file webchild.h.

#define DISPID_NEWWINDOW 107

Definition at line 42 of file webchild.h.

#define DISPID_ONADDRESSBAR 261

Definition at line 63 of file webchild.h.

#define DISPID_ONFULLSCREEN 258

Definition at line 60 of file webchild.h.

#define DISPID_ONMENUBAR 256

Definition at line 58 of file webchild.h.

#define DISPID_ONQUIT 253

Definition at line 55 of file webchild.h.

#define DISPID_ONSTATUSBAR 257

Definition at line 59 of file webchild.h.

#define DISPID_ONTHEATERMODE 260

Definition at line 62 of file webchild.h.

#define DISPID_ONTOOLBAR 255

Definition at line 57 of file webchild.h.

#define DISPID_ONVISIBLE 254

Definition at line 56 of file webchild.h.

#define DISPID_PRIVACYIMPACTEDSTATECHANGE 272

Definition at line 74 of file webchild.h.

#define DISPID_PROGRESSCHANGE 108

Definition at line 43 of file webchild.h.

#define DISPID_PROPERTYCHANGE 112

Definition at line 47 of file webchild.h.

#define DISPID_QUIT 103

Definition at line 38 of file webchild.h.

#define DISPID_SETSECURELOCKICON 269

Definition at line 71 of file webchild.h.

#define DISPID_STATUSTEXTCHANGE 102

Definition at line 37 of file webchild.h.

#define DISPID_TITLECHANGE 113

Definition at line 48 of file webchild.h.

#define DISPID_TITLEICONCHANGE 114

Definition at line 49 of file webchild.h.

#define DISPID_WINDOWACTIVATE 111

Definition at line 46 of file webchild.h.

#define DISPID_WINDOWCLOSING 263

Definition at line 65 of file webchild.h.

#define DISPID_WINDOWMOVE 109

Definition at line 44 of file webchild.h.

#define DISPID_WINDOWRESIZE 110

Definition at line 45 of file webchild.h.

#define DISPID_WINDOWSETHEIGHT 267

Definition at line 69 of file webchild.h.

#define DISPID_WINDOWSETLEFT 264

Definition at line 66 of file webchild.h.

#define DISPID_WINDOWSETRESIZABLE 262

Definition at line 64 of file webchild.h.

#define DISPID_WINDOWSETTOP 265

Definition at line 67 of file webchild.h.

#define DISPID_WINDOWSETWIDTH 266

Definition at line 68 of file webchild.h.

#define V_INT ( x ) V_UNION(x, intVal)

Definition at line 78 of file webchild.h.


ROS Explorer: webchild.h Source File

  • File List
  • File Members
shell

webchild.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // webchild.h
00024  //
00025  // Martin Fuchs, 08.02.2004
00026  //
00027
00028
00029 #ifndef _MSC_VER
00030 #include <exdisp.h>             // for IConnectionPointContainer
00031 #include <exdispid.h>   // for DWebBrowserEvents2 IDs
00032 #endif
00033
00034 #ifndef DISPID_BEFORENAVIGATE   // missing in MinGW (as of 07.02.2004)
00035 #define DISPID_BEFORENAVIGATE                   100
00036 #define DISPID_NAVIGATECOMPLETE                 101
00037 #define DISPID_STATUSTEXTCHANGE                 102
00038 #define DISPID_QUIT                                             103
00039 #define DISPID_DOWNLOADCOMPLETE                 104
00040 #define DISPID_COMMANDSTATECHANGE               105
00041 #define DISPID_DOWNLOADBEGIN                    106
00042 #define DISPID_NEWWINDOW                                107
00043 #define DISPID_PROGRESSCHANGE                   108
00044 #define DISPID_WINDOWMOVE                               109
00045 #define DISPID_WINDOWRESIZE                             110
00046 #define DISPID_WINDOWACTIVATE                   111
00047 #define DISPID_PROPERTYCHANGE                   112
00048 #define DISPID_TITLECHANGE                              113
00049 #define DISPID_TITLEICONCHANGE                  114
00050 #define DISPID_FRAMEBEFORENAVIGATE              200
00051 #define DISPID_FRAMENAVIGATECOMPLETE    201
00052 #define DISPID_FRAMENEWWINDOW                   204
00053
00054 #define DISPID_NAVIGATECOMPLETE2                252
00055 #define DISPID_ONQUIT                                   253
00056 #define DISPID_ONVISIBLE                                254
00057 #define DISPID_ONTOOLBAR                                255
00058 #define DISPID_ONMENUBAR                                256
00059 #define DISPID_ONSTATUSBAR                              257
00060 #define DISPID_ONFULLSCREEN                             258
00061 #define DISPID_DOCUMENTCOMPLETE                 259
00062 #define DISPID_ONTHEATERMODE                    260
00063 #define DISPID_ONADDRESSBAR                             261
00064 #define DISPID_WINDOWSETRESIZABLE               262
00065 #define DISPID_WINDOWCLOSING                    263
00066 #define DISPID_WINDOWSETLEFT                    264
00067 #define DISPID_WINDOWSETTOP                             265
00068 #define DISPID_WINDOWSETWIDTH                   266
00069 #define DISPID_WINDOWSETHEIGHT                  267
00070 #define DISPID_CLIENTTOHOSTWINDOW               268
00071 #define DISPID_SETSECURELOCKICON                269
00072 #define DISPID_FILEDOWNLOAD                             270
00073 #define DISPID_NAVIGATEERROR                    271
00074 #define DISPID_PRIVACYIMPACTEDSTATECHANGE 272
00075 #endif
00076
00077 #ifndef V_INT   // missing in MinGW (as of 07.02.2004)
00078 #define V_INT(x) V_UNION(x, intVal)
00079 #endif
00080
00081 #ifdef _MSC_VER
00082 #pragma warning(disable: 4355)  // use of 'this' for initialization of _connector
00083 #endif
00084
00085
00086 template<typename T> struct ConnectionPoint : public SIfacePtr<T>
00087 {
00088         ConnectionPoint(IConnectionPointContainer* pCPC, REFIID riid)
00089         {
00090                 CheckError(pCPC->FindConnectionPoint(riid, &this->_p));
00091         }
00092 };
00093
00094 struct EventConnection
00095 {
00096         EventConnection(IConnectionPoint* connectionpoint, IUnknown* sink)
00097         {
00098                 CheckError(connectionpoint->Advise(sink, &_cookie));
00099                 _connectionpoint = connectionpoint;
00100         }
00101
00102         template<typename T> EventConnection(T& connectionpoint, IUnknown* sink)
00103         {
00104                 CheckError(connectionpoint->Advise(sink, &_cookie));
00105                 _connectionpoint = connectionpoint;
00106         }
00107
00108 /*      template<typename T> EventConnection(SIfacePtr<T>& connectionpoint, IUnknown* sink)
00109         {
00110                 CheckError(connectionpoint->Advise(sink, &_cookie));
00111                 _connectionpoint = connectionpoint.GetPtr();
00112         } */
00113
00114 /*      template<typename T> EventConnection(T& connectionpoint, IUnknown* sink)
00115         {
00116                 CheckError(connectionpoint->Advise(sink, &_cookie));
00117                 _connectionpoint = connectionpoint;
00118         } */
00119
00120         ~EventConnection()
00121         {
00122                 if (_connectionpoint)
00123                         _connectionpoint->Unadvise(_cookie);
00124         }
00125
00126 protected:
00127         SIfacePtr<IConnectionPoint> _connectionpoint;
00128         DWORD   _cookie;
00129 };
00130
00131 struct EventConnector : public EventConnection
00132 {
00133         EventConnector(IUnknown* unknown, REFIID riid, IUnknown* sink)
00134          :      EventConnection(ConnectionPoint<IConnectionPoint>(
00135                                 SIfacePtr<IConnectionPointContainer>(unknown, IID_IConnectionPointContainer), riid), sink)
00136         {
00137         }
00138 };
00139
00140
00141 struct OleInPlaceClient : public SimpleComObject,
00142                                                         public IOleClientSite,
00143                                                         public IOleInPlaceSite
00144 {
00145 protected:
00146         HWND    _hwnd;
00147
00148 public:
00149         OleInPlaceClient(HWND hwnd=0)
00150          :      _hwnd(hwnd)
00151         {
00152         }
00153
00154         void attach(HWND hwnd)
00155         {
00156                 _hwnd = hwnd;
00157         }
00158
00159         HRESULT attach_control(IOleObject* ole_obj, LONG iVerb=OLEIVERB_INPLACEACTIVATE, HWND hwndParent=0, LPCRECT pRect=NULL)
00160         {
00161                 HRESULT hr = ole_obj->SetClientSite(this);
00162                 if (FAILED(hr))
00163                         return hr;
00164
00165 //              hr = ole_obj->SetHostNames(app, doc));
00166
00167                 hr = ole_obj->DoVerb(iVerb, NULL, this, 0, 0/*hwnd*/, NULL/*&rcPos*/);
00168
00169                 return hr;
00170         }
00171
00172         HRESULT detach(IOleObject* ole_obj, DWORD dwSaveOption=OLECLOSE_SAVEIFDIRTY)
00173         {
00174                 HRESULT hr = ole_obj->Close(dwSaveOption);
00175
00176                 _hwnd = 0;
00177
00178                 return hr;
00179         }
00180
00181         STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv)
00182         {
00183                 if (IsEqualIID(riid, IID_IOleClientSite))
00184                         {*ppv=static_cast<IOleClientSite*>(this); IncRef(); return S_OK;}
00185
00186                 if (IsEqualIID(riid, IID_IOleInPlaceSite))
00187                         {*ppv=static_cast<IOleInPlaceSite*>(this); IncRef(); return S_OK;}
00188
00189                 if (IsEqualIID(riid, IID_IUnknown))
00190                         {*ppv=static_cast<IOleClientSite/*oder auch IOleInPlaceSite*/*>(this); IncRef(); return S_OK;}
00191
00192                 return E_NOINTERFACE;
00193         }
00194
00195         STDMETHODIMP_(ULONG) AddRef() {return IncRef();}
00196         STDMETHODIMP_(ULONG) Release() {return DecRef();}
00197
00198
00199          // IOleWindow:
00200
00201         virtual /* [input_sync] */ HRESULT STDMETHODCALLTYPE GetWindow(/* [out] */ HWND __RPC_FAR *phwnd)
00202         {
00203                 *phwnd = _hwnd;
00204                 return S_OK;
00205         }
00206
00207         virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(/* [in] */ BOOL fEnterMode)
00208         {
00209                 return E_NOTIMPL;
00210         }
00211
00212
00213          // IOleClientSite:
00214
00215         virtual HRESULT STDMETHODCALLTYPE SaveObject()
00216         {
00217                 return E_NOTIMPL;
00218         }
00219
00220         virtual HRESULT STDMETHODCALLTYPE GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker __RPC_FAR *__RPC_FAR *ppmk)
00221         {
00222                 return E_NOTIMPL;
00223         }
00224
00225         virtual HRESULT STDMETHODCALLTYPE GetContainer(IOleContainer __RPC_FAR *__RPC_FAR *ppContainer)
00226         {
00227                 ppContainer = 0;
00228                 return E_NOINTERFACE;
00229         }
00230
00231         virtual HRESULT STDMETHODCALLTYPE ShowObject()
00232         {
00233                 return S_OK;
00234         }
00235
00236         virtual HRESULT STDMETHODCALLTYPE OnShowWindow(BOOL fShow)
00237         {
00238                 return S_OK;
00239         }
00240
00241         virtual HRESULT STDMETHODCALLTYPE RequestNewObjectLayout()
00242         {
00243                 return S_OK;
00244         }
00245
00246
00247          // IOleInPlaceSite:
00248
00249         virtual HRESULT STDMETHODCALLTYPE CanInPlaceActivate()
00250         {
00251                 return S_OK;
00252         }
00253
00254         virtual HRESULT STDMETHODCALLTYPE OnInPlaceActivate()
00255         {
00256                 return S_OK;
00257         }
00258
00259         virtual HRESULT STDMETHODCALLTYPE OnUIActivate()
00260         {
00261                 return S_OK;
00262         }
00263
00264         virtual HRESULT STDMETHODCALLTYPE GetWindowContext(
00265                 /* [out] */ IOleInPlaceFrame __RPC_FAR *__RPC_FAR *ppFrame,
00266                 /* [out] */ IOleInPlaceUIWindow __RPC_FAR *__RPC_FAR *ppDoc,
00267                 /* [out] */ LPRECT lprcPosRect,
00268                 /* [out] */ LPRECT lprcClipRect,
00269                 /* [out][in] */ LPOLEINPLACEFRAMEINFO lpFrameInfo)
00270         {
00271                 ClientRect rect(_hwnd);
00272
00273                 ppFrame = 0;
00274                 ppDoc = 0;
00275                 *lprcPosRect = rect;
00276                 *lprcClipRect = rect;
00277
00278                 assert(lpFrameInfo->cb>=sizeof(OLEINPLACEFRAMEINFO));
00279                 lpFrameInfo->fMDIApp = FALSE;   //@@
00280                 lpFrameInfo->hwndFrame = 0;
00281                 lpFrameInfo->haccel = 0;
00282                 lpFrameInfo->cAccelEntries = 0;
00283
00284                 return S_OK;
00285         }
00286
00287         virtual HRESULT STDMETHODCALLTYPE Scroll(/* [in] */ SIZE scrollExtant)
00288         {
00289                 return S_OK;
00290         }
00291
00292         virtual HRESULT STDMETHODCALLTYPE OnUIDeactivate(/* [in] */ BOOL fUndoable)
00293         {
00294                 return S_OK;
00295         }
00296
00297         virtual HRESULT STDMETHODCALLTYPE OnInPlaceDeactivate()
00298         {
00299                 return S_OK;
00300         }
00301
00302         virtual HRESULT STDMETHODCALLTYPE DiscardUndoState()
00303         {
00304                 return S_OK;
00305         }
00306
00307         virtual HRESULT STDMETHODCALLTYPE DeactivateAndUndo()
00308         {
00309                 return S_OK;
00310         }
00311
00312         virtual HRESULT STDMETHODCALLTYPE OnPosRectChange(/* [in] */ LPCRECT lprcPosRect)
00313         {
00314                 return S_OK;
00315         }
00316 };
00317
00318
00319  // window with in place activates Active-X Control
00320
00321 template<typename BASE, typename SMARTPTR> struct IPCtrlWindow : public BASE
00322 {
00323         typedef BASE super;
00324
00325         IPCtrlWindow(HWND hwnd)
00326          :      super(hwnd)
00327         {
00328         }
00329
00330         template<typename T> IPCtrlWindow(HWND hwnd, T& info)
00331          :      super(hwnd, info)
00332         {
00333         }
00334
00335         HRESULT create_control(HWND hwnd, REFIID clsid, REFIID riid)
00336         {
00337                  // Erzeugen einer Instanz des Controls
00338                 HRESULT hr = _control.CreateInstance(clsid, riid);
00339                 if (FAILED(hr))
00340                         return hr;
00341
00342                 _client_side.attach(hwnd);
00343
00344                 hr = _client_side.attach_control(SIfacePtr<IOleObject>(_control, IID_IOleObject)/*, OLEIVERB_INPLACEACTIVATE,
00345                                                                                         hwnd, &Rect(10, 10, 500, 500)*/);
00346                 if (FAILED(hr))
00347                         return hr;
00348
00349                  // try to get a IOleInPlaceObject interface for window resizing
00350                 return _control.QueryInterface(IID_IOleInPlaceObject, &_in_place_object);       // _in_place_object = _control
00351         }
00352
00353 protected:
00354         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00355         {
00356                 if (nmsg == WM_SIZE) {
00357                         if (_in_place_object) {
00358                                 RECT rect = {0, 0, LOWORD(lparam), HIWORD(lparam)};
00359
00360                                 _in_place_object->SetObjectRects(&rect, &rect);
00361                         }
00362                 } else if (nmsg == WM_CLOSE) {
00363                         _in_place_object = NULL;
00364
00365                         if (_control) {
00366                                 _client_side.detach(SIfacePtr<IOleObject>(_control, IID_IOleObject), OLECLOSE_NOSAVE);
00367                                 _control = NULL;
00368                         }
00369                 }
00370
00371                 return super::WndProc(nmsg, wparam, lparam);
00372         }
00373
00374         ComInit _usingCOM;
00375         SMARTPTR _control;
00376         OleInPlaceClient _client_side;
00377         SIfacePtr<IOleInPlaceObject> _in_place_object;
00378 };
00379
00380
00381
00382 #include "exdispid.h"
00383
00384
00385 struct DWebBrowserEvents2IF
00386 {
00387         virtual ~DWebBrowserEvents2IF() {}
00388
00389     virtual void StatusTextChange(const BStr& text)
00390                 {}
00391
00392     virtual void ProgressChange(long progress, long progressMax)
00393                 {}
00394
00395     virtual void WindowMove()
00396                 {}
00397
00398     virtual void WindowResize()
00399                 {}
00400
00401     virtual void WindowActivate()
00402                 {}
00403
00404     virtual void PropertyChange(const BStr& property)
00405                 {}
00406
00407     virtual void DownloadComplete()
00408                 {}
00409
00410     virtual void CommandStateChange(long command, bool enable)
00411                 {}
00412
00413     virtual void DownloadBegin()
00414                 {}
00415
00416     virtual void NewWindow2(IDispatch** ppDisp, VARIANT_BOOL& cancel)
00417                 {}
00418
00419     virtual void TitleChange(const BStr& text)
00420                 {}
00421
00422     virtual void TitleIconChange(const BStr& text)
00423                 {}
00424
00425         virtual void FrameBeforeNavigate(const BStr& url, long flags, const BStr& targetFrameName, VARIANT* postData, const BStr& headers, VARIANT_BOOL& cancel)
00426                 {}
00427
00428         virtual void FrameNavigateComplete(const BStr& url)
00429                 {}
00430
00431         virtual void FrameNewWindow(const BStr&url, long flags, const BStr& targetFrameName, VARIANT* postData, const BStr& headers, VARIANT_BOOL& processed)
00432                 {}
00433
00434     virtual void BeforeNavigate2(IDispatch* pDisp, const Variant& url, const Variant& flags,
00435                                                         const Variant& targetFrameName, const Variant& postData,
00436                                                         const Variant& headers, VARIANT_BOOL& cancel)
00437                 {}
00438
00439     virtual void NavigateComplete2(IDispatch* pDisp, const Variant& url)
00440                 {}
00441
00442     virtual void OnQuit()
00443                 {}
00444
00445         virtual void OnVisible(bool Visible)
00446                 {}
00447
00448         virtual void OnToolbar(bool Visible)
00449                 {}
00450
00451         virtual void OnMenubar(bool Visible)
00452                 {}
00453
00454         virtual void OnStatusbar(bool Visible)
00455                 {}
00456
00457         virtual void OnFullscreen(bool Visible)
00458                 {}
00459
00460     virtual void DocumentComplete()
00461                 {}
00462
00463         virtual void OnTheatermode(bool Visible)
00464                 {}
00465
00466         virtual void OnAddressbar(bool Visible)
00467                 {}
00468
00469         virtual void WindowSetResizable(bool Visible)
00470                 {}
00471
00472         virtual void WindowClosing(VARIANT_BOOL IsChildWindow, VARIANT_BOOL& cancel)
00473                 {}
00474
00475         virtual void WindowSetLeft(long Left)
00476                 {}
00477
00478         virtual void WindowSetTop(long Top)
00479                 {}
00480
00481         virtual void WindowSetWidth(long Width)
00482                 {}
00483
00484         virtual void WindowSetHeight(long Height)
00485                 {}
00486
00487         virtual void ClientToHostWindow(long& CX, long& CY)
00488                 {}
00489
00490         virtual void SetSecureLockIcon(long SecureLockIcon)
00491                 {}
00492
00493     virtual void FileDownload(Variant& cancel)
00494                 {}
00495
00496     virtual void NavigateError(IDispatch* pDisp, const Variant& url, const Variant& Frame, const Variant& StatusCode, VARIANT_BOOL& cancel)
00497                 {}
00498
00499     virtual void PrivacyImpactedStateChange(bool bImpacted)
00500                 {}
00501 };
00502
00503
00504  // The web browser control has to be initialized completely before being able,
00505  // to display a page, that does not access internet.
00506 struct ANSUNC BrowserNavigator
00507 {
00508         BrowserNavigator();
00509
00510         void    attach(IWebBrowser* browser);
00511         void    goto_url(LPCTSTR url);
00512         void    set_html_page(const String& html_txt);
00513         void    navigated(LPCTSTR url);
00514
00515         IWebBrowser* get_browser() {return _browser.get();}
00516
00517 protected:
00518         SIfacePtr<IWebBrowser> _browser;
00519         String  _new_url;
00520         String  _new_html_txt;
00521         bool    _browser_initialized;
00522 };
00523
00524
00525  // MinGW defines a wrong FixedDWebBrowserEvents2 interface with virtual functions for DISPID calls, so we use our own, corrected version:
00526 interface FixedDWebBrowserEvents2 : public IDispatch
00527 {
00528 #ifdef __GNUC__
00529         virtual ~FixedDWebBrowserEvents2() {}
00530 #endif
00531 };
00532
00533 struct ANSUNC DWebBrowserEvents2Impl
00534  :      public IComSrvBase<FixedDWebBrowserEvents2, DWebBrowserEvents2Impl>, public SimpleComObject,
00535         public DWebBrowserEvents2IF
00536 {
00537         typedef IComSrvBase<FixedDWebBrowserEvents2, DWebBrowserEvents2Impl> super;
00538
00539
00540         DWebBrowserEvents2IF* _callback;
00541
00542
00543         DWebBrowserEvents2Impl(BrowserNavigator& navigator)
00544          :      super(DIID_DWebBrowserEvents2),
00545                 _navigator(navigator)
00546         {
00547                 _callback = this;
00548         }
00549
00550
00551 /*       // IUnknown
00552     STDMETHOD(QueryInterface)(REFIID riid, LPVOID* ppv)
00553         {
00554                 *ppv = NULL;
00555
00556                 if (SUCCEEDED(super::QueryInterface(riid, ppv)))
00557                         return S_OK;
00558
00559                 return E_NOINTERFACE;
00560         } */
00561
00562
00563          // IDispatch
00564         STDMETHOD(GetTypeInfoCount)(UINT* pctinfo)
00565                 {return E_NOTIMPL;}
00566
00567         STDMETHOD(GetTypeInfo)(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
00568                 {return E_NOTIMPL;}
00569
00570         STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId)
00571                 {return E_NOTIMPL;}
00572
00573         STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
00574                                                 DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr)
00575         {
00576                 switch(dispIdMember) {
00577                   case DISPID_STATUSTEXTCHANGE:
00578                         _callback->StatusTextChange((BStr)Variant(pDispParams->rgvarg[0]));
00579                         break;
00580
00581                   case DISPID_COMMANDSTATECHANGE:
00582                         _callback->CommandStateChange(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
00583                         break;
00584
00585                   case DISPID_DOWNLOADBEGIN:
00586                         _callback->DownloadBegin();
00587                         break;
00588
00589                   case DISPID_PROGRESSCHANGE:   // sent when download progress is updated
00590                         _callback->ProgressChange(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
00591                         break;
00592
00593                   case DISPID_WINDOWMOVE:               // sent when main window has been moved
00594                         _callback->WindowMove();
00595                         break;
00596
00597                   case DISPID_WINDOWRESIZE:             // sent when main window has been sized
00598                         _callback->WindowResize();
00599                         break;
00600
00601                   case DISPID_WINDOWACTIVATE:   // sent when main window has been activated
00602                         _callback->WindowActivate();
00603                         break;
00604
00605                   case DISPID_PROPERTYCHANGE:   // sent when the PutProperty method is called
00606                         _callback->PropertyChange((BStr)Variant(pDispParams->rgvarg[0]));
00607                         break;
00608
00609                   case DISPID_TITLECHANGE:              // sent when the document title changes
00610                         _callback->TitleChange((BStr)Variant(pDispParams->rgvarg[0]));
00611                         break;
00612
00613                   case DISPID_TITLEICONCHANGE:  // sent when the top level window icon may have changed.
00614                         _callback->TitleIconChange((BStr)Variant(pDispParams->rgvarg[0]));
00615                         break;
00616
00617
00618                         // anything below here is not present in DWebBrowserEvents, only in DWebBrowserEvents2: ->
00619
00620                   case DISPID_FRAMEBEFORENAVIGATE:
00621                         if (pDispParams->cArgs != 6)
00622                                 return E_INVALIDARG;
00623                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00624                                 return E_INVALIDARG;
00625                         _callback->FrameBeforeNavigate(
00626                                                                   (BStr)Variant(&pDispParams->rgvarg[5]), Variant(&pDispParams->rgvarg[4]),
00627                                                                   (BStr)Variant(&pDispParams->rgvarg[3]), &pDispParams->rgvarg[2],
00628                                                                   (BStr)Variant(&pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0]));
00629                         break;
00630
00631                   case DISPID_FRAMENAVIGATECOMPLETE:
00632                         if (pDispParams->cArgs != 1)
00633                                 return E_INVALIDARG;
00634                         _callback->FrameNavigateComplete((BStr)Variant(pDispParams->rgvarg[0]));
00635                         break;
00636
00637                   case DISPID_FRAMENEWWINDOW:
00638                         if (pDispParams->cArgs != 6)
00639                                 return E_INVALIDARG;
00640                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00641                                 return E_INVALIDARG;
00642                         _callback->FrameNewWindow((BStr)Variant(&pDispParams->rgvarg[5]), Variant(&pDispParams->rgvarg[4]),
00643                                                                   (BStr)Variant(&pDispParams->rgvarg[3]), &pDispParams->rgvarg[2],
00644                                                                   (BStr)Variant(&pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0]));
00645                         break;
00646
00647                   case DISPID_BEFORENAVIGATE2:  // hyperlink clicked on
00648                         if (pDispParams->cArgs != 7)
00649                                 return E_INVALIDARG;
00650                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00651                                 return E_INVALIDARG;
00652                         _callback->BeforeNavigate2(Variant(pDispParams->rgvarg[6]),
00653                                                                   pDispParams->rgvarg[5], &pDispParams->rgvarg[4],
00654                                                                   pDispParams->rgvarg[3], &pDispParams->rgvarg[2],
00655                                                                   pDispParams->rgvarg[1], *V_BOOLREF(&pDispParams->rgvarg[0]));
00656                         break;
00657
00658                   case DISPID_NEWWINDOW2:               // sent when a new window should be created
00659                         if (pDispParams->cArgs != 2)
00660                                 return E_INVALIDARG;
00661                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00662                                 return E_INVALIDARG;
00663                         if (V_VT(&pDispParams->rgvarg[1]) != (VT_DISPATCH|VT_BYREF))
00664                                 return E_INVALIDARG;
00665                         _callback->NewWindow2(V_DISPATCHREF(&pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0]));
00666                         break;
00667
00668                   case DISPID_NAVIGATECOMPLETE2:// UIActivate new document
00669                         if (pDispParams->cArgs != 2)
00670                                 return E_INVALIDARG;
00671
00672                          // notify the navigator
00673                         NavigateComplete2(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
00674
00675                         _callback->NavigateComplete2(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
00676                         break;
00677
00678                   case DISPID_ONQUIT:
00679                         _callback->OnQuit();
00680                         break;
00681
00682                   case DISPID_ONVISIBLE:                // sent when the window goes visible/hidden
00683                         if (pDispParams->cArgs != 1)
00684                                 return E_INVALIDARG;
00685                         _callback->OnVisible(Variant(pDispParams->rgvarg[0]));
00686                         break;
00687
00688                   case DISPID_ONTOOLBAR:                // sent when the toolbar should be shown/hidden
00689                         if (pDispParams->cArgs != 1)
00690                                 return E_INVALIDARG;
00691                         _callback->OnToolbar(Variant(pDispParams->rgvarg[0]));
00692                         break;
00693
00694                   case DISPID_ONMENUBAR:                // sent when the menubar should be shown/hidden
00695                         if (pDispParams->cArgs != 1)
00696                                 return E_INVALIDARG;
00697                         _callback->OnMenubar(Variant(pDispParams->rgvarg[0]));
00698                         break;
00699
00700                   case DISPID_ONSTATUSBAR:              // sent when the statusbar should be shown/hidden
00701                         if (pDispParams->cArgs != 1)
00702                                 return E_INVALIDARG;
00703                         _callback->OnStatusbar(Variant(pDispParams->rgvarg[0]));
00704                         break;
00705
00706                   case DISPID_ONFULLSCREEN:             // sent when kiosk mode should be on/off
00707                         if (pDispParams->cArgs != 1)
00708                                 return E_INVALIDARG;
00709                         _callback->OnFullscreen(Variant(pDispParams->rgvarg[0]));
00710                         break;
00711
00712                   case DISPID_DOCUMENTCOMPLETE:// new document goes ReadyState_Complete
00713                         _callback->DocumentComplete();
00714                         break;
00715
00716                   case DISPID_DOWNLOADCOMPLETE:
00717                         _callback->DownloadComplete();
00718                         break;
00719
00720                   case DISPID_ONTHEATERMODE:    // sent when theater mode should be on/off
00721                         if (pDispParams->cArgs != 1)
00722                                 return E_INVALIDARG;
00723                         _callback->OnTheatermode(Variant(pDispParams->rgvarg[0]));
00724                         break;
00725
00726                   case DISPID_ONADDRESSBAR:             // sent when the address bar should be shown/hidden
00727                         if (pDispParams->cArgs != 1)
00728                                 return E_INVALIDARG;
00729                         _callback->OnAddressbar(Variant(pDispParams->rgvarg[0]));
00730                         break;
00731
00732                   case DISPID_WINDOWSETRESIZABLE:// sent to set the style of the host window frame
00733                         if (pDispParams->cArgs != 1)
00734                                 return E_INVALIDARG;
00735                         _callback->WindowSetResizable(Variant(pDispParams->rgvarg[0]));
00736                         break;
00737
00738                   case DISPID_WINDOWCLOSING:    // sent before script window.close closes the window
00739                         if (pDispParams->cArgs != 2)
00740                                 return E_INVALIDARG;
00741                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00742                                 return E_INVALIDARG;
00743                         _callback->WindowClosing(Variant(pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0]));
00744                         break;
00745
00746                   case DISPID_WINDOWSETLEFT:    // sent when the put_left method is called on the WebOC
00747                         if (pDispParams->cArgs != 1)
00748                                 return E_INVALIDARG;
00749                         _callback->WindowSetLeft(Variant(pDispParams->rgvarg[0]));
00750                         break;
00751
00752                   case DISPID_WINDOWSETTOP:             // sent when the put_top method is called on the WebOC
00753                         if (pDispParams->cArgs != 1)
00754                                 return E_INVALIDARG;
00755                         _callback->WindowSetTop(Variant(pDispParams->rgvarg[0]));
00756                         break;
00757
00758                   case DISPID_WINDOWSETWIDTH:   // sent when the put_width method is called on the WebOC
00759                         if (pDispParams->cArgs != 1)
00760                                 return E_INVALIDARG;
00761                         _callback->WindowSetWidth(Variant(pDispParams->rgvarg[0]));
00762                         break;
00763
00764                   case DISPID_WINDOWSETHEIGHT:  // sent when the put_height method is called on the WebOC
00765                         if (pDispParams->cArgs != 1)
00766                                 return E_INVALIDARG;
00767                         _callback->WindowSetHeight(Variant(pDispParams->rgvarg[0]));
00768                         break;
00769
00770                   case DISPID_CLIENTTOHOSTWINDOW:// sent during window.open to request conversion of dimensions
00771                         if (pDispParams->cArgs != 2)
00772                                 return E_INVALIDARG;
00773                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_I4|VT_BYREF))
00774                                 return E_INVALIDARG;
00775                         if (V_VT(&pDispParams->rgvarg[1]) != (VT_I4|VT_BYREF))
00776                                 return E_INVALIDARG;
00777                         _callback->ClientToHostWindow(*V_I4REF(&pDispParams->rgvarg[1]), *V_I4REF(&pDispParams->rgvarg[0]));
00778                         break;
00779
00780                   case DISPID_SETSECURELOCKICON:// sent to suggest the appropriate security icon to show
00781                         if (pDispParams->cArgs != 1)
00782                                 return E_INVALIDARG;
00783                         _callback->SetSecureLockIcon(Variant(pDispParams->rgvarg[0]));
00784                         break;
00785
00786                   case DISPID_FILEDOWNLOAD: {   // Fired to indicate the File Download dialog is opening
00787                         if (pDispParams->cArgs != 1)    //@@ every time 2 ?!
00788                                 return E_INVALIDARG;
00789                         Variant var(pDispParams->rgvarg[0]);
00790                         _callback->FileDownload(var);}
00791                         break;
00792
00793                   case DISPID_NAVIGATEERROR:    // Fired to indicate the a binding error has occured
00794                         if (pDispParams->cArgs != 5)
00795                                 return E_INVALIDARG;
00796                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00797                                 return E_INVALIDARG;
00798                         _callback->NavigateError(Variant(pDispParams->rgvarg[4]), Variant(pDispParams->rgvarg[3]),
00799                                                                 Variant(pDispParams->rgvarg[2]), Variant(pDispParams->rgvarg[1]),
00800                                                                 *V_BOOLREF(&pDispParams->rgvarg[0]));
00801                         break;
00802
00803                   case DISPID_PRIVACYIMPACTEDSTATECHANGE:// Fired when the user's browsing experience is impacted
00804                         if (pDispParams->cArgs != 1)
00805                                 return E_INVALIDARG;
00806                         _callback->PrivacyImpactedStateChange(Variant(pDispParams->rgvarg[0]));
00807                         break;
00808
00809                   default:
00810                         return NOERROR;
00811                 }
00812
00813                 return S_OK;
00814         }
00815
00816 protected:
00817         BrowserNavigator& _navigator;
00818
00819         void NavigateComplete2(IDispatch* pDisp, const Variant& url)
00820         {
00821                 String adr = (BStr)url;
00822
00823                 _navigator.navigated(adr);
00824         }
00825 };
00826
00827
00829 struct WebChildWindow : public IPCtrlWindow<ChildWindow, SIfacePtr<IWebBrowser2> >,
00830                                                 public DWebBrowserEvents2Impl
00831 {
00832         typedef IPCtrlWindow<ChildWindow, SIfacePtr<IWebBrowser2> > super;
00833         typedef DWebBrowserEvents2Impl web_super;
00834
00835         WebChildWindow(HWND hwnd, const WebChildWndInfo& info);
00836
00837         static WebChildWindow* create(const FileChildWndInfo& info)
00838         {
00839                 ChildWindow* child = ChildWindow::create(info, info._pos.rcNormalPosition,
00840                         WINDOW_CREATOR_INFO(WebChildWindow,WebChildWndInfo), CLASSNAME_CHILDWND, NULL, info._pos.showCmd==SW_SHOWMAXIMIZED? WS_MAXIMIZE: 0);
00841
00842                 return static_cast<WebChildWindow*>(child);
00843         }
00844
00845
00846          // DWebBrowserEvents2Impl overides ->
00847
00848     void BeforeNavigate2(IDispatch* pDisp, const Variant& url, const Variant& flags,
00849                                                         const Variant& targetFrameName, const Variant& postData,
00850                                                         const Variant& headers, VARIANT_BOOL& cancel)
00851         {
00852                 //String adr = (BStr)url;
00853         }
00854
00855     void NavigateComplete2(IDispatch* pDisp, const Variant& url)
00856         {
00857                 web_super::NavigateComplete2(pDisp, url);
00858
00859                 set_url(String(BStr(url)));
00860         }
00861
00862     void StatusTextChange(const BStr& text)
00863         {
00864                 _statusText = text;
00865                 SendMessage(_hwndFrame, PM_SETSTATUSTEXT, 0, (LPARAM)_statusText.c_str());
00866         }
00867
00868     void ProgressChange(long Progress, long ProgressMax)
00869         {
00870         }
00871
00872     void WindowMove()
00873         {
00874         }
00875
00876     void WindowResize()
00877         {
00878         }
00879
00880     void WindowActivate()
00881         {
00882         }
00883
00884     void PropertyChange(const BStr& Property)
00885         {
00886                 Variant value;
00887                 _control->GetProperty(Property, &value);
00888         }
00889
00890     void CommandStateChange(long command/*CSC_NAVIGATEFORWARD, CSC_NAVIGATEBACK*/, bool enable)
00891         {
00892         }
00893
00894     void DownloadBegin()
00895         {
00896         }
00897
00898     void NewWindow2(IDispatch** ppDisp, VARIANT_BOOL& cancel)
00899         {
00900                 //*ppDisp = ;
00901                 //cancel = TRUE;
00902         }
00903
00904     void TitleChange(const BStr& text)
00905         {
00906                 SetWindowText(_hwnd, String(text));
00907         }
00908
00909     void TitleIconChange(const BStr& text)
00910         {
00911         }
00912
00913     void FrameBeforeNavigate(const BStr& url, long flags, const BStr& targetFrameName, VARIANT* postData, const BStr& headers, VARIANT_BOOL& cancel)
00914         {
00915         }
00916
00917     void FrameNavigateComplete(const BStr& url)
00918         {
00919         }
00920
00921     void FrameNewWindow(const BStr& url, long flags, const BStr& targetFrameName, VARIANT* postData, const BStr& headers, VARIANT_BOOL& processed)
00922         {
00923         }
00924
00925     void OnQuit()
00926         {
00927         }
00928
00929         void OnVisible(bool Visible)
00930         {
00931         }
00932
00933         void OnToolbar(bool Visible)
00934         {
00935         }
00936
00937         void OnMenubar(bool Visible)
00938         {
00939         }
00940
00941         void OnStatusbar(bool Visible)
00942         {
00943         }
00944
00945         void OnFullscreen(bool Visible)
00946         {
00947         }
00948
00949     void DocumentComplete()
00950         {
00951         }
00952
00953         void OnTheatermode(bool Visible)
00954         {
00955         }
00956
00957         void OnAddressbar(bool Visible)
00958         {
00959         }
00960
00961         void WindowSetResizable(bool Visible)
00962         {
00963         }
00964
00965         void WindowClosing(VARIANT_BOOL IsChildWindow, VARIANT_BOOL& cancel)
00966         {
00967         }
00968
00969         void WindowSetLeft(long Left)
00970         {
00971         }
00972
00973         void WindowSetTop(long Top)
00974         {
00975         }
00976
00977         void WindowSetWidth(long Width)
00978         {
00979         }
00980
00981         void WindowSetHeight(long Height)
00982         {
00983         }
00984
00985         void ClientToHostWindow(long& CX, long& CY)
00986         {
00987         }
00988
00989         void SetSecureLockIcon(long SecureLockIcon)
00990         {
00991         }
00992
00993     void FileDownload(Variant& cancel)
00994         {
00995         }
00996
00997     void NavigateError(IDispatch* pDisp, const Variant& url, const Variant& Frame, const Variant& StatusCode, VARIANT_BOOL& cancel)
00998         {
00999         }
01000
01001     void PrivacyImpactedStateChange(bool bImpacted)
01002         {
01003         }
01004
01005
01006 protected:
01007         BrowserNavigator _navigator;
01008         auto_ptr<EventConnector> _connector;
01009
01010         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
01011
01012         virtual String jump_to_int(LPCTSTR url);
01013 };


ROS Explorer: window.cpp File Reference

  • File List
  • File Members
utility

window.cpp File Reference

#include <precomp.h>
#include "../resource.h"

Include dependency graph for window.cpp:

Go to the source code of this file.

Defines

#define | PSM_GETRESULT (WM_USER + 135)
#define | PropSheet_GetResult(hDlg) SNDMSG(hDlg, PSM_GETRESULT, 0, 0)

Functions

void | DrawGrayText (HDC hdc, LPRECT pRect, LPCTSTR title, int dt_flags)

Define Documentation

#define PropSheet_GetResult ( hDlg ) SNDMSG(hDlg, PSM_GETRESULT, 0, 0)

Definition at line 1307 of file window.cpp.

#define PSM_GETRESULT (WM_USER + 135)

Definition at line 1306 of file window.cpp.

Referenced by PropSheetPage::PropSheetPage().

Function Documentation

void DrawGrayText | ( | HDC | hdc,
 |  | LPRECT | pRect,
 |  | LPCTSTR | title,
 |  | int | dt_flags
 | ) |

Definition at line 878 of file window.cpp.

Referenced by PictureButton::DrawItem().

00879 {
00880         COLORREF gray = GetSysColor(COLOR_GRAYTEXT);
00881
00882         if (gray) {
00883                 TextColor lcColor(hdc, GetSysColor(COLOR_BTNHIGHLIGHT));
00884                 RECT shadowRect = {pRect->left+1, pRect->top+1, pRect->right+1, pRect->bottom+1};
00885                 DrawText(hdc, title, -1, &shadowRect, dt_flags);
00886
00887                 SetTextColor(hdc, gray);
00888                 DrawText(hdc, title, -1, pRect, dt_flags);
00889         } else {
00890                 int old_r = pRect->right;
00891                 int old_b = pRect->bottom;
00892
00893                 DrawText(hdc, title, -1, pRect, dt_flags|DT_CALCRECT);
00894
00895                 int x = pRect->left + (old_r-pRect->right)/2;
00896                 int y = pRect->top + (old_b-pRect->bottom)/2;
00897                 int w = pRect->right-pRect->left;
00898                 int h = pRect->bottom-pRect->top;
00899                 s_MyDrawText_Rect.right = w;
00900                 s_MyDrawText_Rect.bottom = h;
00901
00902                 GrayString(hdc, GetSysColorBrush(COLOR_GRAYTEXT), MyDrawText, (LPARAM)title, -1, x, y, w, h);
00903         }
00904 }


ROS Explorer: window.cpp Source File

  • File List
  • File Members
utility

window.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // window.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 #include "../resource.h"        // for ID_GO_BACK, ...
00032
00033
00034 WindowClass::WindowClass(LPCTSTR classname, UINT style_, WNDPROC wndproc)
00035 {
00036         memset(this, 0, sizeof(WNDCLASSEX));
00037
00038         cbSize = sizeof(WNDCLASSEX);
00039         style = style_;
00040         hInstance = g_Globals._hInstance;
00041         hCursor = LoadCursor(0, IDC_ARROW);
00042
00043         lpszClassName = classname;
00044         lpfnWndProc = wndproc;
00045
00046         _atomClass = 0;
00047 }
00048
00049
00050 IconWindowClass::IconWindowClass(LPCTSTR classname, UINT nid, UINT style, WNDPROC wndproc)
00051  :      WindowClass(classname, style, wndproc)
00052 {
00053         hIcon = ResIcon(nid);
00054         hIconSm = SmallIcon(nid);
00055 }
00056
00057
00058 Window::WindowMap       Window::s_wnd_map;
00059
00060 Window::CREATORFUNC     Window::s_window_creator = NULL;
00061 const void*                     Window::s_new_info = NULL;
00062
00063 HHOOK                           Window::s_hcbtHook = 0;
00064
00065
00066 Window::StaticWindowData& Window::GetStaticWindowData()
00067 {
00068         static StaticWindowData s_initialized_data;
00069
00070         return s_initialized_data;
00071 }
00072
00073
00074 Window::Window(HWND hwnd)
00075  :      WindowHandle(hwnd)
00076 {
00077         Lock lock(GetStaticWindowData()._map_crit_sect);        // protect access to s_wnd_map
00078
00079         s_wnd_map[_hwnd] = this;
00080 }
00081
00082 Window::~Window()
00083 {
00084         Lock lock(GetStaticWindowData()._map_crit_sect);        // protect access to s_wnd_map
00085
00086         s_wnd_map.erase(_hwnd);
00087 }
00088
00089
00090 HWND Window::Create(CREATORFUNC creator, DWORD dwExStyle,
00091                                         LPCTSTR lpClassName, LPCTSTR lpWindowName,
00092                                         DWORD dwStyle, int x, int y, int w, int h,
00093                                         HWND hwndParent, HMENU hMenu/*, LPVOID lpParam*/)
00094 {
00095         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00096
00097         s_window_creator = creator;
00098         s_new_info = NULL;
00099
00100         return CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle,
00101                                                         x, y, w, h,
00102                                                         hwndParent, hMenu, g_Globals._hInstance, 0/*lpParam*/);
00103 }
00104
00105 HWND Window::Create(CREATORFUNC_INFO creator, const void* info, DWORD dwExStyle,
00106                                         LPCTSTR lpClassName, LPCTSTR lpWindowName,
00107                                         DWORD dwStyle, int x, int y, int w, int h,
00108                                         HWND hwndParent, HMENU hMenu/*, LPVOID lpParam*/)
00109 {
00110         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00111
00112         s_window_creator = (CREATORFUNC) creator;
00113         s_new_info = info;
00114
00115         return CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle,
00116                                                         x, y, w, h,
00117                                                         hwndParent, hMenu, g_Globals._hInstance, 0/*lpParam*/);
00118 }
00119
00120
00121 Window* Window::create_mdi_child(const ChildWndInfo& info, const MDICREATESTRUCT& mcs, CREATORFUNC_INFO creator)
00122 {
00123         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00124
00125         s_window_creator = (CREATORFUNC) creator;
00126         s_new_info = &info;
00127
00128         s_hcbtHook = SetWindowsHookEx(WH_CBT, MDICBTHookProc, 0, GetCurrentThreadId());
00129
00130         HWND hwnd = (HWND) SendMessage(info._hmdiclient, WM_MDICREATE, 0, (LPARAM)&mcs);
00131
00132         UnhookWindowsHookEx(s_hcbtHook);
00133
00134         Window* child = get_window(hwnd);
00135         s_new_info = NULL;
00136
00137         if (child && (!hwnd || !child->_hwnd))
00138                 child = NULL;
00139
00140         return child;
00141 }
00142
00143 LRESULT CALLBACK Window::MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam)
00144 {
00145         if (code == HCBT_CREATEWND) {
00146                 HWND hwnd = (HWND)wparam;
00147
00148                  // create Window controller and associate it with the window handle
00149                 Window* child = get_window(hwnd);
00150
00151                 if (!child)
00152                         child = create_controller(hwnd);
00153         }
00154
00155         return CallNextHookEx(s_hcbtHook, code, wparam, lparam);
00156 }
00157
00158
00159 /*
00160 Window* Window::create_property_sheet(PropertySheetDialog* ppsd, CREATORFUNC creator, const void* info)
00161 {
00162         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00163
00164         s_window_creator = creator;
00165         s_new_info = info;
00166
00167         s_hcbtHook = SetWindowsHookEx(WH_CBT, PropSheetCBTHookProc, 0, GetCurrentThreadId());
00168
00169         HWND hwnd = (HWND) PropertySheet(ppsd);
00170
00171         UnhookWindowsHookEx(s_hcbtHook);
00172
00173         Window* child = get_window(hwnd);
00174         s_new_info = NULL;
00175
00176         if (child && (!hwnd || !child->_hwnd))
00177                 child = NULL;
00178
00179         return child;
00180 }
00181 */
00182
00183 LRESULT CALLBACK Window::PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam)
00184 {
00185         if (code == HCBT_CREATEWND) {
00186                 HWND hwnd = (HWND)wparam;
00187
00188                  // create Window controller and associate it with the window handle
00189                 Window* child = get_window(hwnd);
00190
00191                 if (!child)
00192                         child = create_controller(hwnd);
00193         }
00194
00195         return CallNextHookEx(s_hcbtHook, code, wparam, lparam);
00196 }
00197
00198
00200
00201 Window* Window::get_window(HWND hwnd)
00202 {
00203         {
00204                 Lock lock(GetStaticWindowData()._map_crit_sect);        // protect access to s_wnd_map
00205
00206                 WindowMap::const_iterator found = s_wnd_map.find(hwnd);
00207
00208                 if (found!=s_wnd_map.end())
00209                         return found->second;
00210         }
00211
00212         return NULL;
00213 }
00214
00215
00217
00218 Window* Window::create_controller(HWND hwnd)
00219 {
00220         if (s_window_creator) { // protect for recursion and create the window object only for the first window
00221                 Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00222
00223                 const void* info = s_new_info;
00224                 s_new_info = NULL;
00225
00226                 CREATORFUNC window_creator = s_window_creator;
00227                 s_window_creator = NULL;
00228
00229                 if (info)
00230                         return CREATORFUNC_INFO(window_creator)(hwnd, info);
00231                 else
00232                         return CREATORFUNC(window_creator)(hwnd);
00233         }
00234
00235         return NULL;
00236 }
00237
00238
00239 LRESULT Window::Init(LPCREATESTRUCT pcs)
00240 {
00241         return 0;
00242 }
00243
00244
00245 LRESULT CALLBACK Window::WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
00246 {
00247         Window* pThis = get_window(hwnd);
00248
00249         if (!pThis)
00250                 pThis = create_controller(hwnd);
00251
00252         if (pThis) {
00253                 switch(nmsg) {
00254                   case WM_COMMAND:
00255                         return pThis->Command(LOWORD(wparam), HIWORD(wparam));
00256
00257                   case WM_NOTIFY:
00258                         return pThis->Notify(wparam, (NMHDR*)lparam);
00259
00260                   case WM_NOTIFYFORMAT:
00261                         return NFR_CURRENT;
00262
00263                   case WM_CREATE:
00264                         return pThis->Init((LPCREATESTRUCT)lparam);
00265
00266                   case WM_NCDESTROY:
00267                         delete pThis;
00268                         return 0;
00269
00270                   default:
00271                         return pThis->WndProc(nmsg, wparam, lparam);
00272                 }
00273         }
00274         else
00275                 return DefWindowProc(hwnd, nmsg, wparam, lparam);
00276 }
00277
00278 LRESULT Window::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00279 {
00280         return DefWindowProc(_hwnd, nmsg, wparam, lparam);
00281 }
00282
00283 int Window::Command(int id, int code)
00284 {
00285         return 1;       // no command handler found
00286 }
00287
00288 int Window::Notify(int id, NMHDR* pnmh)
00289 {
00290         return 0;
00291 }
00292
00293 void Window::CancelModes()
00294 {
00295         PostMessage(HWND_BROADCAST, WM_CANCELMODE, 0, 0);
00296 }
00297
00298
00299 SubclassedWindow::SubclassedWindow(HWND hwnd)
00300  :      super(hwnd)
00301 {
00302         _orgWndProc = SubclassWindow(_hwnd, SubclassedWndProc);
00303
00304         if (!_orgWndProc)
00305                 delete this;
00306 }
00307
00308 LRESULT CALLBACK SubclassedWindow::SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
00309 {
00310         SubclassedWindow* pThis = GET_WINDOW(SubclassedWindow, hwnd);
00311         assert(pThis);
00312
00313         if (pThis) {
00314                 switch(nmsg) {
00315                   case WM_COMMAND:
00316                         if (!pThis->Command(LOWORD(wparam), HIWORD(wparam)))
00317                                 return 0;
00318                         break;
00319
00320                   case WM_NOTIFY:
00321                         return pThis->Notify(wparam, (NMHDR*)lparam);
00322
00323                   case WM_NOTIFYFORMAT:
00324                         return NFR_CURRENT;
00325
00326                   case WM_CREATE:
00327                         return pThis->Init((LPCREATESTRUCT)lparam);
00328
00329                   case WM_NCDESTROY:
00330                         delete pThis;
00331                         return 0;
00332
00333                   default:
00334                         return pThis->WndProc(nmsg, wparam, lparam);
00335                 }
00336         }
00337
00338         return CallWindowProc(pThis->_orgWndProc, hwnd, nmsg, wparam, lparam);
00339 }
00340
00341 LRESULT SubclassedWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00342 {
00343         return CallWindowProc(_orgWndProc, _hwnd, nmsg, wparam, lparam);
00344 }
00345
00346 int SubclassedWindow::Command(int id, int code)
00347 {
00348         return 1;       // no command handler found
00349 }
00350
00351 int SubclassedWindow::Notify(int id, NMHDR* pnmh)
00352 {
00353         return CallWindowProc(_orgWndProc, _hwnd, WM_NOTIFY, id, (LPARAM)pnmh);
00354 }
00355
00356
00357 ChildWindow::ChildWindow(HWND hwnd, const ChildWndInfo& info)
00358  :      super(hwnd),
00359         _hwndFrame(GetParent(info._hmdiclient))
00360 {
00361         _focus_pane = 0;
00362         _split_pos = DEFAULT_SPLIT_POS;
00363         _last_split = DEFAULT_SPLIT_POS;
00364 }
00365
00366
00367 ChildWindow* ChildWindow::create(const ChildWndInfo& info, const RECT& rect, CREATORFUNC_INFO creator,
00368                                                                         LPCTSTR classname, LPCTSTR title, DWORD style)
00369 {
00370         MDICREATESTRUCT mcs;
00371
00372         mcs.szClass = classname;
00373         mcs.szTitle = title;
00374         mcs.hOwner      = g_Globals._hInstance;
00375         mcs.x           = rect.left,
00376         mcs.y           = rect.top;
00377         mcs.cx          = rect.right - rect.left;
00378         mcs.cy          = rect.bottom - rect.top;
00379         mcs.style       = style;
00380         mcs.lParam      = 0;
00381
00382         return static_cast<ChildWindow*>(create_mdi_child(info, mcs, creator));
00383 }
00384
00385
00386 LRESULT ChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00387 {
00388         switch(nmsg) {
00389           case WM_PAINT: {
00390                 PaintCanvas canvas(_hwnd);
00391                 ClientRect rt(_hwnd);
00392                 rt.left = _split_pos-SPLIT_WIDTH/2;
00393                 rt.right = _split_pos+SPLIT_WIDTH/2+1;
00394                 HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(COLOR_SPLITBAR));
00395                 Rectangle(canvas, rt.left, rt.top-1, rt.right, rt.bottom+1);
00396                 SelectObject(canvas, lastBrush);
00397                 break;}
00398
00399           case WM_SETCURSOR:
00400                 if (LOWORD(lparam) == HTCLIENT) {
00401                         POINT pt;
00402                         GetCursorPos(&pt);
00403                         ScreenToClient(_hwnd, &pt);
00404
00405                         if (pt.x>=_split_pos-SPLIT_WIDTH/2 && pt.x<_split_pos+SPLIT_WIDTH/2+1) {
00406                                 SetCursor(LoadCursor(0, IDC_SIZEWE));
00407                                 return TRUE;
00408                         }
00409                 }
00410                 goto def;
00411
00412           case WM_SIZE:
00413                 if (wparam != SIZE_MINIMIZED)
00414                         resize_children(LOWORD(lparam), HIWORD(lparam));
00415                 goto def;
00416
00417           case WM_GETMINMAXINFO:
00418                 DefMDIChildProc(_hwnd, nmsg, wparam, lparam);
00419
00420                 {LPMINMAXINFO lpmmi = (LPMINMAXINFO)lparam;
00421
00422                 lpmmi->ptMaxTrackSize.x <<= 1;  // 2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN
00423                 lpmmi->ptMaxTrackSize.y <<= 1;  // 2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN
00424                 break;}
00425
00426           case WM_LBUTTONDOWN: {
00427                 int x = GET_X_LPARAM(lparam);
00428
00429                 ClientRect rt(_hwnd);
00430
00431                 if (x>=_split_pos-SPLIT_WIDTH/2 && x<_split_pos+SPLIT_WIDTH/2+1) {
00432                         _last_split = _split_pos;
00433                         SetCapture(_hwnd);
00434                 }
00435
00436                 break;}
00437
00438           case WM_LBUTTONUP:
00439                 if (GetCapture() == _hwnd)
00440                         ReleaseCapture();
00441                 break;
00442
00443           case WM_KEYDOWN:
00444                 if (wparam == VK_ESCAPE)
00445                         if (GetCapture() == _hwnd) {
00446                                 _split_pos = _last_split;
00447                                 ClientRect rt(_hwnd);
00448                                 resize_children(rt.right, rt.bottom);
00449                                 _last_split = -1;
00450                                 ReleaseCapture();
00451                                 SetCursor(LoadCursor(0, IDC_ARROW));
00452                         }
00453                 break;
00454
00455           case WM_MOUSEMOVE:
00456                 if (GetCapture() == _hwnd) {
00457                         int x = GET_X_LPARAM(lparam);
00458
00459                         ClientRect rt(_hwnd);
00460
00461                         if (x>=0 && x<rt.right) {
00462                                 _split_pos = x;
00463                                 resize_children(rt.right, rt.bottom);
00464                                 rt.left = x-SPLIT_WIDTH/2;
00465                                 rt.right = x+SPLIT_WIDTH/2+1;
00466                                 InvalidateRect(_hwnd, &rt, FALSE);
00467                                 UpdateWindow(_left_hwnd);
00468                                 UpdateWindow(_hwnd);
00469                                 UpdateWindow(_right_hwnd);
00470                         }
00471                 }
00472                 break;
00473
00474           case PM_DISPATCH_COMMAND:
00475                 switch(LOWORD(wparam)) {
00476                   case ID_GO_BACK:
00477                         if (!_url_history.empty()) {
00478                                 const String& url = jump_to_int(_url_history.top());
00479
00480                                 if (jump_to_int(url))
00481                                         set_url(url);
00482
00483                                 _url_history.pop();
00484                         }
00485                         break;
00486
00487                   case ID_GO_FORWARD:
00488                         //@@
00489                         break;
00490
00491                   case ID_GO_UP:
00493                         break;
00494
00495                   case ID_GO_HOME:
00496                         //@@
00497                         break;
00498
00499                   default:
00500                         return FALSE;
00501                 }
00502                 return TRUE;
00503
00504           case WM_MDIACTIVATE:
00505                 if ((HWND)lparam == _hwnd) {
00506                         SendMessage(_hwndFrame, PM_SETSTATUSTEXT, 0, (LPARAM)_statusText.c_str());
00507                         SendMessage(_hwndFrame, PM_URL_CHANGED, 0, (LPARAM)_url.c_str());
00508                 }
00509                 break;
00510
00511           case PM_JUMP_TO_URL:
00512                 return go_to((LPCTSTR)lparam)? TRUE: FALSE;
00513
00514           default: def:
00515                 return DefMDIChildProc(_hwnd, nmsg, wparam, lparam);
00516         }
00517
00518         return 0;
00519 }
00520
00521
00522 void ChildWindow::resize_children(int cx, int cy)
00523 {
00524         HDWP hdwp = BeginDeferWindowPos(2);
00525         RECT rt;
00526
00527         rt.left   = 0;
00528         rt.top    = 0;
00529         rt.right  = cx;
00530         rt.bottom = cy;
00531
00532         if (_left_hwnd) {
00533                 cx = _split_pos + SPLIT_WIDTH/2;
00534
00535                 hdwp = DeferWindowPos(hdwp, _left_hwnd, 0, rt.left, rt.top, _split_pos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
00536         } else {
00537                 _split_pos = 0;
00538                 cx = 0;
00539         }
00540
00541         if (_right_hwnd)
00542                 hdwp = DeferWindowPos(hdwp, _right_hwnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
00543
00544         EndDeferWindowPos(hdwp);
00545 }
00546
00547
00548 bool ChildWindow::go_to(LPCTSTR url)
00549 {
00550         const String& url_str = jump_to_int(url);
00551
00552         if (!url_str.empty()) {
00553                 set_url(url_str);
00554
00555                 _url_history.push(url_str);
00556
00557                 return true;
00558         } else
00559                 return false;
00560 }
00561
00562 void ChildWindow::set_url(LPCTSTR url)
00563 {
00564         if (_url != url) {
00565                 _url = url;
00566
00567                 SendMessage(_hwndFrame, PM_URL_CHANGED, 0, (LPARAM)url);
00568         }
00569 }
00570
00571
00572 WindowSet Window::s_pretranslate_windows;
00573
00574 void Window::register_pretranslate(HWND hwnd)
00575 {
00576         s_pretranslate_windows.insert(hwnd);
00577 }
00578
00579 void Window::unregister_pretranslate(HWND hwnd)
00580 {
00581         s_pretranslate_windows.erase(hwnd);
00582 }
00583
00584 BOOL Window::pretranslate_msg(LPMSG pmsg)
00585 {
00586         for(WindowSet::const_iterator it=Window::s_pretranslate_windows.begin(); it!=s_pretranslate_windows.end(); ++it)
00587                 if (SendMessage(*it, PM_TRANSLATE_MSG, 0, (LPARAM)pmsg))
00588                         return TRUE;
00589
00590         return FALSE;
00591 }
00592
00593
00594 WindowSet Window::s_dialogs;
00595
00596 void Window::register_dialog(HWND hwnd)
00597 {
00598         s_dialogs.insert(hwnd);
00599 }
00600
00601 void Window::unregister_dialog(HWND hwnd)
00602 {
00603         s_dialogs.erase(hwnd);
00604 }
00605
00606 BOOL Window::dispatch_dialog_msg(MSG* pmsg)
00607 {
00608         for(WindowSet::const_iterator it=Window::s_dialogs.begin(); it!=s_dialogs.end(); ++it)
00609                 if (IsDialogMessage(*it, pmsg))
00610                         return TRUE;
00611
00612         return FALSE;
00613 }
00614
00615
00616 int Window::MessageLoop()
00617 {
00618         MSG msg;
00619
00620         while(GetMessage(&msg, 0, 0, 0)) {
00621                 try {
00622                         if (pretranslate_msg(&msg))
00623                                 continue;
00624
00625                         if (dispatch_dialog_msg(&msg))
00626                                 continue;
00627
00628                         TranslateMessage(&msg);
00629
00630                         try {
00631                                 DispatchMessage(&msg);
00632                         } catch(COMException& e) {
00633                                 HandleException(e, 0);
00634                         }
00635                 } catch(COMException& e) {
00636                         HandleException(e, 0);
00637                 }
00638         }
00639
00640         return msg.wParam;
00641 }
00642
00643
00644 LRESULT Window::SendParent(UINT nmsg, WPARAM wparam, LPARAM lparam)
00645 {
00646         HWND parent = GetParent(_hwnd);
00647
00648         if (!parent)
00649                 return 0;
00650
00651         return SendMessage(parent, nmsg, wparam, lparam);
00652 }
00653
00654 LRESULT Window::PostParent(UINT nmsg, WPARAM wparam, LPARAM lparam)
00655 {
00656         HWND parent = GetParent(_hwnd);
00657
00658         if (!parent)
00659                 return 0;
00660
00661         return PostMessage(parent, nmsg, wparam, lparam);
00662 }
00663
00664
00665 PreTranslateWindow::PreTranslateWindow(HWND hwnd)
00666  :      super(hwnd)
00667 {
00668         register_pretranslate(hwnd);
00669 }
00670
00671 PreTranslateWindow::~PreTranslateWindow()
00672 {
00673         unregister_pretranslate(_hwnd);
00674 }
00675
00676
00677 Dialog::Dialog(HWND hwnd)
00678  :      super(hwnd)
00679 {
00680         register_dialog(hwnd);
00681 }
00682
00683 Dialog::~Dialog()
00684 {
00685         unregister_dialog(_hwnd);
00686 }
00687
00688 int Dialog::DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent)
00689 {
00690         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00691
00692         s_window_creator = creator;
00693         s_new_info = NULL;
00694
00696
00697         return DialogBoxParam(g_Globals._hInstance, MAKEINTRESOURCE(nid), hwndParent, DialogProc, 0/*lpParam*/);
00698 }
00699
00700 int Dialog::DoModal(UINT nid, CREATORFUNC_INFO creator, const void* info, HWND hwndParent)
00701 {
00702         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00703
00704         s_window_creator = (CREATORFUNC) creator;
00705         s_new_info = NULL;
00706
00708
00709         return DialogBoxParam(g_Globals._hInstance, MAKEINTRESOURCE(nid), hwndParent, DialogProc, 0/*lpParam*/);
00710 }
00711
00712 INT_PTR CALLBACK Window::DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
00713 {
00714         Window* pThis = get_window(hwnd);
00715
00716         if (pThis) {
00717                 switch(nmsg) {
00718                   case WM_COMMAND:
00719                         pThis->Command(LOWORD(wparam), HIWORD(wparam));
00720                         return TRUE;    // message has been processed
00721
00722                   case WM_NOTIFY:
00723                         pThis->Notify(wparam, (NMHDR*)lparam);
00724                         return TRUE;    // message has been processed
00725
00726                   case WM_NOTIFYFORMAT:
00727                         SetWindowLong(hwnd, DWLP_MSGRESULT, NFR_CURRENT);       // set return value NFR_CURRENT
00728                         return TRUE;    // message has been processed
00729
00730                   case WM_NCDESTROY:
00731                         delete pThis;
00732                         return TRUE;    // message has been processed
00733
00734                   default:
00735                         return pThis->WndProc(nmsg, wparam, lparam);
00736                 }
00737         } else if (nmsg == WM_INITDIALOG) {
00738                 pThis = create_controller(hwnd);
00739
00740                 if (pThis)
00741                         return pThis->Init(NULL);
00742         }
00743
00744         return FALSE;   // message has not been processed
00745 }
00746
00747 LRESULT Dialog::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00748 {
00749         return FALSE;   // message has not been processed
00750 }
00751
00752 int Dialog::Command(int id, int code)
00753 {
00754         if (code == BN_CLICKED) {
00755                 EndDialog(_hwnd, id);
00756                 return 0;       // message has been processed
00757         }
00758
00759         return 1;
00760 }
00761
00762
00763 ResizeManager::ResizeManager(HWND hwnd)
00764  :      _hwnd(hwnd)
00765 {
00766         ClientRect clnt(hwnd);
00767         _last_size.cx = clnt.right;
00768         _last_size.cy = clnt.bottom;
00769
00770         WindowRect rect(hwnd);
00771         _min_wnd_size.cx = rect.right - rect.left;
00772         _min_wnd_size.cy = rect.bottom - rect.top;
00773 }
00774
00775 void ResizeManager::HandleSize(int cx, int cy)
00776 {
00777         ClientRect clnt_rect(_hwnd);
00778         SIZE new_size = {cx, cy};
00779
00780         int dx = new_size.cx - _last_size.cx;
00781         int dy = new_size.cy - _last_size.cy;
00782
00783         if (!dx && !dy)
00784                 return;
00785
00786         _last_size = new_size;
00787
00788         HDWP hDWP = BeginDeferWindowPos(size());
00789
00790         for(ResizeManager::const_iterator it=begin(); it!=end(); ++it) {
00791                 const ResizeEntry& e = *it;
00792                 RECT move = {0};
00793
00794                 if (e._flags & MOVE_LEFT)
00795                         move.left += dx;
00796
00797                 if (e._flags & MOVE_RIGHT)
00798                         move.right += dx;
00799
00800                 if (e._flags & MOVE_TOP)
00801                         move.top += dy;
00802
00803                 if (e._flags & MOVE_BOTTOM)
00804                         move.bottom += dy;
00805
00806                 UINT flags = 0;
00807
00808                 if (!move.left && !move.top)
00809                         flags = SWP_NOMOVE;
00810
00811                 if (move.right==move.left && move.bottom==move.top)
00812                         flags |= SWP_NOSIZE;
00813
00814                 if (flags != (SWP_NOMOVE|SWP_NOSIZE)) {
00815                         HWND hwnd = GetDlgItem(_hwnd, e._id);
00816
00817                         if (hwnd) {
00818                                 WindowRect rect(hwnd);
00819                                 ScreenToClient(_hwnd, rect);
00820
00821                                 rect.left       += move.left;
00822                                 rect.right      += move.right;
00823                                 rect.top        += move.top;
00824                                 rect.bottom     += move.bottom;
00825
00826                                 hDWP = DeferWindowPos(hDWP, hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, flags|SWP_NOACTIVATE|SWP_NOZORDER);
00827                         }
00828                 }
00829         }
00830
00831         EndDeferWindowPos(hDWP);
00832 }
00833
00834 void ResizeManager::Resize(int dx, int dy)
00835 {
00836         ::SetWindowPos(_hwnd, 0, 0, 0, _min_wnd_size.cx+dx, _min_wnd_size.cy+dy, SWP_NOMOVE|SWP_NOACTIVATE);
00837         MoveVisible(_hwnd);
00838
00839         ClientRect clnt_rect(_hwnd);
00840         HandleSize(clnt_rect.right, clnt_rect.bottom);
00841 }
00842
00843
00844 Button::Button(HWND parent, LPCTSTR title, int left, int top, int width, int height,
00845                                 int id, DWORD flags, DWORD exStyle)
00846  :      WindowHandle(CreateWindowEx(exStyle, TEXT("BUTTON"), title, flags, left, top, width, height,
00847                                                         parent, (HMENU)id, g_Globals._hInstance, 0))
00848 {
00849 }
00850
00851
00852 LRESULT OwnerdrawnButton::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00853 {
00854         if (nmsg == PM_DISPATCH_DRAWITEM) {
00855                 DrawItem((LPDRAWITEMSTRUCT)lparam);
00856                 return TRUE;
00857         } else
00858                 return super::WndProc(nmsg, wparam, lparam);
00859 }
00860
00861
00862 Static::Static(HWND parent, LPCTSTR title, int left, int top, int width, int height,
00863                                 int id, DWORD flags, DWORD exStyle)
00864  :      WindowHandle(CreateWindowEx(exStyle, TEXT("STATIC"), title, flags, left, top, width, height,
00865                                                         parent, (HMENU)id, g_Globals._hInstance, 0))
00866 {
00867 }
00868
00869
00870 static RECT s_MyDrawText_Rect = {0, 0, 0, 0};
00871
00872 static BOOL CALLBACK MyDrawText(HDC hdc, LPARAM data, int cnt)
00873 {
00874         ::DrawText(hdc, (LPCTSTR)data, cnt, &s_MyDrawText_Rect, DT_SINGLELINE);
00875         return TRUE;
00876 }
00877
00878 void DrawGrayText(HDC hdc, LPRECT pRect, LPCTSTR title, int dt_flags)
00879 {
00880         COLORREF gray = GetSysColor(COLOR_GRAYTEXT);
00881
00882         if (gray) {
00883                 TextColor lcColor(hdc, GetSysColor(COLOR_BTNHIGHLIGHT));
00884                 RECT shadowRect = {pRect->left+1, pRect->top+1, pRect->right+1, pRect->bottom+1};
00885                 DrawText(hdc, title, -1, &shadowRect, dt_flags);
00886
00887                 SetTextColor(hdc, gray);
00888                 DrawText(hdc, title, -1, pRect, dt_flags);
00889         } else {
00890                 int old_r = pRect->right;
00891                 int old_b = pRect->bottom;
00892
00893                 DrawText(hdc, title, -1, pRect, dt_flags|DT_CALCRECT);
00894
00895                 int x = pRect->left + (old_r-pRect->right)/2;
00896                 int y = pRect->top + (old_b-pRect->bottom)/2;
00897                 int w = pRect->right-pRect->left;
00898                 int h = pRect->bottom-pRect->top;
00899                 s_MyDrawText_Rect.right = w;
00900                 s_MyDrawText_Rect.bottom = h;
00901
00902                 GrayString(hdc, GetSysColorBrush(COLOR_GRAYTEXT), MyDrawText, (LPARAM)title, -1, x, y, w, h);
00903         }
00904 }
00905
00906
00907 /* not yet used
00908 void ColorButton::DrawItem(LPDRAWITEMSTRUCT dis)
00909 {
00910         UINT state = DFCS_BUTTONPUSH;
00911
00912         if (dis->itemState & ODS_DISABLED)
00913                 state |= DFCS_INACTIVE;
00914
00915         RECT textRect = {dis->rcItem.left+2, dis->rcItem.top+2, dis->rcItem.right-4, dis->rcItem.bottom-4};
00916
00917         if (dis->itemState & ODS_SELECTED) {
00918                 state |= DFCS_PUSHED;
00919                 ++textRect.left;        ++textRect.top;
00920                 ++textRect.right;       ++textRect.bottom;
00921         }
00922
00923         DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, state);
00924
00925         TCHAR title[BUFFER_LEN];
00926         GetWindowText(_hwnd, title, BUFFER_LEN);
00927
00928         BkMode bk_mode(dis->hDC, TRANSPARENT);
00929
00930         if (dis->itemState & (ODS_DISABLED|ODS_GRAYED))
00931                 DrawGrayText(dis, &textRect, title, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
00932         else {
00933                 TextColor lcColor(dis->hDC, _textColor);
00934                 DrawText(dis->hDC, title, -1, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
00935         }
00936
00937         if (dis->itemState & ODS_FOCUS) {
00938                 RECT rect = {
00939                         dis->rcItem.left+3, dis->rcItem.top+3,
00940                         dis->rcItem.right-dis->rcItem.left-4, dis->rcItem.bottom-dis->rcItem.top-4
00941                 };
00942                 if (dis->itemState & ODS_SELECTED) {
00943                         ++rect.left;    ++rect.top;
00944                         ++rect.right;   ++rect.bottom;
00945                 }
00946                 DrawFocusRect(dis->hDC, &rect);
00947         }
00948 }
00949 */
00950
00951
00952 void PictureButton::DrawItem(LPDRAWITEMSTRUCT dis)
00953 {
00954         UINT state = DFCS_BUTTONPUSH;
00955         int style = GetWindowStyle(_hwnd);
00956
00957         if (dis->itemState & ODS_DISABLED)
00958                 state |= DFCS_INACTIVE;
00959
00960         POINT imagePos;
00961         RECT textRect;
00962         int dt_flags;
00963
00964         if (style & BS_BOTTOM) {
00965                  // align horizontal centered, vertical floating
00966                 imagePos.x = (dis->rcItem.left + dis->rcItem.right - _cx) / 2;
00967                 imagePos.y = dis->rcItem.top + 3;
00968
00969                 textRect.left = dis->rcItem.left + 2;
00970                 textRect.top = dis->rcItem.top + _cy + 4;
00971                 textRect.right = dis->rcItem.right - 4;
00972                 textRect.bottom = dis->rcItem.bottom - 4;
00973
00974                 dt_flags = DT_SINGLELINE|DT_CENTER|DT_VCENTER;
00975         } else {
00976                  // horizontal floating, vertical centered
00977                 imagePos.x = dis->rcItem.left + 3;
00978                 imagePos.y = (dis->rcItem.top + dis->rcItem.bottom - _cy)/2;
00979
00980                 textRect.left = dis->rcItem.left + _cx + 4;
00981                 textRect.top = dis->rcItem.top + 2;
00982                 textRect.right = dis->rcItem.right - 4;
00983                 textRect.bottom = dis->rcItem.bottom - 4;
00984
00985                 dt_flags = DT_SINGLELINE|DT_VCENTER/*|DT_CENTER*/;
00986         }
00987
00988         if (dis->itemState & ODS_SELECTED) {
00989                 state |= DFCS_PUSHED;
00990                 ++imagePos.x;           ++imagePos.y;
00991                 ++textRect.left;        ++textRect.top;
00992                 ++textRect.right;       ++textRect.bottom;
00993         }
00994
00995         if (_flat) {
00996                 FillRect(dis->hDC, &dis->rcItem, _hBrush);
00997
00998                 if (style & BS_FLAT)    // Only with BS_FLAT set, there will be drawn a frame without highlight.
00999                         DrawEdge(dis->hDC, &dis->rcItem, EDGE_RAISED, BF_RECT|BF_FLAT);
01000         } else
01001                 DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, state);
01002
01003         if (_hIcon)
01004                 DrawIconEx(dis->hDC, imagePos.x, imagePos.y, _hIcon, _cx, _cy, 0, _hBrush, DI_NORMAL);
01005         else {
01006                 MemCanvas mem_dc;
01007                 BitmapSelection sel(mem_dc, _hBmp);
01008                 BitBlt(dis->hDC, imagePos.x, imagePos.y, _cx, _cy, mem_dc, 0, 0, SRCCOPY);
01009         }
01010
01011         TCHAR title[BUFFER_LEN];
01012         GetWindowText(_hwnd, title, BUFFER_LEN);
01013
01014         BkMode bk_mode(dis->hDC, TRANSPARENT);
01015
01016         if (dis->itemState & (ODS_DISABLED|ODS_GRAYED))
01017                 DrawGrayText(dis->hDC, &textRect, title, dt_flags);
01018         else {
01019                 TextColor lcColor(dis->hDC, GetSysColor(COLOR_BTNTEXT));
01020                 DrawText(dis->hDC, title, -1, &textRect, dt_flags);
01021         }
01022
01023         if (dis->itemState & ODS_FOCUS) {
01024                 RECT rect = {
01025                         dis->rcItem.left+3, dis->rcItem.top+3,
01026                         dis->rcItem.right-dis->rcItem.left-4, dis->rcItem.bottom-dis->rcItem.top-4
01027                 };
01028                 if (dis->itemState & ODS_SELECTED) {
01029                         ++rect.left;    ++rect.top;
01030                         ++rect.right;   ++rect.bottom;
01031                 }
01032                 DrawFocusRect(dis->hDC, &rect);
01033         }
01034 }
01035
01036
01037 void FlatButton::DrawItem(LPDRAWITEMSTRUCT dis)
01038 {
01039         UINT style = DFCS_BUTTONPUSH;
01040
01041         if (dis->itemState & ODS_DISABLED)
01042                 style |= DFCS_INACTIVE;
01043
01044         RECT textRect = {dis->rcItem.left+2, dis->rcItem.top+2, dis->rcItem.right-4, dis->rcItem.bottom-4};
01045
01046         if (dis->itemState & ODS_SELECTED) {
01047                 style |= DFCS_PUSHED;
01048                 ++textRect.left;        ++textRect.top;
01049                 ++textRect.right;       ++textRect.bottom;
01050         }
01051
01052         FillRect(dis->hDC, &dis->rcItem, GetSysColorBrush(COLOR_BTNFACE));
01053
01054          // highlight the button?
01055         if (_active)
01056                 DrawEdge(dis->hDC, &dis->rcItem, EDGE_ETCHED, BF_RECT);
01057         else if (GetWindowStyle(_hwnd) & BS_FLAT)       // Only with BS_FLAT there will be drawn a frame to show highlighting.
01058                 DrawEdge(dis->hDC, &dis->rcItem, EDGE_RAISED, BF_RECT|BF_FLAT);
01059
01060         TCHAR txt[BUFFER_LEN];
01061         int txt_len = GetWindowText(_hwnd, txt, BUFFER_LEN);
01062
01063         if (dis->itemState & (ODS_DISABLED|ODS_GRAYED)) {
01064                 COLORREF gray = GetSysColor(COLOR_GRAYTEXT);
01065
01066                 if (gray) {
01067                         {
01068                         TextColor lcColor(dis->hDC, GetSysColor(COLOR_BTNHIGHLIGHT));
01069                         RECT shadowRect = {textRect.left+1, textRect.top+1, textRect.right+1, textRect.bottom+1};
01070                         DrawText(dis->hDC, txt, txt_len, &shadowRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
01071                         }
01072
01073                         BkMode mode(dis->hDC, TRANSPARENT);
01074                         TextColor lcColor(dis->hDC, gray);
01075                         DrawText(dis->hDC, txt, txt_len, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
01076                 } else {
01077                         int old_r = textRect.right;
01078                         int old_b = textRect.bottom;
01079                         DrawText(dis->hDC, txt, txt_len, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER|DT_CALCRECT);
01080                         int x = textRect.left + (old_r-textRect.right)/2;
01081                         int y = textRect.top + (old_b-textRect.bottom)/2;
01082                         int w = textRect.right-textRect.left;
01083                         int h = textRect.bottom-textRect.top;
01084                         s_MyDrawText_Rect.right = w;
01085                         s_MyDrawText_Rect.bottom = h;
01086                         GrayString(dis->hDC, GetSysColorBrush(COLOR_GRAYTEXT), MyDrawText, (LPARAM)txt, txt_len, x, y, w, h);
01087                 }
01088         } else {
01089                 TextColor lcColor(dis->hDC, _active? _activeColor: _textColor);
01090                 DrawText(dis->hDC, txt, txt_len, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
01091         }
01092
01093         if (dis->itemState & ODS_FOCUS) {
01094                 RECT rect = {
01095                         dis->rcItem.left+3, dis->rcItem.top+3,
01096                         dis->rcItem.right-dis->rcItem.left-4, dis->rcItem.bottom-dis->rcItem.top-4
01097                 };
01098                 if (dis->itemState & ODS_SELECTED) {
01099                         ++rect.left;    ++rect.top;
01100                         ++rect.right;   ++rect.bottom;
01101                 }
01102                 DrawFocusRect(dis->hDC, &rect);
01103         }
01104 }
01105
01106 LRESULT FlatButton::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
01107 {
01108         switch(nmsg) {
01109           case WM_MOUSEMOVE: {
01110                 bool active = false;
01111
01112                 if (IsWindowEnabled(_hwnd)) {
01113                         DWORD pid_foreground;
01114                         HWND hwnd_foreground = GetForegroundWindow();   //@@ may be better look for WM_ACTIVATEAPP ?
01115                         GetWindowThreadProcessId(hwnd_foreground, &pid_foreground);
01116
01117                         if (GetCurrentProcessId() == pid_foreground) {
01118                                 POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)};
01119                                 ClientRect clntRect(_hwnd);
01120
01121                                  // highlight the button?
01122                                 if (pt.x>=clntRect.left && pt.x<clntRect.right && pt.y>=clntRect.top && pt.y<clntRect.bottom)
01123                                         active = true;
01124                         }
01125                 }
01126
01127                 if (active != _active) {
01128                         _active = active;
01129
01130                         if (active) {
01131                                 TRACKMOUSEEVENT tme = {sizeof(tme), /*TME_HOVER|*/TME_LEAVE, _hwnd/*, HOVER_DEFAULT*/};
01132                                 _TrackMouseEvent(&tme);
01133                         }
01134
01135                         InvalidateRect(_hwnd, NULL, TRUE);
01136                 }
01137
01138                 return 0;}
01139
01140           case WM_LBUTTONUP: {
01141                 POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)};
01142                 ClientRect clntRect(_hwnd);
01143
01144                  // no more in the active rectangle?
01145                 if (pt.x<clntRect.left || pt.x>=clntRect.right || pt.y<clntRect.top || pt.y>=clntRect.bottom)
01146                         goto cancel_press;
01147
01148                 goto def;}
01149
01150           case WM_CANCELMODE:
01151           cancel_press: {
01152                 TRACKMOUSEEVENT tme = {sizeof(tme), /*TME_HOVER|*/TME_LEAVE|TME_CANCEL, _hwnd/*, HOVER_DEFAULT*/};
01153                 _TrackMouseEvent(&tme);
01154                 _active = false;
01155                 ReleaseCapture();}
01156                 // fall through
01157
01158           case WM_MOUSELEAVE:
01159                 if (_active) {
01160                         _active = false;
01161
01162                         InvalidateRect(_hwnd, NULL, TRUE);
01163                 }
01164
01165                 return 0;
01166
01167           default: def:
01168                 return super::WndProc(nmsg, wparam, lparam);
01169         }
01170 }
01171
01172
01173 HyperlinkCtrl::HyperlinkCtrl(HWND hwnd, COLORREF colorLink, COLORREF colorVisited)
01174  :      super(hwnd),
01175         _cmd(ResString(GetDlgCtrlID(hwnd))),
01176         _textColor(colorLink),
01177         _colorVisited(colorVisited),
01178         _hfont(0),
01179         _crsr_link(0)
01180 {
01181         init();
01182 }
01183
01184 HyperlinkCtrl::HyperlinkCtrl(HWND owner, int id, COLORREF colorLink, COLORREF colorVisited)
01185  :      super(GetDlgItem(owner, id)),
01186         _cmd(ResString(id)),
01187         _textColor(colorLink),
01188         _colorVisited(colorVisited),
01189         _hfont(0),
01190         _crsr_link(0)
01191 {
01192         init();
01193 }
01194
01195 void HyperlinkCtrl::init()
01196 {
01197         if (_cmd.empty()) {
01198                 TCHAR txt[BUFFER_LEN];
01199                 _cmd.assign(txt, GetWindowText(_hwnd, txt, BUFFER_LEN));
01200         }
01201 }
01202
01203 HyperlinkCtrl::~HyperlinkCtrl()
01204 {
01205         if (_hfont)
01206                 DeleteObject(_hfont);
01207 }
01208
01209 LRESULT HyperlinkCtrl::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
01210 {
01211         switch(nmsg) {
01212           case PM_DISPATCH_CTLCOLOR: {
01213                 if (!_hfont) {
01214                         HFONT hfont = (HFONT) SendMessage(_hwnd, WM_GETFONT, 0, 0);
01215                         LOGFONT lf; GetObject(hfont, sizeof(lf), &lf);
01216                         lf.lfUnderline = TRUE;
01217                         _hfont = CreateFontIndirect(&lf);
01218                 }
01219
01220                 HDC hdc = (HDC) wparam;
01221                 SetTextColor(hdc, _textColor);  //@@
01222                 SelectFont(hdc, _hfont);
01223                 SetBkMode(hdc, TRANSPARENT);
01224                 return (LRESULT)GetStockObject(HOLLOW_BRUSH);
01225           }
01226
01227           case WM_SETCURSOR:
01228                 if (!_crsr_link)
01229                         _crsr_link = LoadCursor(0, IDC_HAND);
01230
01231                 if (_crsr_link)
01232                         SetCursor(_crsr_link);
01233                 return 0;
01234
01235           case WM_NCHITTEST:
01236                 return HTCLIENT;        // Aktivierung von Maus-Botschaften
01237
01238           case WM_LBUTTONDOWN:
01239                 if (LaunchLink()) {
01240                         _textColor = _colorVisited;
01241                         InvalidateRect(_hwnd, NULL, FALSE);
01242                 } else
01243                         MessageBeep(0);
01244                 return 0;
01245
01246           default:
01247                 return super::WndProc(nmsg, wparam, lparam);
01248         }
01249 }
01250
01251
01252 ToolTip::ToolTip(HWND owner)
01253  :      super(CreateWindowEx(WS_EX_TOPMOST|WS_EX_NOPARENTNOTIFY, TOOLTIPS_CLASS, 0,
01254                                  WS_POPUP|TTS_NOPREFIX|TTS_ALWAYSTIP, CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
01255                                  owner, 0, g_Globals._hInstance, 0))
01256 {
01257         activate();
01258 }
01259
01260
01261 ListSort::ListSort(HWND hwndListview, PFNLVCOMPARE compare_fct)
01262  :      WindowHandle(hwndListview),
01263         _compare_fct(compare_fct)
01264 {
01265         _sort_crit = 0;
01266         _direction = false;
01267 }
01268
01269 void ListSort::toggle_sort(int idx)
01270 {
01271         if (_sort_crit == idx)
01272                 _direction = !_direction;
01273         else {
01274                 _sort_crit = idx;
01275                 _direction = false;
01276         }
01277 }
01278
01279 void ListSort::sort()
01280 {
01281         int idx = ListView_GetSelectionMark(_hwnd);
01282         LPARAM param = ListView_GetItemData(_hwnd, idx);
01283
01284         ListView_SortItems(_hwnd, _compare_fct, (LPARAM)this);
01285
01286         if (idx >= 0) {
01287                 idx = ListView_FindItemPara(_hwnd, param);
01288                 ListView_EnsureVisible(_hwnd, idx, FALSE);
01289         }
01290 }
01291
01292
01293 PropSheetPage::PropSheetPage(UINT nid, Window::CREATORFUNC dlg_creator)
01294  :      _dlg_creator(dlg_creator)
01295 {
01296         PROPSHEETPAGE::dwSize           = sizeof(PROPSHEETPAGE);
01297         PROPSHEETPAGE::dwFlags          = 0;
01298         PROPSHEETPAGE::hInstance        = g_Globals._hInstance;
01299         PROPSHEETPAGE::pszTemplate      = MAKEINTRESOURCE(nid);
01300         PROPSHEETPAGE::pfnDlgProc       = PropSheetPageDlg::DialogProc;
01301         PROPSHEETPAGE::lParam           = (LPARAM) this;
01302 }
01303
01304
01305 #ifndef PSM_GETRESULT   // currently (as of 18.01.2004) missing in MinGW headers
01306 #define PSM_GETRESULT                           (WM_USER + 135)
01307 #define PropSheet_GetResult(hDlg)       SNDMSG(hDlg, PSM_GETRESULT, 0, 0)
01308 #endif
01309
01310
01311 PropertySheetDialog::PropertySheetDialog(HWND owner)
01312  :      _hwnd(0)
01313 {
01314         PROPSHEETHEADER::dwSize = sizeof(PROPSHEETHEADER);
01315         PROPSHEETHEADER::dwFlags = PSH_PROPSHEETPAGE | PSH_MODELESS;
01316         PROPSHEETHEADER::hwndParent = owner;
01317         PROPSHEETHEADER::hInstance = g_Globals._hInstance;
01318 }
01319
01320 void PropertySheetDialog::add(PropSheetPage& psp)
01321 {
01322         _pages.push_back(psp);
01323 }
01324
01325 int     PropertySheetDialog::DoModal(int start_page)
01326 {
01327         PROPSHEETHEADER::ppsp = (LPCPROPSHEETPAGE) &_pages[0];
01328         PROPSHEETHEADER::nPages = _pages.size();
01329         PROPSHEETHEADER::nStartPage = start_page;
01330 /*
01331         Window* pwnd = Window::create_property_sheet(this, WINDOW_CREATOR(PropertySheetDlg), NULL);
01332         if (!pwnd)
01333                 return -1;
01334
01335         HWND hwndPropSheet = *pwnd;
01336 */
01337         int ret = PropertySheet(this);
01338         if (ret == -1)
01339                 return -1;
01340
01341         HWND hwndPropSheet = (HWND) ret;
01342         HWND hwndparent = GetParent(hwndPropSheet);
01343
01344         if (hwndparent)
01345                 EnableWindow(hwndparent, FALSE);
01346
01347         ret = 0;
01348         MSG msg;
01349
01350         while(GetMessage(&msg, 0, 0, 0)) {
01351                 try {
01352                         if (Window::pretranslate_msg(&msg))
01353                                 continue;
01354
01355                         if (PropSheet_IsDialogMessage(hwndPropSheet, &msg))
01356                                 continue;
01357
01358                         if (Window::dispatch_dialog_msg(&msg))
01359                                 continue;
01360
01361                         TranslateMessage(&msg);
01362
01363                         try {
01364                                 DispatchMessage(&msg);
01365                         } catch(COMException& e) {
01366                                 HandleException(e, 0);
01367                         }
01368
01369                         if (!PropSheet_GetCurrentPageHwnd(hwndPropSheet)) {
01370                                 ret = PropSheet_GetResult(hwndPropSheet);
01371                                 break;
01372                         }
01373                 } catch(COMException& e) {
01374                         HandleException(e, 0);
01375                 }
01376         }
01377
01378         if (hwndparent)
01379                 EnableWindow(hwndparent, TRUE);
01380
01381         DestroyWindow(hwndPropSheet);
01382
01383         return ret;
01384 }
01385
01386 HWND PropertySheetDialog::GetCurrentPage()
01387 {
01388         HWND hdlg = PropSheet_GetCurrentPageHwnd(_hwnd);
01389         return hdlg;
01390 }
01391
01392
01393 PropSheetPageDlg::PropSheetPageDlg(HWND hwnd)
01394  :      super(hwnd)
01395 {
01396 }
01397
01398 INT_PTR CALLBACK PropSheetPageDlg::DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
01399 {
01400         PropSheetPageDlg* pThis = GET_WINDOW(PropSheetPageDlg, hwnd);
01401
01402         if (pThis) {
01403                 switch(nmsg) {
01404                   case WM_COMMAND:
01405                         pThis->Command(LOWORD(wparam), HIWORD(wparam));
01406                         return TRUE;    // message has been processed
01407
01408                   case WM_NOTIFY:
01409                         pThis->Notify(wparam, (NMHDR*)lparam);
01410                         return TRUE;    // message has been processed
01411
01412                   case WM_NOTIFYFORMAT:
01413                         SetWindowLong(hwnd, DWLP_MSGRESULT, NFR_CURRENT);       // set return value NFR_CURRENT
01414                         return TRUE;    // message has been processed
01415
01416                   case WM_NCDESTROY:
01417                         delete pThis;
01418                         return TRUE;    // message has been processed
01419
01420                   default:
01421                         return pThis->WndProc(nmsg, wparam, lparam);
01422                 }
01423         } else if (nmsg == WM_INITDIALOG) {
01424                 PROPSHEETPAGE* psp = (PROPSHEETPAGE*) lparam;
01425                 PropSheetPage* ppsp = (PropSheetPage*) psp->lParam;
01426
01427                 if (ppsp->_dlg_creator) {
01428                         pThis = static_cast<PropSheetPageDlg*>(ppsp->_dlg_creator(hwnd));
01429
01430                         if (pThis)
01431                                 return pThis->Init(NULL);
01432                 }
01433         }
01434
01435         return FALSE;   // message has not been processed
01436 }
01437
01438 int PropSheetPageDlg::Command(int id, int code)
01439 {
01440         // override call to EndDialog in Dialog::Command();
01441
01442         return FALSE;
01443 }


ROS Explorer: window.h File Reference

  • File List
  • File Members
utility

window.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | ChildWndInfo
information structure for creation of a MDI child window More...
struct | Window
Class Window is the base class for several C++ window wrapper classes. More...
struct | Window::StaticWindowData
structure for managing critical sections as static class information in struct Window More...
struct | TypeCheck< CLASS >
dynamic casting of Window pointers More...
struct | SubclassedWindow
SubclassedWindow is used to wrap already existing window handles into C++ Window objects. More...
struct | WindowCreator< WND_CLASS >
template class used in macro WINDOW_CREATOR to define the creater functions for Window objects More...
struct | WindowCreatorInfo< WND_CLASS, INFO_CLASS >
template class used in macro WINDOW_CREATOR_INFO to the define creater functions for Window objects with additional creation information More...
struct | WindowClass
WindowClass is a neat wrapper for RegisterClassEx(). More...
struct | BtnWindowClass
window class with gray background color More...
struct | IconWindowClass
window class with specified icon from resources More...
struct | MenuInfo
menu info structure More...
struct | ChildWindow
Class ChildWindow represents MDI child windows. More...
struct | PreTranslateWindow
PreTranslateWindow is used to register windows to be called by Window::pretranslate_msg(). More...
struct | DialogWindow
The class DialogWindow implements modeless dialogs, which are managed by Window::dispatch_dialog_msg() in Window::MessageLoop(). More...
struct | Dialog
The class Dialog implements modal dialogs. More...
struct | PropSheetPage
struct | PropertySheetDialog
Property Sheet dialog. More...
struct | PropSheetPageDlg
Property Sheet Page (inner dialog). More...
struct | ResizeEntry
structure to assign RESIZE_FLAGS to dialogs control More...
struct | ResizeManager
Management of controls in resizable dialogs. More...
struct | ResizeController< BASE >
Controller base template class for resizable dialogs. More...
struct | Button
This class constructs button controls. More...
struct | Static
This class constructs static controls. More...
struct | CtlColorParent< BASE >
struct | OwnerDrawParent< BASE >
draw message routing for ColorButton and PictureButton More...
struct | OwnerdrawnButton
Subclass button controls to draw them by using PM_DISPATCH_DRAWITEM The owning window should use the OwnerDrawParent template to route owner draw messages to the buttons. More...
struct | FlatButton
Subclass button controls to paint colored text labels. More...
struct | PictureButton
Subclass button controls to paint pictures left to the labels. More...
struct | ColorStatic
struct | HyperlinkCtrl
Hyperlink Controls. More...
struct | ToolTip
encapsulation of tool tip controls More...
struct | ListSort
sorting of list controls More...
struct | TrayIcon
struct | TrayIconControllerTemplate< BASE >
struct | EditController

Defines

#define | GET_WINDOW(CLASS, hwnd) Window::get_window<CLASS>(hwnd)
#define | NFR_CURRENT NFR_ANSI
#define | WINDOW_DYNAMIC_CAST(CLASS, hwnd) TypeCheck<CLASS>::dyn_cast(Window::get_window(hwnd))
#define | WINDOW_CREATOR(WND_CLASS) ((Window::CREATORFUNC) WindowCreator<WND_CLASS>::window_creator)
#define | WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS) ((Window::CREATORFUNC_INFO) WindowCreatorInfo<WND_CLASS, INFO_CLASS>::window_creator)
#define | PM_DISPATCH_COMMAND (WM_APP+0x00)
#define | PM_TRANSLATE_MSG (WM_APP+0x01)
#define | SPLIT_WIDTH 5
#define | DEFAULT_SPLIT_POS 300
#define | COLOR_SPLITBAR LTGRAY_BRUSH
#define | PM_FRM_GET_MENUINFO (WM_APP+0x02)
#define | Frame_GetMenuInfo(hwnd) ((MenuInfo*)SNDMSG(hwnd, PM_FRM_GET_MENUINFO, 0, 0))
#define | PM_SETSTATUSTEXT (WM_APP+0x1E)
#define | PM_FRM_CALC_CLIENT (WM_APP+0x03)
#define | Frame_CalcFrameClient(hwnd, prt) ((BOOL)SNDMSG(hwnd, PM_FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt))
#define | PM_JUMP_TO_URL (WM_APP+0x25)
#define | PM_URL_CHANGED (WM_APP+0x26)
#define | PM_DISPATCH_CTLCOLOR (WM_APP+0x08)
#define | PM_DISPATCH_DRAWITEM (WM_APP+0x09)
#define | PM_TRAYICON (WM_APP+0x20)
#define | WINMSG_TASKBARCREATED TEXT("TaskbarCreated")
#define | WINMSG_SHELLHOOK TEXT("SHELLHOOK")

Typedefs

typedef set< HWND > | WindowSet

Enumerations

enum RESIZE_FLAGS {
MOVE_LEFT = 0x1, MOVE_RIGHT = 0x2, MOVE_TOP = 0x4, MOVE_BOTTOM = 0x8,
MOVE_X = MOVE_LEFT | MOVE_RIGHT, MOVE_Y = MOVE_TOP | MOVE_BOTTOM, RESIZE_X = MOVE_RIGHT, RESIZE_Y = MOVE_BOTTOM,
MOVE = MOVE_X | MOVE_Y, RESIZE = RESIZE_X | RESIZE_Y
}
Flags to specify how to move and resize controls when resizing their parent window. More...
enum | { TRAYBUTTON_LEFT = 0, TRAYBUTTON_RIGHT, TRAYBUTTON_MIDDLE }

Functions

void | DrawGrayText (HDC hdc, LPRECT pRect, LPCTSTR text, int dt_flags)
int | ListView_GetItemData (HWND list_ctrl, int idx)
int | ListView_FindItemPara (HWND list_ctrl, LPARAM param)
int | ListView_GetFocusedItem (HWND list_ctrl)
LPARAM | TreeView_GetItemData (HWND hwndTreeView, HTREEITEM hItem)

Define Documentation

#define COLOR_SPLITBAR LTGRAY_BRUSH

Definition at line 271 of file window.h.

Referenced by ChildWindow::WndProc(), and SDIMainFrame::WndProc().

#define DEFAULT_SPLIT_POS 300

Definition at line 270 of file window.h.

Referenced by ChildWindow::ChildWindow(), SDIMainFrame::SDIMainFrame(), MDIShellBrowserChild::update_shell_browser(), and SDIMainFrame::update_shell_browser().

#define Frame_CalcFrameClient | ( | hwnd,
 |  | prt | ) | ((BOOL)SNDMSG(hwnd, PM_FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt))

Definition at line 387 of file window.h.

Referenced by MainFrameBase::fullscreen_move(), and MainFrameBase::toggle_fullscreen().

#define Frame_GetMenuInfo ( hwnd ) ((MenuInfo*)SNDMSG(hwnd, PM_FRM_GET_MENUINFO, 0, 0))

Definition at line 282 of file window.h.

Referenced by Pane::command().

#define GET_WINDOW | ( | CLASS,
 |  | hwnd | ) | Window::get_window<CLASS>(hwnd)

Definition at line 88 of file window.h.

Referenced by SDIMainFrame::Create(), MDIMainFrame::Create(), DesktopWindow::Create(), PropSheetPageDlg::DialogProc(), DesktopBar::Init(), DesktopBar::ProcessCopyData(), SubclassedWindow::SubclassedWndProc(), NotifyArea::WndProc(), and MDIMainFrame::WndProc().

#define NFR_CURRENT NFR_ANSI

Definition at line 144 of file window.h.

Referenced by PropSheetPageDlg::DialogProc(), Window::DialogProc(), SubclassedWindow::SubclassedWndProc(), and Window::WindowWndProc().

#define PM_DISPATCH_COMMAND (WM_APP+0x00)

Definition at line 265 of file window.h.

Referenced by MDIMainFrame::Command(), and WebChildWindow::WndProc().

#define PM_DISPATCH_CTLCOLOR (WM_APP+0x08)

Definition at line 592 of file window.h.

Referenced by ColorStatic::WndProc(), and CtlColorParent< OwnerDrawParent< Dialog > >::WndProc().

#define PM_DISPATCH_DRAWITEM (WM_APP+0x09)

Definition at line 620 of file window.h.

Referenced by OwnerDrawParent< Dialog >::WndProc(), and OwnerdrawnButton::WndProc().

#define PM_FRM_CALC_CLIENT (WM_APP+0x03)

Definition at line 386 of file window.h.

Referenced by MainFrameBase::ProcessMessage().

#define PM_FRM_GET_MENUINFO (WM_APP+0x02)

Definition at line 280 of file window.h.

Referenced by MainFrameBase::ProcessMessage().

#define PM_JUMP_TO_URL (WM_APP+0x25)

Definition at line 389 of file window.h.

Referenced by MDIMainFrame::go_to().

#define PM_SETSTATUSTEXT (WM_APP+0x1E)

Definition at line 325 of file window.h.

Referenced by MainFrameBase::ProcessMessage(), and WebChildWindow::StatusTextChange().

#define PM_TRANSLATE_MSG (WM_APP+0x01)

Definition at line 266 of file window.h.

Referenced by Window::pretranslate_msg(), and FindProgramDlg::WndProc().

#define PM_TRAYICON (WM_APP+0x20)

Definition at line 983 of file window.h.

Referenced by TrayIcon::Set(), and TrayIconControllerTemplate< BASE >::WndProc().

#define PM_URL_CHANGED (WM_APP+0x26)

Definition at line 390 of file window.h.

Referenced by MainFrameBase::ProcessMessage(), and ChildWindow::set_url().

#define SPLIT_WIDTH 5

Definition at line 269 of file window.h.

Referenced by ChildWindow::resize_children(), SDIMainFrame::resize_children(), FileChildWindow::resize_children(), ChildWindow::WndProc(), and SDIMainFrame::WndProc().

#define WINDOW_CREATOR ( WND_CLASS ) ((Window::CREATORFUNC) WindowCreator<WND_CLASS>::window_creator)

Definition at line 202 of file window.h.

Referenced by NotifyArea::Command(), StartMenuHandler::Command(), TaskbarSettingsDlg::Command(), MainFrameBase::Command(), ClockWindow::Create(), NotifyArea::Create(), TaskBar::Create(), StartMenuRoot::Create(), SDIMainFrame::Create(), MDIMainFrame::Create(), DesktopBar::Create(), DesktopWindow::Create(), explorer_about(), explorer_show_frame(), and ExplorerPropertySheet().

#define WINDOW_CREATOR_INFO | ( | WND_CLASS,
 |  | INFO_CLASS | ) | ((Window::CREATORFUNC_INFO) WindowCreatorInfo<WND_CLASS, INFO_CLASS>::window_creator)

Definition at line 215 of file window.h.

Referenced by WebChildWindow::create(), MDIShellBrowserChild::create(), and FileChildWindow::create().

#define WINDOW_DYNAMIC_CAST | ( | CLASS,
 |  | hwnd | ) | TypeCheck<CLASS>::dyn_cast(Window::get_window(hwnd))

Definition at line 166 of file window.h.

Referenced by StartMenuRoot::TrackStartmenu().

#define WINMSG_SHELLHOOK TEXT("SHELLHOOK")

Definition at line 987 of file window.h.

#define WINMSG_TASKBARCREATED TEXT("TaskbarCreated")

Definition at line 985 of file window.h.

Typedef Documentation

typedef set<HWND> WindowSet

Definition at line 29 of file window.h.

Enumeration Type Documentation

anonymous enum

Enumerator:
TRAYBUTTON_LEFT
TRAYBUTTON_RIGHT
TRAYBUTTON_MIDDLE

Definition at line 981 of file window.h.

00981 {TRAYBUTTON_LEFT=0, TRAYBUTTON_RIGHT, TRAYBUTTON_MIDDLE};

enum RESIZE_FLAGS

Flags to specify how to move and resize controls when resizing their parent window.

Enumerator:
MOVE_LEFT
MOVE_RIGHT
MOVE_TOP
MOVE_BOTTOM
MOVE_X
MOVE_Y
RESIZE_X
RESIZE_Y
MOVE
RESIZE

Definition at line 454 of file window.h.

00454                   {
00455         MOVE_LEFT       = 0x1,
00456         MOVE_RIGHT      = 0x2,
00457         MOVE_TOP        = 0x4,
00458         MOVE_BOTTOM     = 0x8,
00459
00460         MOVE_X  =  MOVE_LEFT | MOVE_RIGHT,
00461         MOVE_Y  =  MOVE_TOP | MOVE_BOTTOM,
00462         RESIZE_X=  MOVE_RIGHT,
00463         RESIZE_Y=  MOVE_BOTTOM,
00464
00465         MOVE    = MOVE_X   | MOVE_Y,
00466         RESIZE  = RESIZE_X | RESIZE_Y
00467 };

Function Documentation

void DrawGrayText | ( | HDC | hdc,
 |  | LPRECT | pRect,
 |  | LPCTSTR | text,
 |  | int | dt_flags
 | ) |

Definition at line 878 of file window.cpp.

Referenced by PictureButton::DrawItem().

00879 {
00880         COLORREF gray = GetSysColor(COLOR_GRAYTEXT);
00881
00882         if (gray) {
00883                 TextColor lcColor(hdc, GetSysColor(COLOR_BTNHIGHLIGHT));
00884                 RECT shadowRect = {pRect->left+1, pRect->top+1, pRect->right+1, pRect->bottom+1};
00885                 DrawText(hdc, title, -1, &shadowRect, dt_flags);
00886
00887                 SetTextColor(hdc, gray);
00888                 DrawText(hdc, title, -1, pRect, dt_flags);
00889         } else {
00890                 int old_r = pRect->right;
00891                 int old_b = pRect->bottom;
00892
00893                 DrawText(hdc, title, -1, pRect, dt_flags|DT_CALCRECT);
00894
00895                 int x = pRect->left + (old_r-pRect->right)/2;
00896                 int y = pRect->top + (old_b-pRect->bottom)/2;
00897                 int w = pRect->right-pRect->left;
00898                 int h = pRect->bottom-pRect->top;
00899                 s_MyDrawText_Rect.right = w;
00900                 s_MyDrawText_Rect.bottom = h;
00901
00902                 GrayString(hdc, GetSysColorBrush(COLOR_GRAYTEXT), MyDrawText, (LPARAM)title, -1, x, y, w, h);
00903         }
00904 }

int ListView_FindItemPara | ( | HWND | list_ctrl,
 |  | LPARAM | param
 | ) | [inline]

Definition at line 927 of file window.h.

Referenced by ListSort::sort().

00928 {
00929         LVFINDINFO fi;
00930
00931         fi.flags = LVFI_PARAM;
00932         fi.lParam = param;
00933
00934         return ListView_FindItem(list_ctrl, (unsigned)-1, &fi);
00935 }

int ListView_GetFocusedItem ( HWND list_ctrl ) [inline]

Definition at line 937 of file window.h.

00938 {
00939         int idx = ListView_GetItemCount(list_ctrl);
00940
00941         while(--idx >= 0)
00942                 if (ListView_GetItemState(list_ctrl, idx, LVIS_FOCUSED))
00943                         break;
00944
00945         return idx;
00946 }

int ListView_GetItemData | ( | HWND | list_ctrl,
 |  | int | idx
 | ) | [inline]

Definition at line 914 of file window.h.

Referenced by FindProgramDlg::LaunchSelected(), and ListSort::sort().

00915 {
00916         LV_ITEM item;
00917
00918         item.mask = LVIF_PARAM;
00919         item.iItem = idx;
00920
00921         if (!ListView_GetItem(list_ctrl, &item))
00922                 return 0;
00923
00924         return item.lParam;
00925 }

LPARAM TreeView_GetItemData | ( | HWND | hwndTreeView,
 |  | HTREEITEM | hItem
 | ) | [inline]

Definition at line 967 of file window.h.

Referenced by MainFrameBase::Notify(), ShellBrowser::OnDefaultCommand(), ShellBrowser::OnTreeItemExpanding(), ShellBrowser::OnTreeItemRClick(), ShellBrowser::select_entry(), and TrayNotifyDlg::SetIconMode().

00968 {
00969         TVITEM tvItem;
00970
00971         tvItem.mask = TVIF_PARAM;
00972         tvItem.hItem = hItem;
00973
00974         if (!TreeView_GetItem(hwndTreeView, &tvItem))
00975                 return 0;
00976
00977         return tvItem.lParam;
00978 }


ROS Explorer: window.h Source File

  • File List
  • File Members
utility

window.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004, 2005 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // window.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 typedef set<HWND> WindowSet;
00030
00031
00032  /*
00033         Classes are declared using "struct", not "class" because the default
00034         access mode is "public". This way we can list the member functions in a
00035         natural order without explicitly specifying any access mode at the begin
00036         of the definition.
00037         First are public constructors and destructor, then public member functions.
00038         After that we list protected member varibables and functions. If needed,
00039         private implemenation varibales and functions are positioned at the end.
00040  */
00041
00042
00044 struct ChildWndInfo
00045 {
00046         ChildWndInfo(HWND hmdiclient)
00047          :      _hmdiclient(hmdiclient) {}
00048
00049         HWND    _hmdiclient;
00050 };
00051
00052
00058 struct Window : public WindowHandle
00059 {
00060         Window(HWND hwnd);
00061         virtual ~Window();
00062
00063
00064         typedef map<HWND,Window*> WindowMap;
00065
00066         typedef Window* (*CREATORFUNC)(HWND);
00067         typedef Window* (*CREATORFUNC_INFO)(HWND, const void*);
00068
00069         static HWND Create(CREATORFUNC creator, DWORD dwExStyle,
00070                                 LPCTSTR lpClassName, LPCTSTR lpWindowName,
00071                                 DWORD dwStyle, int x, int y, int w, int h,
00072                                 HWND hwndParent=0, HMENU hMenu=0/*, LPVOID lpParam=0*/);
00073
00074         static HWND Create(CREATORFUNC_INFO creator, const void* info,
00075                                 DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName,
00076                                 DWORD dwStyle, int x, int y, int w, int h,
00077                                 HWND hwndParent=0, HMENU hMenu=0/*, LPVOID lpParam=0*/);
00078
00079         static Window* create_mdi_child(const ChildWndInfo& info, const MDICREATESTRUCT& mcs, CREATORFUNC_INFO creator);
00080 //      static Window* create_property_sheet(struct PropertySheetDialog* ppsd, CREATORFUNC creator, const void* info);
00081
00082         static LRESULT CALLBACK WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
00083         static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
00084
00085         static Window* get_window(HWND hwnd);
00086 #ifndef _MSC_VER
00087         template<typename CLASS> static CLASS* get_window(HWND hwnd) {return static_cast<CLASS*>(get_window(hwnd));}
00088 #define GET_WINDOW(CLASS, hwnd) Window::get_window<CLASS>(hwnd)
00089 #endif
00090
00091         static void register_pretranslate(HWND hwnd);
00092         static void unregister_pretranslate(HWND hwnd);
00093         static BOOL     pretranslate_msg(LPMSG pmsg);
00094
00095         static void     register_dialog(HWND hwnd);
00096         static void     unregister_dialog(HWND hwnd);
00097         static BOOL     dispatch_dialog_msg(LPMSG pmsg);
00098
00099         static int      MessageLoop();
00100
00101
00102         LRESULT SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0);
00103         LRESULT PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0);
00104
00105         static void CancelModes();
00106
00107
00108 protected:
00109         virtual LRESULT Init(LPCREATESTRUCT pcs);                                                       // WM_CREATE processing
00110         virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00111         virtual int             Command(int id, int code);                                                      // WM_COMMAND processing
00112         virtual int             Notify(int id, NMHDR* pnmh);                                            // WM_NOTIFY processing
00113
00114         static Window* create_controller(HWND hwnd);
00115
00116
00117         static WindowMap        s_wnd_map;
00118
00119         static const void*      s_new_info;
00120         static CREATORFUNC      s_window_creator;
00121
00122
00124         struct StaticWindowData {
00125                 CritSect        _map_crit_sect;
00126                 CritSect        _create_crit_sect;
00127         };
00128
00129         static StaticWindowData& GetStaticWindowData();
00130
00131
00132          // MDI child creation
00133         static HHOOK s_hcbtHook;
00134         static LRESULT CALLBACK MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam);
00135         static LRESULT CALLBACK PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam);
00136
00137         static WindowSet s_pretranslate_windows;
00138         static WindowSet s_dialogs;
00139 };
00140
00141 #ifdef UNICODE
00142 #define NFR_CURRENT     NFR_UNICODE
00143 #else
00144 #define NFR_CURRENT     NFR_ANSI
00145 #endif
00146
00147
00148 #ifdef _MSC_VER
00149 template<typename CLASS> struct GetWindowHelper
00150 {
00151         static CLASS* get_window(HWND hwnd) {
00152                 return static_cast<CLASS*>(Window::get_window(hwnd));
00153         }
00154 };
00155 #define GET_WINDOW(CLASS, hwnd) GetWindowHelper<CLASS>::get_window(hwnd)
00156 #endif
00157
00158
00160 template<typename CLASS> struct TypeCheck
00161 {
00162         static CLASS* dyn_cast(Window* wnd)
00163                 {return dynamic_cast<CLASS*>(wnd);}
00164 };
00165
00166 #define WINDOW_DYNAMIC_CAST(CLASS, hwnd) \
00167         TypeCheck<CLASS>::dyn_cast(Window::get_window(hwnd))
00168
00169
00170
00176 struct SubclassedWindow : public Window
00177 {
00178         typedef Window super;
00179
00180         SubclassedWindow(HWND);
00181
00182 protected:
00183         WNDPROC _orgWndProc;
00184
00185         static LRESULT CALLBACK SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
00186
00187         virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00188         virtual int             Command(int id, int code);
00189         virtual int             Notify(int id, NMHDR* pnmh);
00190 };
00191
00192
00194 template<typename WND_CLASS> struct WindowCreator
00195 {
00196         static WND_CLASS* window_creator(HWND hwnd)
00197         {
00198                 return new WND_CLASS(hwnd);
00199         }
00200 };
00201
00202 #define WINDOW_CREATOR(WND_CLASS) \
00203         ((Window::CREATORFUNC) WindowCreator<WND_CLASS>::window_creator)
00204
00205
00207 template<typename WND_CLASS, typename INFO_CLASS> struct WindowCreatorInfo
00208 {
00209         static WND_CLASS* window_creator(HWND hwnd, const void* info)
00210         {
00211                 return new WND_CLASS(hwnd, *static_cast<const INFO_CLASS*>(info));
00212         }
00213 };
00214
00215 #define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS) \
00216         ((Window::CREATORFUNC_INFO) WindowCreatorInfo<WND_CLASS, INFO_CLASS>::window_creator)
00217
00218
00226 struct WindowClass : public WNDCLASSEX
00227 {
00228         WindowClass(LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc);
00229
00230         ATOM Register()
00231         {
00232                 if (!_atomClass)
00233                         _atomClass = RegisterClassEx(this);
00234
00235                 return _atomClass;
00236         }
00237
00238         operator ATOM() {return Register();}
00239
00240          // return LPCTSTR for the CreateWindowEx() parameter
00241         operator LPCTSTR() {return (LPCTSTR)(int)Register();}
00242
00243 protected:
00244         ATOM    _atomClass;
00245 };
00246
00248 struct BtnWindowClass : public WindowClass
00249 {
00250         BtnWindowClass(LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc)
00251          :      WindowClass(classname, style, wndproc)
00252         {
00253                 hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
00254         }
00255 };
00256
00258 struct IconWindowClass : public WindowClass
00259 {
00260         IconWindowClass(LPCTSTR classname, UINT nid, UINT style=0, WNDPROC wndproc=Window::WindowWndProc);
00261 };
00262
00263
00264  // private message constants
00265 #define PM_DISPATCH_COMMAND             (WM_APP+0x00)
00266 #define PM_TRANSLATE_MSG                (WM_APP+0x01)
00267
00268
00269 #define SPLIT_WIDTH             5
00270 #define DEFAULT_SPLIT_POS       300
00271 #define COLOR_SPLITBAR          LTGRAY_BRUSH
00272
00273
00275 struct MenuInfo
00276 {
00277         HMENU   _hMenuView;
00278 };
00279
00280 #define PM_FRM_GET_MENUINFO             (WM_APP+0x02)
00281
00282 #define Frame_GetMenuInfo(hwnd) ((MenuInfo*)SNDMSG(hwnd, PM_FRM_GET_MENUINFO, 0, 0))
00283
00284
00289 struct ChildWindow : public Window
00290 {
00291         typedef Window super;
00292
00293         ChildWindow(HWND hwnd, const ChildWndInfo& info);
00294
00295         static ChildWindow* create(const ChildWndInfo& info, const RECT& rect, CREATORFUNC_INFO creator,
00296                                                                 LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0);
00297
00298         bool    go_to(LPCTSTR url);
00299
00300 protected:
00301         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00302
00303         virtual void resize_children(int cx, int cy);
00304         virtual String jump_to_int(LPCTSTR url) = 0;
00305
00306 protected:
00307         MenuInfo*_menu_info;
00308
00309         WindowHandle _left_hwnd;
00310         WindowHandle _right_hwnd;
00311         int     _focus_pane;            // 0: left      1: right
00312
00313         int     _split_pos;
00314         int             _last_split;
00315
00316         HWND    _hwndFrame;
00317         String  _statusText;
00318         String  _url;
00319
00320         stack<String> _url_history;
00321
00322         void    set_url(LPCTSTR url);
00323 };
00324
00325 #define PM_SETSTATUSTEXT                (WM_APP+0x1E)
00326
00327
00333 struct PreTranslateWindow : public Window
00334 {
00335         typedef Window super;
00336
00337         PreTranslateWindow(HWND);
00338         ~PreTranslateWindow();
00339 };
00340
00341
00348 struct DialogWindow : public Window
00349 {
00350         typedef Window super;
00351
00352         DialogWindow(HWND hwnd)
00353          :      super(hwnd)
00354         {
00355                 register_dialog(hwnd);
00356         }
00357
00358         ~DialogWindow()
00359         {
00360                 unregister_dialog(_hwnd);
00361         }
00362 };
00363
00364
00370 struct Dialog : public Window
00371 {
00372         typedef Window super;
00373
00374         Dialog(HWND);
00375         ~Dialog();
00376
00377         static int DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0);
00378         static int DoModal(UINT nid, CREATORFUNC_INFO creator, const void* info, HWND hwndParent=0);
00379
00380 protected:
00381         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00382         int             Command(int id, int code);
00383 };
00384
00385
00386 #define PM_FRM_CALC_CLIENT              (WM_APP+0x03)
00387 #define Frame_CalcFrameClient(hwnd, prt) ((BOOL)SNDMSG(hwnd, PM_FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt))
00388
00389 #define PM_JUMP_TO_URL                  (WM_APP+0x25)
00390 #define PM_URL_CHANGED                  (WM_APP+0x26)
00391
00392
00393 struct PropSheetPage : public PROPSHEETPAGE
00394 {
00395         PropSheetPage(UINT nid, Window::CREATORFUNC dlg_creator);
00396
00397         void    init(struct PropertySheetDialog*);
00398
00399 protected:
00400         friend struct PropSheetPageDlg;
00401
00402         Window::CREATORFUNC     _dlg_creator;
00403 };
00404
00405
00407 struct PropertySheetDialog : public PROPSHEETHEADER
00408 {
00409         PropertySheetDialog(HWND owner);
00410
00411         void    add(PropSheetPage& psp);
00412         int             DoModal(int start_page=0);
00413
00414         HWND    GetCurrentPage();
00415
00416 protected:
00417         typedef vector<PROPSHEETPAGE> Vector;
00418         Vector  _pages;
00419         HWND    _hwnd;
00420 };
00421
00422
00424 struct PropSheetPageDlg : public Dialog
00425 {
00426         typedef Dialog super;
00427
00428         PropSheetPageDlg(HWND);
00429
00430 protected:
00431         friend struct PropertySheetDialog;
00432         friend struct PropSheetPage;
00433
00434         static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
00435
00436         int     Command(int id, int code);
00437 };
00438
00439
00440 /*
00442 struct PropertySheetDlg : public SubclassedWindow
00443 {
00444         typedef SubclassedWindow super;
00445
00446         PropertySheetDlg(HWND hwnd) : super(hwnd) {}
00447 };
00448 */
00449
00450
00451  // Layouting of resizable windows
00452
00454 enum RESIZE_FLAGS {
00455         MOVE_LEFT       = 0x1,
00456         MOVE_RIGHT      = 0x2,
00457         MOVE_TOP        = 0x4,
00458         MOVE_BOTTOM     = 0x8,
00459
00460         MOVE_X  =  MOVE_LEFT | MOVE_RIGHT,
00461         MOVE_Y  =  MOVE_TOP | MOVE_BOTTOM,
00462         RESIZE_X=  MOVE_RIGHT,
00463         RESIZE_Y=  MOVE_BOTTOM,
00464
00465         MOVE    = MOVE_X   | MOVE_Y,
00466         RESIZE  = RESIZE_X | RESIZE_Y
00467 };
00468
00470 struct ResizeEntry
00471 {
00472         ResizeEntry(UINT id, int flags)
00473          : _id(id), _flags(flags) {}
00474
00475         ResizeEntry(HWND hwnd, int flags)
00476          : _id(GetDlgCtrlID(hwnd)), _flags(flags) {}
00477
00478         UINT    _id;
00479         int             _flags;
00480 };
00481
00482
00484 struct ResizeManager : public std::list<ResizeEntry>
00485 {
00486         typedef std::list<ResizeEntry> super;
00487
00488         ResizeManager(HWND hwnd);
00489
00490         void Add(UINT id, int flags)
00491                 {push_back(ResizeEntry(id, flags));}
00492
00493         void Add(HWND hwnd, int flags)
00494                 {push_back(ResizeEntry(hwnd, flags));}
00495
00496         void HandleSize(int cx, int cy);
00497         void Resize(int dx, int dy);
00498
00499         void SetMinMaxInfo(LPMINMAXINFO lpmmi)
00500         {
00501                 lpmmi->ptMinTrackSize.x = _min_wnd_size.cx;
00502                 lpmmi->ptMinTrackSize.y = _min_wnd_size.cy;
00503         }
00504
00505         SIZE    _min_wnd_size;
00506
00507 protected:
00508         HWND    _hwnd;
00509         SIZE    _last_size;
00510 };
00511
00512
00514 template<typename BASE> struct ResizeController : public BASE
00515 {
00516         typedef BASE super;
00517
00518         ResizeController(HWND hwnd)
00519          :      super(hwnd),
00520                 _resize_mgr(hwnd)
00521         {
00522         }
00523
00524         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00525         {
00526                 switch(nmsg) {
00527                   case PM_FRM_CALC_CLIENT:
00528                         GetClientSpace((PRECT)lparam);
00529                         return TRUE;
00530
00531                   case WM_SIZE:
00532                         if (wparam != SIZE_MINIMIZED)
00533                                 _resize_mgr.HandleSize(LOWORD(lparam), HIWORD(lparam));
00534                         goto def;
00535
00536                   case WM_GETMINMAXINFO:
00537                         _resize_mgr.SetMinMaxInfo((LPMINMAXINFO)lparam);
00538                         goto def;
00539
00540                   default: def:
00541                         return super::WndProc(nmsg, wparam, lparam);
00542                 }
00543         }
00544
00545         virtual void GetClientSpace(PRECT prect)
00546         {
00547                  if (!IsIconic(this->_hwnd)) {
00548                         GetClientRect(this->_hwnd, prect);
00549                  } else {
00550                         WINDOWPLACEMENT wp;
00551                         GetWindowPlacement(this->_hwnd, &wp);
00552                         prect->left = prect->top = 0;
00553                         prect->right = wp.rcNormalPosition.right-wp.rcNormalPosition.left-
00554                                 2*(GetSystemMetrics(SM_CXSIZEFRAME)+GetSystemMetrics(SM_CXEDGE));
00555                         prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top-
00556                                 2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))-
00557                                 GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE);
00558                 }
00559         }
00560
00561 protected:
00562         ResizeManager _resize_mgr;
00563 };
00564
00565
00571 struct Button : public WindowHandle
00572 {
00573         Button(HWND parent, LPCTSTR text, int left, int top, int width, int height,
00574                         int id, DWORD flags=WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, DWORD exStyle=0);
00575 };
00576
00577
00583 struct Static : public WindowHandle
00584 {
00585         Static(HWND parent, LPCTSTR text, int left, int top, int width, int height,
00586                         int id, DWORD flags=WS_VISIBLE|WS_CHILD|SS_SIMPLE, DWORD ex_flags=0);
00587 };
00588
00589
00590  // control color message routing for ColorStatic and HyperlinkCtrl
00591
00592 #define PM_DISPATCH_CTLCOLOR    (WM_APP+0x08)
00593
00594 template<typename BASE> struct CtlColorParent : public BASE
00595 {
00596         typedef BASE super;
00597
00598         CtlColorParent(HWND hwnd)
00599          : super(hwnd) {}
00600
00601         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00602         {
00603                 switch(nmsg) {
00604                   case WM_CTLCOLOR:
00605                   case WM_CTLCOLORBTN:
00606                   case WM_CTLCOLORDLG:
00607                   case WM_CTLCOLORSCROLLBAR:
00608                   case WM_CTLCOLORSTATIC: {
00609                         HWND hctl = (HWND) lparam;
00610                         return SendMessage(hctl, PM_DISPATCH_CTLCOLOR, wparam, nmsg);
00611                   }
00612
00613                   default:
00614                         return super::WndProc(nmsg, wparam, lparam);
00615                 }
00616         }
00617 };
00618
00619
00620 #define PM_DISPATCH_DRAWITEM    (WM_APP+0x09)
00621
00623 template<typename BASE> struct OwnerDrawParent : public BASE
00624 {
00625         typedef BASE super;
00626
00627         OwnerDrawParent(HWND hwnd)
00628          : super(hwnd) {}
00629
00630         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00631         {
00632                 switch(nmsg) {
00633                   case WM_DRAWITEM:
00634                         if (wparam) {   // should there be drawn a control?
00635                                 HWND hctl = GetDlgItem(this->_hwnd, wparam);
00636
00637                                 if (hctl)
00638                                         return SendMessage(hctl, PM_DISPATCH_DRAWITEM, wparam, lparam);
00639                         } /*else                // or is it a menu entry?
00640                                 ; */
00641
00642                         return 0;
00643
00644                   default:
00645                         return super::WndProc(nmsg, wparam, lparam);
00646                 }
00647         }
00648 };
00649
00650
00655 struct OwnerdrawnButton : public SubclassedWindow
00656 {
00657         typedef SubclassedWindow super;
00658
00659         OwnerdrawnButton(HWND hwnd)
00660          :      super(hwnd) {}
00661
00662 protected:
00663         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00664
00665         virtual void DrawItem(LPDRAWITEMSTRUCT dis) = 0;
00666 };
00667
00668 extern void DrawGrayText(HDC hdc, LPRECT pRect, LPCTSTR text, int dt_flags);
00669
00670
00675 /* not yet used
00676 struct ColorButton : public OwnerdrawnButton
00677 {
00678         typedef OwnerdrawnButton super;
00679
00680         ColorButton(HWND hwnd, COLORREF textColor)
00681          :      super(hwnd), _textColor(textColor) {}
00682
00683 protected:
00684         virtual void DrawItem(LPDRAWITEMSTRUCT dis);
00685
00686         COLORREF _textColor;
00687 };
00688 */
00689
00690
00691 struct FlatButton : public OwnerdrawnButton
00692 {
00693         typedef OwnerdrawnButton super;
00694
00695         FlatButton(HWND hwnd)
00696          : super(hwnd), _active(false) {}
00697
00698         FlatButton(HWND owner, int id)
00699          : super(GetDlgItem(owner, IDOK)), _active(false) {}
00700
00701 protected:
00702         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00703         virtual void DrawItem(LPDRAWITEMSTRUCT dis);
00704
00705         COLORREF _textColor;
00706         COLORREF _activeColor;
00707         bool    _active;
00708 };
00709
00710
00716 struct PictureButton : public OwnerdrawnButton
00717 {
00718         typedef OwnerdrawnButton super;
00719
00720         PictureButton(HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
00721          :      super(hwnd), _hIcon(hIcon), _hBmp(0), _hBrush(hbrush), _flat(flat)
00722         {
00723                 _cx = 16;
00724                 _cy = 16;
00725         }
00726
00727         PictureButton(HWND hparent, int id, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
00728          :      super(GetDlgItem(hparent, id)), _hIcon(hIcon), _hBmp(0), _hBrush(hbrush), _flat(flat)
00729         {
00730                 _cx = 16;
00731                 _cy = 16;
00732         }
00733
00734         PictureButton(HWND hwnd, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
00735          :      super(hwnd), _hIcon(0), _hBmp(hBmp), _hBrush(hbrush), _flat(flat)
00736         {
00737                 BITMAP bmp;
00738                 GetObject(hBmp, sizeof(bmp), &bmp);
00739                 _cx = bmp.bmWidth;
00740                 _cy = bmp.bmHeight;
00741         }
00742
00743         PictureButton(HWND hparent, int id, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
00744          :      super(GetDlgItem(hparent, id)), _hIcon(0), _hBmp(hBmp), _hBrush(hbrush), _flat(flat)
00745         {
00746                 BITMAP bmp;
00747                 GetObject(hBmp, sizeof(bmp), &bmp);
00748                 _cx = bmp.bmWidth;
00749                 _cy = bmp.bmHeight;
00750         }
00751
00752 protected:
00753         virtual void DrawItem(LPDRAWITEMSTRUCT dis);
00754
00755         HICON   _hIcon;
00756         HBITMAP _hBmp;
00757         HBRUSH  _hBrush;
00758
00759         int             _cx;
00760         int             _cy;
00761
00762         bool    _flat;
00763 };
00764
00765
00766 struct ColorStatic : public SubclassedWindow
00767 {
00768         typedef SubclassedWindow super;
00769
00770         ColorStatic(HWND hwnd, COLORREF textColor=RGB(255,0,0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0)
00771          :      super(hwnd),
00772                 _textColor(textColor),
00773                 _hbrush_bkgnd(hbrush_bkgnd),
00774                 _hfont(hfont)
00775         {
00776         }
00777
00778         ColorStatic(HWND owner, int id, COLORREF textColor=RGB(255,0,0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0)
00779          :      super(GetDlgItem(owner, id)),
00780                 _textColor(textColor),
00781                 _hbrush_bkgnd(hbrush_bkgnd),
00782                 _hfont(hfont)
00783         {
00784         }
00785
00786 protected:
00787         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
00788         {
00789                 if (nmsg == PM_DISPATCH_CTLCOLOR) {
00790                         HDC hdc = (HDC) wparam;
00791
00792                         SetTextColor(hdc, _textColor);
00793
00794                         if (_hfont)
00795                                 SelectFont(hdc, _hfont);
00796
00797                         if (_hbrush_bkgnd)
00798                                 return (LRESULT)_hbrush_bkgnd;
00799                         else {
00800                                 SetBkMode(hdc, TRANSPARENT);
00801                                 return (LRESULT)GetStockBrush(HOLLOW_BRUSH);
00802                         }
00803                 } else
00804                         return super::WndProc(nmsg, wparam, lparam);
00805         }
00806
00807         COLORREF        _textColor;
00808         HBRUSH          _hbrush_bkgnd;
00809         HFONT           _hfont;
00810 };
00811
00812
00814
00815 struct HyperlinkCtrl : public SubclassedWindow
00816 {
00817         typedef SubclassedWindow super;
00818
00819         HyperlinkCtrl(HWND hwnd, COLORREF colorLink=RGB(0,0,255), COLORREF colorVisited=RGB(128,0,128));
00820         HyperlinkCtrl(HWND owner, int id, COLORREF colorLink=RGB(0,0,255), COLORREF colorVisited=RGB(128,0,128));
00821
00822         ~HyperlinkCtrl();
00823
00824         String  _cmd;
00825
00826 protected:
00827         COLORREF _textColor;
00828         COLORREF _colorVisited;
00829         HFONT    _hfont;
00830         HCURSOR _crsr_link;
00831
00832         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
00833
00834         void init();
00835
00836         bool LaunchLink()
00837         {
00838                 if (!_cmd.empty()) {
00839                         HINSTANCE hinst = ShellExecute(GetParent(_hwnd), _T("open"), _cmd, 0, 0, SW_SHOWNORMAL);
00840                         return (int)hinst > HINSTANCE_ERROR;
00841                 }
00842
00843                 return true;
00844         }
00845 };
00846
00847
00849 struct ToolTip : public WindowHandle
00850 {
00851         typedef WindowHandle super;
00852
00853         ToolTip(HWND owner);
00854
00855         void activate(BOOL active=TRUE)
00856         {
00857                 SendMessage(_hwnd, TTM_ACTIVATE, active, 0);
00858         }
00859
00860         void add(HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
00861         {
00862                 TOOLINFO ti = {
00863                         sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND|TTF_TRANSPARENT, hparent, (UINT)htool,
00864                         {0,0,0,0}, 0, (LPTSTR)txt, lparam
00865                 };
00866
00867 #ifdef UNICODE
00868                 if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti))
00869                         SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
00870 #else
00871                 if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti))
00872                         SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti);
00873 #endif
00874         }
00875
00876         void add(HWND hparent, UINT id, const RECT& rect, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
00877         {
00878                 TOOLINFO ti = {
00879                         sizeof(TOOLINFO), TTF_SUBCLASS|TTF_TRANSPARENT, hparent, id,
00880                         {rect.left,rect.top,rect.right,rect.bottom}, 0, (LPTSTR)txt, lparam
00881                 };
00882
00883 #ifdef UNICODE
00884                 if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti))
00885                         SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
00886 #else
00887                 if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti))
00888                         SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti);
00889 #endif
00890         }
00891
00892         void remove(HWND hparent, HWND htool)
00893         {
00894                 TOOLINFO ti = {
00895                         sizeof(TOOLINFO), TTF_IDISHWND, hparent, (UINT)htool,
00896                         {0,0,0,0}, 0, 0, 0
00897                 };
00898
00899                 SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti);
00900         }
00901
00902         void remove(HWND hparent, UINT id)
00903         {
00904                 TOOLINFO ti = {
00905                         sizeof(TOOLINFO), 0, hparent, id,
00906                         {0,0,0,0}, 0, 0, 0
00907                 };
00908
00909                 SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti);
00910         }
00911 };
00912
00913
00914 inline int ListView_GetItemData(HWND list_ctrl, int idx)
00915 {
00916         LV_ITEM item;
00917
00918         item.mask = LVIF_PARAM;
00919         item.iItem = idx;
00920
00921         if (!ListView_GetItem(list_ctrl, &item))
00922                 return 0;
00923
00924         return item.lParam;
00925 }
00926
00927 inline int ListView_FindItemPara(HWND list_ctrl, LPARAM param)
00928 {
00929         LVFINDINFO fi;
00930
00931         fi.flags = LVFI_PARAM;
00932         fi.lParam = param;
00933
00934         return ListView_FindItem(list_ctrl, (unsigned)-1, &fi);
00935 }
00936
00937 inline int ListView_GetFocusedItem(HWND list_ctrl)
00938 {
00939         int idx = ListView_GetItemCount(list_ctrl);
00940
00941         while(--idx >= 0)
00942                 if (ListView_GetItemState(list_ctrl, idx, LVIS_FOCUSED))
00943                         break;
00944
00945         return idx;
00946 }
00947
00948
00950 struct ListSort : public WindowHandle
00951 {
00952         ListSort(HWND hwndListview, PFNLVCOMPARE compare_fct);
00953
00954         void    toggle_sort(int idx);
00955         void    sort();
00956
00957         int             _sort_crit;
00958         bool    _direction;
00959
00960 protected:
00961         PFNLVCOMPARE _compare_fct;
00962
00963         static int CALLBACK CompareFunc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort);
00964 };
00965
00966
00967 inline LPARAM TreeView_GetItemData(HWND hwndTreeView, HTREEITEM hItem)
00968 {
00969         TVITEM tvItem;
00970
00971         tvItem.mask = TVIF_PARAM;
00972         tvItem.hItem = hItem;
00973
00974         if (!TreeView_GetItem(hwndTreeView, &tvItem))
00975                 return 0;
00976
00977         return tvItem.lParam;
00978 }
00979
00980
00981 enum {TRAYBUTTON_LEFT=0, TRAYBUTTON_RIGHT, TRAYBUTTON_MIDDLE};
00982
00983 #define PM_TRAYICON             (WM_APP+0x20)
00984
00985 #define WINMSG_TASKBARCREATED   TEXT("TaskbarCreated")
00986
00987 #define WINMSG_SHELLHOOK                TEXT("SHELLHOOK")
00988
00989
00990 struct TrayIcon
00991 {
00992         TrayIcon(HWND hparent, UINT id)
00993          :      _hparent(hparent), _id(id) {}
00994
00995         ~TrayIcon()
00996                 {Remove();}
00997
00998         void    Add(HICON hIcon, LPCTSTR tooltip=NULL)
00999                 {Set(NIM_ADD, _id, hIcon, tooltip);}
01000
01001         void    Modify(HICON hIcon, LPCTSTR tooltip=NULL)
01002                 {Set(NIM_MODIFY, _id, hIcon, tooltip);}
01003
01004         void    Remove()
01005         {
01006                 NOTIFYICONDATA nid = {
01007                         sizeof(NOTIFYICONDATA), // cbSize
01008                         _hparent,                               // hWnd
01009                         _id,                                    // uID
01010                 };
01011
01012                 Shell_NotifyIcon(NIM_DELETE, &nid);
01013         }
01014
01015 protected:
01016         HWND    _hparent;
01017         UINT    _id;
01018
01019         void    Set(DWORD dwMessage, UINT id, HICON hIcon, LPCTSTR tooltip=NULL)
01020         {
01021                 NOTIFYICONDATA nid = {
01022                         sizeof(NOTIFYICONDATA), // cbSize
01023                         _hparent,                               // hWnd
01024                         id,                                             // uID
01025                         NIF_MESSAGE|NIF_ICON,   // uFlags
01026                         PM_TRAYICON,                    // uCallbackMessage
01027                         hIcon                                   // hIcon
01028                 };
01029
01030                 if (tooltip)
01031                         lstrcpyn(nid.szTip, tooltip, COUNTOF(nid.szTip));
01032
01033                 if (nid.szTip[0])
01034                         nid.uFlags |= NIF_TIP;
01035
01036                 Shell_NotifyIcon(dwMessage, &nid);
01037         }
01038 };
01039
01040
01041 template<typename BASE> struct TrayIconControllerTemplate : public BASE
01042 {
01043         typedef BASE super;
01044
01045         TrayIconControllerTemplate(HWND hwnd) : BASE(hwnd),
01046                 WM_TASKBARCREATED(RegisterWindowMessage(WINMSG_TASKBARCREATED))
01047         {
01048         }
01049
01050         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
01051         {
01052                 if (nmsg == PM_TRAYICON) {
01053                         switch(lparam) {
01054                           case WM_MOUSEMOVE:
01055                                 TrayMouseOver(wparam);
01056                                 break;
01057
01058                           case WM_LBUTTONDOWN:
01059                                 TrayClick(wparam, TRAYBUTTON_LEFT);
01060                                 break;
01061
01062                           case WM_LBUTTONDBLCLK:
01063                                 TrayDblClick(wparam, TRAYBUTTON_LEFT);
01064                                 break;
01065
01066                           case WM_RBUTTONDOWN:
01067                                 TrayClick(wparam, TRAYBUTTON_RIGHT);
01068                                 break;
01069
01070                           case WM_RBUTTONDBLCLK:
01071                                 TrayDblClick(wparam, TRAYBUTTON_RIGHT);
01072                                 break;
01073
01074                           case WM_MBUTTONDOWN:
01075                                 TrayClick(wparam, TRAYBUTTON_MIDDLE);
01076                                 break;
01077
01078                           case WM_MBUTTONDBLCLK:
01079                                 TrayDblClick(wparam, TRAYBUTTON_MIDDLE);
01080                                 break;
01081                         }
01082
01083                         return 0;
01084                 } else if (nmsg == WM_TASKBARCREATED) {
01085                         AddTrayIcons();
01086                         return 0;
01087                 } else
01088                         return super::WndProc(nmsg, wparam, lparam);
01089         }
01090
01091         virtual void AddTrayIcons() = 0;
01092         virtual void TrayMouseOver(UINT id) {}
01093         virtual void TrayClick(UINT id, int btn) {}
01094         virtual void TrayDblClick(UINT id, int btn) {}
01095
01096 protected:
01097         const UINT WM_TASKBARCREATED;
01098 };
01099
01100
01101 struct EditController : public SubclassedWindow
01102 {
01103         typedef SubclassedWindow super;
01104
01105         EditController(HWND hwnd)
01106          :      super(hwnd)
01107         {
01108         }
01109
01110 protected:
01111         LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
01112         {
01113                 if (nmsg==WM_KEYDOWN && wparam==VK_RETURN) {
01114                         SendParent(WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(_hwnd),1), (LPARAM)_hwnd);
01115                         return 0;
01116                 } else
01117                         return super::WndProc(nmsg, wparam, lparam);
01118         }
01119 };


ROS Explorer: winfs.cpp File Reference

  • File List
  • File Members
shell

winfs.cpp File Reference

#include <precomp.h>

Include dependency graph for winfs.cpp:

Go to the source code of this file.

Functions

int ScanNTFSStreams (Entry *entry, HANDLE hFile)

Function Documentation

int ScanNTFSStreams | ( | Entry * | entry,
 |  | HANDLE | hFile
 | ) |

Definition at line 34 of file winfs.cpp.

References Entry::_down, _MAX_FNAME, Entry::_next, and THROW_EXCEPTION.

Referenced by WinDirectory::read_directory(), and ShellDirectory::read_directory().

00035 {
00036         PVOID ctx = 0;
00037         DWORD read, seek_high;
00038         Entry** pnext = &entry->_down;
00039         int cnt = 0;
00040
00041         for(;;) {
00042                 struct NTFS_StreamHdr : public WIN32_STREAM_ID {
00043                         WCHAR name_padding[_MAX_FNAME]; // room for reading stream name
00044                 } hdr;
00045
00046                 if (!BackupRead(hFile, (LPBYTE)&hdr, (LPBYTE)&hdr.cStreamName-(LPBYTE)&hdr, &read, FALSE, FALSE, &ctx) ||
00047                         (long)read!=(LPBYTE)&hdr.cStreamName-(LPBYTE)&hdr)
00048                         break;
00049
00050                 if (hdr.dwStreamId == BACKUP_ALTERNATE_DATA) {
00051                         if (hdr.dwStreamNameSize &&
00052                                 BackupRead(hFile, (LPBYTE)hdr.cStreamName, hdr.dwStreamNameSize, &read, FALSE, FALSE, &ctx) &&
00053                                 read==hdr.dwStreamNameSize)
00054                         {
00055                                 ++cnt;
00056
00057                                 int l = hdr.dwStreamNameSize / sizeof(WCHAR);
00058                                 LPCWSTR p = hdr.cStreamName;
00059                                 LPCWSTR e = hdr.cStreamName + l;
00060
00061                                 if (l>0 && *p==':') {
00062                                         ++p, --l;
00063
00064                                         e = p;
00065
00066                                         while(l>0 && *e!=':')
00067                                                 ++e, --l;
00068
00069                                         l = e - p;
00070                                 }
00071
00072                                 Entry* stream_entry = new WinEntry(entry);
00073
00074                                 memcpy(&stream_entry->_data, &entry->_data, sizeof(WIN32_FIND_DATA));
00075                                 lstrcpy(stream_entry->_data.cFileName, String(p, l));
00076
00077                                 stream_entry->_down = NULL;
00078                                 stream_entry->_expanded = false;
00079                                 stream_entry->_scanned = false;
00080                                 stream_entry->_level = entry->_level + 1;
00081
00082                                 *pnext = stream_entry;
00083                                 pnext = &stream_entry->_next;
00084                         }
00085                 }
00086
00087                  // jump to the next stream header
00088                 if (!BackupSeek(hFile, ~0, ~0, &read, &seek_high, &ctx)) {
00089                         DWORD error = GetLastError();
00090
00091                         if (error != ERROR_SEEK) {
00092                                 BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx);      // terminate BackupRead() loop
00093                                 THROW_EXCEPTION(error);
00094                                 //break;
00095                         }
00096
00097                         hdr.Size.QuadPart -= read;
00098                         hdr.Size.HighPart -= seek_high;
00099
00100                         BYTE buffer[4096];
00101
00102                         while(hdr.Size.QuadPart > 0) {
00103                                 if (!BackupRead(hFile, buffer, sizeof(buffer), &read, FALSE, FALSE, &ctx) || read!=sizeof(buffer))
00104                                         break;
00105
00106                                 hdr.Size.QuadPart -= read;
00107                         }
00108                 }
00109         }
00110
00111         if (ctx)
00112                 if (!BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx)) // terminate BackupRead() loop
00113                         THROW_EXCEPTION(GetLastError());
00114
00115         return cnt;
00116 }


ROS Explorer: winfs.cpp Source File

  • File List
  • File Members
shell

winfs.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // winfs.cpp
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00029 #include <precomp.h>
00030
00031 //#include "winfs.h"
00032
00033
00034 int ScanNTFSStreams(Entry* entry, HANDLE hFile)
00035 {
00036         PVOID ctx = 0;
00037         DWORD read, seek_high;
00038         Entry** pnext = &entry->_down;
00039         int cnt = 0;
00040
00041         for(;;) {
00042                 struct NTFS_StreamHdr : public WIN32_STREAM_ID {
00043                         WCHAR name_padding[_MAX_FNAME]; // room for reading stream name
00044                 } hdr;
00045
00046                 if (!BackupRead(hFile, (LPBYTE)&hdr, (LPBYTE)&hdr.cStreamName-(LPBYTE)&hdr, &read, FALSE, FALSE, &ctx) ||
00047                         (long)read!=(LPBYTE)&hdr.cStreamName-(LPBYTE)&hdr)
00048                         break;
00049
00050                 if (hdr.dwStreamId == BACKUP_ALTERNATE_DATA) {
00051                         if (hdr.dwStreamNameSize &&
00052                                 BackupRead(hFile, (LPBYTE)hdr.cStreamName, hdr.dwStreamNameSize, &read, FALSE, FALSE, &ctx) &&
00053                                 read==hdr.dwStreamNameSize)
00054                         {
00055                                 ++cnt;
00056
00057                                 int l = hdr.dwStreamNameSize / sizeof(WCHAR);
00058                                 LPCWSTR p = hdr.cStreamName;
00059                                 LPCWSTR e = hdr.cStreamName + l;
00060
00061                                 if (l>0 && *p==':') {
00062                                         ++p, --l;
00063
00064                                         e = p;
00065
00066                                         while(l>0 && *e!=':')
00067                                                 ++e, --l;
00068
00069                                         l = e - p;
00070                                 }
00071
00072                                 Entry* stream_entry = new WinEntry(entry);
00073
00074                                 memcpy(&stream_entry->_data, &entry->_data, sizeof(WIN32_FIND_DATA));
00075                                 lstrcpy(stream_entry->_data.cFileName, String(p, l));
00076
00077                                 stream_entry->_down = NULL;
00078                                 stream_entry->_expanded = false;
00079                                 stream_entry->_scanned = false;
00080                                 stream_entry->_level = entry->_level + 1;
00081
00082                                 *pnext = stream_entry;
00083                                 pnext = &stream_entry->_next;
00084                         }
00085                 }
00086
00087                  // jump to the next stream header
00088                 if (!BackupSeek(hFile, ~0, ~0, &read, &seek_high, &ctx)) {
00089                         DWORD error = GetLastError();
00090
00091                         if (error != ERROR_SEEK) {
00092                                 BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx);      // terminate BackupRead() loop
00093                                 THROW_EXCEPTION(error);
00094                                 //break;
00095                         }
00096
00097                         hdr.Size.QuadPart -= read;
00098                         hdr.Size.HighPart -= seek_high;
00099
00100                         BYTE buffer[4096];
00101
00102                         while(hdr.Size.QuadPart > 0) {
00103                                 if (!BackupRead(hFile, buffer, sizeof(buffer), &read, FALSE, FALSE, &ctx) || read!=sizeof(buffer))
00104                                         break;
00105
00106                                 hdr.Size.QuadPart -= read;
00107                         }
00108                 }
00109         }
00110
00111         if (ctx)
00112                 if (!BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx)) // terminate BackupRead() loop
00113                         THROW_EXCEPTION(GetLastError());
00114
00115         return cnt;
00116 }
00117
00118
00119 void WinDirectory::read_directory(int scan_flags)
00120 {
00121         CONTEXT("WinDirectory::read_directory()");
00122
00123         int level = _level + 1;
00124
00125         Entry* first_entry = NULL;
00126         Entry* last = NULL;
00127         Entry* entry;
00128
00129         LPCTSTR path = (LPCTSTR)_path;
00130         TCHAR buffer[MAX_PATH], *pname;
00131         for(pname=buffer; *path; )
00132                 *pname++ = *path++;
00133
00134         lstrcpy(pname, TEXT("\\*"));
00135
00136         WIN32_FIND_DATA w32fd;
00137         HANDLE hFind = FindFirstFile(buffer, &w32fd);
00138
00139         if (hFind != INVALID_HANDLE_VALUE) {
00140                 do {
00141                         lstrcpy(pname+1, w32fd.cFileName);
00142
00143                         if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00144                                 entry = new WinDirectory(this, buffer);
00145                         else
00146                                 entry = new WinEntry(this);
00147
00148                         if (!first_entry)
00149                                 first_entry = entry;
00150
00151                         if (last)
00152                                 last->_next = entry;
00153
00154                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00155                         entry->_level = level;
00156
00157                          // display file type names, but don't hide file extensions
00158                         g_Globals._ftype_mgr.set_type(entry, true);
00159
00160                         if (scan_flags & SCAN_DO_ACCESS) {
00161                                 HANDLE hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
00162                                                                                         0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
00163
00164                                 if (hFile != INVALID_HANDLE_VALUE) {
00165                                         if (GetFileInformationByHandle(hFile, &entry->_bhfi))
00166                                                 entry->_bhfi_valid = true;
00167
00168                                         if (ScanNTFSStreams(entry, hFile))
00169                                                 entry->_scanned = true; // There exist named NTFS sub-streams in this file.
00170
00171                                         CloseHandle(hFile);
00172                                 }
00173                         }
00174
00175                         last = entry;   // There is always at least one entry, because FindFirstFile() succeeded and we don't filter the file entries.
00176                 } while(FindNextFile(hFind, &w32fd));
00177
00178                 last->_next = NULL;
00179
00180                 FindClose(hFind);
00181         }
00182
00183         _down = first_entry;
00184         _scanned = true;
00185 }
00186
00187
00188 const void* WinDirectory::get_next_path_component(const void* p) const
00189 {
00190         LPCTSTR s = (LPCTSTR) p;
00191
00192         while(*s && *s!=TEXT('\\') && *s!=TEXT('/'))
00193                 ++s;
00194
00195         while(*s==TEXT('\\') || *s==TEXT('/'))
00196                 ++s;
00197
00198         if (!*s)
00199                 return NULL;
00200
00201         return s;
00202 }
00203
00204
00205 Entry* WinDirectory::find_entry(const void* p)
00206 {
00207         LPCTSTR name = (LPCTSTR)p;
00208
00209         for(Entry*entry=_down; entry; entry=entry->_next) {
00210                 LPCTSTR p = name;
00211                 LPCTSTR q = entry->_data.cFileName;
00212
00213                 do {
00214                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00215                                 return entry;
00216                 } while(tolower(*p++) == tolower(*q++));
00217
00218                 p = name;
00219                 q = entry->_data.cAlternateFileName;
00220
00221                 do {
00222                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00223                                 return entry;
00224                 } while(tolower(*p++) == tolower(*q++));
00225         }
00226
00227         return NULL;
00228 }
00229
00230
00231  // get full path of specified directory entry
00232 bool WinEntry::get_path(PTSTR path, size_t path_count) const
00233 {
00234         return get_path_base ( path, path_count, ET_WINDOWS );
00235 }
00236
00237 ShellPath WinEntry::create_absolute_pidl() const
00238 {
00239         CONTEXT("WinEntry::create_absolute_pidl()");
00240
00241         TCHAR path[MAX_PATH];
00242
00243         if (get_path(path, COUNTOF(path)))
00244                 return ShellPath(path);
00245
00246         return ShellPath();
00247 }


ROS Explorer: winfs.h File Reference

  • File List
  • File Members
shell

winfs.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | WinEntry
Windows file system file-entry. More...
struct | WinDirectory
Windows file system directory-entry. More...

Functions

int | ScanNTFSStreams (Entry *entry, HANDLE hFile)

Function Documentation

int ScanNTFSStreams | ( | Entry * | entry,
 |  | HANDLE | hFile
 | ) |

Definition at line 34 of file winfs.cpp.

References Entry::_down, _MAX_FNAME, Entry::_next, and THROW_EXCEPTION.

Referenced by ShellDirectory::read_directory(), and WinDirectory::read_directory().

00035 {
00036         PVOID ctx = 0;
00037         DWORD read, seek_high;
00038         Entry** pnext = &entry->_down;
00039         int cnt = 0;
00040
00041         for(;;) {
00042                 struct NTFS_StreamHdr : public WIN32_STREAM_ID {
00043                         WCHAR name_padding[_MAX_FNAME]; // room for reading stream name
00044                 } hdr;
00045
00046                 if (!BackupRead(hFile, (LPBYTE)&hdr, (LPBYTE)&hdr.cStreamName-(LPBYTE)&hdr, &read, FALSE, FALSE, &ctx) ||
00047                         (long)read!=(LPBYTE)&hdr.cStreamName-(LPBYTE)&hdr)
00048                         break;
00049
00050                 if (hdr.dwStreamId == BACKUP_ALTERNATE_DATA) {
00051                         if (hdr.dwStreamNameSize &&
00052                                 BackupRead(hFile, (LPBYTE)hdr.cStreamName, hdr.dwStreamNameSize, &read, FALSE, FALSE, &ctx) &&
00053                                 read==hdr.dwStreamNameSize)
00054                         {
00055                                 ++cnt;
00056
00057                                 int l = hdr.dwStreamNameSize / sizeof(WCHAR);
00058                                 LPCWSTR p = hdr.cStreamName;
00059                                 LPCWSTR e = hdr.cStreamName + l;
00060
00061                                 if (l>0 && *p==':') {
00062                                         ++p, --l;
00063
00064                                         e = p;
00065
00066                                         while(l>0 && *e!=':')
00067                                                 ++e, --l;
00068
00069                                         l = e - p;
00070                                 }
00071
00072                                 Entry* stream_entry = new WinEntry(entry);
00073
00074                                 memcpy(&stream_entry->_data, &entry->_data, sizeof(WIN32_FIND_DATA));
00075                                 lstrcpy(stream_entry->_data.cFileName, String(p, l));
00076
00077                                 stream_entry->_down = NULL;
00078                                 stream_entry->_expanded = false;
00079                                 stream_entry->_scanned = false;
00080                                 stream_entry->_level = entry->_level + 1;
00081
00082                                 *pnext = stream_entry;
00083                                 pnext = &stream_entry->_next;
00084                         }
00085                 }
00086
00087                  // jump to the next stream header
00088                 if (!BackupSeek(hFile, ~0, ~0, &read, &seek_high, &ctx)) {
00089                         DWORD error = GetLastError();
00090
00091                         if (error != ERROR_SEEK) {
00092                                 BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx);      // terminate BackupRead() loop
00093                                 THROW_EXCEPTION(error);
00094                                 //break;
00095                         }
00096
00097                         hdr.Size.QuadPart -= read;
00098                         hdr.Size.HighPart -= seek_high;
00099
00100                         BYTE buffer[4096];
00101
00102                         while(hdr.Size.QuadPart > 0) {
00103                                 if (!BackupRead(hFile, buffer, sizeof(buffer), &read, FALSE, FALSE, &ctx) || read!=sizeof(buffer))
00104                                         break;
00105
00106                                 hdr.Size.QuadPart -= read;
00107                         }
00108                 }
00109         }
00110
00111         if (ctx)
00112                 if (!BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx)) // terminate BackupRead() loop
00113                         THROW_EXCEPTION(GetLastError());
00114
00115         return cnt;
00116 }


ROS Explorer: winfs.h Source File

  • File List
  • File Members
shell

winfs.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2003, 2004 Martin Fuchs
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018
00019
00020  //
00021  // Explorer clone
00022  //
00023  // winfs.h
00024  //
00025  // Martin Fuchs, 23.07.2003
00026  //
00027
00028
00030 struct WinEntry : public Entry
00031 {
00032         WinEntry(Entry* parent) : Entry(parent, ET_WINDOWS) {}
00033
00034 protected:
00035         WinEntry() : Entry(ET_WINDOWS) {}
00036
00037         virtual bool get_path(PTSTR path, size_t path_count) const;
00038         virtual ShellPath create_absolute_pidl() const;
00039 };
00040
00041
00043 struct WinDirectory : public WinEntry, public Directory
00044 {
00045         WinDirectory(LPCTSTR root_path)
00046          :      WinEntry()
00047         {
00048                 _path = _tcsdup(root_path);
00049         }
00050
00051         WinDirectory(Entry* parent, LPCTSTR path)
00052          :      WinEntry(parent)
00053         {
00054                 _path = _tcsdup(path);
00055         }
00056
00057         ~WinDirectory()
00058         {
00059                 free(_path);
00060                 _path = NULL;
00061         }
00062
00063         virtual void read_directory(int scan_flags=SCAN_ALL);
00064         virtual const void* get_next_path_component(const void*) const;
00065         virtual Entry* find_entry(const void*);
00066 };
00067
00068 extern int ScanNTFSStreams(Entry* entry, HANDLE hFile);


ROS Explorer: xmlstorage.cpp File Reference

  • File List
  • File Members
utility

xmlstorage.cpp File Reference

#include <precomp.h>

Include dependency graph for xmlstorage.cpp:

Go to the source code of this file.

Namespaces

namespace | XMLStorage

Defines

#define | _NO_COMMENT

Functions

std::string | XMLStorage::EncodeXMLString (const XS_String &str)
encode XML string literals
XS_String | XMLStorage::DecodeXMLString (const XS_String &str)
decode XML string literals

Define Documentation

#define _NO_COMMENT

Definition at line 40 of file xmlstorage.cpp.


ROS Explorer: xmlstorage.cpp Source File

  • File List
  • File Members
utility

xmlstorage.cpp

Go to the documentation of this file.
00001
00002  //
00003  // XML storage classes
00004  //
00005  // xmlstorage.cpp
00006  //
00007  // Copyright (c) 2004, 2005 Martin Fuchs <martin-fuchs@gmx.net>
00008  //
00009
00010
00011 /*
00012
00013   All rights reserved.
00014
00015   Redistribution and use in source and binary forms, with or without
00016   modification, are permitted provided that the following conditions are met:
00017
00018   * Redistributions of source code must retain the above copyright
00019         notice, this list of conditions and the following disclaimer.
00020   * Redistributions in binary form must reproduce the above copyright
00021         notice, this list of conditions and the following disclaimer in
00022         the documentation and/or other materials provided with the
00023         distribution.
00024
00025   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00028   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00029   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00030   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00031   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00032   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00033   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00034   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00035   POSSIBILITY OF SUCH DAMAGE.
00036
00037 */
00038
00039 #ifndef _NO_COMMENT
00040 #define _NO_COMMENT     // no #pragma comment(lib, ...) statements in .lib files
00041 #endif
00042
00043 //#include "xmlstorage.h"
00044 #include <precomp.h>
00045
00046
00047  // work around GCC's wide string constant bug
00048 #ifdef __GNUC__
00049 const LPCXSSTR XMLStorage::XS_TRUE = XS_TRUE_STR;
00050 const LPCXSSTR XMLStorage::XS_FALSE = XS_FALSE_STR;
00051 const LPCXSSTR XMLStorage::XS_NUMBERFMT = XS_NUMBERFMT_STR;
00052 #endif
00053
00054
00055 namespace XMLStorage {
00056
00057
00059 static std::string unescape(const char* s, char b='"', char e='"')
00060 {
00061         const char* end = s + strlen(s);
00062
00063 //      if (*s == b)
00064 //              ++s;
00065 //
00066 //      if (end>s && end[-1]==e)
00067 //              --end;
00068
00069         if (*s == b)
00070                 if (end>s && end[-1]==e)
00071                         ++s, --end;
00072
00073         return std::string(s, end-s);
00074 }
00075
00077 static std::string unescape(const char* s, int l, char b='"', char e='"')
00078 {
00079         const char* end = s + l;
00080
00081 //      if (*s == b)
00082 //              ++s;
00083 //
00084 //      if (end>s && end[-1]==e)
00085 //              --end;
00086
00087         if (*s == b)
00088                 if (end>s && end[-1]==e)
00089                         ++s, --end;
00090
00091         return std::string(s, end-s);
00092 }
00093
00094
00096 bool XMLPos::go(const char* path)
00097 {
00098         XMLNode* node = _cur;
00099
00100          // Is this an absolute path?
00101         if (*path == '/') {
00102                 node = _root;
00103                 ++path;
00104         }
00105
00106         node = node->find_relative(path);
00107
00108         if (node) {
00109                 go_to(node);
00110                 return true;
00111         } else
00112                 return false;
00113 }
00114
00116 bool const_XMLPos::go(const char* path)
00117 {
00118         const XMLNode* node = _cur;
00119
00120          // Is this an absolute path?
00121         if (*path == '/') {
00122                 node = _root;
00123                 ++path;
00124         }
00125
00126         node = node->find_relative(path);
00127
00128         if (node) {
00129                 go_to(node);
00130                 return true;
00131         } else
00132                 return false;
00133 }
00134
00135
00136 const XMLNode* XMLNode::find_relative(const char* path) const
00137 {
00138         const XMLNode* node = this;
00139
00140          // parse relative path
00141         while(*path) {
00142                 const char* slash = strchr(path, '/');
00143                 if (slash == path)
00144                         return NULL;
00145
00146                 int l = slash? slash-path: strlen(path);
00147                 std::string comp(path, l);
00148                 path += l;
00149
00150                  // look for [n] and [@attr_name="attr_value"] expressions in path components
00151                 const char* bracket = strchr(comp.c_str(), '[');
00152                 l = bracket? bracket-comp.c_str(): comp.length();
00153                 std::string child_name(comp.c_str(), l);
00154                 std::string attr_name, attr_value;
00155
00156                 int n = 0;
00157                 if (bracket) {
00158                         std::string expr = unescape(bracket, '[', ']');
00159                         const char* p = expr.c_str();
00160
00161                         n = atoi(p);    // read index number
00162
00163                         if (n)
00164                                 n = n - 1;      // convert into zero based index
00165
00166                         const char* at = strchr(p, '@');
00167
00168                         if (at) {
00169                                 p = at + 1;
00170                                 const char* equal = strchr(p, '=');
00171
00172                                  // read attribute name and value
00173                                 if (equal) {
00174                                         attr_name = unescape(p, equal-p);
00175                                         attr_value = unescape(equal+1);
00176                                 }
00177                         }
00178                 }
00179
00180                 if (attr_name.empty())
00181                          // search n.th child node with specified name
00182                         node = node->find(child_name, n);
00183                 else
00184                          // search n.th child node with specified name and matching attribute value
00185                         node = node->find(child_name, attr_name, attr_value, n);
00186
00187                 if (!node)
00188                         return NULL;
00189
00190                 if (*path == '/')
00191                         ++path;
00192         }
00193
00194         return node;
00195 }
00196
00197 XMLNode* XMLNode::create_relative(const char* path)
00198 {
00199         XMLNode* node = this;
00200
00201          // parse relative path
00202         while(*path) {
00203                 const char* slash = strchr(path, '/');
00204                 if (slash == path)
00205                         return NULL;
00206
00207                 int l = slash? slash-path: strlen(path);
00208                 std::string comp(path, l);
00209                 path += l;
00210
00211                  // look for [n] and [@attr_name="attr_value"] expressions in path components
00212                 const char* bracket = strchr(comp.c_str(), '[');
00213                 l = bracket? bracket-comp.c_str(): comp.length();
00214                 std::string child_name(comp.c_str(), l);
00215                 std::string attr_name, attr_value;
00216
00217                 int n = 0;
00218                 if (bracket) {
00219                         std::string expr = unescape(bracket, '[', ']');
00220                         const char* p = expr.c_str();
00221
00222                         n = atoi(p);    // read index number
00223
00224                         if (n)
00225                                 n = n - 1;      // convert into zero based index
00226
00227                         const char* at = strchr(p, '@');
00228
00229                         if (at) {
00230                                 p = at + 1;
00231                                 const char* equal = strchr(p, '=');
00232
00233                                  // read attribute name and value
00234                                 if (equal) {
00235                                         attr_name = unescape(p, equal-p);
00236                                         attr_value = unescape(equal+1);
00237                                 }
00238                         }
00239                 }
00240
00241                 XMLNode* child;
00242
00243                 if (attr_name.empty())
00244                          // search n.th child node with specified name
00245                         child = node->find(child_name, n);
00246                 else
00247                          // search n.th child node with specified name and matching attribute value
00248                         child = node->find(child_name, attr_name, attr_value, n);
00249
00250                 if (!child) {
00251                         child = new XMLNode(child_name);
00252                         node->add_child(child);
00253
00254                         if (!attr_name.empty())
00255                                 (*node)[attr_name] = attr_value;
00256                 }
00257
00258                 node = child;
00259
00260                 if (*path == '/')
00261                         ++path;
00262         }
00263
00264         return node;
00265 }
00266
00267
00269 XML_Status XMLReaderBase::read()
00270 {
00271         XML_Status status = XML_STATUS_OK;
00272
00273         while(status == XML_STATUS_OK) {
00274                 char* buffer = (char*) XML_GetBuffer(_parser, BUFFER_LEN);
00275
00276                 int l = read_buffer(buffer, BUFFER_LEN);
00277                 if (l < 0)
00278                         break;
00279
00280                 status = XML_ParseBuffer(_parser, l, false);
00281         }
00282
00283         if (status != XML_STATUS_ERROR)
00284                 status = XML_ParseBuffer(_parser, 0, true);
00285
00286         if (_pos->_children.empty())
00287                 _pos->_trailing.append(_content);
00288         else
00289                 _pos->_children.back()->_trailing.append(_content);
00290
00291         _content.erase();
00292
00293         return status;
00294 }
00295
00296
00298 void XMLCALL XMLReaderBase::XML_XmlDeclHandler(void* userData, const XML_Char* version, const XML_Char* encoding, int standalone)
00299 {
00300         XMLReaderBase* pReader = (XMLReaderBase*) userData;
00301
00302         if (version)
00303                 pReader->_xml_version = version;
00304
00305         if (encoding)
00306                 pReader->_encoding = encoding;
00307 }
00308
00310 void XMLCALL XMLReaderBase::XML_StartElementHandler(void* userData, const XML_Char* name, const XML_Char** atts)
00311 {
00312         XMLReaderBase* pReader = (XMLReaderBase*) userData;
00313         XMLPos& pos = pReader->_pos;
00314
00315          // search for end of first line
00316         const char* s = pReader->_content.c_str();
00317         const char* p = s;
00318         const char* e = p + pReader->_content.length();
00319
00320         for(; p<e; ++p)
00321                 if (*p == '\n') {
00322                         ++p;
00323                         break;
00324                 }
00325
00326         if (p != s)
00327                 if (pos->_children.empty()) {   // no children in last node?
00328                         if (pReader->_last_tag == TAG_START)
00329                                 pos->_content.append(s, p-s);
00330                         else if (pReader->_last_tag == TAG_END)
00331                                 pos->_trailing.append(s, p-s);
00332                         // else TAG_NONE -> don't store white space in root node
00333                 } else
00334                         pos->_children.back()->_trailing.append(s, p-s);
00335
00336         std::string leading;
00337
00338         if (p != e)
00339                 leading.assign(p, e-p);
00340
00341         XMLNode* node = new XMLNode(String_from_XML_Char(name), leading);
00342
00343         pos.add_down(node);
00344
00345         while(*atts) {
00346                 const XML_Char* attr_name = *atts++;
00347                 const XML_Char* attr_value = *atts++;
00348
00349                 (*node)[String_from_XML_Char(attr_name)] = String_from_XML_Char(attr_value);
00350         }
00351
00352         pReader->_last_tag = TAG_START;
00353         pReader->_content.erase();
00354 }
00355
00357 void XMLCALL XMLReaderBase::XML_EndElementHandler(void* userData, const XML_Char* name)
00358 {
00359         XMLReaderBase* pReader = (XMLReaderBase*) userData;
00360         XMLPos& pos = pReader->_pos;
00361
00362          // search for end of first line
00363         const char* s = pReader->_content.c_str();
00364         const char* p = s;
00365         const char* e = p + pReader->_content.length();
00366
00367         for(; p<e; ++p)
00368                 if (*p == '\n') {
00369                         ++p;
00370                         break;
00371                 }
00372
00373         if (p != s)
00374                 if (pos->_children.empty())     // no children in current node?
00375                         pos->_content.append(s, p-s);
00376                 else
00377                         if (pReader->_last_tag == TAG_START)
00378                                 pos->_content.append(s, p-s);
00379                         else
00380                                 pos->_children.back()->_trailing.append(s, p-s);
00381
00382         if (p != e)
00383                 pos->_end_leading.assign(p, e-p);
00384
00385         pos.back();
00386
00387         pReader->_last_tag = TAG_END;
00388         pReader->_content.erase();
00389 }
00390
00392 void XMLCALL XMLReaderBase::XML_DefaultHandler(void* userData, const XML_Char* s, int len)
00393 {
00394         XMLReaderBase* pReader = (XMLReaderBase*) userData;
00395
00396         pReader->_content.append(s, len);
00397 }
00398
00399
00401 std::string XMLReaderBase::get_error_string() const
00402 {
00403         XML_Error error = XML_GetErrorCode(_parser);
00404
00405         switch(error) {
00406           case XML_ERROR_NONE:                                                          return "XML_ERROR_NONE";
00407           case XML_ERROR_NO_MEMORY:                                                     return "XML_ERROR_NO_MEMORY";
00408           case XML_ERROR_SYNTAX:                                                        return "XML_ERROR_SYNTAX";
00409           case XML_ERROR_NO_ELEMENTS:                                           return "XML_ERROR_NO_ELEMENTS";
00410           case XML_ERROR_INVALID_TOKEN:                                         return "XML_ERROR_INVALID_TOKEN";
00411           case XML_ERROR_UNCLOSED_TOKEN:                                        return "XML_ERROR_UNCLOSED_TOKEN";
00412           case XML_ERROR_PARTIAL_CHAR:                                          return "XML_ERROR_PARTIAL_CHAR";
00413           case XML_ERROR_TAG_MISMATCH:                                          return "XML_ERROR_TAG_MISMATCH";
00414           case XML_ERROR_DUPLICATE_ATTRIBUTE:                           return "XML_ERROR_DUPLICATE_ATTRIBUTE";
00415           case XML_ERROR_JUNK_AFTER_DOC_ELEMENT:                        return "XML_ERROR_JUNK_AFTER_DOC_ELEMENT";
00416           case XML_ERROR_PARAM_ENTITY_REF:                                      return "XML_ERROR_PARAM_ENTITY_REF";
00417           case XML_ERROR_UNDEFINED_ENTITY:                                      return "XML_ERROR_UNDEFINED_ENTITY";
00418           case XML_ERROR_RECURSIVE_ENTITY_REF:                          return "XML_ERROR_RECURSIVE_ENTITY_REF";
00419           case XML_ERROR_ASYNC_ENTITY:                                          return "XML_ERROR_ASYNC_ENTITY";
00420           case XML_ERROR_BAD_CHAR_REF:                                          return "XML_ERROR_BAD_CHAR_REF";
00421           case XML_ERROR_BINARY_ENTITY_REF:                                     return "XML_ERROR_BINARY_ENTITY_REF";
00422           case XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF:         return "XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF";
00423           case XML_ERROR_MISPLACED_XML_PI:                                      return "XML_ERROR_MISPLACED_XML_PI";
00424           case XML_ERROR_UNKNOWN_ENCODING:                                      return "XML_ERROR_UNKNOWN_ENCODING";
00425           case XML_ERROR_INCORRECT_ENCODING:                            return "XML_ERROR_INCORRECT_ENCODING";
00426           case XML_ERROR_UNCLOSED_CDATA_SECTION:                        return "XML_ERROR_UNCLOSED_CDATA_SECTION";
00427           case XML_ERROR_EXTERNAL_ENTITY_HANDLING:                      return "XML_ERROR_EXTERNAL_ENTITY_HANDLING";
00428           case XML_ERROR_NOT_STANDALONE:                                        return "XML_ERROR_NOT_STANDALONE";
00429           case XML_ERROR_UNEXPECTED_STATE:                                      return "XML_ERROR_UNEXPECTED_STATE";
00430           case XML_ERROR_ENTITY_DECLARED_IN_PE:                         return "XML_ERROR_ENTITY_DECLARED_IN_PE";
00431           case XML_ERROR_FEATURE_REQUIRES_XML_DTD:                      return "XML_ERROR_FEATURE_REQUIRES_XML_DTD";
00432           case XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING:      return "XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING";
00433           case XML_ERROR_UNBOUND_PREFIX:                                        return "XML_ERROR_UNBOUND_PREFIX";
00434  // EXPAT version >= 1.95.8
00435 #if XML_MAJOR_VERSION>1 || (XML_MAJOR_VERSION==1 && XML_MINOR_VERSION>95) || (XML_MAJOR_VERSION==1 && XML_MINOR_VERSION==95 && XML_MICRO_VERSION>7)
00436           case XML_ERROR_UNDECLARING_PREFIX:                            return "XML_ERROR_UNDECLARING_PREFIX";
00437           case XML_ERROR_INCOMPLETE_PE:                                         return "XML_ERROR_INCOMPLETE_PE";
00438           case XML_ERROR_XML_DECL:                                                      return "XML_ERROR_XML_DECL";
00439           case XML_ERROR_TEXT_DECL:                                                     return "XML_ERROR_TEXT_DECL";
00440           case XML_ERROR_PUBLICID:                                                      return "XML_ERROR_PUBLICID";
00441           case XML_ERROR_SUSPENDED:                                                     return "XML_ERROR_SUSPENDED";
00442           case XML_ERROR_NOT_SUSPENDED:                                         return "XML_ERROR_NOT_SUSPENDED";
00443           case XML_ERROR_ABORTED:                                                       return "XML_ERROR_ABORTED";
00444           case XML_ERROR_FINISHED:                                                      return "XML_ERROR_FINISHED";
00445           case XML_ERROR_SUSPEND_PE:                                            return "XML_ERROR_SUSPEND_PE";
00446 //#endif
00447 //#if XML_MAJOR_VERSION>=2
00448                 /* Added in 2.0. */
00449           case XML_ERROR_RESERVED_PREFIX_XML:                           return "XML_ERROR_RESERVED_PREFIX_XML";
00450           case XML_ERROR_RESERVED_PREFIX_XMLNS:                         return "XML_ERROR_RESERVED_PREFIX_XMLNS";
00451           case XML_ERROR_RESERVED_NAMESPACE_URI:                        return "XML_ERROR_RESERVED_NAMESPACE_URI";
00452 #endif
00453         }
00454
00455         std::ostringstream out;
00456
00457         out << "XML parser error #" << error;
00458
00459         return out.str();
00460 }
00461
00462
00464 std::string EncodeXMLString(const XS_String& str)
00465 {
00466         LPCXSSTR s = str.c_str();
00467         LPXSSTR buffer = (LPXSSTR)alloca(6*sizeof(XS_CHAR)*XS_len(s));  // worst case "&quot;" / "&apos;"
00468         LPXSSTR o = buffer;
00469
00470         for(LPCXSSTR p=s; *p; ++p)
00471                 switch(*p) {
00472                   case '&':
00473                         *o++ = '&';     *o++ = 'a';     *o++ = 'm';     *o++ = 'p';     *o++ = ';';
00474                         break;
00475
00476                   case '<':
00477                         *o++ = '&';     *o++ = 'l'; *o++ = 't'; *o++ = ';';
00478                         break;
00479
00480                   case '>':
00481                         *o++ = '&';     *o++ = 'g'; *o++ = 't'; *o++ = ';';
00482                         break;
00483
00484                   case '"':
00485                         *o++ = '&';     *o++ = 'q'; *o++ = 'u'; *o++ = 'o'; *o++ = 't'; *o++ = ';';
00486                         break;
00487
00488                   case '\'':
00489                         *o++ = '&';     *o++ = 'a'; *o++ = 'p'; *o++ = 'o'; *o++ = 's'; *o++ = ';';
00490                         break;
00491
00492                   default:
00493                         if ((unsigned)*p<20 && *p!='\t' && *p!='\r' && *p!='\n') {
00494                                 char b[16];
00495                                 sprintf(b, "&%d;", (unsigned)*p);
00496                                 for(const char*q=b; *q; )
00497                                         *o++ = *q++;
00498                         } else
00499                                 *o++ = *p;
00500                 }
00501
00502 #ifdef XS_STRING_UTF8
00503         return XS_String(buffer, o-buffer);
00504 #else
00505         return get_utf8(buffer, o-buffer);
00506 #endif
00507 }
00508
00510 XS_String DecodeXMLString(const XS_String& str)
00511 {
00512         LPCXSSTR s = str.c_str();
00513         LPXSSTR buffer = (LPXSSTR)alloca(sizeof(XS_CHAR)*XS_len(s));
00514         LPXSSTR o = buffer;
00515
00516         for(LPCXSSTR p=s; *p; ++p)
00517                 if (*p == '&') {
00518                         if (!XS_nicmp(p+1, XS_TEXT("lt;"), 3)) {
00519                                 *o++ = '<';
00520                                 p += 3;
00521                         } else if (!XS_nicmp(p+1, XS_TEXT("gt;"), 3)) {
00522                                 *o++ = '>';
00523                                 p += 3;
00524                         } else if (!XS_nicmp(p+1, XS_TEXT("amp;"), 4)) {
00525                                 *o++ = '&';
00526                                 p += 4;
00527                         } else if (!XS_nicmp(p+1, XS_TEXT("quot;"), 5)) {
00528                                 *o++ = '"';
00529                                 p += 5;
00530                         } else if (!XS_nicmp(p+1, XS_TEXT("apos;"), 5)) {
00531                                 *o++ = '\'';
00532                                 p += 5;
00533                         } else
00534                                 *o++ = *p;
00535                 } else
00536                         *o++ = *p;
00537
00538         return XS_String(buffer, o-buffer);
00539 }
00540
00541
00543 void XMLNode::write_worker(std::ostream& out, int indent) const
00544 {
00545         out << _leading << '<' << EncodeXMLString(*this);
00546
00547         for(AttributeMap::const_iterator it=_attributes.begin(); it!=_attributes.end(); ++it)
00548                 out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\"";
00549
00550         if (!_children.empty() || !_content.empty()) {
00551                 out << '>' << _content;
00552
00553                 for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it)
00554                         (*it)->write_worker(out, indent+1);
00555
00556                 out << _end_leading << "</" << EncodeXMLString(*this) << '>';
00557         } else
00558                 out << "/>";
00559
00560         out << _trailing;
00561 }
00562
00563
00565 void XMLNode::pretty_write_worker(std::ostream& out, int indent) const
00566 {
00567         for(int i=indent; i--; )
00568                 out << XML_INDENT_SPACE;
00569
00570         out << '<' << EncodeXMLString(*this);
00571
00572         for(AttributeMap::const_iterator it=_attributes.begin(); it!=_attributes.end(); ++it)
00573                 out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\"";
00574
00575         if (!_children.empty() || !_content.empty()) {
00576                 out << ">\n";
00577
00578                 for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it)
00579                         (*it)->pretty_write_worker(out, indent+1);
00580
00581                 for(int i=indent; i--; )
00582                         out << XML_INDENT_SPACE;
00583
00584                 out << "</" << EncodeXMLString(*this) << ">\n";
00585         } else
00586                 out << "/>\n";
00587 }
00588
00589
00591 void XMLNode::smart_write_worker(std::ostream& out, int indent) const
00592 {
00593         if (_leading.empty())
00594                 for(int i=indent; i--; )
00595                         out << XML_INDENT_SPACE;
00596         else
00597                 out << _leading;
00598
00599         out << '<' << EncodeXMLString(*this);
00600
00601         for(AttributeMap::const_iterator it=_attributes.begin(); it!=_attributes.end(); ++it)
00602                 out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\"";
00603
00604         if (_children.empty() && _content.empty())
00605                 out << "/>";
00606         else {
00607                 out << '>';
00608
00609                 if (_content.empty())
00610                         out << '\n';
00611                 else
00612                         out << _content;
00613
00614                 Children::const_iterator it = _children.begin();
00615
00616                 if (it != _children.end()) {
00617                         for(; it!=_children.end(); ++it)
00618                                 (*it)->smart_write_worker(out, indent+1);
00619
00620                         if (_end_leading.empty())
00621                                 for(int i=indent; i--; )
00622                                         out << XML_INDENT_SPACE;
00623                         else
00624                                 out << _end_leading;
00625                 } else
00626                         out << _end_leading;
00627
00628                 out << "</" << EncodeXMLString(*this) << '>';
00629         }
00630
00631         if (_trailing.empty())
00632                 out << '\n';
00633         else
00634                 out << _trailing;
00635 }
00636
00637
00638 }       // namespace XMLStorage


ROS Explorer: xmlstorage.h File Reference

  • File List
  • File Members
utility

xmlstorage.h File Reference

#include <expat/expat.h>
#include <windows.h>
#include <tchar.h>
#include <malloc.h>
#include <fstream>
#include <sstream>
#include <string>
#include <stack>
#include <list>
#include <map>

Include dependency graph for xmlstorage.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace | XMLStorage

Classes

struct | XMLStorage::XS_String
string class for TCHAR strings More...
struct | XMLStorage::FileHolder
struct | XMLStorage::tifstream
input file stream with ANSI/UNICODE file names More...
struct | XMLStorage::tofstream
output file stream with ANSI/UNICODE file names More...
struct | XMLStorage::String_from_XML_Char
converter from Expat strings to XMLStorage internal strings More...
struct | XMLStorage::XMLNode
in memory representation of an XML node More...
struct | XMLStorage::XMLNode::Children
internal children node list More...
struct | XMLStorage::XMLChildrenFilter
iterator access to children nodes with name filtering More...
struct | XMLStorage::XMLChildrenFilter::iterator
internal iterator class More...
struct | XMLStorage::const_XMLChildrenFilter
read only iterator access to children nodes with name filtering More...
struct | XMLStorage::const_XMLChildrenFilter::const_iterator
internal iterator class More...
struct | XMLStorage::XMLPos
iterator for XML trees More...
struct | XMLStorage::const_XMLPos
iterator for XML trees More...
struct | XMLStorage::XMLBool
type converter for boolean data More...
struct | XMLStorage::XMLBoolRef
type converter for boolean data with write access More...
struct | XMLStorage::XMLInt
type converter for integer data More...
struct | XMLStorage::XMLIntRef
type converter for integer data with write access More...
struct | XMLStorage::XMLString
type converter for string data More...
struct | XMLStorage::XMStringRef
type converter for string data with write access More...
struct | XMLStorage::XMLReaderBase
XML reader base class. More...
struct | XMLStorage::XMLReader
XML file reader. More...
struct | XMLStorage::XMLHeader
management of XML file headers More...
struct | XMLStorage::XMLDoc
XML document holder. More...
struct | XMLStorage::XMLMessage
XML message wrapper. More...
struct | XMLStorage::XMLWriter
struct | XMLStorage::XMLWriter::StackEntry

Defines

#define | BUFFER_LEN 2048
#define | XS_CHAR TCHAR
#define | XS_TEXT(x) TEXT(x)
#define | LPXSSTR LPTSTR
#define | LPCXSSTR LPCTSTR
#define | XS_icmp _tcsicmp
#define | XS_nicmp _tcsnicmp
#define | XS_toi _ttoi
#define | XS_len _tcslen
#define | XS_snprintf _sntprintf
#define | XS_vsnprintf _vsntprintf
#define | COUNTOF(b) (sizeof(b)/sizeof(b[0]))
#define | XML_INDENT_SPACE " "
#define | XS_TRUE_STR XS_TEXT("true")
#define | XS_FALSE_STR XS_TEXT("false")
#define | XS_NUMBERFMT_STR XS_TEXT("%d")
#define | XS_TRUE XS_TRUE_STR
#define | XS_FALSE XS_FALSE_STR
#define | XS_NUMBERFMT XS_NUMBERFMT_STR
#define | _XMLSTORAGE_H

Typedefs

typedef std::filebuf | XMLStorage::STDIO_FILEBUF

Enumerations

enum | XMLStorage::PRETTY_FLAGS { XMLStorage::PRETTY_PLAIN = 0, XMLStorage::PRETTY_LINEFEED = 1, XMLStorage::PRETTY_INDENT = 2 }

Functions

void | XMLStorage::assign_utf8 (XS_String &s, const char *str)
std::string | XMLStorage::get_utf8 (LPCTSTR s, size_t l)
std::string | XMLStorage::get_utf8 (const XS_String &s)
std::string | XMLStorage::EncodeXMLString (const XS_String &str)
encode XML string literals
XS_String | XMLStorage::DecodeXMLString (const XS_String &str)
decode XML string literals
template<typename T>
void | XMLStorage::read_option (T &var, const_XMLPos &cfg, LPCXSSTR key)
template<>
void | XMLStorage::read_option (int &var, const_XMLPos &cfg, LPCXSSTR key)

Define Documentation

#define _XMLSTORAGE_H

Definition at line 1939 of file xmlstorage.h.

#define BUFFER_LEN 2048

Definition at line 67 of file xmlstorage.h.

#define COUNTOF ( b ) (sizeof(b)/sizeof(b[0]))

Definition at line 101 of file xmlstorage.h.

#define LPCXSSTR LPCTSTR

Definition at line 91 of file xmlstorage.h.

Referenced by XMLStorage::DecodeXMLString(), and XMLStorage::EncodeXMLString().

#define LPXSSTR LPTSTR

Definition at line 90 of file xmlstorage.h.

Referenced by XMLStorage::DecodeXMLString(), and XMLStorage::EncodeXMLString().

#define XML_INDENT_SPACE " "

Definition at line 342 of file xmlstorage.h.

Referenced by XMLStorage::XMLNode::pretty_write_worker(), XMLStorage::XMLNode::smart_write_worker(), XMLStorage::XMLWriter::write_post(), and XMLStorage::XMLWriter::write_pre().

#define XS_CHAR TCHAR

Definition at line 88 of file xmlstorage.h.

Referenced by XMLStorage::XS_String::appendf(), XMLStorage::XMLIntRef::assign(), XMLStorage::EncodeXMLString(), XMLStorage::XMLInt::operator XS_String(), XMLStorage::XS_String::printf(), XMLStorage::XS_String::vappendf(), and XMLStorage::XS_String::vprintf().

#define XS_FALSE XS_FALSE_STR

Definition at line 1254 of file xmlstorage.h.

Referenced by XMLStorage::XMLBoolRef::assign(), and XMLStorage::XMLBool::operator LPCXSSTR().

#define XS_FALSE_STR XS_TEXT("false")

Definition at line 1244 of file xmlstorage.h.

#define XS_icmp _tcsicmp

Definition at line 92 of file xmlstorage.h.

Referenced by XMLStorage::XMLBoolRef::operator bool(), XMLStorage::XMLBoolRef::operator!(), and XMLStorage::XMLBool::XMLBool().

#define XS_len _tcslen

Definition at line 95 of file xmlstorage.h.

Referenced by XMLStorage::DecodeXMLString(), and XMLStorage::EncodeXMLString().

#define XS_nicmp _tcsnicmp

Definition at line 93 of file xmlstorage.h.

Referenced by XMLStorage::DecodeXMLString().

#define XS_NUMBERFMT XS_NUMBERFMT_STR

Definition at line 1255 of file xmlstorage.h.

Referenced by XMLStorage::XMLIntRef::assign(), and XMLStorage::XMLInt::operator XS_String().

#define XS_NUMBERFMT_STR XS_TEXT("%d")

Definition at line 1245 of file xmlstorage.h.

#define XS_snprintf _sntprintf

Definition at line 96 of file xmlstorage.h.

Referenced by XMLStorage::XMLIntRef::assign(), and XMLStorage::XMLInt::operator XS_String().

#define XS_TEXT ( x ) TEXT(x)

Definition at line 89 of file xmlstorage.h.

Referenced by XMLStorage::DecodeXMLString().

#define XS_toi _ttoi

Definition at line 94 of file xmlstorage.h.

Referenced by XMLStorage::XMLIntRef::operator int(), XMLStorage::read_option(), and XMLStorage::XMLInt::XMLInt().

#define XS_TRUE XS_TRUE_STR

Definition at line 1253 of file xmlstorage.h.

Referenced by XMLStorage::XMLBoolRef::operator bool(), XMLStorage::XMLBool::operator LPCXSSTR(), XMLStorage::XMLBoolRef::operator!(), and XMLStorage::XMLBool::XMLBool().

#define XS_TRUE_STR XS_TEXT("true")

Definition at line 1243 of file xmlstorage.h.

#define XS_vsnprintf _vsntprintf

Definition at line 97 of file xmlstorage.h.

Referenced by XMLStorage::XS_String::appendf(), XMLStorage::XS_String::printf(), XMLStorage::XS_String::vappendf(), and XMLStorage::XS_String::vprintf().


ROS Explorer: xmlstorage.h Source File

  • File List
  • File Members
utility

xmlstorage.h

Go to the documentation of this file.
00001
00002  //
00003  // XML storage classes
00004  //
00005  // xmlstorage.h
00006  //
00007  // Copyright (c) 2004, 2005 Martin Fuchs <martin-fuchs@gmx.net>
00008  //
00009
00010
00011 /*
00012
00013   All rights reserved.
00014
00015   Redistribution and use in source and binary forms, with or without
00016   modification, are permitted provided that the following conditions are met:
00017
00018   * Redistributions of source code must retain the above copyright
00019         notice, this list of conditions and the following disclaimer.
00020   * Redistributions in binary form must reproduce the above copyright
00021         notice, this list of conditions and the following disclaimer in
00022         the documentation and/or other materials provided with the
00023         distribution.
00024
00025   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00026   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00028   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00029   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00030   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00031   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00032   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00033   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00034   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00035   POSSIBILITY OF SUCH DAMAGE.
00036
00037 */
00038
00039 #ifndef _XMLSTORAGE_H
00040
00041 #include <expat/expat.h>
00042
00043 #ifdef _MSC_VER
00044 #pragma comment(lib, "libexpat.lib")
00045 #pragma warning(disable: 4786)
00046 #endif
00047
00048
00049 #include <windows.h>    // for LPCTSTR
00050
00051 #ifdef UNICODE
00052 #define _UNICODE
00053 #endif
00054
00055 #include <tchar.h>
00056 #include <malloc.h>
00057
00058 #include <fstream>
00059 #include <sstream>
00060 #include <string>
00061 #include <stack>
00062 #include <list>
00063 #include <map>
00064
00065
00066 #ifndef BUFFER_LEN
00067 #define BUFFER_LEN 2048
00068 #endif
00069
00070
00071 namespace XMLStorage {
00072
00073
00074 #ifndef XS_String
00075
00076 #ifdef XS_STRING_UTF8
00077 #define XS_CHAR char
00078 #define XS_TEXT(x) x
00079 #define LPXSSTR LPSTR
00080 #define LPCXSSTR LPCSTR
00081 #define XS_icmp stricmp
00082 #define XS_nicmp strnicmp
00083 #define XS_toi atoi
00084 #define XS_len strlen
00085 #define XS_snprintf snprintf
00086 #define XS_vsnprintf vsnprintf
00087 #else
00088 #define XS_CHAR TCHAR
00089 #define XS_TEXT(x) TEXT(x)
00090 #define LPXSSTR LPTSTR
00091 #define LPCXSSTR LPCTSTR
00092 #define XS_icmp _tcsicmp
00093 #define XS_nicmp _tcsnicmp
00094 #define XS_toi _ttoi
00095 #define XS_len _tcslen
00096 #define XS_snprintf _sntprintf
00097 #define XS_vsnprintf _vsntprintf
00098 #endif
00099
00100 #ifndef COUNTOF
00101 #define COUNTOF(b) (sizeof(b)/sizeof(b[0]))
00102 #endif
00103
00104 #if defined(_STRING_DEFINED) && !defined(XS_STRING_UTF8)
00105
00106 #define XS_String String
00107
00108 #else // _STRING_DEFINED, !XS_STRING_UTF8
00109
00111
00112 struct XS_String
00113 #if defined(UNICODE) && !defined(XS_STRING_UTF8)
00114  : public std::wstring
00115 #else
00116  : public std::string
00117 #endif
00118 {
00119 #if defined(UNICODE) && !defined(XS_STRING_UTF8)
00120         typedef std::wstring super;
00121 #else
00122         typedef std::string super;
00123 #endif
00124
00125         XS_String() {}
00126
00127         XS_String(LPCXSSTR s) {if (s) super::assign(s);}
00128         XS_String(LPCXSSTR s, size_t l) : super(s, l) {}
00129
00130         XS_String(const super& other) : super(other) {}
00131         XS_String(const XS_String& other) : super(other) {}
00132
00133 #if defined(UNICODE) && !defined(XS_STRING_UTF8)
00134         XS_String(LPCSTR s) {assign(s);}
00135         XS_String(LPCSTR s, size_t l) {assign(s, l);}
00136         XS_String(const std::string& other) {assign(other.c_str());}
00137         XS_String& operator=(LPCSTR s) {assign(s); return *this;}
00138         void assign(LPCSTR s) {if (s) {size_t bl=strlen(s); LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); super::assign(b, MultiByteToWideChar(CP_ACP, 0, s, bl, b, bl));} else erase();}
00139         void assign(LPCSTR s, size_t l) {if (s) {size_t bl=l; LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); super::assign(b, MultiByteToWideChar(CP_ACP, 0, s, l, b, bl));} else erase();}
00140 #else
00141         XS_String(LPCWSTR s) {assign(s);}
00142         XS_String(LPCWSTR s, size_t l) {assign(s, l);}
00143         XS_String(const std::wstring& other) {assign(other.c_str());}
00144         XS_String& operator=(LPCWSTR s) {assign(s); return *this;}
00145 #ifdef XS_STRING_UTF8
00146         void assign(const XS_String& s) {assign(s.c_str());}
00147         void assign(LPCWSTR s) {if (s) {size_t bl=wcslen(s); LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_UTF8, 0, s, (int)bl, b, (int)bl, 0, 0));} else erase();}
00148         void assign(LPCWSTR s, size_t l) {size_t bl=l; if (s) {LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_UTF8, 0, s, (int)l, b, (int)bl, 0, 0));} else erase();}
00149 #else // if !UNICODE && !XS_STRING_UTF8
00150         void assign(LPCWSTR s) {if (s) {size_t bl=wcslen(s); LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, (int)bl, b, (int)bl, 0, 0));} else erase();}
00151         void assign(LPCWSTR s, size_t l) {size_t bl=l; if (s) {LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, (int)l, b, (int)bl, 0, 0));} else erase();}
00152 #endif
00153 #endif
00154
00155         XS_String& operator=(LPCXSSTR s) {if (s) super::assign(s); else erase(); return *this;}
00156         XS_String& operator=(const super& s) {super::assign(s); return *this;}
00157         void assign(LPCXSSTR s) {super::assign(s);}
00158         void assign(LPCXSSTR s, size_t l) {super::assign(s, l);}
00159
00160         operator LPCXSSTR() const {return c_str();}
00161
00162 #ifdef XS_STRING_UTF8
00163         operator std::wstring() const {size_t bl=length(); LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); return std::wstring(b, MultiByteToWideChar(CP_UTF8, 0, c_str(), bl, b, bl));}
00164 #elif defined(UNICODE)
00165         operator std::string() const {size_t bl=length(); LPSTR b=(LPSTR)alloca(bl); return std::string(b, WideCharToMultiByte(CP_ACP, 0, c_str(), bl, b, bl, 0, 0));}
00166 #else
00167         operator std::wstring() const {size_t bl=length(); LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); return std::wstring(b, MultiByteToWideChar(CP_ACP, 0, c_str(), (int)bl, b, (int)bl));}
00168 #endif
00169
00170         XS_String& printf(LPCXSSTR fmt, ...)
00171         {
00172                 va_list l;
00173                 XS_CHAR b[BUFFER_LEN];
00174
00175                 va_start(l, fmt);
00176                 super::assign(b, XS_vsnprintf(b, COUNTOF(b), fmt, l));
00177                 va_end(l);
00178
00179                 return *this;
00180         }
00181
00182         XS_String& vprintf(LPCXSSTR fmt, va_list l)
00183         {
00184                 XS_CHAR b[BUFFER_LEN];
00185
00186                 super::assign(b, XS_vsnprintf(b, COUNTOF(b), fmt, l));
00187
00188                 return *this;
00189         }
00190
00191         XS_String& appendf(LPCXSSTR fmt, ...)
00192         {
00193                 va_list l;
00194                 XS_CHAR b[BUFFER_LEN];
00195
00196                 va_start(l, fmt);
00197                 super::append(b, XS_vsnprintf(b, COUNTOF(b), fmt, l));
00198                 va_end(l);
00199
00200                 return *this;
00201         }
00202
00203         XS_String& vappendf(LPCXSSTR fmt, va_list l)
00204         {
00205                 XS_CHAR b[BUFFER_LEN];
00206
00207                 super::append(b, XS_vsnprintf(b, COUNTOF(b), fmt, l));
00208
00209                 return *this;
00210         }
00211 };
00212
00213 #endif // _STRING_DEFINED, !XS_STRING_UTF8
00214
00215 #endif // XS_String
00216
00217
00218 #ifndef XS_STRING_UTF8
00219
00220 inline void assign_utf8(XS_String& s, const char* str)
00221 {
00222         int lutf8 = (int)strlen(str);
00223
00224 #ifdef UNICODE
00225         LPTSTR buffer = (LPTSTR)alloca(sizeof(TCHAR)*lutf8);
00226         int l = MultiByteToWideChar(CP_UTF8, 0, str, lutf8, buffer, lutf8);
00227 #else
00228         LPWSTR wbuffer = (LPWSTR)alloca(sizeof(WCHAR)*lutf8);
00229         int l = MultiByteToWideChar(CP_UTF8, 0, str, lutf8, wbuffer, lutf8);
00230
00231         int bl=2*l; LPSTR buffer = (LPSTR)alloca(bl);
00232         l = WideCharToMultiByte(CP_ACP, 0, wbuffer, l, buffer, bl, 0, 0);
00233 #endif
00234
00235         s.assign(buffer, l);
00236 }
00237
00238 inline std::string get_utf8(LPCTSTR s, size_t l)
00239 {
00240 #ifdef UNICODE
00241         size_t bl=2*l; LPSTR buffer = (LPSTR)alloca(bl);
00242         l = WideCharToMultiByte(CP_UTF8, 0, s, (int)l, buffer, (int)bl, 0, 0);
00243 #else
00244         LPWSTR wbuffer = (LPWSTR)alloca(sizeof(WCHAR)*l);
00245         l = MultiByteToWideChar(CP_ACP, 0, s, (int)l, wbuffer, (int)l);
00246
00247         size_t bl=2*l; LPSTR buffer = (LPSTR)alloca(bl);
00248         l = WideCharToMultiByte(CP_UTF8, 0, wbuffer, (int)l, buffer, (int)bl, 0, 0);
00249 #endif
00250
00251         return std::string(buffer, l);
00252 }
00253
00254 inline std::string get_utf8(const XS_String& s)
00255 {
00256         return get_utf8(s.c_str(), s.length());
00257 }
00258
00259 #endif // XS_STRING_UTF8
00260
00261 extern std::string EncodeXMLString(const XS_String& str);
00262 extern XS_String DecodeXMLString(const XS_String& str);
00263
00264
00265 #ifdef __GNUC__
00266 #include <ext/stdio_filebuf.h>
00267 typedef __gnu_cxx::stdio_filebuf<char> STDIO_FILEBUF;
00268 #else
00269 typedef std::filebuf STDIO_FILEBUF;
00270 #endif
00271
00272
00273 struct FileHolder
00274 {
00275         FileHolder(LPCTSTR path, LPCTSTR mode)
00276         {
00277 #ifdef __STDC_WANT_SECURE_LIB__ // secure CRT functions using VS 2005
00278                 if (_tfopen_s(&_pfile, path, mode) != 0)
00279                         _pfile = NULL;
00280 #else
00281                 _pfile = _tfopen(path, mode);
00282 #endif
00283         }
00284
00285         ~FileHolder()
00286         {
00287                 if (_pfile)
00288                         fclose(_pfile);
00289         }
00290
00291 protected:
00292         FILE*   _pfile;
00293 };
00294
00296 struct tifstream : public std::istream, FileHolder
00297 {
00298         typedef std::istream super;
00299
00300         tifstream(LPCTSTR path)
00301          :      super(&_buf),
00302                 FileHolder(path, TEXT("r")),
00303 #ifdef __GNUC__
00304                 _buf(_pfile, ios::in)
00305 #else
00306                 _buf(_pfile)
00307 #endif
00308         {
00309         }
00310
00311 protected:
00312         STDIO_FILEBUF _buf;
00313 };
00314
00316 struct tofstream : public std::ostream, FileHolder
00317 {
00318         typedef std::ostream super;
00319
00320         tofstream(LPCTSTR path)
00321          :      super(&_buf),
00322                 FileHolder(path, TEXT("w")),
00323 #ifdef __GNUC__
00324                 _buf(_pfile, ios::out)
00325 #else
00326                 _buf(_pfile)
00327 #endif
00328         {
00329         }
00330
00331         ~tofstream()
00332         {
00333                 flush();
00334         }
00335
00336 protected:
00337         STDIO_FILEBUF _buf;
00338 };
00339
00340
00341  // write XML files with 2 spaces indenting
00342 #define XML_INDENT_SPACE "  "
00343
00344
00345 #ifdef XML_UNICODE      // Are XML_Char strings UTF-16 encoded?
00346
00347 typedef XS_String String_from_XML_Char;
00348
00349 #elif defined(XS_STRING_UTF8)
00350
00351 typedef XS_String String_from_XML_Char;
00352
00353 #else
00354
00356 struct String_from_XML_Char : public XS_String
00357 {
00358         String_from_XML_Char(const XML_Char* str)
00359         {
00360                 assign_utf8(*this, str);
00361         }
00362 };
00363
00364 #endif
00365
00366
00367 #if defined(UNICODE) && !defined(XS_STRING_UTF8)
00368
00369  // optimization for faster UNICODE/ASCII string comparison without temporary A/U conversion
00370 inline bool operator==(const XS_String& s1, const char* s2)
00371 {
00372         LPCWSTR p = s1;
00373         const unsigned char* q = (const unsigned char*)s2;
00374
00375         while(*p && *q)
00376                 if (*p++ != *q++)
00377                         return false;
00378
00379         return *p == *q;
00380 };
00381
00382 #endif
00383
00384
00386 struct XMLNode : public XS_String
00387 {
00388 #if defined(UNICODE) && !defined(XS_STRING_UTF8)
00389          // optimized read access without temporary A/U conversion when using ASCII attribute names
00390         struct AttributeMap : public std::map<XS_String, XS_String>
00391         {
00392                 typedef std::map<XS_String, XS_String> super;
00393
00394                 const_iterator find(const char* x) const
00395                 {
00396                         for(const_iterator it=begin(); it!=end(); ++it)
00397                                 if (it->first == x)
00398                                         return it;
00399
00400                         return end();
00401                 }
00402
00403                 const_iterator find(const key_type& x) const
00404                 {
00405                         return super::find(x);
00406                 }
00407
00408                 iterator find(const key_type& x)
00409                 {
00410                         return super::find(x);
00411                 }
00412         };
00413 #else
00414         typedef std::map<XS_String, XS_String> AttributeMap;
00415 #endif
00416
00418         struct Children : public std::list<XMLNode*>
00419         {
00420                 void assign(const Children& other)
00421                 {
00422                         clear();
00423
00424                         for(Children::const_iterator it=other.begin(); it!=other.end(); ++it)
00425                                 push_back(new XMLNode(**it));
00426                 }
00427
00428                 void clear()
00429                 {
00430                         while(!empty()) {
00431                                 XMLNode* node = back();
00432                                 pop_back();
00433
00434                                 node->clear();
00435                                 delete node;
00436                         }
00437                 }
00438         };
00439
00440          // access to protected class members for XMLPos and XMLReader
00441         friend struct XMLPos;
00442         friend struct const_XMLPos;
00443         friend struct XMLReaderBase;
00444
00445         XMLNode(const XS_String& name)
00446          :      XS_String(name)
00447         {
00448         }
00449
00450         XMLNode(const XS_String& name, const std::string& leading)
00451          :      XS_String(name),
00452                 _leading(leading)
00453         {
00454         }
00455
00456         XMLNode(const XMLNode& other)
00457          :      _attributes(other._attributes),
00458                 _leading(other._leading),
00459                 _content(other._content),
00460                 _end_leading(other._end_leading),
00461                 _trailing(other._trailing)
00462         {
00463                 for(Children::const_iterator it=other._children.begin(); it!=other._children.end(); ++it)
00464                         _children.push_back(new XMLNode(**it));
00465         }
00466
00467         ~XMLNode()
00468         {
00469                 while(!_children.empty()) {
00470                         delete _children.back();
00471                         _children.pop_back();
00472                 }
00473         }
00474
00475         void clear()
00476         {
00477                 _leading.erase();
00478                 _content.erase();
00479                 _end_leading.erase();
00480                 _trailing.erase();
00481
00482                 _attributes.clear();
00483                 _children.clear();
00484
00485                 XS_String::erase();
00486         }
00487
00488         XMLNode& operator=(const XMLNode& other)
00489         {
00490                 _children.assign(other._children);
00491
00492                 _attributes = other._attributes;
00493
00494                 _leading = other._leading;
00495                 _content = other._content;
00496                 _end_leading = other._end_leading;
00497                 _trailing = other._trailing;
00498
00499                 return *this;
00500         }
00501
00503         void add_child(XMLNode* child)
00504         {
00505                 _children.push_back(child);
00506         }
00507
00509         void put(const XS_String& attr_name, const XS_String& value)
00510         {
00511                 _attributes[attr_name] = value;
00512         }
00513
00515         XS_String& operator[](const XS_String& attr_name)
00516         {
00517                 return _attributes[attr_name];
00518         }
00519
00521         template<typename T> XS_String get(const T& attr_name) const
00522         {
00523                 AttributeMap::const_iterator found = _attributes.find(attr_name);
00524
00525                 if (found != _attributes.end())
00526                         return found->second;
00527                 else
00528                         return XS_String();
00529         }
00530
00532         XS_String subvalue(const XS_String& name, const XS_String& attr_name, int n=0) const
00533         {
00534                 const XMLNode* node = find(name, n);
00535
00536                 if (node)
00537                         return node->get(attr_name);
00538                 else
00539                         return XS_String();
00540         }
00541
00543         XS_String& subvalue(const XS_String& name, const XS_String& attr_name, int n=0)
00544         {
00545                 XMLNode* node = find(name, n);
00546
00547                 if (!node) {
00548                         node = new XMLNode(name);
00549                         add_child(node);
00550                 }
00551
00552                 return (*node)[attr_name];
00553         }
00554
00555 #if defined(UNICODE) && !defined(XS_STRING_UTF8)
00556
00557         XS_String subvalue(const char* name, const char* attr_name, int n=0) const
00558         {
00559                 const XMLNode* node = find(name, n);
00560
00561                 if (node)
00562                         return node->get(attr_name);
00563                 else
00564                         return XS_String();
00565         }
00566
00568         XS_String& subvalue(const char* name, const XS_String& attr_name, int n=0)
00569         {
00570                 XMLNode* node = find(name, n);
00571
00572                 if (!node) {
00573                         node = new XMLNode(name);
00574                         add_child(node);
00575                 }
00576
00577                 return (*node)[attr_name];
00578         }
00579 #endif
00580
00581         const Children& get_children() const
00582         {
00583                 return _children;
00584         }
00585
00586         Children& get_children()
00587         {
00588                 return _children;
00589         }
00590
00591         XS_String get_content() const
00592         {
00593 #ifdef XS_STRING_UTF8
00594                 const XS_String& ret = _content;
00595 #else
00596                 XS_String ret;
00597                 assign_utf8(ret, _content.c_str());
00598 #endif
00599
00600                 return DecodeXMLString(ret.c_str());
00601         }
00602
00603         void set_content(const XS_String& s)
00604         {
00605                 _content.assign(EncodeXMLString(s.c_str()));
00606         }
00607
00608         enum WRITE_MODE {
00609                 FORMAT_SMART    = 0,
00610                 FORMAT_ORIGINAL = 1,
00611                 FORMAT_PRETTY   = 2
00612         };
00613
00615         std::ostream& write(std::ostream& out, WRITE_MODE mode=FORMAT_SMART, int indent=0) const
00616         {
00617                 switch(mode) {
00618                   case FORMAT_PRETTY:
00619                         pretty_write_worker(out, indent);
00620                         break;
00621
00622                   case FORMAT_ORIGINAL:
00623                         write_worker(out, indent);
00624                         break;
00625
00626                 default:         // FORMAT_SMART
00627                         smart_write_worker(out, indent);
00628                 }
00629
00630                 return out;
00631         }
00632
00633 protected:
00634         Children _children;
00635         AttributeMap _attributes;
00636
00637         std::string _leading;
00638         std::string _content;
00639         std::string _end_leading;
00640         std::string _trailing;
00641
00642         XMLNode* get_first_child() const
00643         {
00644                 if (!_children.empty())
00645                         return _children.front();
00646                 else
00647                         return NULL;
00648         }
00649
00650         XMLNode* find(const XS_String& name, int n=0) const
00651         {
00652                 for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it)
00653                         if (**it == name)
00654                                 if (!n--)
00655                                         return *it;
00656
00657                 return NULL;
00658         }
00659
00660         XMLNode* find(const XS_String& name, const XS_String& attr_name, const XS_String& attr_value, int n=0) const
00661         {
00662                 for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it) {
00663                         const XMLNode& node = **it;
00664
00665                         if (node==name && node.get(attr_name)==attr_value)
00666                                 if (!n--)
00667                                         return *it;
00668                 }
00669
00670                 return NULL;
00671         }
00672
00673 #if defined(UNICODE) && !defined(XS_STRING_UTF8)
00674         XMLNode* find(const char* name, int n=0) const
00675         {
00676                 for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it)
00677                         if (**it == name)
00678                                 if (!n--)
00679                                         return *it;
00680
00681                 return NULL;
00682         }
00683
00684         template<typename T, typename U>
00685         XMLNode* find(const char* name, const T& attr_name, const U& attr_value, int n=0) const
00686         {
00687                 for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it) {
00688                         const XMLNode& node = **it;
00689
00690                         if (node==name && node.get(attr_name)==attr_value)
00691                                 if (!n--)
00692                                         return *it;
00693                 }
00694
00695                 return NULL;
00696         }
00697 #endif
00698
00700         const XMLNode* find_relative(const char* path) const;
00701
00703         XMLNode* find_relative(const char* path)
00704                 {return const_cast<XMLNode*>(const_cast<const XMLNode*>(this)->find_relative(path));}
00705
00707         XMLNode* create_relative(const char* path);
00708
00709         void write_worker(std::ostream& out, int indent) const;
00710         void pretty_write_worker(std::ostream& out, int indent) const;
00711         void smart_write_worker(std::ostream& out, int indent) const;
00712 };
00713
00714
00716 struct XMLChildrenFilter
00717 {
00718         XMLChildrenFilter(XMLNode::Children& children, const XS_String& name)
00719          :      _begin(children.begin(), children.end(), name),
00720                 _end(children.end(), children.end(), name)
00721         {
00722         }
00723
00724         XMLChildrenFilter(XMLNode* node, const XS_String& name)
00725          :      _begin(node->get_children().begin(), node->get_children().end(), name),
00726                 _end(node->get_children().end(), node->get_children().end(), name)
00727         {
00728         }
00729
00731         struct iterator
00732         {
00733                 typedef XMLNode::Children::iterator BaseIterator;
00734
00735                 iterator(BaseIterator begin, BaseIterator end, const XS_String& filter_name)
00736                  :      _cur(begin),
00737                         _end(end),
00738                         _filter_name(filter_name)
00739                 {
00740                         search_next();
00741                 }
00742
00743                 operator BaseIterator()
00744                 {
00745                         return _cur;
00746                 }
00747
00748                 const XMLNode* operator*() const
00749                 {
00750                         return *_cur;
00751                 }
00752
00753                 XMLNode* operator*()
00754                 {
00755                         return *_cur;
00756                 }
00757
00758                 iterator& operator++()
00759                 {
00760                         ++_cur;
00761                         search_next();
00762
00763                         return *this;
00764                 }
00765
00766                 iterator operator++(int)
00767                 {
00768                         iterator ret = *this;
00769
00770                         ++_cur;
00771                         search_next();
00772
00773                         return ret;
00774                 }
00775
00776                 bool operator==(const BaseIterator& other) const
00777                 {
00778                         return _cur == other;
00779                 }
00780
00781                 bool operator!=(const BaseIterator& other) const
00782                 {
00783                         return _cur != other;
00784                 }
00785
00786         protected:
00787                 BaseIterator    _cur;
00788                 BaseIterator    _end;
00789                 XS_String       _filter_name;
00790
00791                 void search_next()
00792                 {
00793                         while(_cur!=_end && **_cur!=_filter_name)
00794                                 ++_cur;
00795                 }
00796         };
00797
00798         iterator begin()
00799         {
00800                 return _begin;
00801         }
00802
00803         iterator end()
00804         {
00805                 return _end;
00806         }
00807
00808 protected:
00809         iterator        _begin;
00810         iterator        _end;
00811 };
00812
00813
00815 struct const_XMLChildrenFilter
00816 {
00817         const_XMLChildrenFilter(const XMLNode::Children& children, const XS_String& name)
00818          :      _begin(children.begin(), children.end(), name),
00819                 _end(children.end(), children.end(), name)
00820         {
00821         }
00822
00823         const_XMLChildrenFilter(const XMLNode* node, const XS_String& name)
00824          :      _begin(node->get_children().begin(), node->get_children().end(), name),
00825                 _end(node->get_children().end(), node->get_children().end(), name)
00826         {
00827         }
00828
00830         struct const_iterator
00831         {
00832                 typedef XMLNode::Children::const_iterator BaseIterator;
00833
00834                 const_iterator(BaseIterator begin, BaseIterator end, const XS_String& filter_name)
00835                  :      _cur(begin),
00836                         _end(end),
00837                         _filter_name(filter_name)
00838                 {
00839                         search_next();
00840                 }
00841
00842                 operator BaseIterator()
00843                 {
00844                         return _cur;
00845                 }
00846
00847                 const XMLNode* operator*() const
00848                 {
00849                         return *_cur;
00850                 }
00851
00852                 const_iterator& operator++()
00853                 {
00854                         ++_cur;
00855                         search_next();
00856
00857                         return *this;
00858                 }
00859
00860                 const_iterator operator++(int)
00861                 {
00862                         const_iterator ret = *this;
00863
00864                         ++_cur;
00865                         search_next();
00866
00867                         return ret;
00868                 }
00869
00870                 bool operator==(const BaseIterator& other) const
00871                 {
00872                         return _cur == other;
00873                 }
00874
00875                 bool operator!=(const BaseIterator& other) const
00876                 {
00877                         return _cur != other;
00878                 }
00879
00880         protected:
00881                 BaseIterator    _cur;
00882                 BaseIterator    _end;
00883                 XS_String       _filter_name;
00884
00885                 void search_next()
00886                 {
00887                         while(_cur!=_end && **_cur!=_filter_name)
00888                                 ++_cur;
00889                 }
00890         };
00891
00892         const_iterator begin()
00893         {
00894                 return _begin;
00895         }
00896
00897         const_iterator end()
00898         {
00899                 return _end;
00900         }
00901
00902 protected:
00903         const_iterator  _begin;
00904         const_iterator  _end;
00905 };
00906
00907
00909 struct XMLPos
00910 {
00911         XMLPos(XMLNode* root)
00912          :      _root(root),
00913                 _cur(root)
00914         {
00915         }
00916
00917         XMLPos(const XMLPos& other)
00918          :      _root(other._root),
00919                 _cur(other._cur)
00920         {       // don't copy _stack
00921         }
00922
00923         XMLPos(XMLNode* node, const XS_String& name)
00924          :      _root(node),
00925                 _cur(node)
00926         {
00927                 smart_create(name);
00928         }
00929
00930         XMLPos(XMLNode* node, const XS_String& name, const XS_String& attr_name, const XS_String& attr_value)
00931          :      _root(node),
00932                 _cur(node)
00933         {
00934                 smart_create(name, attr_name, attr_value);
00935         }
00936
00937         XMLPos(const XMLPos& other, const XS_String& name)
00938          :      _root(other._root),
00939                 _cur(other._cur)
00940         {
00941                 smart_create(name);
00942         }
00943
00944         XMLPos(const XMLPos& other, const XS_String& name, const XS_String& attr_name, const XS_String& attr_value)
00945          :      _root(other._root),
00946                 _cur(other._cur)
00947         {
00948                 smart_create(name, attr_name, attr_value);
00949         }
00950
00952         XMLNode& cur()
00953         {
00954                 return *_cur;
00955         }
00956
00957         const XMLNode& cur() const
00958         {
00959                 return *_cur;
00960         }
00961
00963         operator const XMLNode*() const {return _cur;}
00964         operator XMLNode*() {return _cur;}
00965
00966         const XMLNode* operator->() const {return _cur;}
00967         XMLNode* operator->() {return _cur;}
00968
00969         const XMLNode& operator*() const {return *_cur;}
00970         XMLNode& operator*() {return *_cur;}
00971
00973         XS_String get(const XS_String& attr_name) const
00974         {
00975                 return _cur->get(attr_name);
00976         }
00977
00979         void put(const XS_String& attr_name, const XS_String& value)
00980         {
00981                 _cur->put(attr_name, value);
00982         }
00983
00985         template<typename T> XS_String get(const T& attr_name) const {return (*_cur)[attr_name];}
00986         XS_String& operator[](const XS_String& attr_name) {return (*_cur)[attr_name];}
00987
00989         void add_down(XMLNode* child)
00990         {
00991                 _cur->add_child(child);
00992                 go_to(child);
00993         }
00994
00996         bool back()
00997         {
00998                 if (!_stack.empty()) {
00999                         _cur = _stack.top();
01000                         _stack.pop();
01001                         return true;
01002                 } else
01003                         return false;
01004         }
01005
01007         bool go_down()
01008         {
01009                 XMLNode* node = _cur->get_first_child();
01010
01011                 if (node) {
01012                         go_to(node);
01013                         return true;
01014                 } else
01015                         return false;
01016         }
01017
01019         bool go_down(const XS_String& name, int n=0)
01020         {
01021                 XMLNode* node = _cur->find(name, n);
01022
01023                 if (node) {
01024                         go_to(node);
01025                         return true;
01026                 } else
01027                         return false;
01028         }
01029
01031         bool go(const char* path);
01032
01034         bool create_relative(const char* path)
01035         {
01036                 XMLNode* node = _cur->create_relative(path);
01037                 if (!node)
01038                         return false;   // invalid path specified
01039
01040                 go_to(node);
01041                 return true;
01042         }
01043
01045         void create(const XS_String& name)
01046         {
01047                 add_down(new XMLNode(name));
01048         }
01049
01051         void smart_create(const XS_String& name)
01052         {
01053                 XMLNode* node = _cur->find(name);
01054
01055                 if (node)
01056                         go_to(node);
01057                 else
01058                         add_down(new XMLNode(name));
01059         }
01060
01062         void smart_create(const XS_String& name, const XS_String& attr_name, const XS_String& attr_value)
01063         {
01064                 XMLNode* node = _cur->find(name, attr_name, attr_value);
01065
01066                 if (node)
01067                         go_to(node);
01068                 else {
01069                         node = new XMLNode(name);
01070                         add_down(node);
01071                         (*node)[attr_name] = attr_value;
01072                 }
01073         }
01074
01075 #if defined(UNICODE) && !defined(XS_STRING_UTF8)
01076
01077         bool go_down(const char* name, int n=0)
01078         {
01079                 XMLNode* node = _cur->find(name, n);
01080
01081                 if (node) {
01082                         go_to(node);
01083                         return true;
01084                 } else
01085                         return false;
01086         }
01087
01089         void create(const char* name)
01090         {
01091                 add_down(new XMLNode(name));
01092         }
01093
01095         void smart_create(const char* name)
01096         {
01097                 XMLNode* node = _cur->find(name);
01098
01099                 if (node)
01100                         go_to(node);
01101                 else
01102                         add_down(new XMLNode(name));
01103         }
01104
01106         template<typename T, typename U>
01107         void smart_create(const char* name, const T& attr_name, const U& attr_value)
01108         {
01109                 XMLNode* node = _cur->find(name, attr_name, attr_value);
01110
01111                 if (node)
01112                         go_to(node);
01113                 else {
01114                         XMLNode* node = new XMLNode(name);
01115                         add_down(node);
01116                         (*node)[attr_name] = attr_value;
01117                 }
01118         }
01119 #endif
01120
01121         XS_String& str() {return *_cur;}
01122         const XS_String& str() const {return *_cur;}
01123
01124 protected:
01125         XMLNode* _root;
01126         XMLNode* _cur;
01127         std::stack<XMLNode*> _stack;
01128
01130         void go_to(XMLNode* child)
01131         {
01132                 _stack.push(_cur);
01133                 _cur = child;
01134         }
01135 };
01136
01137
01139 struct const_XMLPos
01140 {
01141         const_XMLPos(const XMLNode* root)
01142          :      _root(root),
01143                 _cur(root)
01144         {
01145         }
01146
01147         const_XMLPos(const const_XMLPos& other)
01148          :      _root(other._root),
01149                 _cur(other._cur)
01150         {       // don't copy _stack
01151         }
01152
01154         const XMLNode& cur() const
01155         {
01156                 return *_cur;
01157         }
01158
01160         operator const XMLNode*() const {return _cur;}
01161
01162         const XMLNode* operator->() const {return _cur;}
01163
01164         const XMLNode& operator*() const {return *_cur;}
01165
01167         XS_String get(const XS_String& attr_name) const
01168         {
01169                 return _cur->get(attr_name);
01170         }
01171
01173         template<typename T> XS_String get(const T& attr_name) const {return _cur->get(attr_name);}
01174
01176         bool back()
01177         {
01178                 if (!_stack.empty()) {
01179                         _cur = _stack.top();
01180                         _stack.pop();
01181                         return true;
01182                 } else
01183                         return false;
01184         }
01185
01187         bool go_down()
01188         {
01189                 const XMLNode* node = _cur->get_first_child();
01190
01191                 if (node) {
01192                         go_to(node);
01193                         return true;
01194                 } else
01195                         return false;
01196         }
01197
01199         bool go_down(const XS_String& name, int n=0)
01200         {
01201                 XMLNode* node = _cur->find(name, n);
01202
01203                 if (node) {
01204                         go_to(node);
01205                         return true;
01206                 } else
01207                         return false;
01208         }
01209
01211         bool go(const char* path);
01212
01213 #if defined(UNICODE) && !defined(XS_STRING_UTF8)
01214
01215         bool go_down(const char* name, int n=0)
01216         {
01217                 XMLNode* node = _cur->find(name, n);
01218
01219                 if (node) {
01220                         go_to(node);
01221                         return true;
01222                 } else
01223                         return false;
01224         }
01225 #endif
01226
01227         const XS_String& str() const {return *_cur;}
01228
01229 protected:
01230         const XMLNode* _root;
01231         const XMLNode* _cur;
01232         std::stack<const XMLNode*> _stack;
01233
01235         void go_to(const XMLNode* child)
01236         {
01237                 _stack.push(_cur);
01238                 _cur = child;
01239         }
01240 };
01241
01242
01243 #define XS_TRUE_STR XS_TEXT("true")
01244 #define XS_FALSE_STR XS_TEXT("false")
01245 #define XS_NUMBERFMT_STR XS_TEXT("%d")
01246
01247  // work around GCC's wide string constant bug
01248 #ifdef __GNUC__
01249 extern const LPCXSSTR XS_TRUE;
01250 extern const LPCXSSTR XS_FALSE;
01251 extern const LPCXSSTR XS_NUMBERFMT;
01252 #else
01253 #define XS_TRUE XS_TRUE_STR
01254 #define XS_FALSE XS_FALSE_STR
01255 #define XS_NUMBERFMT XS_NUMBERFMT_STR
01256 #endif
01257
01258
01260 struct XMLBool
01261 {
01262         XMLBool(bool value=false)
01263          :      _value(value)
01264         {
01265         }
01266
01267         XMLBool(LPCXSSTR value, bool def=false)
01268         {
01269                 if (value && *value)
01270                         _value = !XS_icmp(value, XS_TRUE);
01271                 else
01272                         _value = def;
01273         }
01274
01275         XMLBool(const XMLNode* node, const XS_String& attr_name, bool def=false)
01276         {
01277                 const XS_String& value = node->get(attr_name);
01278
01279                 if (!value.empty())
01280                         _value = !XS_icmp(value.c_str(), XS_TRUE);
01281                 else
01282                         _value = def;
01283         }
01284
01285         operator bool() const
01286         {
01287                 return _value;
01288         }
01289
01290         bool operator!() const
01291         {
01292                 return !_value;
01293         }
01294
01295         operator LPCXSSTR() const
01296         {
01297                 return _value? XS_TRUE: XS_FALSE;
01298         }
01299
01300 protected:
01301         bool    _value;
01302
01303 private:
01304         void operator=(const XMLBool&); // disallow assignment operations
01305 };
01306
01308 struct XMLBoolRef
01309 {
01310         XMLBoolRef(XMLNode* node, const XS_String& attr_name, bool def=false)
01311          :      _ref((*node)[attr_name])
01312         {
01313                 if (_ref.empty())
01314                         assign(def);
01315         }
01316
01317         operator bool() const
01318         {
01319                 return !XS_icmp(_ref.c_str(), XS_TRUE);
01320         }
01321
01322         bool operator!() const
01323         {
01324                 return XS_icmp(_ref.c_str(), XS_TRUE)? true: false;
01325         }
01326
01327         XMLBoolRef& operator=(bool value)
01328         {
01329                 assign(value);
01330
01331                 return *this;
01332         }
01333
01334         void assign(bool value)
01335         {
01336                 _ref.assign(value? XS_TRUE: XS_FALSE);
01337         }
01338
01339         void toggle()
01340         {
01341                 assign(!operator bool());
01342         }
01343
01344 protected:
01345         XS_String& _ref;
01346 };
01347
01348
01350 struct XMLInt
01351 {
01352         XMLInt(int value)
01353          :      _value(value)
01354         {
01355         }
01356
01357         XMLInt(LPCXSSTR value, int def=0)
01358         {
01359                 if (value && *value)
01360                         _value = XS_toi(value);
01361                 else
01362                         _value = def;
01363         }
01364
01365         XMLInt(const XMLNode* node, const XS_String& attr_name, int def=0)
01366         {
01367                 const XS_String& value = node->get(attr_name);
01368
01369                 if (!value.empty())
01370                         _value = XS_toi(value.c_str());
01371                 else
01372                         _value = def;
01373         }
01374
01375         operator int() const
01376         {
01377                 return _value;
01378         }
01379
01380         operator XS_String() const
01381         {
01382                 XS_CHAR buffer[32];
01383                 XS_snprintf(buffer, COUNTOF(buffer), XS_NUMBERFMT, _value);
01384                 return buffer;
01385         }
01386
01387 protected:
01388         int _value;
01389
01390 private:
01391         void operator=(const XMLInt&); // disallow assignment operations
01392 };
01393
01395 struct XMLIntRef
01396 {
01397         XMLIntRef(XMLNode* node, const XS_String& attr_name, int def=0)
01398          :      _ref((*node)[attr_name])
01399         {
01400                 if (_ref.empty())
01401                         assign(def);
01402         }
01403
01404         XMLIntRef& operator=(int value)
01405         {
01406                 assign(value);
01407
01408                 return *this;
01409         }
01410
01411         operator int() const
01412         {
01413                 return XS_toi(_ref.c_str());
01414         }
01415
01416         void assign(int value)
01417         {
01418                 XS_CHAR buffer[32];
01419                 XS_snprintf(buffer, COUNTOF(buffer), XS_NUMBERFMT, value);
01420                 _ref.assign(buffer);
01421         }
01422
01423 protected:
01424         XS_String& _ref;
01425 };
01426
01427
01429 struct XMLString
01430 {
01431         XMLString(const XS_String& value)
01432          :      _value(value)
01433         {
01434         }
01435
01436         XMLString(LPCXSSTR value, LPCXSSTR def=XS_TEXT(""))
01437         {
01438                 if (value && *value)
01439                         _value = value;
01440                 else
01441                         _value = def;
01442         }
01443
01444         XMLString(const XMLNode* node, const XS_String& attr_name, LPCXSSTR def=XS_TEXT(""))
01445         {
01446                 const XS_String& value = node->get(attr_name);
01447
01448                 if (!value.empty())
01449                         _value = value;
01450                 else
01451                         _value = def;
01452         }
01453
01454         operator const XS_String&() const
01455         {
01456                 return _value;
01457         }
01458
01459         const XS_String& c_str() const
01460         {
01461                 return _value;
01462         }
01463
01464 protected:
01465         XS_String       _value;
01466
01467 private:
01468         void operator=(const XMLString&); // disallow assignment operations
01469 };
01470
01472 struct XMStringRef
01473 {
01474         XMStringRef(XMLNode* node, const XS_String& attr_name, LPCXSSTR def=XS_TEXT(""))
01475          :      _ref((*node)[attr_name])
01476         {
01477                 if (_ref.empty())
01478                         assign(def);
01479         }
01480
01481         XMStringRef(XMLNode* node, const XS_String& node_name, const XS_String& attr_name, LPCXSSTR def=XS_TEXT(""))
01482          :      _ref(node->subvalue(node_name, attr_name))
01483         {
01484                 if (_ref.empty())
01485                         assign(def);
01486         }
01487
01488         XMStringRef& operator=(const XS_String& value)
01489         {
01490                 assign(value);
01491
01492                 return *this;
01493         }
01494
01495         operator const XS_String&() const
01496         {
01497                 return _ref;
01498         }
01499
01500         void assign(const XS_String& value)
01501         {
01502                 _ref.assign(value);
01503         }
01504
01505 protected:
01506         XS_String& _ref;
01507 };
01508
01509
01510 template<typename T>
01511         inline void read_option(T& var, const_XMLPos& cfg, LPCXSSTR key)
01512         {
01513                 const XS_String& val = cfg.get(key);
01514
01515                 if (!val.empty())
01516                         var = val;
01517         }
01518
01519 template<>
01520         inline void read_option(int& var, const_XMLPos& cfg, LPCXSSTR key)
01521         {
01522                 const XS_String& val = cfg.get(key);
01523
01524                 if (!val.empty())
01525                         var = XS_toi(val.c_str());
01526         }
01527
01528
01529 #ifdef _MSC_VER
01530 #pragma warning(disable: 4355)
01531 #endif
01532
01534 struct XMLReaderBase
01535 {
01536         XMLReaderBase(XMLNode* node)
01537          :      _pos(node),
01538                 _parser(XML_ParserCreate(NULL))
01539         {
01540                 XML_SetUserData(_parser, this);
01541                 XML_SetXmlDeclHandler(_parser, XML_XmlDeclHandler);
01542                 XML_SetElementHandler(_parser, XML_StartElementHandler, XML_EndElementHandler);
01543                 XML_SetDefaultHandler(_parser, XML_DefaultHandler);
01544
01545                 _last_tag = TAG_NONE;
01546         }
01547
01548         virtual ~XMLReaderBase()
01549         {
01550                 XML_ParserFree(_parser);
01551         }
01552
01553         XML_Status read();
01554
01555         virtual int read_buffer(char* buffer, int len) = 0;
01556
01557         std::string get_position() const
01558         {
01559                 int line = XML_GetCurrentLineNumber(_parser);
01560                 int column = XML_GetCurrentColumnNumber(_parser);
01561
01562                 std::ostringstream out;
01563                 out << "(" << line << ") : [column " << column << "]";
01564
01565                 return out.str();
01566         }
01567
01568         std::string get_instructions() const {return _instructions;}
01569
01570         XML_Error       get_error_code() {return XML_GetErrorCode(_parser);}
01571         std::string get_error_string() const;
01572
01573 protected:
01574         XMLPos          _pos;
01575         XML_Parser      _parser;
01576         std::string _xml_version;
01577         std::string _encoding;
01578         std::string     _instructions;
01579
01580         std::string _content;
01581         enum {TAG_NONE, TAG_START, TAG_END} _last_tag;
01582
01583         static void XMLCALL XML_XmlDeclHandler(void* userData, const XML_Char* version, const XML_Char* encoding, int standalone);
01584         static void XMLCALL XML_StartElementHandler(void* userData, const XML_Char* name, const XML_Char** atts);
01585         static void XMLCALL XML_EndElementHandler(void* userData, const XML_Char* name);
01586         static void XMLCALL XML_DefaultHandler(void* userData, const XML_Char* s, int len);
01587 };
01588
01589
01591 struct XMLReader : public XMLReaderBase
01592 {
01593         XMLReader(XMLNode* node, std::istream& in)
01594          :      XMLReaderBase(node),
01595                 _in(in)
01596         {
01597         }
01598
01600         int read_buffer(char* buffer, int len)
01601         {
01602                 if (!_in.good())
01603                         return -1;
01604
01605                 _in.read(buffer, len);
01606
01607                 return _in.gcount();
01608         }
01609
01610 protected:
01611         std::istream&   _in;
01612 };
01613
01614
01616 struct XMLHeader
01617 {
01618         XMLHeader(const std::string& xml_version="1.0", const std::string& encoding="UTF-8", const std::string& doctype="")
01619          :      _version(xml_version),
01620                 _encoding(encoding),
01621                 _doctype(doctype)
01622         {
01623         }
01624
01625         void print(std::ostream& out, bool pretty=true) const
01626         {
01627                 out << "<?xml version=\"" << _version << "\" encoding=\"" << _encoding << "\"?>";
01628
01629                 if (pretty)
01630                         out << std::endl;
01631
01632                 if (!_doctype.empty())
01633                         out << _doctype << '\n';
01634
01635                 if (!_additional.empty())
01636                         out << _additional << '\n';
01637         }
01638
01639         std::string _version;
01640         std::string _encoding;
01641         std::string _doctype;
01642         std::string _additional;
01643 };
01644
01645
01647 struct XMLDoc : public XMLNode
01648 {
01649         XMLDoc()
01650          :      XMLNode(""),
01651                 _last_error(XML_ERROR_NONE)
01652         {
01653         }
01654
01655         XMLDoc(LPCTSTR path)
01656          :      XMLNode(""),
01657                 _last_error(XML_ERROR_NONE)
01658         {
01659                 read(path);
01660         }
01661
01662         std::istream& read(std::istream& in)
01663         {
01664                 XMLReader reader(this, in);
01665
01666                 read(reader);
01667
01668                 return in;
01669         }
01670
01671         bool read(LPCTSTR path)
01672         {
01673                 tifstream in(path);
01674                 XMLReader reader(this, in);
01675
01676 //#if defined(_STRING_DEFINED) && !defined(XS_STRING_UTF8)
01677 //              return read(reader, std::string(ANS(path)));
01678 //#else
01679                 return read(reader, XS_String(path));
01680 //#endif
01681         }
01682
01683         bool read(XMLReaderBase& reader)
01684         {
01685                 XML_Status status = reader.read();
01686
01687                 _header._additional = reader.get_instructions();
01688
01689                 if (status == XML_STATUS_ERROR) {
01690                         std::ostringstream out;
01691
01692                         out << "input stream" << reader.get_position() << " " << reader.get_error_string();
01693
01694                         _last_error = reader.get_error_code();
01695                         _last_error_msg = out.str();
01696                 }
01697
01698                 return status != XML_STATUS_ERROR;
01699         }
01700
01701         bool read(XMLReaderBase& reader, const std::string& display_path)
01702         {
01703                 XML_Status status = reader.read();
01704
01705                 _header._additional = reader.get_instructions();
01706
01707                 if (status == XML_STATUS_ERROR) {
01708                         std::ostringstream out;
01709
01710                         out << display_path << reader.get_position() << " " << reader.get_error_string();
01711
01712                         _last_error = reader.get_error_code();
01713                         _last_error_msg = out.str();
01714                 }
01715
01716                 return status != XML_STATUS_ERROR;
01717         }
01718
01720         std::ostream& write(std::ostream& out, WRITE_MODE mode=FORMAT_SMART) const
01721         {
01722                 _header.print(out);
01723
01724                 if (!_children.empty())
01725                         _children.front()->write(out);
01726
01727                 return out;
01728         }
01729
01731         std::ostream& write_formating(std::ostream& out) const
01732         {
01733                 return write(out, FORMAT_PRETTY);
01734         }
01735
01736         void write(LPCTSTR path, WRITE_MODE mode=FORMAT_SMART) const
01737         {
01738                 tofstream out(path);
01739
01740                 write(out, mode);
01741         }
01742
01743         void write_formating(LPCTSTR path) const
01744         {
01745                 tofstream out(path);
01746
01747                 write_formating(out);
01748         }
01749
01750         XMLHeader       _header;
01751         XML_Error       _last_error;
01752         std::string _last_error_msg;
01753 };
01754
01755
01757 struct XMLMessage : public XMLDoc
01758 {
01759         XMLMessage(const char* name)
01760          :      _pos(this)
01761         {
01762                 _pos.create(name);
01763         }
01764
01765         XMLPos  _pos;
01766 };
01767
01768
01769 enum PRETTY_FLAGS {
01770         PRETTY_PLAIN    = 0,
01771         PRETTY_LINEFEED = 1,
01772         PRETTY_INDENT   = 2
01773 };
01774
01775 struct XMLWriter
01776 {
01777         XMLWriter(std::ostream& out, PRETTY_FLAGS pretty=PRETTY_INDENT, const XMLHeader& header=XMLHeader())
01778          :      _pofstream(NULL),
01779                 _out(out),
01780                 _pretty(pretty)
01781         {
01782                 header.print(_out, false);
01783         }
01784
01785         XMLWriter(LPCTSTR path, PRETTY_FLAGS pretty=PRETTY_INDENT, const XMLHeader& header=XMLHeader())
01786          :      _pofstream(new tofstream(path)),
01787                 _out(*_pofstream),
01788                 _pretty(pretty)
01789         {
01790                 header.print(_out, false);
01791         }
01792
01793         ~XMLWriter()
01794         {
01795                 _out << std::endl;
01796                 delete _pofstream;
01797         }
01798
01800         void create(const XS_String& name)
01801         {
01802                 if (!_stack.empty()) {
01803                         StackEntry& last = _stack.top();
01804
01805                         if (last._state < PRE_CLOSED) {
01806                                 write_attributes(last);
01807                                 close_pre(last);
01808                         }
01809
01810                         ++last._children;
01811                 }
01812
01813                 StackEntry entry;
01814                 entry._node_name = name;
01815                 _stack.push(entry);
01816
01817                 write_pre(entry);
01818         }
01819
01821         bool back()
01822         {
01823                 if (!_stack.empty()) {
01824                         write_post(_stack.top());
01825
01826                         _stack.pop();
01827                         return true;
01828                 } else
01829                         return false;
01830         }
01831
01833         void put(const XS_String& attr_name, const XS_String& value)
01834         {
01835                 if (!_stack.empty())
01836                         _stack.top()._attributes[attr_name] = value;
01837         }
01838
01840         XS_String& operator[](const XS_String& attr_name)
01841         {
01842                 if (_stack.empty())
01843                         return s_empty_attr;
01844
01845                 return _stack.top()._attributes[attr_name];
01846         }
01847
01848         void set_content(const XS_String& s)
01849         {
01850                 if (!_stack.empty())
01851                         _stack.top()._content = s;
01852         }
01853
01854          // public for access in StackEntry
01855         enum WRITESTATE {
01856                 NOTHING, /*PRE,*/ ATTRIBUTES, PRE_CLOSED, /*CONTENT,*/ POST
01857         };
01858
01859 protected:
01860         tofstream*              _pofstream;
01861         std::ostream&   _out;
01862         PRETTY_FLAGS    _pretty;
01863
01864         typedef XMLNode::AttributeMap AttrMap;
01865
01866         struct StackEntry {
01867                 XS_String       _node_name;
01868                 AttrMap         _attributes;
01869                 std::string     _content;
01870                 WRITESTATE      _state;
01871                 bool            _children;
01872
01873                 StackEntry() : _state(NOTHING), _children(false) {}
01874         };
01875
01876         std::stack<StackEntry> _stack;
01877
01878         static XS_String s_empty_attr;
01879
01880         void close_pre(StackEntry& entry)
01881         {
01882                 _out << '>';
01883
01884                 entry._state = PRE_CLOSED;
01885         }
01886
01887         void write_pre(StackEntry& entry)
01888         {
01889                 if (_pretty >= PRETTY_LINEFEED)
01890                         _out << std::endl;
01891
01892                 if (_pretty == PRETTY_INDENT)
01893                         for(int i=_stack.size(); --i>0; )
01894                                 _out << XML_INDENT_SPACE;
01895
01896                 _out << '<' << EncodeXMLString(entry._node_name);
01897                 //entry._state = PRE;
01898         }
01899
01900         void write_attributes(StackEntry& entry)
01901         {
01902                 for(AttrMap::const_iterator it=entry._attributes.begin(); it!=entry._attributes.end(); ++it)
01903                         _out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\"";
01904
01905                 entry._state = ATTRIBUTES;
01906         }
01907
01908         void write_post(StackEntry& entry)
01909         {
01910                 if (entry._state < ATTRIBUTES)
01911                         write_attributes(entry);
01912
01913                 if (entry._children || !entry._content.empty()) {
01914                         if (entry._state < PRE_CLOSED)
01915                                 close_pre(entry);
01916
01917                         _out << entry._content;
01918                         //entry._state = CONTENT;
01919
01920                         if (_pretty>=PRETTY_LINEFEED && entry._content.empty())
01921                                 _out << std::endl;
01922
01923                         if (_pretty==PRETTY_INDENT && entry._content.empty())
01924                                 for(int i=_stack.size(); --i>0; )
01925                                         _out << XML_INDENT_SPACE;
01926
01927                         _out << "</" << EncodeXMLString(entry._node_name) << ">";
01928                 } else {
01929                         _out << "/>";
01930                 }
01931
01932                 entry._state = POST;
01933         }
01934 };
01935
01936
01937 }       // namespace XMLStorage
01938
01939 #define _XMLSTORAGE_H
01940 #endif // _XMLSTORAGE_H


ROS Explorer: Class List

  • Class List
  • Alphabetical List
  • Class Hierarchy
  • Class Members

ROS Explorer Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
BackgroundWindow | Subclassed Background window behind the visible desktop window
BitmapSelection | BitmapSelection locally selects a bitmap into a device context
BkMode | BkMode locally sets the background mode for drawing
Bookmark |
BookmarkFolder |
BookmarkList |
BookmarkNode |
BootSector |
BootSector32 |
BrowseMenu | "Browse Files..." sub-start menu
BrowserCallback |
BrowserNavigator |
BrushSelection | BrushSelection locally selects a brush into a device context
BStr |
BtnWindowClass | Window class with gray background color
Buffer |
BufferCanvas | BufferCanvas manages offscreen bitmaps selected into memory device contexts
BufferedCanvas | BufferedCanvas enables double buffering for a device context
BufferedPaintCanvas | BufferedPaintCanvas extends PaintCanvas for double buffering
Button | This class constructs button controls
Cache |
Canvas | Canvas is a encapsulation of device contexts
ChildWindow | Class ChildWindow represents MDI child windows
ChildWndInfo | Information structure for creation of a MDI child window
ClientRect | ClientRect retreives the client area rectangle of a window
ClockWindow | Window for displaying the time in the tray notification area
CollectProgramsThread | Thread for collecting start menu entries
ColorStatic |
COMException | Exception with context information
COMExceptionBase | COM ExceptionBase class as replacement for _com_error
ComInit | COM Initialisation
CommonControlInit | Initialization of windows common controls
CommonDesktop | Caching of desktop ShellFolder object
CommonShellMalloc | We use a common IMalloc object for all shell memory allocations
ComSrvObject |
ConnectionPoint< T > |
XMLStorage::const_XMLChildrenFilter | Read only iterator access to children nodes with name filtering
XMLStorage::const_XMLChildrenFilter::const_iterator | Internal iterator class
XMLStorage::const_XMLPos | Iterator for XML trees
Context |
CRITICAL_SECTION |
CritSect | Critical section wrapper
CtlColorParent< BASE > |
CtxMenuInterfaces |
DataStorage | Structure containing information for one format of EnumFormatEtcImpl
DEntry |
DEntry_E |
Desktop |
DesktopBar | Desktop bar window, also known as "system tray"
DesktopDropTarget | OLE drop target for the desktop window
DesktopFolder | Shell folder of the desktop
DesktopFolderPath | Shell folder path of the desktop
Desktops |
DesktopSettingsDlg | "Desktopbar Settings" Property Sheet Dialog
DesktopShellView | Subclassed ShellView window
DesktopWindow | Implementation of the Explorer desktop window
Dialog | The class Dialog implements modal dialogs
DialogWindow | The class DialogWindow implements modeless dialogs, which are managed by Window::dispatch_dialog_msg() in Window::MessageLoop()
Directory | Base for all directory entries
dirent |
dirsecz |
DragSourceHelper | Implementation of IDragSourceHelper interface
dskrwblk |
DWebBrowserEvents2IF |
DWebBrowserEvents2Impl |
DynamicFct< FCT > | Link dynamicly to functions by using GetModuleHandle() and GetProcAddress()
DynamicLoadLibFct< FCT > | Link dynamicly to functions by using LoadLibrary() and GetProcAddress()
EditController |
Entry | Base of all file and directory entries
EnumFormatEtcImpl | Implementation of IEnumFORMATETC interface
EventConnection |
EventConnector |
ExecuteDialog | The "Execute..."-dialog lets the user enter a command line to launch
ExplorerAboutDlg | "About Explorer" Dialog
ExplorerCmd | Explorer command line parser
ExplorerGlobals | Structure containing global variables of Explorer
ExtContextMenuHandlerT< BASE > |
FAT_attribute |
FATChildWndInfo | Information structure for creation of FileChildWindow
FATDirectory | FAT file system directory-entry
FATDrive | FAT drive root entry
FATEntry | FAT file system file-entry
fattr |
Favorites |
FavoritesMenu | Bookmarks sub-startmenu
fdate |
FileChildWindow | MDI child window displaying file lists
FileChildWndInfo | Information structure for creation of FileChildWindow
XMLStorage::FileHolder |
FileSysShellPath | Retrieval of file system paths of ShellPath objects
FileTypeInfo | Management of file types
FileTypeManager |
FindProgramDlg | Dialog to work with the complete list of start menu entries
FixedDWebBrowserEvents2 |
FlatButton | Subclass button controls to paint colored text labels
FmtString |
FolderBrowser | Browse dialog operating on shell namespace
FontSelection | FontSelection locally selects a font for drawing
FPDEntry | Entry for the list in "find program" dialogs
ftime |
FullScreenParameters | Structure containing information about full screen display of the frame window
HiddenWindow | Locally hide a window
HyperlinkCtrl | Hyperlink Controls
ICommDlgBrowser |
IComSrvBase< BASE, OBJ > |
IComSrvQI< BASE > |
IComSrvQI< IUnknown > |
Icon |
IconCache |
IconWindowClass | Window class with specified icon from resources
IDataObject |
IDataObjectImpl | Implementation of IDataObject interface
IDropSource |
IDropSourceImpl | Implementation of IDropSource interface
IDropTarget |
IDropTargetImpl | Implementation of IDropTarget interface
IEnumFORMATETC |
IOleClientSite |
IOleCommandTarget |
IOleInPlaceSite |
IPCtrlWindow< BASE, SMARTPTR > |
IServiceProvider |
IShellBrowser |
IShellBrowserImpl | Implementation of IShellBrowser and ICommDlgBrowser interfaces for explorer child windows (see ShellBrowserChild)
IShellFolderViewCB |
istream |
IUnknown |
Kette |
list |
list |
ListSort | Sorting of list controls
Lock | Lock protects a code section utilizing a critical section
MainFrameBase | Explorer frame window base class
map |
MDIMainFrame |
MdiSdiDlg | Configuration dialog to choose between MDI and SDI mode
MDIShellBrowserChild |
MemCanvas | Memory Canvas creates and destroys memory devoce contexts
MenuInfo | Menu info structure
NotifyArea | Tray notification area aka "tray"
NotifyHook |
NotifyIconConfig | Configuration for the display mode of a notification icon
NotifyIconDlgInfo |
NotifyIconIndex | NotifyIconIndex is used for maintaining the order of notification icons
NotifyInfo | Structure for maintaining informations about one notification icon
NTDLL |
NtObjChildWndInfo | Information structure for creation of FileChildWindow for NT object namespace
NtObjDirectory | NtObj file system directory-entry
NtObject |
NtObjectInfo |
NtObjEntry | NtObj file system file-entry
OleInit | OLE initialisation for drag drop support
OleInPlaceClient |
OpenStruct |
ostream |
OutputWorker | Worker for drawing contents of file lists in child pane
OwnerdrawnButton | Subclass button controls to draw them by using PM_DISPATCH_DRAWITEM The owning window should use the OwnerDrawParent template to route owner draw messages to the buttons
OwnerDrawParent< BASE > | Draw message routing for ColorButton and PictureButton
PaintCanvas | PaintCanvas is a encapsulation of device contexts managed by BeginPaint()/EndPaint()
PAINTSTRUCT |
Pane | Child window pane for displaying file lists
PictureButton | Subclass button controls to paint pictures left to the labels
PIDList | List of PIDLs
Point | PointL encapsulates the POINT structure into a C++ object
PopupMenu | Popup Menus
PreTranslateWindow | PreTranslateWindow is used to register windows to be called by Window::pretranslate_msg()
PropertySheetDialog | Property Sheet dialog
PROPSHEETHEADER |
PROPSHEETPAGE |
PropSheetPage |
PropSheetPageDlg | Property Sheet Page (inner dialog)
QuickLaunchBar | Quick launch bar window
QuickLaunchEntry | Quick launch bar shortcut
QuickLaunchMap | Map for managing the task bar buttons
RecentStartMenu | "Recent Files" sub-start menu
RegDirectory | Registry key entry
RegEntry | Registry entry
RegistryChildWndInfo | Information structure for creation of FileChildWindow for the Registry
RegistryRoot | Registry key entry
ResBitmap | Convenient loading of bitmap resources
ResIcon | Convenient loading of standard (32x32) icon resources
ResIconEx | Convenient loading of icon resources with specified sizes
ResizeController< BASE > | Controller base template class for resizable dialogs
ResizeEntry | Structure to assign RESIZE_FLAGS to dialogs control
ResizeManager | Management of controls in resizable dialogs
ResString | Convenient loading of string resources
Root | Root entry for file system trees
RtlAnsiString |
RtlUnicodeString |
SDIMainFrame |
SearchMenu | Search sub-startmenu
SelectedBitmap | SelectedBitmap is used to localy select bitmaps into device contexts
SettingsMenu | Settings sub-startmenu
ShellBrowser | Implementation of IShellBrowserImpl interface in explorer child windows
ShellBrowserChildT< BASE > |
ShellChildWndInfo | Information structure for creation of MDIShellBrowserChild
ShellDirectory | Shell folder entry
ShellEntry | Shell file/directory entry
ShellFolder | IShellFolder smart pointer
ShellItemEnumerator | Wrapper class for enumerating shell namespace objects
ShellLinkPtr | IShellLink smart pointer
ShellMalloc | Wrapper class for IMalloc with usage of common allocator
ShellPath | Wrapper class for item ID lists
ShellPathInfo | Information structure to hold current shell folder information
SIfacePtr< T > | Wrapper class for COM interface pointers
SimpleComObject |
SmallIcon | Convenient loading of small (16x16) icon resources
SMBtnInfo |
SpecialFolder | Retrieval of special shell folder
SpecialFolderFSPath | File system path of special folder
SpecialFolderPath | Retrieval of special shell folder paths
SShellPtr< T > | Wrapper template class for pointers to shell objects managed by IMalloc
StartButton | Special "Start" button with one click activation
StartMenu | Startmenu window
StartMenuCreateInfo | Structor containing information for creating of start menus
StartMenuDirectory | StartMenuDirectory is used to store the base directory of start menus
StartMenuEntry | Structure holding information about one start menu entry
StartMenuHandler | Handling of standard start menu commands
StartMenuRoot | Startmenu root window
StartmenuSettingsDlg | "Startmenu Settings" Property Sheet Dialog
Static | This class constructs static controls
string |
string |
String | String class for TCHAR strings
XMLStorage::String_from_XML_Char | Converter from Expat strings to XMLStorage internal strings
STRRET |
StrRetA | Easy retrieval of multi byte strings out of STRRET structures
StrRetW | Easy retrieval of wide char strings out of STRRET structures
SubclassedWindow | SubclassedWindow is used to wrap already existing window handles into C++ Window objects
SysCacheIcon |
TaskBar | Taskbar window
TaskBarEntry | Internal task bar button management entry
TaskBarMap | Map for managing the task bar buttons, mapped by application window handle
TaskbarSettingsDlg | "Taskbar Settings" Property Sheet Dialog
TextColor | TextColor locally selects a text color for drawing
Thread | Thread base class
XMLStorage::tifstream | Input file stream with ANSI/UNICODE file names
XMLStorage::tofstream | Output file stream with ANSI/UNICODE file names
ToolTip | Encapsulation of tool tip controls
TrayIcon |
TrayIconControllerTemplate< BASE > |
TrayNotifyCDS | Copy data structure for tray notifications
TrayNotifyDlg | Configuration dialog for notification icons
TreeDropTarget | OLE drop target for tree controls
TypeCheck< CLASS > | Dynamic casting of Window pointers
UNC |
UnicodeString |
Variant |
VARIANT |
WaitCursor |
WebChildWindow | Encapsulation of Web control in MDI child windows
WebChildWndInfo | Information structure for creation of WebChildWindow
WinDirectory | Windows file system directory-entry
Window | Class Window is the base class for several C++ window wrapper classes
Window::StaticWindowData | Structure for managing critical sections as static class information in struct Window
WindowCanvas | WindowCanvas is a encapsulation of client area device contexts
WindowClass | WindowClass is a neat wrapper for RegisterClassEx()
WindowCreator< WND_CLASS > | Template class used in macro WINDOW_CREATOR to define the creater functions for Window objects
WindowCreatorInfo< WND_CLASS, INFO_CLASS > | Template class used in macro WINDOW_CREATOR_INFO to the define creater functions for Window objects with additional creation information
WindowHandle | Base of all structures storing a window handle
WindowRect | ClientRect retreives the window rectangle of a window
WinEntry | Windows file system file-entry
WNDCLASSEX |
XMLStorage::XMLBool | Type converter for boolean data
XMLStorage::XMLBoolRef | Type converter for boolean data with write access
XMLStorage::XMLChildrenFilter | Iterator access to children nodes with name filtering
XMLStorage::XMLChildrenFilter::iterator | Internal iterator class
XMLStorage::XMLDoc | XML document holder
XMLStorage::XMLHeader | Management of XML file headers
XMLStorage::XMLInt | Type converter for integer data
XMLStorage::XMLIntRef | Type converter for integer data with write access
XMLStorage::XMLMessage | XML message wrapper
XMLStorage::XMLNode | In memory representation of an XML node
XMLStorage::XMLNode::Children | Internal children node list
XMLStorage::XMLPos | Iterator for XML trees
XMLStorage::XMLReader | XML file reader
XMLStorage::XMLReaderBase | XML reader base class
XMLStorage::XMLString | Type converter for string data
XMLStorage::XMLWriter |
XMLStorage::XMLWriter::StackEntry |
XMLStorage::XMStringRef | Type converter for string data with write access
XMLStorage::XS_String | String class for TCHAR strings


ROS Explorer: BackgroundWindow Struct Reference

  • Class Members

BackgroundWindow Struct Reference

subclassed Background window behind the visible desktop window More...

#include <desktop.h>

Inheritance diagram for BackgroundWindow:

[legend]
Collaboration diagram for BackgroundWindow:

[legend]
List of all members.

Public Types

typedef SubclassedWindow | super

Public Member Functions

BackgroundWindow (HWND hwnd)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
void | DrawDesktopBkgnd (HDC hdc)

Protected Attributes

int | _display_version

Detailed Description

subclassed Background window behind the visible desktop window

Definition at line 35 of file desktop.h.

Member Typedef Documentation

typedef SubclassedWindow BackgroundWindow::super

Reimplemented from SubclassedWindow.

Definition at line 37 of file desktop.h.

Constructor & Destructor Documentation

BackgroundWindow::BackgroundWindow ( HWND hwnd )

Definition at line 257 of file desktop.cpp.

References _display_version, and RegGetDWORDValue().

00258  :      super(hwnd)
00259 {
00260          // set background brush for the short moment of displaying the
00261          // background color while moving foreground windows
00262         SetClassLong(hwnd, GCL_HBRBACKGROUND, COLOR_BACKGROUND+1);
00263
00264         _display_version = RegGetDWORDValue(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), TEXT("PaintDesktopVersion"), 1);
00265 }

Here is the call graph for this function:

Member Function Documentation

void BackgroundWindow::DrawDesktopBkgnd ( HDC hdc ) [protected]

Definition at line 299 of file desktop.cpp.

Referenced by WndProc().

00300 {
00301         PaintDesktop(hdc);
00302
00303 /* special solid background
00304         HBRUSH bkgndBrush = CreateSolidBrush(RGB(0,32,160));    // dark blue
00305         FillRect(hdc, &rect, bkgndBrush);
00306         DeleteBrush(bkgndBrush);
00307 */
00308 }

LRESULT BackgroundWindow::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:
Changing the PaintDesktopVersion-Flag needs a restart of the shell -> display a message box

Reimplemented from SubclassedWindow.

Definition at line 267 of file desktop.cpp.

References _display_version, WindowHandle::_hwnd, ExplorerGlobals::_hwndDesktop, DrawDesktopBkgnd(), g_Globals, PM_DISPLAY_VERSION, RegSetDWORDValue(), and SubclassedWindow::WndProc().

00268 {
00269         switch(nmsg) {
00270           case WM_ERASEBKGND:
00271                 DrawDesktopBkgnd((HDC)wparam);
00272                 return TRUE;
00273
00274           case WM_MBUTTONDBLCLK:
00275                 /* Imagelist icons are missing if MainFrame::Create() is called directly from here!
00276                 explorer_show_frame(SW_SHOWNORMAL); */
00277                 PostMessage(g_Globals._hwndDesktop, nmsg, wparam, lparam);
00278                 break;
00279
00280           case PM_DISPLAY_VERSION:
00281                 if (lparam || wparam) {
00282                         DWORD or_mask = wparam;
00283                         DWORD reset_mask = LOWORD(lparam);
00284                         DWORD xor_mask = HIWORD(lparam);
00285                         _display_version = ((_display_version&~reset_mask) | or_mask) ^ xor_mask;
00286                         RegSetDWORDValue(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), TEXT("PaintDesktopVersion"), _display_version);
00288                         InvalidateRect(_hwnd, NULL, TRUE);
00289                 }
00290                 return _display_version;
00291
00292           default:
00293                 return super::WndProc(nmsg, wparam, lparam);
00294         }
00295
00296         return 0;
00297 }

Here is the call graph for this function:

Member Data Documentation

int BackgroundWindow::_display_version [protected]

Definition at line 46 of file desktop.h.

Referenced by BackgroundWindow(), and WndProc().

The documentation for this struct was generated from the following files:
  • desktop.h
  • desktop.cpp


ROS Explorer: Member List

BackgroundWindow Member List

This is the complete list of members for BackgroundWindow, including all inherited members.

_display_version | BackgroundWindow | [protected]
_hwnd | WindowHandle | [protected]
_orgWndProc | SubclassedWindow | [protected]
BackgroundWindow(HWND hwnd) | BackgroundWindow |
CancelModes() | Window | [static]
Command(int id, int code) | SubclassedWindow | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawDesktopBkgnd(HDC hdc) | BackgroundWindow | [protected]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | SubclassedWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | BackgroundWindow |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | BackgroundWindow | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: BitmapSelection Struct Reference

BitmapSelection Struct Reference

BitmapSelection locally selects a bitmap into a device context. More...

#include <utility.h>

Collaboration diagram for BitmapSelection:

[legend]
List of all members.

Public Member Functions

BitmapSelection (HDC hdc, HBITMAP hBmp)
~BitmapSelection ()

Protected Attributes

HDC | _hdc
HBITMAP | _old_hBmp

Detailed Description

BitmapSelection locally selects a bitmap into a device context.

Definition at line 628 of file utility.h.

Constructor & Destructor Documentation

BitmapSelection::BitmapSelection | ( | HDC | hdc,
 |  | HBITMAP | hBmp
 | ) | [inline]

Definition at line 630 of file utility.h.

00631          : _hdc(hdc), _old_hBmp(SelectBitmap(hdc, hBmp)) {}

BitmapSelection::~BitmapSelection ( ) [inline]

Definition at line 633 of file utility.h.

00633 {SelectBitmap(_hdc, _old_hBmp);}

Member Data Documentation

HDC BitmapSelection::_hdc [protected]

Definition at line 636 of file utility.h.

HBITMAP BitmapSelection::_old_hBmp [protected]

Definition at line 637 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

BitmapSelection Member List

This is the complete list of members for BitmapSelection, including all inherited members.

_hdc | BitmapSelection | [protected]
_old_hBmp | BitmapSelection | [protected]
BitmapSelection(HDC hdc, HBITMAP hBmp) | BitmapSelection | [inline]
~BitmapSelection() | BitmapSelection | [inline]


ROS Explorer: BkMode Struct Reference

BkMode Struct Reference

BkMode locally sets the background mode for drawing. More...

#include <utility.h>

Collaboration diagram for BkMode:

[legend]
List of all members.

Public Member Functions

BkMode (HDC hdc, int bkmode)
~BkMode ()

Protected Attributes

HDC | _hdc
COLORREF | _old_bkmode

Detailed Description

BkMode locally sets the background mode for drawing.

Definition at line 602 of file utility.h.

Constructor & Destructor Documentation

BkMode::BkMode | ( | HDC | hdc,
 |  | int | bkmode
 | ) | [inline]

Definition at line 604 of file utility.h.

00605          : _hdc(hdc), _old_bkmode(SetBkMode(hdc, bkmode)) {}

BkMode::~BkMode ( ) [inline]

Definition at line 607 of file utility.h.

00607 {SetBkMode(_hdc, _old_bkmode);}

Member Data Documentation

HDC BkMode::_hdc [protected]

Definition at line 610 of file utility.h.

COLORREF BkMode::_old_bkmode [protected]

Definition at line 611 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

BkMode Member List

This is the complete list of members for BkMode, including all inherited members.

_hdc | BkMode | [protected]
_old_bkmode | BkMode | [protected]
BkMode(HDC hdc, int bkmode) | BkMode | [inline]
~BkMode() | BkMode | [inline]


ROS Explorer: Bookmark Struct Reference

Bookmark Struct Reference

#include <favorites.h>

Collaboration diagram for Bookmark:

[legend]
List of all members.

Public Member Functions

Bookmark ()
bool | read_url (LPCTSTR path)
read .URL file
bool | read (const_XMLPos &pos)
void | write (XMLPos &pos) const

Public Attributes

String _name
String _description
String _url
String _icon_path
int | _icon_idx

Detailed Description

Definition at line 32 of file favorites.h.

Constructor & Destructor Documentation

Bookmark::Bookmark ( ) [inline]

Definition at line 34 of file favorites.h.

00034 : _icon_idx(0) {}

Member Function Documentation

bool Bookmark::read ( const_XMLPos & pos )

bool Bookmark::read_url ( LPCTSTR path )

read .URL file

Definition at line 54 of file favorites.cpp.

References _icon_path, _url, BUFFER_LEN, and DecodeURLString().

Referenced by BookmarkList::import_IE_favorites().

00055 {
00056         char line[BUFFER_LEN];
00057
00058         tifstream in(path);
00059
00060         while(in.good()) {
00061                 in.getline(line, BUFFER_LEN);
00062
00063                 const char* p = line;
00064                 while(isspace(*p))
00065                         ++p;
00066
00067                 const char* keyword = p;
00068                 const char* eq = strchr(p, '=');
00069
00070                 if (eq) {
00071                         const char* cont = eq + 1;
00072                         while(isspace(*cont))
00073                                 ++cont;
00074
00075                         if (!_strnicmp(keyword, "URL", 3))
00076                                 _url = DecodeURLString(cont);
00077                         else if (!_strnicmp(keyword, "IconFile", 8))
00078                                 _icon_path = DecodeURLString(cont);
00079                 }
00080         }
00081
00082         return true;
00083 }

Here is the call graph for this function:

void Bookmark::write ( XMLPos & pos ) const

Member Data Documentation

String Bookmark::_description

Definition at line 37 of file favorites.h.

Referenced by FavoritesMenu::AddEntries(), and MainFrameBase::Notify().

int Bookmark::_icon_idx

Definition at line 40 of file favorites.h.

Referenced by FavoritesMenu::AddEntries(), and BookmarkList::fill_tree().

String Bookmark::_icon_path

Definition at line 39 of file favorites.h.

Referenced by FavoritesMenu::AddEntries(), BookmarkList::fill_tree(), and read_url().

String Bookmark::_name

Definition at line 36 of file favorites.h.

Referenced by FavoritesMenu::AddEntries(), BookmarkList::fill_tree(), and BookmarkList::import_IE_favorites().

String Bookmark::_url

Definition at line 38 of file favorites.h.

Referenced by FavoritesMenu::AddEntries(), FavoritesMenu::Command(), MainFrameBase::Notify(), and read_url().

The documentation for this struct was generated from the following files:
  • favorites.h
  • favorites.cpp


ROS Explorer: Member List

Bookmark Member List

This is the complete list of members for Bookmark, including all inherited members.

_description | Bookmark |
_icon_idx | Bookmark |
_icon_path | Bookmark |
_name | Bookmark |
_url | Bookmark |
Bookmark() | Bookmark | [inline]
read(const_XMLPos &pos) | Bookmark |
read_url(LPCTSTR path) | Bookmark |
write(XMLPos &pos) const | Bookmark |


ROS Explorer: BookmarkFolder Struct Reference

BookmarkFolder Struct Reference

#include <favorites.h>

Collaboration diagram for BookmarkFolder:

[legend]
List of all members.

Public Member Functions

void | read (const_XMLPos &pos)
void | write (XMLPos &pos) const

Public Attributes

String _name
String _description
BookmarkList _bookmarks

Detailed Description

Definition at line 86 of file favorites.h.

Member Function Documentation

void BookmarkFolder::read ( const_XMLPos & pos )

void BookmarkFolder::write ( XMLPos & pos ) const

Member Data Documentation

BookmarkList BookmarkFolder::_bookmarks

Definition at line 90 of file favorites.h.

Referenced by FavoritesMenu::Command(), BookmarkList::fill_tree(), and BookmarkList::import_IE_favorites().

String BookmarkFolder::_description

Definition at line 89 of file favorites.h.

Referenced by MainFrameBase::Notify().

String BookmarkFolder::_name

Definition at line 88 of file favorites.h.

Referenced by FavoritesMenu::AddEntries(), FavoritesMenu::Command(), BookmarkList::fill_tree(), and BookmarkList::import_IE_favorites().

The documentation for this struct was generated from the following file:
  • favorites.h


ROS Explorer: Member List

BookmarkFolder Member List

This is the complete list of members for BookmarkFolder, including all inherited members.

_bookmarks | BookmarkFolder
_description | BookmarkFolder
_name | BookmarkFolder
read(const_XMLPos &pos) | BookmarkFolder
write(XMLPos &pos) const | BookmarkFolder


ROS Explorer: BookmarkList Struct Reference

BookmarkList Struct Reference

#include <favorites.h>

Inheritance diagram for BookmarkList:

[legend]
Collaboration diagram for BookmarkList:

[legend]
List of all members.

Public Member Functions

void | import_IE_favorites (struct ShellDirectory &dir, HWND hwnd)
import Internet Explorer bookmarks from Favorites folder into bookmark list
void | read (const_XMLPos &pos)
void | write (XMLPos &pos) const
void | fill_tree (HWND hwnd, HTREEITEM parent, HIMAGELIST, HDC hdc_wnd) const
fill treeview control with bookmark tree content

Detailed Description

Definition at line 76 of file favorites.h.

Member Function Documentation

void BookmarkList::fill_tree | ( | HWND | hwnd,
 |  | HTREEITEM | parent,
 |  | HIMAGELIST | ,
 |  | HDC | hdc_wnd
 | ) | const

fill treeview control with bookmark tree content

Definition at line 327 of file favorites.cpp.

References BookmarkFolder::_bookmarks, ExplorerGlobals::_icon_cache, Bookmark::_icon_idx, Bookmark::_icon_path, Bookmark::_name, BookmarkFolder::_name, Icon::add_to_imagelist(), BookmarkNode::BMNT_BOOKMARK, BookmarkNode::BMNT_FOLDER, IconCache::extract(), fill_tree(), g_Globals, and ICID_NONE.

Referenced by fill_tree(), and MainFrameBase::FillBookmarks().

00328 {
00329         TV_INSERTSTRUCT tvi;
00330
00331         tvi.hParent = parent;
00332         tvi.hInsertAfter = TVI_LAST;
00333
00334         TV_ITEM& tv = tvi.item;
00335         tv.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
00336
00337         for(const_iterator it=begin(); it!=end(); ++it) {
00338                 const BookmarkNode& node = *it;
00339
00340                 tv.lParam = (LPARAM)&node;
00341
00342                 if (node._type == BookmarkNode::BMNT_FOLDER) {
00343                         const BookmarkFolder& folder = *node._pfolder;
00344
00345                         tv.pszText = (LPTSTR)folder._name.c_str();
00346                         tv.iImage = 3;                  // folder
00347                         tv.iSelectedImage = 4;  // open folder
00348                         HTREEITEM hitem = TreeView_InsertItem(hwnd, &tvi);
00349
00350                         folder._bookmarks.fill_tree(hwnd, hitem, himagelist, hdc_wnd);
00351                 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
00352                         const Bookmark& bookmark = *node._pbookmark;
00353
00354                         tv.pszText = (LPTSTR)bookmark._name.c_str();
00355                         tv.iImage = 1;                  // bookmark
00356                         tv.iSelectedImage = 2;  // selected bookmark
00357
00358                         if (!bookmark._icon_path.empty()) {
00359                                 const Icon& icon = g_Globals._icon_cache.extract(bookmark._icon_path, bookmark._icon_idx);
00360
00361                                 if ((ICON_ID)icon != ICID_NONE)
00362                                         tv.iImage = tv.iSelectedImage = icon.add_to_imagelist(himagelist, hdc_wnd);
00363                         }
00364
00365                         (void)TreeView_InsertItem(hwnd, &tvi);
00366                 }
00367         }
00368 }

Here is the call graph for this function:

void BookmarkList::import_IE_favorites | ( | struct ShellDirectory & | dir,
 |  | HWND | hwnd
 | ) |

import Internet Explorer bookmarks from Favorites folder into bookmark list

Todo:
read shell links

Definition at line 372 of file favorites.cpp.

References BookmarkFolder::_bookmarks, Entry::_down, Entry::_etype, ShellDirectory::_folder, _MAX_EXT, Bookmark::_name, BookmarkFolder::_name, Entry::_next, Entry::_shell_attribs, _tsplitpath_s, COUNTOF, XMLStorage::DecodeXMLString(), ET_SHELL, ShellFolder::get_name(), GetDesktopFolder(), import_IE_favorites(), Bookmark::read_url(), SCAN_FILESYSTEM, Entry::smart_scan(), and SORT_NAME.

Referenced by Favorites::import_IE_favorites(), and import_IE_favorites().

00373 {
00374         TCHAR path[MAX_PATH], ext[_MAX_EXT];
00375
00376         dir.smart_scan(SORT_NAME, SCAN_FILESYSTEM);
00377
00378         for(Entry*entry=dir._down; entry; entry=entry->_next) {
00379                 if (entry->_shell_attribs & SFGAO_HIDDEN)       // ignore files like "desktop.ini"
00380                         continue;
00381
00382                 String name;
00383
00384                 if (entry->_etype == ET_SHELL)
00385                         name = dir._folder.get_name(static_cast<ShellEntry*>(entry)->_pidl);
00386                 else
00387                         name = entry->_display_name;
00388
00389                 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00390                         BookmarkFolder new_folder;
00391
00392                         new_folder._name = DecodeXMLString(name);
00393
00394                         if (entry->_etype == ET_SHELL) {
00395                                 ShellDirectory new_dir(dir._folder, static_cast<ShellEntry*>(entry)->_pidl, hwnd);
00396                                 new_folder._bookmarks.import_IE_favorites(new_dir, hwnd);
00397                         } else {
00398                                 entry->get_path(path, COUNTOF(path));
00399                                 ShellDirectory new_dir(GetDesktopFolder(), path, hwnd);
00400                                 new_folder._bookmarks.import_IE_favorites(new_dir, hwnd);
00401                         }
00402
00403                         push_back(new_folder);
00404                 } else {
00405                         Bookmark bookmark;
00406
00407                         bookmark._name = DecodeXMLString(name);
00408
00409                         entry->get_path(path, COUNTOF(path));
00410                         _tsplitpath_s(path, NULL, 0, NULL, 0, NULL, 0, ext, COUNTOF(ext));
00411
00412                         if (!_tcsicmp(ext, TEXT(".url"))) {
00413                                 bookmark.read_url(path);
00414                                 push_back(bookmark);
00415                         } else {
00417                                 //assert(0);
00418                         }
00419                 }
00420         }
00421 }

Here is the call graph for this function:

void BookmarkList::read ( const_XMLPos & pos )

Referenced by Favorites::read().

void BookmarkList::write ( XMLPos & pos ) const

Referenced by Favorites::write().

The documentation for this struct was generated from the following files:
  • favorites.h
  • favorites.cpp


ROS Explorer: Member List

BookmarkList Member List

This is the complete list of members for BookmarkList, including all inherited members.

fill_tree(HWND hwnd, HTREEITEM parent, HIMAGELIST, HDC hdc_wnd) const | BookmarkList
import_IE_favorites(struct ShellDirectory &dir, HWND hwnd) | BookmarkList
read(const_XMLPos &pos) | BookmarkList
write(XMLPos &pos) const | BookmarkList


ROS Explorer: BookmarkNode Struct Reference

BookmarkNode Struct Reference

#include <favorites.h>

Collaboration diagram for BookmarkNode:

[legend]
List of all members.

Public Types

enum | BOOKMARKNODE_TYPE { BMNT_NONE, BMNT_BOOKMARK, BMNT_FOLDER }

Public Member Functions

BookmarkNode ()
BookmarkNode (const Bookmark &bm)
BookmarkNode (const BookmarkFolder &bmf)
BookmarkNode (const BookmarkNode &other)
~BookmarkNode ()
BookmarkNode & | operator= (const Bookmark &bm)
BookmarkNode & | operator= (const BookmarkFolder &bmf)
BookmarkNode & | operator= (const BookmarkNode &other)
void | clear ()

Public Attributes

BOOKMARKNODE_TYPE _type
Bookmark * _pbookmark
BookmarkFolder * _pfolder

Detailed Description

Definition at line 49 of file favorites.h.

Member Enumeration Documentation

enum BookmarkNode::BOOKMARKNODE_TYPE

Enumerator:
BMNT_NONE
BMNT_BOOKMARK
BMNT_FOLDER

Definition at line 64 of file favorites.h.

00064                                {
00065                 BMNT_NONE, BMNT_BOOKMARK, BMNT_FOLDER
00066         };

Constructor & Destructor Documentation

BookmarkNode::BookmarkNode ( )

Definition at line 196 of file favorites.cpp.

References _pbookmark.

00197  :      _type(BMNT_NONE)
00198 {
00199         _pbookmark = NULL;
00200 }

BookmarkNode::BookmarkNode ( const Bookmark & bm )

Definition at line 202 of file favorites.cpp.

References _pbookmark.

00203  :      _type(BMNT_BOOKMARK)
00204 {
00205         _pbookmark = new Bookmark(bm);
00206 }

BookmarkNode::BookmarkNode ( const BookmarkFolder & bmf )

Definition at line 208 of file favorites.cpp.

References _pfolder.

00209  :      _type(BMNT_FOLDER)
00210 {
00211         _pfolder = new BookmarkFolder(bmf);
00212 }

BookmarkNode::BookmarkNode ( const BookmarkNode & other )

Definition at line 214 of file favorites.cpp.

References _pbookmark, _pfolder, _type, BMNT_BOOKMARK, and BMNT_FOLDER.

00215  :      _type(other._type)
00216 {
00217         if (other._type == BMNT_BOOKMARK)
00218                 _pbookmark = new Bookmark(*other._pbookmark);
00219         else if (other._type == BMNT_FOLDER)
00220                 _pfolder = new BookmarkFolder(*other._pfolder);
00221         else
00222                 _pbookmark = NULL;
00223 }

BookmarkNode::~BookmarkNode ( )

Definition at line 225 of file favorites.cpp.

References _pbookmark, _pfolder, _type, BMNT_BOOKMARK, and BMNT_FOLDER.

00226 {
00227         if (_type == BMNT_BOOKMARK)
00228                 delete _pbookmark;
00229         else if (_type == BMNT_FOLDER)
00230                 delete _pfolder;
00231 }

Member Function Documentation

void BookmarkNode::clear ( )

Definition at line 265 of file favorites.cpp.

References _pbookmark, _pfolder, _type, BMNT_BOOKMARK, BMNT_FOLDER, and BMNT_NONE.

Referenced by operator=().

00266 {
00267         if (_type == BMNT_BOOKMARK) {
00268                 delete _pbookmark;
00269                 _pbookmark = NULL;
00270         }
00271         else if (_type == BMNT_FOLDER) {
00272                 delete _pfolder;
00273                 _pfolder = NULL;
00274         }
00275
00276         _type = BMNT_NONE;
00277 }

BookmarkNode & BookmarkNode::operator= ( const BookmarkNode & other )

Definition at line 251 of file favorites.cpp.

References _pbookmark, _pfolder, _type, BMNT_BOOKMARK, BMNT_FOLDER, and clear().

00252 {
00253         clear();
00254
00255         _type = other._type;
00256
00257         if (other._type == BMNT_BOOKMARK)
00258                 _pbookmark = new Bookmark(*other._pbookmark);
00259         else if (other._type == BMNT_FOLDER)
00260                 _pfolder = new BookmarkFolder(*other._pfolder);
00261
00262         return *this;
00263 }

Here is the call graph for this function:

BookmarkNode & BookmarkNode::operator= ( const BookmarkFolder & bmf )

Definition at line 242 of file favorites.cpp.

References _pfolder, and clear().

00243 {
00244         clear();
00245
00246         _pfolder = new BookmarkFolder(bmf);
00247
00248         return *this;
00249 }

Here is the call graph for this function:

BookmarkNode & BookmarkNode::operator= ( const Bookmark & bm )

Definition at line 233 of file favorites.cpp.

References _pbookmark, and clear().

00234 {
00235         clear();
00236
00237         _pbookmark = new Bookmark(bm);
00238
00239         return *this;
00240 }

Here is the call graph for this function:

Member Data Documentation

Bookmark* BookmarkNode::_pbookmark

Definition at line 71 of file favorites.h.

Referenced by BookmarkNode(), clear(), MainFrameBase::Notify(), operator=(), and ~BookmarkNode().

BookmarkFolder* BookmarkNode::_pfolder

Definition at line 72 of file favorites.h.

Referenced by BookmarkNode(), clear(), MainFrameBase::Notify(), operator=(), and ~BookmarkNode().

BOOKMARKNODE_TYPE BookmarkNode::_type

Definition at line 68 of file favorites.h.

Referenced by BookmarkNode(), clear(), MainFrameBase::Notify(), operator=(), and ~BookmarkNode().

The documentation for this struct was generated from the following files:
  • favorites.h
  • favorites.cpp


ROS Explorer: Member List

BookmarkNode Member List

This is the complete list of members for BookmarkNode, including all inherited members.

_pbookmark | BookmarkNode
_pfolder | BookmarkNode
_type | BookmarkNode
BMNT_BOOKMARK enum value | BookmarkNode
BMNT_FOLDER enum value | BookmarkNode
BMNT_NONE enum value | BookmarkNode
BookmarkNode() | BookmarkNode
BookmarkNode(const Bookmark &bm) | BookmarkNode
BookmarkNode(const BookmarkFolder &bmf) | BookmarkNode
BookmarkNode(const BookmarkNode &other) | BookmarkNode
BOOKMARKNODE_TYPE enum name | BookmarkNode
clear() | BookmarkNode
operator=(const Bookmark &bm) | BookmarkNode
operator=(const BookmarkFolder &bmf) | BookmarkNode
operator=(const BookmarkNode &other) | BookmarkNode
~BookmarkNode() | BookmarkNode


ROS Explorer: BootSector Struct Reference

BootSector Struct Reference

#include <fatfs.h>

Collaboration diagram for BootSector:

[legend]
List of all members.

Public Attributes

BYTE | jmp [3]
char | OEM [8]
WORD | BytesPerSector
BYTE | SectorsPerCluster
WORD | ReservedSectors
BYTE | NumberFATs
WORD | RootEntries
WORD | Sectors16
BYTE | MediaDescr
WORD | SectorsPerFAT
WORD | SectorsPerTrack
WORD | Heads
DWORD | HiddenSectors
DWORD | Sectors32
BYTE | DriveUnit
WORD | ExtBootFlag
DWORD | SerialNr
char | Label [11]
char | FileSystem [8]
BYTE | BootCode [448]
BYTE | BootSignature [2]

Detailed Description

Definition at line 72 of file fatfs.h.

Member Data Documentation

BYTE BootSector::BootCode[448]

Definition at line 92 of file fatfs.h.

BYTE BootSector::BootSignature[2]

Definition at line 93 of file fatfs.h.

WORD BootSector::BytesPerSector

Definition at line 75 of file fatfs.h.

Referenced by FATDrive::FATDrive(), FATDrive::read_cache(), FATDirectory::read_dir(), FATDrive::read_FAT(), and FATDrive::read_sector().

BYTE BootSector::DriveUnit

Definition at line 87 of file fatfs.h.

WORD BootSector::ExtBootFlag

Definition at line 88 of file fatfs.h.

char BootSector::FileSystem[8]

Definition at line 91 of file fatfs.h.

WORD BootSector::Heads

Definition at line 84 of file fatfs.h.

DWORD BootSector::HiddenSectors

Definition at line 85 of file fatfs.h.

BYTE BootSector::jmp[3]

Definition at line 73 of file fatfs.h.

char BootSector::Label[11]

Definition at line 90 of file fatfs.h.

BYTE BootSector::MediaDescr

Definition at line 81 of file fatfs.h.

BYTE BootSector::NumberFATs

Definition at line 78 of file fatfs.h.

Referenced by FATDrive::read_cache(), and FATDirectory::read_dir().

char BootSector::OEM[8]

Definition at line 74 of file fatfs.h.

WORD BootSector::ReservedSectors

Definition at line 77 of file fatfs.h.

Referenced by FATDirectory::read_dir(), and FATDrive::read_FAT().

WORD BootSector::RootEntries

Definition at line 79 of file fatfs.h.

Referenced by FATDirectory::read_dir().

WORD BootSector::Sectors16

Definition at line 80 of file fatfs.h.

Referenced by FATDrive::read_FAT().

DWORD BootSector::Sectors32

Definition at line 86 of file fatfs.h.

Referenced by FATDrive::read_FAT().

BYTE BootSector::SectorsPerCluster

Definition at line 76 of file fatfs.h.

Referenced by FATDrive::read_FAT().

WORD BootSector::SectorsPerFAT

Definition at line 82 of file fatfs.h.

Referenced by FATDrive::read_cache(), and FATDirectory::read_dir().

WORD BootSector::SectorsPerTrack

Definition at line 83 of file fatfs.h.

DWORD BootSector::SerialNr

Definition at line 89 of file fatfs.h.

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: BootSector32 Struct Reference

BootSector32 Struct Reference

#include <fatfs.h>

Collaboration diagram for BootSector32:

[legend]
List of all members.

Public Attributes

BYTE | jmp [3]
char | OEM [8]
WORD | BytesPerSector
BYTE | SectorsPerCluster
WORD | ReservedSectors
BYTE | NumberFATs
WORD | reserved1
WORD | Sectors16
BYTE | MediaDescr
WORD | reserved2
WORD | SectorsPerTrack
WORD | Heads
DWORD | HiddenSectors
DWORD | Sectors32
DWORD | SectorsPerFAT32
DWORD | unknown1
DWORD | RootSectors
char | unknown2 [6]
char | FileSystem [8]
BYTE | BootCode [448]
BYTE | BootSignature [2]

Detailed Description

Definition at line 96 of file fatfs.h.

Member Data Documentation

BYTE BootSector32::BootCode[448]

Definition at line 116 of file fatfs.h.

BYTE BootSector32::BootSignature[2]

Definition at line 117 of file fatfs.h.

WORD BootSector32::BytesPerSector

Definition at line 99 of file fatfs.h.

char BootSector32::FileSystem[8]

Definition at line 115 of file fatfs.h.

WORD BootSector32::Heads

Definition at line 108 of file fatfs.h.

DWORD BootSector32::HiddenSectors

Definition at line 109 of file fatfs.h.

BYTE BootSector32::jmp[3]

Definition at line 97 of file fatfs.h.

BYTE BootSector32::MediaDescr

Definition at line 105 of file fatfs.h.

BYTE BootSector32::NumberFATs

Definition at line 102 of file fatfs.h.

char BootSector32::OEM[8]

Definition at line 98 of file fatfs.h.

WORD BootSector32::reserved1

Definition at line 103 of file fatfs.h.

WORD BootSector32::reserved2

Definition at line 106 of file fatfs.h.

WORD BootSector32::ReservedSectors

Definition at line 101 of file fatfs.h.

DWORD BootSector32::RootSectors

Definition at line 113 of file fatfs.h.

Referenced by FATDirectory::read_dir().

WORD BootSector32::Sectors16

Definition at line 104 of file fatfs.h.

DWORD BootSector32::Sectors32

Definition at line 110 of file fatfs.h.

BYTE BootSector32::SectorsPerCluster

Definition at line 100 of file fatfs.h.

DWORD BootSector32::SectorsPerFAT32

Definition at line 111 of file fatfs.h.

Referenced by FATDirectory::read_dir().

WORD BootSector32::SectorsPerTrack

Definition at line 107 of file fatfs.h.

DWORD BootSector32::unknown1

Definition at line 112 of file fatfs.h.

char BootSector32::unknown2[6]

Definition at line 114 of file fatfs.h.

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

BootSector32 Member List

This is the complete list of members for BootSector32, including all inherited members.

BootCode | BootSector32
BootSignature | BootSector32
BytesPerSector | BootSector32
FileSystem | BootSector32
Heads | BootSector32
HiddenSectors | BootSector32
jmp | BootSector32
MediaDescr | BootSector32
NumberFATs | BootSector32
OEM | BootSector32
reserved1 | BootSector32
reserved2 | BootSector32
ReservedSectors | BootSector32
RootSectors | BootSector32
Sectors16 | BootSector32
Sectors32 | BootSector32
SectorsPerCluster | BootSector32
SectorsPerFAT32 | BootSector32
SectorsPerTrack | BootSector32
unknown1 | BootSector32
unknown2 | BootSector32


ROS Explorer: BrowseMenu Struct Reference

BrowseMenu Struct Reference

"Browse Files..." sub-start menu More...

#include <startmenu.h>

Inheritance diagram for BrowseMenu:

[legend]
Collaboration diagram for BrowseMenu:

[legend]
List of all members.

Public Types

typedef StartMenuHandler | super

Public Member Functions

BrowseMenu (HWND hwnd, const StartMenuCreateInfo &create_info)

Protected Member Functions

virtual void | AddEntries ()

Detailed Description

"Browse Files..." sub-start menu

Definition at line 404 of file startmenu.h.

Member Typedef Documentation

typedef StartMenuHandler BrowseMenu::super

Reimplemented from StartMenuHandler.

Definition at line 406 of file startmenu.h.

Constructor & Destructor Documentation

BrowseMenu::BrowseMenu | ( | HWND | hwnd,
 |  | const StartMenuCreateInfo & | create_info
 | ) | [inline]

Definition at line 408 of file startmenu.h.

00409          :      super(hwnd, create_info)
00410         {
00411         }

Member Function Documentation

void BrowseMenu::AddEntries ( ) [protected, virtual]

Reimplemented from StartMenu.

Definition at line 2170 of file startmenu.cpp.

References StartMenu::AddButton(), StartMenu::AddEntries(), g_Globals, ICID_FOLDER, ICID_NETWORK, IDC_DRIVES, IDC_NETWORK, IDS_DRIVES, and IDS_NETWORK.

02171 {
02172         super::AddEntries();
02173
02174 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
02175         if (!g_Globals._SHRestricted || !SHRestricted(REST_NONETHOOD))  // or REST_NOENTIRENETWORK ?
02176 #endif
02177 #if defined(ROSSHELL) || defined(_ROS_) // _ROS_ to be removed when printer/network will be implemented
02178                 AddButton(ResString(IDS_NETWORK),               ICID_NETWORK, false, IDC_NETWORK);
02179 #else
02180                 AddButton(ResString(IDS_NETWORK),               ICID_NETWORK, true, IDC_NETWORK);
02181 #endif
02182
02183         AddButton(ResString(IDS_DRIVES),                        ICID_FOLDER, true, IDC_DRIVES);
02184 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • startmenu.h
  • startmenu.cpp


ROS Explorer: Member List

BrowseMenu Member List

This is the complete list of members for BrowseMenu, including all inherited members.

_arrow_btns | StartMenu | [protected]
_border_left | StartMenu | [protected]
_border_top | StartMenu | [protected]
_bottom_max | StartMenu | [protected]
_buttons | StartMenu | [protected]
_cm_ifs | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [protected]
_create_info | StartMenu | [protected]
_dirs | StartMenu | [protected]
_entries | StartMenu | [protected]
_floating_btn | StartMenu | [protected]
_hwnd | WindowHandle | [protected]
_invisible_lines | StartMenu | [protected]
_large_icons | StartMenu | [protected]
_last_mouse_pos | StartMenu | [protected]
_last_pos | StartMenu | [protected]
_next_id | StartMenu | [protected]
_scroll_mode | StartMenu | [protected]
_scroll_pos | StartMenu | [protected]
_selected_id | StartMenu | [protected]
_submenu | StartMenu | [protected]
_submenu_id | StartMenu | [protected]
ActivateEntry(int id, const ShellEntrySet &entries) | StartMenu | [protected]
AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true) | StartMenu | [protected]
AddEntries() | BrowseMenu | [protected, virtual]
AddEntry(const String &title, ICON_ID icon_id, Entry *entry) | StartMenu | [protected]
AddEntry(const String &title, ICON_ID icon_id=ICID_NONE, int id=-1) | StartMenu | [protected]
AddEntry(const ShellFolder folder, ShellEntry *entry) | StartMenu | [protected]
AddEntry(const ShellFolder folder, Entry *entry) | StartMenu | [protected]
AddSeparator() | StartMenu | [protected]
AddShellEntries(const ShellDirectory &dir, int max=-1, const String &ignore="") | StartMenu | [protected]
BrowseMenu(HWND hwnd, const StartMenuCreateInfo &create_info) | BrowseMenu | [inline]
ButtonHitTest(POINT pt) | StartMenu | [protected]
CancelModes() | Window | [static]
CloseOtherSubmenus(int id=0) | StartMenu | [protected]
CloseStartMenu(int id=0) | StartMenu | [protected, virtual]
CloseSubmenus() | StartMenu | [inline, protected]
Command(int id, int code) | StartMenuHandler | [protected, virtual]
Create(int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="") | StartMenu | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawArrows(HDC hdc, bool large_icons) | StartMenu | [protected]
DrawFloatingButton(HDC hdc) | StartMenu | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down, bool large_icons) | StartMenu | [protected]
GetButtonInfo(int id) const | StartMenu | [protected]
GetButtonRect(int id, PRECT prect) const | StartMenu | [protected]
GetFloatingButtonRect(LPRECT prect) | StartMenu | [protected]
GetSelectionIndex() | StartMenu | [protected]
GetStaticWindowData() | Window | [protected, static]
GetWndClasss() | StartMenu | [protected, static]
Init(LPCREATESTRUCT pcs) | StartMenu | [protected, virtual]
InvalidateSelection() | StartMenu | [protected]
JumpToNextShortcut(char c) | StartMenu | [protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Navigate(int step) | StartMenu | [protected]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
OpenSubmenu(bool select_first=false) | StartMenu | [protected]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< Window > | [inline]
Paint(PaintCanvas &canvas) | StartMenu | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
ProcessKey(int vk) | StartMenu | [protected, virtual]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeButtons(int cx) | StartMenu | [protected]
ResizeToButtons() | StartMenu | [protected]
s_def_creator | StartMenu | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SCROLL_DOWN enum value | StartMenu | [protected]
SCROLL_MODE enum name | StartMenu | [protected]
SCROLL_NOT enum value | StartMenu | [protected]
SCROLL_UP enum value | StartMenu | [protected]
SelectButton(int id, bool open_sub=true) | StartMenu | [protected]
SelectButtonIndex(int idx, bool open_sub=true) | StartMenu | [protected]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
ShowLaunchDialog(HWND hwndOwner) | StartMenuHandler | [protected, static]
ShowLogoffDialog(HWND hwndOwner) | StartMenuHandler | [protected, static]
ShowSearchComputer() | StartMenuHandler | [protected, static]
ShowSearchDialog() | StartMenuHandler | [protected, static]
StartMenu(HWND hwnd, bool large_icons=false) | StartMenu |
StartMenu(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenu |
StartMenuHandler(HWND hwnd, bool large_icons=false) | StartMenuHandler | [inline]
StartMenuHandler(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenuHandler | [inline]
super typedef | BrowseMenu |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
UpdateIcons() | StartMenu | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | StartMenu | [protected, virtual]
~StartMenu() | StartMenu |
~Window() | Window | [virtual]


ROS Explorer: BrowserCallback Struct Reference

BrowserCallback Struct Reference

#include <shellbrowser.h>

Inheritance diagram for BrowserCallback:

[legend]
List of all members.

Public Member Functions

virtual | ~BrowserCallback ()
virtual void | entry_selected (Entry *entry)=0

Detailed Description

Definition at line 51 of file shellbrowser.h.

Constructor & Destructor Documentation

virtual BrowserCallback::~BrowserCallback ( ) [inline, virtual]

Definition at line 53 of file shellbrowser.h.

00053 {}

Member Function Documentation

virtual void BrowserCallback::entry_selected ( Entry * entry ) [pure virtual]

Implemented in SDIMainFrame, and MDIShellBrowserChild.

Referenced by ShellBrowser::jump_to(), and ShellBrowser::OnTreeItemSelected().

The documentation for this struct was generated from the following file:
  • shellbrowser.h


ROS Explorer: Member List

BrowserCallback Member List

This is the complete list of members for BrowserCallback, including all inherited members.

entry_selected(Entry *entry)=0 | BrowserCallback | [pure virtual]
~BrowserCallback() | BrowserCallback | [inline, virtual]


ROS Explorer: BrowserNavigator Struct Reference

BrowserNavigator Struct Reference

#include <webchild.h>

Collaboration diagram for BrowserNavigator:

[legend]
List of all members.

Public Member Functions

BrowserNavigator ()
void | attach (IWebBrowser *browser)
void | goto_url (LPCTSTR url)
void | set_html_page (const String &html_txt)
void | navigated (LPCTSTR url)
IWebBrowser * | get_browser ()

Protected Attributes

SIfacePtr< IWebBrowser > | _browser
String _new_url
String _new_html_txt
bool | _browser_initialized

Detailed Description

Definition at line 506 of file webchild.h.

Constructor & Destructor Documentation

BrowserNavigator::BrowserNavigator ( )

Definition at line 119 of file webchild.cpp.

00120  :      _browser_initialized(false)
00121 {
00122 }

Member Function Documentation

void BrowserNavigator::attach ( IWebBrowser * browser )

Definition at line 124 of file webchild.cpp.

References _browser.

Referenced by WebChildWindow::WebChildWindow().

00125 {
00126         _browser = browser;
00127 }

IWebBrowser* BrowserNavigator::get_browser ( ) [inline]

Definition at line 515 of file webchild.h.

00515 {return _browser.get();}

void BrowserNavigator::goto_url ( LPCTSTR url )

Definition at line 129 of file webchild.cpp.

References _browser, _browser_initialized, and _new_url.

Referenced by WebChildWindow::jump_to_int(), and set_html_page().

00130 {
00131         if (_browser_initialized)
00132                 _browser->Navigate(BStr(url), NULL, NULL, NULL, NULL);
00133         else {
00134                 _new_url = url;
00135
00136                 _browser->Navigate(L"about:blank", NULL, NULL, NULL, NULL);
00137         }
00138 }

void BrowserNavigator::navigated ( LPCTSTR url )

Todo:
move this into DocumentComplete() ?

Definition at line 153 of file webchild.cpp.

References _browser, _browser_initialized, and _new_url.

Referenced by DWebBrowserEvents2Impl::NavigateComplete2().

00154 {
00155         _browser_initialized = true;
00156
00157         bool nav = false;
00158
00159         if (!_new_url.empty()) {
00160                 if (!_tcscmp(url,TEXT("about:blank")) && _new_url!=TEXT("about:blank")) {
00161                         _browser->Navigate(BStr(_new_url), NULL, NULL, NULL, NULL);
00162                         ++nav;
00163                 }
00164
00165                 _new_url.erase();
00166         }
00167
00168         if (!nav && !_new_html_txt.empty()) {
00169                 int len = _new_html_txt.length();
00170                 HGLOBAL hHtmlText = GlobalAlloc(GPTR, len);
00171
00172                 if (!hHtmlText) {
00173                         T2nA_binary(_new_html_txt, (char*)hHtmlText, len);
00174                         _new_html_txt.erase();
00175
00176                         SIfacePtr<IStream> pStream;
00177                         HRESULT hr = CreateStreamOnHGlobal(hHtmlText, TRUE, &pStream);
00178
00179                         if (SUCCEEDED(hr)) {
00180                                 SIfacePtr<IDispatch> pHtmlDoc;
00181                                 CheckError(_browser->get_Document(&pHtmlDoc));
00182
00183                                 SIfacePtr<IPersistStreamInit> pPersistStreamInit;
00184                                 pHtmlDoc.QueryInterface(IID_IPersistStreamInit, &pPersistStreamInit);
00185
00186                                 CheckError(pPersistStreamInit->InitNew());
00187                                 CheckError(pPersistStreamInit->Load(pStream));
00188                         } else
00189                                 GlobalFree(hHtmlText);
00190                 }
00191         }
00192 }

void BrowserNavigator::set_html_page ( const String & html_txt )

Definition at line 140 of file webchild.cpp.

References _new_html_txt, and goto_url().

00141 {
00142         _new_html_txt = html_txt;
00143
00144         goto_url(TEXT("about:blank"));
00145 }

Here is the call graph for this function:

Member Data Documentation

SIfacePtr<IWebBrowser> BrowserNavigator::_browser [protected]

Definition at line 518 of file webchild.h.

Referenced by attach(), goto_url(), and navigated().

bool BrowserNavigator::_browser_initialized [protected]

Definition at line 521 of file webchild.h.

Referenced by goto_url(), and navigated().

String BrowserNavigator::_new_html_txt [protected]

Definition at line 520 of file webchild.h.

Referenced by set_html_page().

String BrowserNavigator::_new_url [protected]

Definition at line 519 of file webchild.h.

Referenced by goto_url(), and navigated().

The documentation for this struct was generated from the following files:
  • webchild.h
  • webchild.cpp


ROS Explorer: Member List

BrowserNavigator Member List

This is the complete list of members for BrowserNavigator, including all inherited members.

_browser | BrowserNavigator | [protected]
_browser_initialized | BrowserNavigator | [protected]
_new_html_txt | BrowserNavigator | [protected]
_new_url | BrowserNavigator | [protected]
attach(IWebBrowser *browser) | BrowserNavigator |
BrowserNavigator() | BrowserNavigator |
get_browser() | BrowserNavigator | [inline]
goto_url(LPCTSTR url) | BrowserNavigator |
navigated(LPCTSTR url) | BrowserNavigator |
set_html_page(const String &html_txt) | BrowserNavigator |


ROS Explorer: BrushSelection Struct Reference

BrushSelection Struct Reference

BrushSelection locally selects a brush into a device context. More...

#include <utility.h>

Collaboration diagram for BrushSelection:

[legend]
List of all members.

Public Member Functions

BrushSelection (HDC hdc, HBRUSH hBrush)
~BrushSelection ()

Protected Attributes

HDC | _hdc
HBRUSH | _old_hBrush

Detailed Description

BrushSelection locally selects a brush into a device context.

Definition at line 641 of file utility.h.

Constructor & Destructor Documentation

BrushSelection::BrushSelection | ( | HDC | hdc,
 |  | HBRUSH | hBrush
 | ) | [inline]

Definition at line 643 of file utility.h.

00644          : _hdc(hdc), _old_hBrush(SelectBrush(hdc, hBrush)) {}

BrushSelection::~BrushSelection ( ) [inline]

Definition at line 646 of file utility.h.

00646 {SelectBrush(_hdc, _old_hBrush);}

Member Data Documentation

HDC BrushSelection::_hdc [protected]

Definition at line 649 of file utility.h.

HBRUSH BrushSelection::_old_hBrush [protected]

Definition at line 650 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

BrushSelection Member List

This is the complete list of members for BrushSelection, including all inherited members.

_hdc | BrushSelection | [protected]
_old_hBrush | BrushSelection | [protected]
BrushSelection(HDC hdc, HBRUSH hBrush) | BrushSelection | [inline]
~BrushSelection() | BrushSelection | [inline]


ROS Explorer: BStr Struct Reference

BStr Struct Reference

#include <utility.h>

Collaboration diagram for BStr:

[legend]
List of all members.

Public Member Functions

BStr ()
BStr (const BSTR s)
BStr (LPCSTR s)
BStr (LPCWSTR s)
BStr (const VARIANT &var)
~BStr ()
void | assign (BSTR s)
void | assign (const VARIANT &var)
operator BSTR () const
int | length () const

Protected Attributes

BSTR | _p

Detailed Description

Definition at line 714 of file utility.h.

Constructor & Destructor Documentation

BStr::BStr ( ) [inline]

Definition at line 716 of file utility.h.

00717         {
00718                 _p = NULL;
00719         }

BStr::BStr ( const BSTR s ) [inline]

Definition at line 721 of file utility.h.

00722         {
00723                 _p = SysAllocString(s);
00724         }

BStr::BStr ( LPCSTR s ) [inline]

Definition at line 726 of file utility.h.

References BUFFER_LEN.

00727         {
00728                 WCHAR b[BUFFER_LEN];
00729
00730                 if (s)
00731                         _p = SysAllocStringLen(b, MultiByteToWideChar(CP_ACP, 0, s, -1, b, BUFFER_LEN)-1);
00732                 else
00733                         _p = NULL;
00734         }

BStr::BStr ( LPCWSTR s ) [inline]

Definition at line 736 of file utility.h.

00737         {
00738                 _p = SysAllocString(s);
00739         }

BStr::BStr ( const VARIANT & var ) [inline]

Definition at line 741 of file utility.h.

00742          :      _p(NULL)
00743         {
00744                 assign(var);
00745         }

BStr::~BStr ( ) [inline]

Definition at line 747 of file utility.h.

00748         {
00749                 SysFreeString(_p);
00750         }

Member Function Documentation

void BStr::assign ( const VARIANT & var )

Definition at line 107 of file webchild.cpp.

References assign(), and CheckError().

00108 {
00109         if (V_VT(&var) == VT_BSTR)
00110                 assign(V_BSTR(&var));
00111         else {
00112                 Variant v;
00113                 CheckError(VariantChangeType(&v, const_cast<VARIANT*>(&var), 0, VT_BSTR));
00114                 assign(V_BSTR(&v));
00115         }
00116 }

Here is the call graph for this function:

void BStr::assign ( BSTR s )

Definition at line 101 of file webchild.cpp.

References _p, and THROW_EXCEPTION.

Referenced by assign().

00102 {
00103         if (!SysReAllocString(&_p, s))
00104                 THROW_EXCEPTION(E_OUTOFMEMORY);
00105 }

int BStr::length ( ) const [inline]

Definition at line 760 of file utility.h.

Referenced by String::assign().

00761         {
00762                 return _p? wcslen(_p): 0;
00763         }

BStr::operator BSTR ( ) const [inline]

Definition at line 755 of file utility.h.

00756         {
00757                 return _p? _p: (BSTR)L"";
00758         }

Member Data Documentation

BSTR BStr::_p [protected]

Definition at line 766 of file utility.h.

Referenced by assign().

The documentation for this struct was generated from the following files:
  • utility.h
  • webchild.cpp


ROS Explorer: Member List

BStr Member List

This is the complete list of members for BStr, including all inherited members.

_p | BStr | [protected]
assign(BSTR s) | BStr |
assign(const VARIANT &var) | BStr |
BStr() | BStr | [inline]
BStr(const BSTR s) | BStr | [inline]
BStr(LPCSTR s) | BStr | [inline]
BStr(LPCWSTR s) | BStr | [inline]
BStr(const VARIANT &var) | BStr | [inline]
length() const | BStr | [inline]
operator BSTR() const | BStr | [inline]
~BStr() | BStr | [inline]


ROS Explorer: BtnWindowClass Struct Reference

BtnWindowClass Struct Reference

window class with gray background color More...

#include <window.h>

Inheritance diagram for BtnWindowClass:

[legend]
Collaboration diagram for BtnWindowClass:

[legend]
List of all members.

Public Member Functions

BtnWindowClass (LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc)

Detailed Description

window class with gray background color

Definition at line 248 of file window.h.

Constructor & Destructor Documentation

BtnWindowClass::BtnWindowClass | ( | LPCTSTR | classname,
 |  | UINT | style = 0,
 |  | WNDPROC | wndproc = Window::WindowWndProc
 | ) | [inline]

Definition at line 250 of file window.h.

00251          :      WindowClass(classname, style, wndproc)
00252         {
00253                 hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
00254         }

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

BtnWindowClass Member List

This is the complete list of members for BtnWindowClass, including all inherited members.

_atomClass | WindowClass | [protected]
BtnWindowClass(LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc) | BtnWindowClass | [inline]
operator ATOM() | WindowClass | [inline]
operator LPCTSTR() | WindowClass | [inline]
Register() | WindowClass | [inline]
WindowClass(LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc) | WindowClass |


ROS Explorer: Buffer Struct Reference

Buffer Struct Reference

#include <fatfs.h>

Collaboration diagram for Buffer:

[legend]
List of all members.

Public Attributes

BYTE dat [BufLen]

Detailed Description

Definition at line 169 of file fatfs.h.

Member Data Documentation

BYTE Buffer::dat[BufLen]

Definition at line 170 of file fatfs.h.

Referenced by FATDrive::read_FAT().

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

Buffer Member List

This is the complete list of members for Buffer, including all inherited members.

dat Buffer


ROS Explorer: BufferCanvas Struct Reference

BufferCanvas Struct Reference

BufferCanvas manages offscreen bitmaps selected into memory device contexts. More...

#include <utility.h>

Inheritance diagram for BufferCanvas:

[legend]
Collaboration diagram for BufferCanvas:

[legend]
List of all members.

Public Member Functions

BufferCanvas (HDC hdc, int x, int y, int w, int h)
BufferCanvas (HDC hdc, const RECT &rect)

Protected Attributes

HDC | _hdctarg
int | _x
int | _y
int | _w
int | _h
SelectedBitmap _bmp

Detailed Description

BufferCanvas manages offscreen bitmaps selected into memory device contexts.

Definition at line 543 of file utility.h.

Constructor & Destructor Documentation

BufferCanvas::BufferCanvas | ( | HDC | hdc,
 |  | int | x,
 |  | int | y,
 |  | int | w,
 |  | int | h
 | ) | [inline]

Definition at line 545 of file utility.h.

00546          :      MemCanvas(hdc), _hdctarg(hdc),
00547                 _x(x), _y(y), _w(w), _h(h),
00548                 _bmp(_hdc, CreateCompatibleBitmap(hdc, w, h)) {}

BufferCanvas::BufferCanvas | ( | HDC | hdc,
 |  | const RECT & | rect
 | ) | [inline]

Definition at line 550 of file utility.h.

00551          :      MemCanvas(hdc), _hdctarg(hdc),
00552                 _x(rect.left), _y(rect.top), _w(rect.right-rect.left), _h(rect.bottom-rect.top),
00553                 _bmp(_hdc, CreateCompatibleBitmap(hdc, _w, _h)) {}

Member Data Documentation

SelectedBitmap BufferCanvas::_bmp [protected]

Definition at line 558 of file utility.h.

int BufferCanvas::_h [protected]

Definition at line 557 of file utility.h.

HDC BufferCanvas::_hdctarg [protected]

Definition at line 556 of file utility.h.

int BufferCanvas::_w [protected]

Definition at line 557 of file utility.h.

int BufferCanvas::_x [protected]

Definition at line 557 of file utility.h.

int BufferCanvas::_y [protected]

Definition at line 557 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

BufferCanvas Member List

This is the complete list of members for BufferCanvas, including all inherited members.

_bmp | BufferCanvas | [protected]
_h | BufferCanvas | [protected]
_hdc | Canvas | [protected]
_hdctarg | BufferCanvas | [protected]
_w | BufferCanvas | [protected]
_x | BufferCanvas | [protected]
_y | BufferCanvas | [protected]
BufferCanvas(HDC hdc, int x, int y, int w, int h) | BufferCanvas | [inline]
BufferCanvas(HDC hdc, const RECT &rect) | BufferCanvas | [inline]
Canvas(HDC hdc) | Canvas | [inline]
MemCanvas(HDC hdc=0) | MemCanvas | [inline]
operator HDC() | Canvas | [inline]
~MemCanvas() | MemCanvas | [inline]


ROS Explorer: BufferedCanvas Struct Reference

BufferedCanvas Struct Reference

BufferedCanvas enables double buffering for a device context. More...

#include <utility.h>

Inheritance diagram for BufferedCanvas:

[legend]
Collaboration diagram for BufferedCanvas:

[legend]
List of all members.

Public Member Functions

BufferedCanvas (HDC hdc, int x, int y, int w, int h, DWORD mode=SRCCOPY)
BufferedCanvas (HDC hdc, const RECT &rect, DWORD mode=SRCCOPY)
~BufferedCanvas ()

Public Attributes

DWORD _mode

Detailed Description

BufferedCanvas enables double buffering for a device context.

Definition at line 562 of file utility.h.

Constructor & Destructor Documentation

BufferedCanvas::BufferedCanvas | ( | HDC | hdc,
 |  | int | x,
 |  | int | y,
 |  | int | w,
 |  | int | h,
 |  | DWORD | mode = SRCCOPY
 | ) | [inline]

Definition at line 564 of file utility.h.

00565          :      BufferCanvas(hdc, x, y, w, h), _mode(mode) {}

BufferedCanvas::BufferedCanvas | ( | HDC | hdc,
 |  | const RECT & | rect,
 |  | DWORD | mode = SRCCOPY
 | ) | [inline]

Definition at line 567 of file utility.h.

00568          :      BufferCanvas(hdc, rect), _mode(mode) {}

BufferedCanvas::~BufferedCanvas ( ) [inline]

Definition at line 570 of file utility.h.

00570 {BitBlt(_hdctarg, _x, _y, _w, _h, _hdc, 0, 0, _mode);}

Member Data Documentation

DWORD BufferedCanvas::_mode

Definition at line 572 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

BufferedCanvas Member List

This is the complete list of members for BufferedCanvas, including all inherited members.

_bmp | BufferCanvas | [protected]
_h | BufferCanvas | [protected]
_hdc | Canvas | [protected]
_hdctarg | BufferCanvas | [protected]
_mode | BufferedCanvas |
_w | BufferCanvas | [protected]
_x | BufferCanvas | [protected]
_y | BufferCanvas | [protected]
BufferCanvas(HDC hdc, int x, int y, int w, int h) | BufferCanvas | [inline]
BufferCanvas(HDC hdc, const RECT &rect) | BufferCanvas | [inline]
BufferedCanvas(HDC hdc, int x, int y, int w, int h, DWORD mode=SRCCOPY) | BufferedCanvas | [inline]
BufferedCanvas(HDC hdc, const RECT &rect, DWORD mode=SRCCOPY) | BufferedCanvas | [inline]
Canvas(HDC hdc) | Canvas | [inline]
MemCanvas(HDC hdc=0) | MemCanvas | [inline]
operator HDC() | Canvas | [inline]
~BufferedCanvas() | BufferedCanvas | [inline]
~MemCanvas() | MemCanvas | [inline]


ROS Explorer: BufferedPaintCanvas Struct Reference

BufferedPaintCanvas Struct Reference

BufferedPaintCanvas extends PaintCanvas for double buffering. More...

#include <utility.h>

Inheritance diagram for BufferedPaintCanvas:

[legend]
Collaboration diagram for BufferedPaintCanvas:

[legend]
List of all members.

Public Member Functions

BufferedPaintCanvas (HWND hwnd)
operator HDC ()

Detailed Description

BufferedPaintCanvas extends PaintCanvas for double buffering.

Definition at line 576 of file utility.h.

Constructor & Destructor Documentation

BufferedPaintCanvas::BufferedPaintCanvas ( HWND hwnd ) [inline]

Definition at line 578 of file utility.h.

00579          :      PaintCanvas(hwnd),
00580                 BufferedCanvas(PAINTSTRUCT::hdc, 0, 0, rcPaint.right, rcPaint.bottom)
00581         {
00582         }

Member Function Documentation

BufferedPaintCanvas::operator HDC ( ) [inline]

Reimplemented from Canvas.

Definition at line 584 of file utility.h.

References Canvas::_hdc.

00584 {return BufferedCanvas::_hdc;}

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

BufferedPaintCanvas Member List

This is the complete list of members for BufferedPaintCanvas, including all inherited members.

_bmp | BufferCanvas | [protected]
_h | BufferCanvas | [protected]
_hdc | Canvas | [protected]
_hdctarg | BufferCanvas | [protected]
_hwnd | PaintCanvas | [protected]
_mode | BufferedCanvas |
_w | BufferCanvas | [protected]
_x | BufferCanvas | [protected]
_y | BufferCanvas | [protected]
BufferCanvas(HDC hdc, int x, int y, int w, int h) | BufferCanvas | [inline]
BufferCanvas(HDC hdc, const RECT &rect) | BufferCanvas | [inline]
BufferedCanvas(HDC hdc, int x, int y, int w, int h, DWORD mode=SRCCOPY) | BufferedCanvas | [inline]
BufferedCanvas(HDC hdc, const RECT &rect, DWORD mode=SRCCOPY) | BufferedCanvas | [inline]
BufferedPaintCanvas(HWND hwnd) | BufferedPaintCanvas | [inline]
Canvas(HDC hdc) | Canvas | [inline]
MemCanvas(HDC hdc=0) | MemCanvas | [inline]
operator HDC() | BufferedPaintCanvas | [inline]
PaintCanvas::operator HDC() const | PaintCanvas | [inline]
PaintCanvas(HWND hwnd) | PaintCanvas | [inline]
~BufferedCanvas() | BufferedCanvas | [inline]
~MemCanvas() | MemCanvas | [inline]
~PaintCanvas() | PaintCanvas | [inline]


ROS Explorer: Button Struct Reference

Button Struct Reference

This class constructs button controls. More...

#include <window.h>

Inheritance diagram for Button:

[legend]
Collaboration diagram for Button:

[legend]
List of all members.

Public Member Functions

Button (HWND parent, LPCTSTR text, int left, int top, int width, int height, int id, DWORD flags=WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, DWORD exStyle=0)

Detailed Description

This class constructs button controls.

The button will remain existent when the C++ Button object is destroyed. There is no conjunction between C++ object and windows control life time.

Definition at line 571 of file window.h.

Constructor & Destructor Documentation

Button::Button | ( | HWND | parent,
 |  | LPCTSTR | text,
 |  | int | left,
 |  | int | top,
 |  | int | width,
 |  | int | height,
 |  | int | id,
 |  | DWORD | flags = WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON,
 |  | DWORD | exStyle = 0
 | ) |

Definition at line 844 of file window.cpp.

00846  :      WindowHandle(CreateWindowEx(exStyle, TEXT("BUTTON"), title, flags, left, top, width, height,
00847                                                         parent, (HMENU)id, g_Globals._hInstance, 0))
00848 {
00849 }

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

Button Member List

This is the complete list of members for Button, including all inherited members.

_hwnd | WindowHandle | [protected]
Button(HWND parent, LPCTSTR text, int left, int top, int width, int height, int id, DWORD flags=WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, DWORD exStyle=0) | Button |
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]


ROS Explorer: Cache Struct Reference

Cache Struct Reference

#include <fatfs.h>

Collaboration diagram for Cache:

[legend]
List of all members.

Public Attributes

BYTE dat [BufLen]

Detailed Description

Definition at line 173 of file fatfs.h.

Member Data Documentation

BYTE Cache::dat[BufLen]

Definition at line 174 of file fatfs.h.

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

Cache Member List

This is the complete list of members for Cache, including all inherited members.

dat Cache


ROS Explorer: Canvas Struct Reference

Canvas Struct Reference

Canvas is a encapsulation of device contexts. More...

#include <utility.h>

Inheritance diagram for Canvas:

[legend]
Collaboration diagram for Canvas:

[legend]
List of all members.

Public Member Functions

Canvas (HDC hdc)
operator HDC ()

Protected Attributes

HDC _hdc

Detailed Description

Canvas is a encapsulation of device contexts.

Definition at line 495 of file utility.h.

Constructor & Destructor Documentation

Canvas::Canvas ( HDC hdc ) [inline]

Definition at line 497 of file utility.h.

00497 : _hdc(hdc) {}

Member Function Documentation

Canvas::operator HDC ( ) [inline]

Reimplemented in BufferedPaintCanvas.

Definition at line 499 of file utility.h.

00499 {return _hdc;}

Member Data Documentation

HDC Canvas::_hdc [protected]

Definition at line 502 of file utility.h.

Referenced by BufferedPaintCanvas::operator HDC().

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

Canvas Member List

This is the complete list of members for Canvas, including all inherited members.

_hdc | Canvas | [protected]
Canvas(HDC hdc) | Canvas | [inline]
operator HDC() | Canvas | [inline]


ROS Explorer: ChildWindow Struct Reference

ChildWindow Struct Reference

Class ChildWindow represents MDI child windows. More...

#include <window.h>

Inheritance diagram for ChildWindow:

[legend]
Collaboration diagram for ChildWindow:

[legend]
List of all members.

Public Types

typedef Window | super

Public Member Functions

ChildWindow (HWND hwnd, const ChildWndInfo &info)
bool | go_to (LPCTSTR url)

Static Public Member Functions

static ChildWindow * | create (const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual void | resize_children (int cx, int cy)
virtual String | jump_to_int (LPCTSTR url)=0
void | set_url (LPCTSTR url)

Protected Attributes

MenuInfo * _menu_info
WindowHandle _left_hwnd
WindowHandle _right_hwnd
int | _focus_pane
int | _split_pos
int | _last_split
HWND _hwndFrame
String _statusText
String _url
stack< String > | _url_history

Detailed Description

Class ChildWindow represents MDI child windows.

It is used with class MainFrame.

Definition at line 289 of file window.h.

Member Typedef Documentation

typedef Window ChildWindow::super

Reimplemented in FileChildWindow, MDIShellBrowserChild, WebChildWindow, ShellBrowserChildT< ChildWindow >, IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >, ExtContextMenuHandlerT< ChildWindow >, and ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >.

Definition at line 291 of file window.h.

Constructor & Destructor Documentation

ChildWindow::ChildWindow | ( | HWND | hwnd,
 |  | const ChildWndInfo & | info
 | ) |

Definition at line 357 of file window.cpp.

References _focus_pane, _last_split, _split_pos, and DEFAULT_SPLIT_POS.

00358  :      super(hwnd),
00359         _hwndFrame(GetParent(info._hmdiclient))
00360 {
00361         _focus_pane = 0;
00362         _split_pos = DEFAULT_SPLIT_POS;
00363         _last_split = DEFAULT_SPLIT_POS;
00364 }

Member Function Documentation

ChildWindow * ChildWindow::create | ( | const ChildWndInfo & | info,
 |  | const RECT & | rect,
 |  | CREATORFUNC_INFO | creator,
 |  | LPCTSTR | classname,
 |  | LPCTSTR | title = NULL,
 |  | DWORD | style = 0
 | ) | [static]

Definition at line 367 of file window.cpp.

References ExplorerGlobals::_hInstance, Window::create_mdi_child(), and g_Globals.

Referenced by WebChildWindow::create(), and MDIShellBrowserChild::create().

00369 {
00370         MDICREATESTRUCT mcs;
00371
00372         mcs.szClass = classname;
00373         mcs.szTitle = title;
00374         mcs.hOwner      = g_Globals._hInstance;
00375         mcs.x           = rect.left,
00376         mcs.y           = rect.top;
00377         mcs.cx          = rect.right - rect.left;
00378         mcs.cy          = rect.bottom - rect.top;
00379         mcs.style       = style;
00380         mcs.lParam      = 0;
00381
00382         return static_cast<ChildWindow*>(create_mdi_child(info, mcs, creator));
00383 }

Here is the call graph for this function:

bool ChildWindow::go_to ( LPCTSTR url )

Definition at line 548 of file window.cpp.

References _url_history, jump_to_int(), and set_url().

00549 {
00550         const String& url_str = jump_to_int(url);
00551
00552         if (!url_str.empty()) {
00553                 set_url(url_str);
00554
00555                 _url_history.push(url_str);
00556
00557                 return true;
00558         } else
00559                 return false;
00560 }

Here is the call graph for this function:

virtual String ChildWindow::jump_to_int ( LPCTSTR url ) [protected, pure virtual]

Implemented in FileChildWindow, MDIShellBrowserChild, and WebChildWindow.

Referenced by go_to().

void ChildWindow::resize_children | ( | int | cx,
 |  | int | cy
 | ) | [protected, virtual]

Reimplemented in FileChildWindow.

Definition at line 522 of file window.cpp.

References _left_hwnd, _right_hwnd, _split_pos, and SPLIT_WIDTH.

Referenced by MDIShellBrowserChild::entry_selected().

00523 {
00524         HDWP hdwp = BeginDeferWindowPos(2);
00525         RECT rt;
00526
00527         rt.left   = 0;
00528         rt.top    = 0;
00529         rt.right  = cx;
00530         rt.bottom = cy;
00531
00532         if (_left_hwnd) {
00533                 cx = _split_pos + SPLIT_WIDTH/2;
00534
00535                 hdwp = DeferWindowPos(hdwp, _left_hwnd, 0, rt.left, rt.top, _split_pos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
00536         } else {
00537                 _split_pos = 0;
00538                 cx = 0;
00539         }
00540
00541         if (_right_hwnd)
00542                 hdwp = DeferWindowPos(hdwp, _right_hwnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
00543
00544         EndDeferWindowPos(hdwp);
00545 }

void ChildWindow::set_url ( LPCTSTR url ) [protected]

Definition at line 562 of file window.cpp.

References _url, and PM_URL_CHANGED.

Referenced by MDIShellBrowserChild::entry_selected(), go_to(), and FileChildWindow::set_curdir().

00563 {
00564         if (_url != url) {
00565                 _url = url;
00566
00567                 SendMessage(_hwndFrame, PM_URL_CHANGED, 0, (LPARAM)url);
00568         }
00569 }

LRESULT ChildWindow::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:

Reimplemented from Window.

Reimplemented in FileChildWindow, MDIShellBrowserChild, WebChildWindow, ShellBrowserChildT< ChildWindow >, IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >, ExtContextMenuHandlerT< ChildWindow >, and ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >.

Definition at line 386 of file window.cpp.

References WindowHandle::_hwnd, _split_pos, COLOR_SPLITBAR, and SPLIT_WIDTH.

00387 {
00388         switch(nmsg) {
00389           case WM_PAINT: {
00390                 PaintCanvas canvas(_hwnd);
00391                 ClientRect rt(_hwnd);
00392                 rt.left = _split_pos-SPLIT_WIDTH/2;
00393                 rt.right = _split_pos+SPLIT_WIDTH/2+1;
00394                 HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(COLOR_SPLITBAR));
00395                 Rectangle(canvas, rt.left, rt.top-1, rt.right, rt.bottom+1);
00396                 SelectObject(canvas, lastBrush);
00397                 break;}
00398
00399           case WM_SETCURSOR:
00400                 if (LOWORD(lparam) == HTCLIENT) {
00401                         POINT pt;
00402                         GetCursorPos(&pt);
00403                         ScreenToClient(_hwnd, &pt);
00404
00405                         if (pt.x>=_split_pos-SPLIT_WIDTH/2 && pt.x<_split_pos+SPLIT_WIDTH/2+1) {
00406                                 SetCursor(LoadCursor(0, IDC_SIZEWE));
00407                                 return TRUE;
00408                         }
00409                 }
00410                 goto def;
00411
00412           case WM_SIZE:
00413                 if (wparam != SIZE_MINIMIZED)
00414                         resize_children(LOWORD(lparam), HIWORD(lparam));
00415                 goto def;
00416
00417           case WM_GETMINMAXINFO:
00418                 DefMDIChildProc(_hwnd, nmsg, wparam, lparam);
00419
00420                 {LPMINMAXINFO lpmmi = (LPMINMAXINFO)lparam;
00421
00422                 lpmmi->ptMaxTrackSize.x <<= 1;  // 2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN
00423                 lpmmi->ptMaxTrackSize.y <<= 1;  // 2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN
00424                 break;}
00425
00426           case WM_LBUTTONDOWN: {
00427                 int x = GET_X_LPARAM(lparam);
00428
00429                 ClientRect rt(_hwnd);
00430
00431                 if (x>=_split_pos-SPLIT_WIDTH/2 && x<_split_pos+SPLIT_WIDTH/2+1) {
00432                         _last_split = _split_pos;
00433                         SetCapture(_hwnd);
00434                 }
00435
00436                 break;}
00437
00438           case WM_LBUTTONUP:
00439                 if (GetCapture() == _hwnd)
00440                         ReleaseCapture();
00441                 break;
00442
00443           case WM_KEYDOWN:
00444                 if (wparam == VK_ESCAPE)
00445                         if (GetCapture() == _hwnd) {
00446                                 _split_pos = _last_split;
00447                                 ClientRect rt(_hwnd);
00448                                 resize_children(rt.right, rt.bottom);
00449                                 _last_split = -1;
00450                                 ReleaseCapture();
00451                                 SetCursor(LoadCursor(0, IDC_ARROW));
00452                         }
00453                 break;
00454
00455           case WM_MOUSEMOVE:
00456                 if (GetCapture() == _hwnd) {
00457                         int x = GET_X_LPARAM(lparam);
00458
00459                         ClientRect rt(_hwnd);
00460
00461                         if (x>=0 && x<rt.right) {
00462                                 _split_pos = x;
00463                                 resize_children(rt.right, rt.bottom);
00464                                 rt.left = x-SPLIT_WIDTH/2;
00465                                 rt.right = x+SPLIT_WIDTH/2+1;
00466                                 InvalidateRect(_hwnd, &rt, FALSE);
00467                                 UpdateWindow(_left_hwnd);
00468                                 UpdateWindow(_hwnd);
00469                                 UpdateWindow(_right_hwnd);
00470                         }
00471                 }
00472                 break;
00473
00474           case PM_DISPATCH_COMMAND:
00475                 switch(LOWORD(wparam)) {
00476                   case ID_GO_BACK:
00477                         if (!_url_history.empty()) {
00478                                 const String& url = jump_to_int(_url_history.top());
00479
00480                                 if (jump_to_int(url))
00481                                         set_url(url);
00482
00483                                 _url_history.pop();
00484                         }
00485                         break;
00486
00487                   case ID_GO_FORWARD:
00488                         //@@
00489                         break;
00490
00491                   case ID_GO_UP:
00493                         break;
00494
00495                   case ID_GO_HOME:
00496                         //@@
00497                         break;
00498
00499                   default:
00500                         return FALSE;
00501                 }
00502                 return TRUE;
00503
00504           case WM_MDIACTIVATE:
00505                 if ((HWND)lparam == _hwnd) {
00506                         SendMessage(_hwndFrame, PM_SETSTATUSTEXT, 0, (LPARAM)_statusText.c_str());
00507                         SendMessage(_hwndFrame, PM_URL_CHANGED, 0, (LPARAM)_url.c_str());
00508                 }
00509                 break;
00510
00511           case PM_JUMP_TO_URL:
00512                 return go_to((LPCTSTR)lparam)? TRUE: FALSE;
00513
00514           default: def:
00515                 return DefMDIChildProc(_hwnd, nmsg, wparam, lparam);
00516         }
00517
00518         return 0;
00519 }

Member Data Documentation

int ChildWindow::_focus_pane [protected]

Definition at line 311 of file window.h.

Referenced by ChildWindow(), FileChildWindow::set_focus_pane(), and FileChildWindow::switch_focus_pane().

HWND ChildWindow::_hwndFrame [protected]

Definition at line 316 of file window.h.

int ChildWindow::_last_split [protected]

Definition at line 314 of file window.h.

Referenced by ChildWindow().

WindowHandle ChildWindow::_left_hwnd [protected]

Definition at line 309 of file window.h.

Referenced by FileChildWindow::activate_entry(), FileChildWindow::Command(), FileChildWindow::expand_entry(), resize_children(), FileChildWindow::resize_children(), and FileChildWindow::scan_entry().

MenuInfo* ChildWindow::_menu_info [protected]

Definition at line 307 of file window.h.

WindowHandle ChildWindow::_right_hwnd [protected]

Definition at line 310 of file window.h.

Referenced by resize_children(), FileChildWindow::resize_children(), and FileChildWindow::set_curdir().

int ChildWindow::_split_pos [protected]

Definition at line 313 of file window.h.

Referenced by ChildWindow(), resize_children(), FileChildWindow::resize_children(), MDIShellBrowserChild::update_shell_browser(), and WndProc().

String ChildWindow::_statusText [protected]

Definition at line 317 of file window.h.

String ChildWindow::_url [protected]

Definition at line 318 of file window.h.

Referenced by set_url(), and MDIShellBrowserChild::WndProc().

stack<String> ChildWindow::_url_history [protected]

Definition at line 320 of file window.h.

Referenced by go_to().

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

ChildWindow Member List

This is the complete list of members for ChildWindow, including all inherited members.

_focus_pane | ChildWindow | [protected]
_hwnd | WindowHandle | [protected]
_hwndFrame | ChildWindow | [protected]
_last_split | ChildWindow | [protected]
_left_hwnd | ChildWindow | [protected]
_menu_info | ChildWindow | [protected]
_right_hwnd | ChildWindow | [protected]
_split_pos | ChildWindow | [protected]
_statusText | ChildWindow | [protected]
_url | ChildWindow | [protected]
_url_history | ChildWindow | [protected]
CancelModes() | Window | [static]
ChildWindow(HWND hwnd, const ChildWndInfo &info) | ChildWindow |
Command(int id, int code) | Window | [protected, virtual]
create(const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0) | ChildWindow | [static]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
go_to(LPCTSTR url) | ChildWindow |
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
jump_to_int(LPCTSTR url)=0 | ChildWindow | [protected, pure virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
resize_children(int cx, int cy) | ChildWindow | [protected, virtual]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
set_url(LPCTSTR url) | ChildWindow | [protected]
super typedef | ChildWindow |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | ChildWindow | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: ChildWndInfo Struct Reference

ChildWndInfo Struct Reference

information structure for creation of a MDI child window More...

#include <window.h>

Inheritance diagram for ChildWndInfo:

[legend]
Collaboration diagram for ChildWndInfo:

[legend]
List of all members.

Public Member Functions

ChildWndInfo (HWND hmdiclient)

Public Attributes

HWND _hmdiclient

Detailed Description

information structure for creation of a MDI child window

Definition at line 44 of file window.h.

Constructor & Destructor Documentation

ChildWndInfo::ChildWndInfo ( HWND hmdiclient ) [inline]

Definition at line 46 of file window.h.

00047          :      _hmdiclient(hmdiclient) {}

Member Data Documentation

HWND ChildWndInfo::_hmdiclient

Definition at line 49 of file window.h.

Referenced by Window::create_mdi_child().

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

ChildWndInfo Member List

This is the complete list of members for ChildWndInfo, including all inherited members.

_hmdiclient | ChildWndInfo |
ChildWndInfo(HWND hmdiclient) | ChildWndInfo | [inline]


ROS Explorer: ClientRect Struct Reference

ClientRect Struct Reference

ClientRect retreives the client area rectangle of a window. More...

#include <utility.h>

Inheritance diagram for ClientRect:

[legend]
Collaboration diagram for ClientRect:

[legend]
List of all members.

Public Member Functions

ClientRect (HWND hwnd)
operator LPRECT ()
POINT & pos ()

Detailed Description

ClientRect retreives the client area rectangle of a window.

Definition at line 404 of file utility.h.

Constructor & Destructor Documentation

ClientRect::ClientRect ( HWND hwnd ) [inline]

Definition at line 406 of file utility.h.

00407         {
00408                 GetClientRect(hwnd, this);
00409         }

Member Function Documentation

ClientRect::operator LPRECT ( ) [inline]

Definition at line 411 of file utility.h.

00411 {return this;}

POINT& ClientRect::pos ( ) [inline]

Definition at line 413 of file utility.h.

00413 {return *(LPPOINT)this;}

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

ClientRect Member List

This is the complete list of members for ClientRect, including all inherited members.

ClientRect(HWND hwnd) | ClientRect | [inline]
operator LPRECT() | ClientRect | [inline]
pos() | ClientRect | [inline]


ROS Explorer: ClockWindow Struct Reference

ClockWindow Struct Reference

window for displaying the time in the tray notification area More...

#include <traynotify.h>

Inheritance diagram for ClockWindow:

[legend]
Collaboration diagram for ClockWindow:

[legend]
List of all members.

Public Types

typedef Window | super

Public Member Functions

ClockWindow (HWND hwnd)
void | TimerTick ()

Static Public Member Functions

static HWND | Create (HWND hwndParent)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Notify (int id, NMHDR *pnmh)
bool | FormatTime ()
void | Paint ()

Protected Attributes

TCHAR | _time [16]
ToolTip _tooltip

Detailed Description

window for displaying the time in the tray notification area

Definition at line 238 of file traynotify.h.

Member Typedef Documentation

typedef Window ClockWindow::super

Definition at line 240 of file traynotify.h.

Constructor & Destructor Documentation

ClockWindow::ClockWindow ( HWND hwnd )

Definition at line 1265 of file traynotify.cpp.

References WindowHandle::_hwnd, _time, _tooltip, ToolTip::add(), and FormatTime().

01266  :      super(hwnd),
01267         _tooltip(hwnd)
01268 {
01269         *_time = TEXT('\0');
01270         FormatTime();
01271
01272         _tooltip.add(_hwnd, _hwnd);
01273 }

Here is the call graph for this function:

Member Function Documentation

HWND ClockWindow::Create ( HWND hwndParent ) [static]

Definition at line 1275 of file traynotify.cpp.

References CLASSNAME_CLOCKWINDOW, Window::Create(), and WINDOW_CREATOR.

Referenced by NotifyArea::show_clock().

01276 {
01277         static BtnWindowClass wcClock(CLASSNAME_CLOCKWINDOW, CS_DBLCLKS);
01278
01279         ClientRect clnt(hwndParent);
01280
01281         WindowCanvas canvas(hwndParent);
01282         FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
01283
01284         RECT rect = {0, 0, 0, 0};
01285         TCHAR buffer[8];
01286
01287         if (!GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, buffer, sizeof(buffer)/sizeof(TCHAR)))
01288                 _tcscpy(buffer, TEXT("00:00"));
01289
01290         DrawText(canvas, buffer, -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
01291         int clockwindowWidth = rect.right-rect.left + 4;
01292
01293         return Window::Create(WINDOW_CREATOR(ClockWindow), 0,
01294                                                         wcClock, NULL, WS_CHILD|WS_VISIBLE,
01295                                                         clnt.right-(clockwindowWidth), 1, clockwindowWidth, clnt.bottom-2, hwndParent);
01296 }

Here is the call graph for this function:

bool ClockWindow::FormatTime ( ) [protected]

Definition at line 1341 of file traynotify.cpp.

References _time.

Referenced by ClockWindow(), and TimerTick().

01342 {
01343         TCHAR buffer[16];
01344
01345         if (GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, buffer, sizeof(buffer)/sizeof(TCHAR)))
01346                 if (_tcscmp(buffer, _time)) {
01347                         _tcscpy(_time, buffer);
01348                         return true;    // The text to display has changed.
01349                 }
01350
01351         return false;   // no change
01352 }

int ClockWindow::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 1316 of file traynotify.cpp.

01317 {
01318         if (pnmh->code == TTN_GETDISPINFO) {
01319                 LPNMTTDISPINFO pdi = (LPNMTTDISPINFO)pnmh;
01320
01321                 SYSTEMTIME systime;
01322                 TCHAR buffer[64];
01323
01324                 GetLocalTime(&systime);
01325
01326                 if (GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &systime, NULL, buffer, 64))
01327                         _tcscpy(pdi->szText, buffer);
01328                 else
01329                         pdi->szText[0] = '\0';
01330         }
01331
01332         return 0;
01333 }

void ClockWindow::Paint ( ) [protected]

Definition at line 1354 of file traynotify.cpp.

References WindowHandle::_hwnd, and _time.

Referenced by WndProc().

01355 {
01356         PaintCanvas canvas(_hwnd);
01357
01358         FillRect(canvas, &canvas.rcPaint, GetSysColorBrush(COLOR_BTNFACE));
01359
01360         BkMode bkmode(canvas, TRANSPARENT);
01361         FontSelection font(canvas, GetStockFont(ANSI_VAR_FONT));
01362
01363         DrawText(canvas, _time, -1, ClientRect(_hwnd), DT_SINGLELINE|DT_VCENTER|DT_NOPREFIX);
01364 }

void ClockWindow::TimerTick ( )

Definition at line 1335 of file traynotify.cpp.

References WindowHandle::_hwnd, and FormatTime().

Referenced by NotifyArea::WndProc().

01336 {
01337         if (FormatTime())
01338                 InvalidateRect(_hwnd, NULL, TRUE);      // refresh displayed time
01339 }

Here is the call graph for this function:

LRESULT ClockWindow::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 1298 of file traynotify.cpp.

References WindowHandle::_hwnd, launch_cpanel(), Paint(), and Window::WndProc().

01299 {
01300         switch(nmsg) {
01301           case WM_PAINT:
01302                 Paint();
01303                 break;
01304
01305           case WM_LBUTTONDBLCLK:
01306                 launch_cpanel(_hwnd, TEXT("timedate.cpl"));
01307                 break;
01308
01309           default:
01310                 return super::WndProc(nmsg, wparam, lparam);
01311         }
01312
01313         return 0;
01314 }

Here is the call graph for this function:

Member Data Documentation

TCHAR ClockWindow::_time[16] [protected]

Definition at line 255 of file traynotify.h.

Referenced by ClockWindow(), FormatTime(), and Paint().

ToolTip ClockWindow::_tooltip [protected]

Definition at line 256 of file traynotify.h.

Referenced by ClockWindow().

The documentation for this struct was generated from the following files:
  • traynotify.h
  • traynotify.cpp


ROS Explorer: Member List

ClockWindow Member List

This is the complete list of members for ClockWindow, including all inherited members.

_hwnd | WindowHandle | [protected]
_time | ClockWindow | [protected]
_tooltip | ClockWindow | [protected]
CancelModes() | Window | [static]
ClockWindow(HWND hwnd) | ClockWindow |
Command(int id, int code) | Window | [protected, virtual]
Create(HWND hwndParent) | ClockWindow | [static]
Window::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Window::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
FormatTime() | ClockWindow | [protected]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | ClockWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
Paint() | ClockWindow | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | ClockWindow |
TimerTick() | ClockWindow |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | ClockWindow | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: CollectProgramsThread Struct Reference

CollectProgramsThread Struct Reference

Thread for collecting start menu entries. More...

#include <searchprogram.h>

Inheritance diagram for CollectProgramsThread:

[legend]
Collaboration diagram for CollectProgramsThread:

[legend]
List of all members.

Public Member Functions

CollectProgramsThread (COLLECT_CALLBACK callback, HWND hwnd, void *para)
~CollectProgramsThread ()
int | Run ()
void | free_dirs ()

Public Attributes

bool | _cache_valid

Protected Member Functions

void | collect_programs (const ShellPath &path)

Protected Attributes

COLLECT_CALLBACK _callback
HWND _hwnd
void * | _para
ShellDirectoryStack _dirs

Detailed Description

Thread for collecting start menu entries.

Definition at line 35 of file searchprogram.h.

Constructor & Destructor Documentation

CollectProgramsThread::CollectProgramsThread | ( | COLLECT_CALLBACK | callback,
 |  | HWND | hwnd,
 |  | void * | para
 | ) | [inline]

Definition at line 37 of file searchprogram.h.

00038          :      _cache_valid(false),
00039                 _callback(callback),
00040                 _hwnd(hwnd),
00041                 _para(para)
00042         {
00043         }

CollectProgramsThread::~CollectProgramsThread ( ) [inline]

Definition at line 45 of file searchprogram.h.

00046         {
00047                 free_dirs();
00048         }

Member Function Documentation

void CollectProgramsThread::collect_programs ( const ShellPath & path ) [protected]

Definition at line 57 of file searchprogram.cpp.

References Thread::_alive, _callback, _dirs, Entry::_down, Entry::_next, _para, GetDesktopFolder(), SCAN_FILESYSTEM, Entry::smart_scan(), and SORT_NONE.

Referenced by Run().

00058 {
00059         ShellDirectory* dir = new ShellDirectory(GetDesktopFolder(), path, 0);
00060         _dirs.push(dir);
00061
00062         dir->smart_scan(SORT_NONE, /*SCAN_EXTRACT_ICONS|*/SCAN_FILESYSTEM);
00063
00064         for(Entry*entry=dir->_down; _alive && entry; entry=entry->_next) {
00065                 if (entry->_shell_attribs & SFGAO_HIDDEN)
00066                         continue;
00067
00068                 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00069                         collect_programs(entry->create_absolute_pidl());
00070                 else if (entry->_shell_attribs & SFGAO_LINK)
00071                         if (_alive)
00072                                 _callback(entry, _para);
00073         }
00074 }

Here is the call graph for this function:

void CollectProgramsThread::free_dirs ( )

Definition at line 76 of file searchprogram.cpp.

References _dirs.

Referenced by FindProgramDlg::Refresh().

00077 {
00078         while(!_dirs.empty()) {
00079                 ShellDirectory* dir = _dirs.top();
00080                 dir->free_subentries();
00081                 _dirs.pop();
00082         }
00083 }

int CollectProgramsThread::Run ( ) [virtual]

Implements Thread.

Definition at line 38 of file searchprogram.cpp.

References Thread::_alive, _cache_valid, _hwnd, and collect_programs().

00039 {
00040         try {
00041                 collect_programs(SpecialFolderPath(CSIDL_COMMON_PROGRAMS, _hwnd));
00042         } catch(COMException&) {
00043         }
00044
00045         if (_alive)
00046                 try {
00047                         collect_programs(SpecialFolderPath(CSIDL_PROGRAMS, _hwnd));
00048                 } catch(COMException&) {
00049                 }
00050
00051         if (_alive)
00052                 _cache_valid = true;
00053
00054         return 0;
00055 }

Here is the call graph for this function:

Member Data Documentation

bool CollectProgramsThread::_cache_valid

Definition at line 53 of file searchprogram.h.

Referenced by FindProgramDlg::Refresh(), and Run().

COLLECT_CALLBACK CollectProgramsThread::_callback [protected]

Definition at line 56 of file searchprogram.h.

Referenced by collect_programs().

ShellDirectoryStack CollectProgramsThread::_dirs [protected]

Definition at line 59 of file searchprogram.h.

Referenced by collect_programs(), and free_dirs().

HWND CollectProgramsThread::_hwnd [protected]

Definition at line 57 of file searchprogram.h.

Referenced by Run().

void* CollectProgramsThread::_para [protected]

Definition at line 58 of file searchprogram.h.

Referenced by collect_programs().

The documentation for this struct was generated from the following files:
  • searchprogram.h
  • searchprogram.cpp


ROS Explorer: Member List

CollectProgramsThread Member List

This is the complete list of members for CollectProgramsThread, including all inherited members.

_alive | Thread | [protected]
_cache_valid | CollectProgramsThread |
_callback | CollectProgramsThread | [protected]
_crit_sect | Thread |
_destroy | Thread | [protected]
_dirs | CollectProgramsThread | [protected]
_evtFinish | Thread | [protected]
_hThread | Thread | [protected]
_hwnd | CollectProgramsThread | [protected]
_para | CollectProgramsThread | [protected]
collect_programs(const ShellPath &path) | CollectProgramsThread | [protected]
CollectProgramsThread(COLLECT_CALLBACK callback, HWND hwnd, void *para) | CollectProgramsThread | [inline]
free_dirs() | CollectProgramsThread |
is_alive() const | Thread | [inline]
Run() | CollectProgramsThread | [virtual]
Start() | Thread | [inline]
Stop() | Thread | [inline]
Thread() | Thread | [inline]
ThreadProc(void *para) | Thread | [protected, static]
~CollectProgramsThread() | CollectProgramsThread | [inline]
~Thread() | Thread | [inline, virtual]


ROS Explorer: ColorStatic Struct Reference

ColorStatic Struct Reference

#include <window.h>

Inheritance diagram for ColorStatic:

[legend]
Collaboration diagram for ColorStatic:

[legend]
List of all members.

Public Types

typedef SubclassedWindow | super

Public Member Functions

ColorStatic (HWND hwnd, COLORREF textColor=RGB(255, 0, 0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0)
ColorStatic (HWND owner, int id, COLORREF textColor=RGB(255, 0, 0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Protected Attributes

COLORREF | _textColor
HBRUSH | _hbrush_bkgnd
HFONT | _hfont

Detailed Description

Definition at line 766 of file window.h.

Member Typedef Documentation

typedef SubclassedWindow ColorStatic::super

Reimplemented from SubclassedWindow.

Definition at line 768 of file window.h.

Constructor & Destructor Documentation

ColorStatic::ColorStatic | ( | HWND | hwnd,
 |  | COLORREF | textColor = RGB(255,0,0),
 |  | HBRUSH | hbrush_bkgnd = 0,
 |  | HFONT | hfont = 0
 | ) | [inline]

Definition at line 770 of file window.h.

00771          :      super(hwnd),
00772                 _textColor(textColor),
00773                 _hbrush_bkgnd(hbrush_bkgnd),
00774                 _hfont(hfont)
00775         {
00776         }

ColorStatic::ColorStatic | ( | HWND | owner,
 |  | int | id,
 |  | COLORREF | textColor = RGB(255,0,0),
 |  | HBRUSH | hbrush_bkgnd = 0,
 |  | HFONT | hfont = 0
 | ) | [inline]

Definition at line 778 of file window.h.

00779          :      super(GetDlgItem(owner, id)),
00780                 _textColor(textColor),
00781                 _hbrush_bkgnd(hbrush_bkgnd),
00782                 _hfont(hfont)
00783         {
00784         }

Member Function Documentation

LRESULT ColorStatic::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [inline, protected, virtual]

Reimplemented from SubclassedWindow.

Definition at line 787 of file window.h.

References PM_DISPATCH_CTLCOLOR.

00788         {
00789                 if (nmsg == PM_DISPATCH_CTLCOLOR) {
00790                         HDC hdc = (HDC) wparam;
00791
00792                         SetTextColor(hdc, _textColor);
00793
00794                         if (_hfont)
00795                                 SelectFont(hdc, _hfont);
00796
00797                         if (_hbrush_bkgnd)
00798                                 return (LRESULT)_hbrush_bkgnd;
00799                         else {
00800                                 SetBkMode(hdc, TRANSPARENT);
00801                                 return (LRESULT)GetStockBrush(HOLLOW_BRUSH);
00802                         }
00803                 } else
00804                         return super::WndProc(nmsg, wparam, lparam);
00805         }

Member Data Documentation

HBRUSH ColorStatic::_hbrush_bkgnd [protected]

Definition at line 808 of file window.h.

HFONT ColorStatic::_hfont [protected]

Definition at line 809 of file window.h.

COLORREF ColorStatic::_textColor [protected]

Definition at line 807 of file window.h.

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

ColorStatic Member List

This is the complete list of members for ColorStatic, including all inherited members.

_hbrush_bkgnd | ColorStatic | [protected]
_hfont | ColorStatic | [protected]
_hwnd | WindowHandle | [protected]
_orgWndProc | SubclassedWindow | [protected]
_textColor | ColorStatic | [protected]
CancelModes() | Window | [static]
ColorStatic(HWND hwnd, COLORREF textColor=RGB(255, 0, 0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0) | ColorStatic | [inline]
ColorStatic(HWND owner, int id, COLORREF textColor=RGB(255, 0, 0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0) | ColorStatic | [inline]
Command(int id, int code) | SubclassedWindow | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | SubclassedWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | ColorStatic |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | ColorStatic | [inline, protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: COMException Struct Reference

COMException Struct Reference

Exception with context information. More...

#include <shellclasses.h>

Inheritance diagram for COMException:

[legend]
Collaboration diagram for COMException:

[legend]
List of all members.

Public Types

typedef COMExceptionBase | super

Public Member Functions

COMException (HRESULT hr)
COMException (HRESULT hr, const char *file, int line)
COMException (HRESULT hr, const String &obj)
COMException (HRESULT hr, const String &obj, const char *file, int line)
String | toString () const

Public Attributes

Context _context
const char * | _file
int | _line

Detailed Description

Exception with context information.

Definition at line 113 of file shellclasses.h.

Member Typedef Documentation

typedef COMExceptionBase COMException::super

Definition at line 115 of file shellclasses.h.

Constructor & Destructor Documentation

COMException::COMException ( HRESULT hr ) [inline]

Definition at line 117 of file shellclasses.h.

References CURRENT_CONTEXT, LOG, and toString().

Referenced by CheckError().

00118          :      super(hr),
00119                 _context(CURRENT_CONTEXT),
00120                 _file(NULL), _line(0)
00121         {
00122                 LOG(toString());
00123                 LOG(CURRENT_CONTEXT.getStackTrace());
00124         }

Here is the call graph for this function:

COMException::COMException | ( | HRESULT | hr,
 |  | const char * | file,
 |  | int | line
 | ) | [inline]

Definition at line 126 of file shellclasses.h.

References CURRENT_CONTEXT, LOG, and toString().

00127          :      super(hr),
00128                 _context(CURRENT_CONTEXT),
00129                 _file(file), _line(line)
00130         {
00131                 LOG(toString());
00132                 LOG(CURRENT_CONTEXT.getStackTrace());
00133         }

Here is the call graph for this function:

COMException::COMException | ( | HRESULT | hr,
 |  | const String & | obj
 | ) | [inline]

Definition at line 135 of file shellclasses.h.

References CURRENT_CONTEXT, LOG, and toString().

00136          :      super(hr),
00137                 _context(CURRENT_CONTEXT),
00138                 _file(NULL), _line(0)
00139         {
00140                 LOG(toString());
00141                 LOG(CURRENT_CONTEXT.getStackTrace());
00142         }

Here is the call graph for this function:

COMException::COMException | ( | HRESULT | hr,
 |  | const String & | obj,
 |  | const char * | file,
 |  | int | line
 | ) | [inline]

Definition at line 144 of file shellclasses.h.

References CURRENT_CONTEXT, LOG, and toString().

00145          :      super(hr),
00146                 _context(CURRENT_CONTEXT),
00147                 _file(file), _line(line)
00148         {
00149                 LOG(toString());
00150                 LOG(CURRENT_CONTEXT.getStackTrace());
00151         }

Here is the call graph for this function:

Member Function Documentation

String COMException::toString ( ) const

Definition at line 70 of file shellclasses.cpp.

References _context, _file, _line, _stprintf_s2, BUFFER_LEN, COMExceptionBase::ErrorMessage(), and Context::toString().

Referenced by COMException(), and HandleException().

00071 {
00072         TCHAR msg[4*BUFFER_LEN];
00073         int l = 4*BUFFER_LEN;
00074         LPTSTR p = msg;
00075
00076         int n = _stprintf_s2(p, l, TEXT("%s\nContext: %s"), super::ErrorMessage(), (LPCTSTR)_context.toString());
00077         p += n;
00078         l -= n;
00079
00080         if (_file)
00081                 p += _stprintf_s2(p, l, TEXT("\nLocation: %hs:%d"), _file, _line);
00082
00083         return msg;
00084 }

Here is the call graph for this function:

Member Data Documentation

Context COMException::_context

Definition at line 155 of file shellclasses.h.

Referenced by toString().

const char* COMException::_file

Definition at line 157 of file shellclasses.h.

Referenced by toString().

int COMException::_line

Definition at line 158 of file shellclasses.h.

Referenced by toString().

The documentation for this struct was generated from the following files:
  • shellclasses.h
  • shellclasses.cpp


ROS Explorer: Member List

COMException Member List

This is the complete list of members for COMException, including all inherited members.

_context | COMException |
_file | COMException |
_hr | COMExceptionBase | [protected]
_line | COMException |
_msg | COMExceptionBase | [mutable, protected]
COMException(HRESULT hr) | COMException | [inline]
COMException(HRESULT hr, const char *file, int line) | COMException | [inline]
COMException(HRESULT hr, const String &obj) | COMException | [inline]
COMException(HRESULT hr, const String &obj, const char *file, int line) | COMException | [inline]
COMExceptionBase(HRESULT hr) | COMExceptionBase | [inline]
Error() const | COMExceptionBase | [inline]
ErrorMessage() const | COMExceptionBase | [inline]
super typedef | COMException |
toString() const | COMException |


ROS Explorer: COMExceptionBase Struct Reference

COMExceptionBase Struct Reference

COM ExceptionBase class as replacement for _com_error. More...

#include <shellclasses.h>

Inheritance diagram for COMExceptionBase:

[legend]
Collaboration diagram for COMExceptionBase:

[legend]
List of all members.

Public Member Functions

COMExceptionBase (HRESULT hr)
HRESULT | Error () const
LPCTSTR | ErrorMessage () const

Protected Attributes

HRESULT | _hr
String _msg

Detailed Description

COM ExceptionBase class as replacement for _com_error.

Definition at line 72 of file shellclasses.h.

Constructor & Destructor Documentation

COMExceptionBase::COMExceptionBase ( HRESULT hr ) [inline]

Definition at line 74 of file shellclasses.h.

00075          :      _hr(hr)
00076         {
00077         }

Member Function Documentation

HRESULT COMExceptionBase::Error ( ) const [inline]

Definition at line 79 of file shellclasses.h.

References _hr.

00080         {
00081                 return _hr;
00082         }

LPCTSTR COMExceptionBase::ErrorMessage ( ) const [inline]

Definition at line 84 of file shellclasses.h.

References _hr, _msg, and COUNTOF.

Referenced by COMException::toString().

00085         {
00086                 if (_msg.empty()) {
00087                         LPTSTR pBuf;
00088
00089                         if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
00090                                 0, _hr, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPTSTR)&pBuf, 0, NULL)) {
00091                                 _msg = pBuf;
00092                                 LocalFree(pBuf);
00093                          } else {
00094                                 TCHAR buffer[128];
00095                                 _sntprintf(buffer, COUNTOF(buffer), TEXT("unknown Exception: 0x%08lX"), _hr);
00096                                 _msg = buffer;
00097                          }
00098                 }
00099
00100                 return _msg;
00101         }

Member Data Documentation

HRESULT COMExceptionBase::_hr [protected]

Definition at line 104 of file shellclasses.h.

Referenced by Error(), and ErrorMessage().

String COMExceptionBase::_msg [mutable, protected]

Definition at line 105 of file shellclasses.h.

Referenced by ErrorMessage().

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

COMExceptionBase Member List

This is the complete list of members for COMExceptionBase, including all inherited members.

_hr | COMExceptionBase | [protected]
_msg | COMExceptionBase | [mutable, protected]
COMExceptionBase(HRESULT hr) | COMExceptionBase | [inline]
Error() const | COMExceptionBase | [inline]
ErrorMessage() const | COMExceptionBase | [inline]


ROS Explorer: ComInit Struct Reference

ComInit Struct Reference

COM Initialisation. More...

#include <shellclasses.h>

List of all members.

Public Member Functions

ComInit ()
~ComInit ()

Detailed Description

COM Initialisation.

Definition at line 178 of file shellclasses.h.

Constructor & Destructor Documentation

ComInit::ComInit ( ) [inline]

Definition at line 180 of file shellclasses.h.

References CHECKERROR.

00181         {
00182                 CHECKERROR(CoInitialize(0));
00183         }

ComInit::~ComInit ( ) [inline]

Definition at line 192 of file shellclasses.h.

00193         {
00194                 CoUninitialize();
00195         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

ComInit Member List

This is the complete list of members for ComInit, including all inherited members.

ComInit() | ComInit | [inline]
~ComInit() | ComInit | [inline]


ROS Explorer: CommonControlInit Struct Reference

CommonControlInit Struct Reference

initialization of windows common controls More...

#include <utility.h>

List of all members.

Public Member Functions

CommonControlInit (DWORD flags=ICC_LISTVIEW_CLASSES|ICC_TREEVIEW_CLASSES|ICC_BAR_CLASSES|ICC_PROGRESS_CLASS|ICC_COOL_CLASSES)

Detailed Description

initialization of windows common controls

Definition at line 241 of file utility.h.

Constructor & Destructor Documentation

CommonControlInit::CommonControlInit ( DWORD flags = ICC_LISTVIEW_CLASSES|ICC_TREEVIEW_CLASSES|ICC_BAR_CLASSES|ICC_PROGRESS_CLASS|ICC_COOL_CLASSES ) [inline]

Definition at line 243 of file utility.h.

00244         {
00245                 INITCOMMONCONTROLSEX icc = {sizeof(INITCOMMONCONTROLSEX), flags};
00246
00247                 InitCommonControlsEx(&icc);
00248         }

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

CommonControlInit Member List

This is the complete list of members for CommonControlInit, including all inherited members.

CommonControlInit(DWORD flags=ICC_LISTVIEW_CLASSES|ICC_TREEVIEW_CLASSES|ICC_BAR_CLASSES|ICC_PROGRESS_CLASS|ICC_COOL_CLASSES) CommonControlInit [inline]


ROS Explorer: CommonDesktop Struct Reference

CommonDesktop Struct Reference

caching of desktop ShellFolder object More...

#include <shellclasses.h>

Collaboration diagram for CommonDesktop:

[legend]
List of all members.

Public Member Functions

CommonDesktop ()
~CommonDesktop ()
void init ()
operator ShellFolder & ()

Protected Attributes

ShellFolder * _desktop

Detailed Description

caching of desktop ShellFolder object

Definition at line 531 of file shellclasses.h.

Constructor & Destructor Documentation

CommonDesktop::CommonDesktop ( ) [inline]

Definition at line 533 of file shellclasses.h.

00534         {
00535                 _desktop = 0;
00536         }

CommonDesktop::~CommonDesktop ( )

Definition at line 132 of file shellclasses.cpp.

References _desktop.

00133 {
00134         if (_desktop)
00135                 delete _desktop;
00136 }

Member Function Documentation

void CommonDesktop::init ( )

Definition at line 124 of file shellclasses.cpp.

References _desktop, and CONTEXT.

Referenced by GetDesktopFolder().

00125 {
00126         CONTEXT("CommonDesktop::init()");
00127
00128         if (!_desktop)
00129                 _desktop = new ShellFolder;
00130 }

CommonDesktop::operator ShellFolder & ( ) [inline]

Definition at line 542 of file shellclasses.h.

00543         {
00544                 return *_desktop;
00545         }

Member Data Documentation

ShellFolder* CommonDesktop::_desktop [protected]

Definition at line 548 of file shellclasses.h.

Referenced by init(), and ~CommonDesktop().

The documentation for this struct was generated from the following files:
  • shellclasses.h
  • shellclasses.cpp


ROS Explorer: Member List

CommonDesktop Member List

This is the complete list of members for CommonDesktop, including all inherited members.

_desktop | CommonDesktop | [protected]
CommonDesktop() | CommonDesktop | [inline]
init() | CommonDesktop |
operator ShellFolder &() | CommonDesktop | [inline]
~CommonDesktop() | CommonDesktop |


ROS Explorer: CommonShellMalloc Struct Reference

CommonShellMalloc Struct Reference

We use a common IMalloc object for all shell memory allocations. More...

#include <shellclasses.h>

Collaboration diagram for CommonShellMalloc:

[legend]
List of all members.

Public Member Functions

CommonShellMalloc ()
void | init ()
~CommonShellMalloc ()
operator IMalloc * ()

Public Attributes

IMalloc * | _p

Detailed Description

We use a common IMalloc object for all shell memory allocations.

Definition at line 222 of file shellclasses.h.

Constructor & Destructor Documentation

CommonShellMalloc::CommonShellMalloc ( ) [inline]

Definition at line 224 of file shellclasses.h.

00225         {
00226                 _p = NULL;
00227         }

CommonShellMalloc::~CommonShellMalloc ( ) [inline]

Definition at line 235 of file shellclasses.h.

00236         {
00237                 if (_p)
00238                         _p->Release();
00239         }

Member Function Documentation

void CommonShellMalloc::init ( ) [inline]

Definition at line 229 of file shellclasses.h.

References CHECKERROR.

00230         {
00231                 if (!_p)
00232                         CHECKERROR(SHGetMalloc(&_p));
00233         }

CommonShellMalloc::operator IMalloc * ( ) [inline]

Definition at line 241 of file shellclasses.h.

00242         {
00243                 return _p;
00244         }

Member Data Documentation

IMalloc* CommonShellMalloc::_p

Definition at line 246 of file shellclasses.h.

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

CommonShellMalloc Member List

This is the complete list of members for CommonShellMalloc, including all inherited members.

_p | CommonShellMalloc |
CommonShellMalloc() | CommonShellMalloc | [inline]
init() | CommonShellMalloc | [inline]
operator IMalloc *() | CommonShellMalloc | [inline]
~CommonShellMalloc() | CommonShellMalloc | [inline]


ROS Explorer: ComSrvObject Struct Reference

ComSrvObject Struct Reference

#include <shellclasses.h>

Inheritance diagram for ComSrvObject:

[legend]
Collaboration diagram for ComSrvObject:

[legend]
List of all members.

Protected Member Functions

ComSrvObject ()
virtual | ~ComSrvObject ()

Protected Attributes

ULONG | _ref

Detailed Description

Definition at line 448 of file shellclasses.h.

Constructor & Destructor Documentation

ComSrvObject::ComSrvObject ( ) [inline, protected]

Definition at line 451 of file shellclasses.h.

00451 : _ref(1) {}

virtual ComSrvObject::~ComSrvObject ( ) [inline, protected, virtual]

Definition at line 452 of file shellclasses.h.

00452 {}

Member Data Documentation

ULONG ComSrvObject::_ref [protected]

Definition at line 454 of file shellclasses.h.

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

ComSrvObject Member List

This is the complete list of members for ComSrvObject, including all inherited members.

_ref | ComSrvObject | [protected]
ComSrvObject() | ComSrvObject | [inline, protected]
~ComSrvObject() | ComSrvObject | [inline, protected, virtual]


ROS Explorer: ConnectionPoint< T > Struct Template Reference

ConnectionPoint< T > Struct Template Reference

#include <webchild.h>

Inheritance diagram for ConnectionPoint< T >:

[legend]
Collaboration diagram for ConnectionPoint< T >:

[legend]
List of all members.

Public Member Functions

ConnectionPoint (IConnectionPointContainer *pCPC, REFIID riid)

Detailed Description

template<typename T>
struct ConnectionPoint< T >

Definition at line 86 of file webchild.h.

Constructor & Destructor Documentation

template<typename T>
ConnectionPoint< T >::ConnectionPoint | ( | IConnectionPointContainer * | pCPC,
 |  | REFIID | riid
 | ) | [inline]

Definition at line 88 of file webchild.h.

References CheckError().

00089         {
00090                 CheckError(pCPC->FindConnectionPoint(riid, &this->_p));
00091         }

Here is the call graph for this function:

The documentation for this struct was generated from the following file:
  • webchild.h


ROS Explorer: Member List

ConnectionPoint< T > Member List

This is the complete list of members for ConnectionPoint< T >, including all inherited members.

_p | SIfacePtr< T > | [protected]
ConnectionPoint(IConnectionPointContainer *pCPC, REFIID riid) | ConnectionPoint< T > | [inline]
CreateInstance(REFIID clsid, REFIID riid) | SIfacePtr< T > | [inline]
empty() const | SIfacePtr< T > | [inline]
Free() | SIfacePtr< T > | [inline]
get() | SIfacePtr< T > | [inline]
operator &() | SIfacePtr< T > | [inline]
operator T *() | SIfacePtr< T > | [inline]
operator->() | SIfacePtr< T > | [inline]
operator->() const | SIfacePtr< T > | [inline]
operator=(T *p) | SIfacePtr< T > | [inline]
operator=(SIfacePtr const &o) | SIfacePtr< T > | [inline]
QueryInterface(REFIID riid, I *p) | SIfacePtr< T > | [inline]
SIfacePtr() | SIfacePtr< T > | [inline]
SIfacePtr(T *p) | SIfacePtr< T > | [inline]
SIfacePtr(IUnknown *unknown, REFIID riid) | SIfacePtr< T > | [inline]
SIfacePtr(const SIfacePtr &o) | SIfacePtr< T > | [inline, protected]
~SIfacePtr() | SIfacePtr< T > | [inline]


ROS Explorer: XMLStorage::const_XMLChildrenFilter Struct Reference

XMLStorage::const_XMLChildrenFilter

XMLStorage::const_XMLChildrenFilter Struct Reference

read only iterator access to children nodes with name filtering More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::const_XMLChildrenFilter:

[legend]
List of all members.

Public Member Functions

const_XMLChildrenFilter (const XMLNode::Children &children, const XS_String &name)
const_XMLChildrenFilter (const XMLNode *node, const XS_String &name)
const_iterator begin ()
const_iterator end ()

Protected Attributes

const_iterator _begin
const_iterator _end

Classes

struct const_iterator
internal iterator class More...

Detailed Description

read only iterator access to children nodes with name filtering

Definition at line 815 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::const_XMLChildrenFilter::const_XMLChildrenFilter | ( | const XMLNode::Children & | children,
 |  | const XS_String & | name
 | ) | [inline]

Definition at line 817 of file xmlstorage.h.

00818          :      _begin(children.begin(), children.end(), name),
00819                 _end(children.end(), children.end(), name)
00820         {
00821         }

XMLStorage::const_XMLChildrenFilter::const_XMLChildrenFilter | ( | const XMLNode * | node,
 |  | const XS_String & | name
 | ) | [inline]

Definition at line 823 of file xmlstorage.h.

00824          :      _begin(node->get_children().begin(), node->get_children().end(), name),
00825                 _end(node->get_children().end(), node->get_children().end(), name)
00826         {
00827         }

Member Function Documentation

const_iterator XMLStorage::const_XMLChildrenFilter::begin ( ) [inline]

Definition at line 892 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::_begin.

00893         {
00894                 return _begin;
00895         }

const_iterator XMLStorage::const_XMLChildrenFilter::end ( ) [inline]

Definition at line 897 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_end.

00898         {
00899                 return _end;
00900         }

Member Data Documentation

const_iterator XMLStorage::const_XMLChildrenFilter::_begin [protected]

Definition at line 903 of file xmlstorage.h.

const_iterator XMLStorage::const_XMLChildrenFilter::_end [protected]

Definition at line 904 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::const_XMLChildrenFilter Member List

This is the complete list of members for XMLStorage::const_XMLChildrenFilter, including all inherited members.

_begin | XMLStorage::const_XMLChildrenFilter | [protected]
_end | XMLStorage::const_XMLChildrenFilter | [protected]
begin() | XMLStorage::const_XMLChildrenFilter | [inline]
const_XMLChildrenFilter(const XMLNode::Children &children, const XS_String &name) | XMLStorage::const_XMLChildrenFilter | [inline]
const_XMLChildrenFilter(const XMLNode *node, const XS_String &name) | XMLStorage::const_XMLChildrenFilter | [inline]
end() | XMLStorage::const_XMLChildrenFilter | [inline]


ROS Explorer: XMLStorage::const_XMLChildrenFilter::const_iterator Struct Reference

XMLStorage::const_XMLChildrenFilter::const_iterator

XMLStorage::const_XMLChildrenFilter::const_iterator Struct Reference

internal iterator class More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::const_XMLChildrenFilter::const_iterator:

[legend]
List of all members.

Public Types

typedef XMLNode::Children::const_iterator | BaseIterator

Public Member Functions

const_iterator (BaseIterator begin, BaseIterator end, const XS_String &filter_name)
operator BaseIterator ()
const XMLNode * | operator * () const
const_iterator & operator++ ()
const_iterator | operator++ (int)
bool | operator== (const BaseIterator &other) const
bool | operator!= (const BaseIterator &other) const

Protected Member Functions

void | search_next ()

Protected Attributes

BaseIterator _cur
BaseIterator _end
XS_String _filter_name

Detailed Description

internal iterator class

Definition at line 830 of file xmlstorage.h.

Member Typedef Documentation

typedef XMLNode::Children::const_iterator XMLStorage::const_XMLChildrenFilter::const_iterator::BaseIterator

Definition at line 832 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::const_XMLChildrenFilter::const_iterator::const_iterator | ( | BaseIterator | begin,
 |  | BaseIterator | end,
 |  | const XS_String & | filter_name
 | ) | [inline]

Definition at line 834 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::search_next().

00835                  :      _cur(begin),
00836                         _end(end),
00837                         _filter_name(filter_name)
00838                 {
00839                         search_next();
00840                 }

Here is the call graph for this function:

Member Function Documentation

const XMLNode* XMLStorage::const_XMLChildrenFilter::const_iterator::operator * ( ) const [inline]

Definition at line 847 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00848                 {
00849                         return *_cur;
00850                 }

XMLStorage::const_XMLChildrenFilter::const_iterator::operator BaseIterator ( ) [inline]

Definition at line 842 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00843                 {
00844                         return _cur;
00845                 }

bool XMLStorage::const_XMLChildrenFilter::const_iterator::operator!= ( const BaseIterator & other ) const [inline]

Definition at line 875 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00876                 {
00877                         return _cur != other;
00878                 }

const_iterator XMLStorage::const_XMLChildrenFilter::const_iterator::operator++ ( int ) [inline]

Definition at line 860 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur, and XMLStorage::XMLChildrenFilter::iterator::search_next().

00861                 {
00862                         const_iterator ret = *this;
00863
00864                         ++_cur;
00865                         search_next();
00866
00867                         return ret;
00868                 }

Here is the call graph for this function:

const_iterator& XMLStorage::const_XMLChildrenFilter::const_iterator::operator++ ( ) [inline]

Definition at line 852 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur, and XMLStorage::XMLChildrenFilter::iterator::search_next().

00853                 {
00854                         ++_cur;
00855                         search_next();
00856
00857                         return *this;
00858                 }

Here is the call graph for this function:

bool XMLStorage::const_XMLChildrenFilter::const_iterator::operator== ( const BaseIterator & other ) const [inline]

Definition at line 870 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00871                 {
00872                         return _cur == other;
00873                 }

void XMLStorage::const_XMLChildrenFilter::const_iterator::search_next ( ) [inline, protected]

Definition at line 885 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur, XMLStorage::XMLChildrenFilter::iterator::_end, and XMLStorage::XMLChildrenFilter::iterator::_filter_name.

00886                 {
00887                         while(_cur!=_end && **_cur!=_filter_name)
00888                                 ++_cur;
00889                 }

Member Data Documentation

BaseIterator XMLStorage::const_XMLChildrenFilter::const_iterator::_cur [protected]

Definition at line 881 of file xmlstorage.h.

BaseIterator XMLStorage::const_XMLChildrenFilter::const_iterator::_end [protected]

Definition at line 882 of file xmlstorage.h.

XS_String XMLStorage::const_XMLChildrenFilter::const_iterator::_filter_name [protected]

Definition at line 883 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::const_XMLChildrenFilter::const_iterator Member List

This is the complete list of members for XMLStorage::const_XMLChildrenFilter::const_iterator, including all inherited members.

_cur | XMLStorage::const_XMLChildrenFilter::const_iterator | [protected]
_end | XMLStorage::const_XMLChildrenFilter::const_iterator | [protected]
_filter_name | XMLStorage::const_XMLChildrenFilter::const_iterator | [protected]
BaseIterator typedef | XMLStorage::const_XMLChildrenFilter::const_iterator |
const_iterator(BaseIterator begin, BaseIterator end, const XS_String &filter_name) | XMLStorage::const_XMLChildrenFilter::const_iterator | [inline]
operator *() const | XMLStorage::const_XMLChildrenFilter::const_iterator | [inline]
operator BaseIterator() | XMLStorage::const_XMLChildrenFilter::const_iterator | [inline]
operator!=(const BaseIterator &other) const | XMLStorage::const_XMLChildrenFilter::const_iterator | [inline]
operator++() | XMLStorage::const_XMLChildrenFilter::const_iterator | [inline]
operator++(int) | XMLStorage::const_XMLChildrenFilter::const_iterator | [inline]
operator==(const BaseIterator &other) const | XMLStorage::const_XMLChildrenFilter::const_iterator | [inline]
search_next() | XMLStorage::const_XMLChildrenFilter::const_iterator | [inline, protected]


ROS Explorer: XMLStorage::const_XMLPos Struct Reference

XMLStorage::const_XMLPos

XMLStorage::const_XMLPos Struct Reference

iterator for XML trees More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::const_XMLPos:

[legend]
List of all members.

Public Member Functions

const_XMLPos (const XMLNode *root)
const_XMLPos (const const_XMLPos &other)
const XMLNode & | cur () const
access to current node
operator const XMLNode * () const
C++ access to current node.
const XMLNode * | operator-> () const
const XMLNode & | operator * () const
XS_String | get (const XS_String &attr_name) const
attribute access
template<typename T>
XS_String | get (const T &attr_name) const
C++ attribute access.
bool | back ()
go back to previous position
bool | go_down ()
go down to first child
bool | go_down (const XS_String &name, int n=0)
search for child and go down
bool | go (const char *path)
move XPath like to position in XML tree
const XS_String & | str () const

Protected Member Functions

void | go_to (const XMLNode *child)
go to specified node

Protected Attributes

const XMLNode * | _root
const XMLNode * | _cur
std::stack< const XMLNode * > | _stack

Detailed Description

iterator for XML trees

Definition at line 1139 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::const_XMLPos::const_XMLPos ( const XMLNode * root ) [inline]

Definition at line 1141 of file xmlstorage.h.

01142          :      _root(root),
01143                 _cur(root)
01144         {
01145         }

XMLStorage::const_XMLPos::const_XMLPos ( const const_XMLPos & other ) [inline]

Definition at line 1147 of file xmlstorage.h.

01148          :      _root(other._root),
01149                 _cur(other._cur)
01150         {       // don't copy _stack
01151         }

Member Function Documentation

bool XMLStorage::const_XMLPos::back ( ) [inline]

go back to previous position

Definition at line 1176 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01177         {
01178                 if (!_stack.empty()) {
01179                         _cur = _stack.top();
01180                         _stack.pop();
01181                         return true;
01182                 } else
01183                         return false;
01184         }

const XMLNode& XMLStorage::const_XMLPos::cur ( ) const [inline]

access to current node

Definition at line 1154 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01155         {
01156                 return *_cur;
01157         }

template<typename T>
XS_String XMLStorage::const_XMLPos::get ( const T & attr_name ) const [inline]

C++ attribute access.

Definition at line 1173 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01173 {return _cur->get(attr_name);}

XS_String XMLStorage::const_XMLPos::get ( const XS_String & attr_name ) const [inline]

attribute access

Definition at line 1167 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

Referenced by XMLStorage::read_option().

01168         {
01169                 return _cur->get(attr_name);
01170         }

bool XMLStorage::const_XMLPos::go ( const char * path )

move XPath like to position in XML tree

Definition at line 116 of file xmlstorage.cpp.

References _cur, _root, XMLStorage::XMLNode::find_relative(), and go_to().

00117 {
00118         const XMLNode* node = _cur;
00119
00120          // Is this an absolute path?
00121         if (*path == '/') {
00122                 node = _root;
00123                 ++path;
00124         }
00125
00126         node = node->find_relative(path);
00127
00128         if (node) {
00129                 go_to(node);
00130                 return true;
00131         } else
00132                 return false;
00133 }

Here is the call graph for this function:

bool XMLStorage::const_XMLPos::go_down | ( | const XS_String & | name,
 |  | int | n = 0
 | ) | [inline]

search for child and go down

Definition at line 1199 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01200         {
01201                 XMLNode* node = _cur->find(name, n);
01202
01203                 if (node) {
01204                         go_to(node);
01205                         return true;
01206                 } else
01207                         return false;
01208         }

bool XMLStorage::const_XMLPos::go_down ( ) [inline]

go down to first child

Definition at line 1187 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01188         {
01189                 const XMLNode* node = _cur->get_first_child();
01190
01191                 if (node) {
01192                         go_to(node);
01193                         return true;
01194                 } else
01195                         return false;
01196         }

void XMLStorage::const_XMLPos::go_to ( const XMLNode * child ) [inline, protected]

go to specified node

Definition at line 1235 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

Referenced by go().

01236         {
01237                 _stack.push(_cur);
01238                 _cur = child;
01239         }

const XMLNode& XMLStorage::const_XMLPos::operator * ( ) const [inline]

Definition at line 1164 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01164 {return *_cur;}

XMLStorage::const_XMLPos::operator const XMLNode * ( ) const [inline]

C++ access to current node.

Definition at line 1160 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01160 {return _cur;}

const XMLNode* XMLStorage::const_XMLPos::operator-> ( ) const [inline]

Definition at line 1162 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01162 {return _cur;}

const XS_String& XMLStorage::const_XMLPos::str ( ) const [inline]

Definition at line 1227 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01227 {return *_cur;}

Member Data Documentation

const XMLNode* XMLStorage::const_XMLPos::_cur [protected]

Definition at line 1231 of file xmlstorage.h.

Referenced by go().

const XMLNode* XMLStorage::const_XMLPos::_root [protected]

Definition at line 1230 of file xmlstorage.h.

Referenced by go().

std::stack<const XMLNode*> XMLStorage::const_XMLPos::_stack [protected]

Definition at line 1232 of file xmlstorage.h.

The documentation for this struct was generated from the following files:
  • xmlstorage.h
  • xmlstorage.cpp


ROS Explorer: Member List

XMLStorage::const_XMLPos Member List

This is the complete list of members for XMLStorage::const_XMLPos, including all inherited members.

_cur | XMLStorage::const_XMLPos | [protected]
_root | XMLStorage::const_XMLPos | [protected]
_stack | XMLStorage::const_XMLPos | [protected]
back() | XMLStorage::const_XMLPos | [inline]
const_XMLPos(const XMLNode *root) | XMLStorage::const_XMLPos | [inline]
const_XMLPos(const const_XMLPos &other) | XMLStorage::const_XMLPos | [inline]
cur() const | XMLStorage::const_XMLPos | [inline]
get(const XS_String &attr_name) const | XMLStorage::const_XMLPos | [inline]
get(const T &attr_name) const | XMLStorage::const_XMLPos | [inline]
go(const char *path) | XMLStorage::const_XMLPos |
go_down() | XMLStorage::const_XMLPos | [inline]
go_down(const XS_String &name, int n=0) | XMLStorage::const_XMLPos | [inline]
go_to(const XMLNode *child) | XMLStorage::const_XMLPos | [inline, protected]
operator *() const | XMLStorage::const_XMLPos | [inline]
operator const XMLNode *() const | XMLStorage::const_XMLPos | [inline]
operator->() const | XMLStorage::const_XMLPos | [inline]
str() const | XMLStorage::const_XMLPos | [inline]


ROS Explorer: Context Struct Reference

Context Struct Reference

#include <utility.h>

Collaboration diagram for Context:

[legend]
List of all members.

Public Member Functions

Context (const char *ctx)
Context (const char *ctx, LPCSTR obj)
Context (const char *ctx, LPCWSTR obj)
Context (const Context &other)
~Context ()
String | toString () const
String | getStackTrace () const

Static Public Member Functions

static Context & | current ()

Public Attributes

const char * | _ctx
String _obj

Protected Attributes

Context * _last

Static Protected Attributes

static Context * | s_current = &Context::s_main
static Context | s_main

Detailed Description

Definition at line 1007 of file utility.h.

Constructor & Destructor Documentation

Context::Context ( const char * ctx ) [inline]

Definition at line 1009 of file utility.h.

01010          :      _ctx(ctx)
01011         {
01012                 _last = s_current;
01013                 s_current = this;
01014         }

Context::Context | ( | const char * | ctx,
 |  | LPCSTR | obj
 | ) | [inline]

Definition at line 1016 of file utility.h.

01017          :      _ctx(ctx),
01018                 _obj(obj)
01019         {
01020                 _last = s_current;
01021                 s_current = this;
01022         }

Context::Context | ( | const char * | ctx,
 |  | LPCWSTR | obj
 | ) | [inline]

Definition at line 1024 of file utility.h.

01025          :      _ctx(ctx),
01026                 _obj(obj)
01027         {
01028                 _last = s_current;
01029                 s_current = this;
01030         }

Context::Context ( const Context & other ) [inline]

Definition at line 1032 of file utility.h.

01033          :      _ctx(other._ctx),
01034                 _obj(other._obj)
01035         {
01036                 _last = NULL;
01037         }

Context::~Context ( ) [inline]

Definition at line 1039 of file utility.h.

01040         {
01041                 if (_last) {
01042                         s_current = _last;
01043                         _last = NULL;
01044                 }
01045         }

Member Function Documentation

static Context& Context::current ( ) [inline, static]

Definition at line 1053 of file utility.h.

01053 {return *s_current;}

String Context::getStackTrace ( ) const

Definition at line 140 of file utility.cpp.

References _ctx, _last, _obj, ANS, and s_main.

00141 {
00142         ostringstream str;
00143
00144         str << "Context Trace:\n";
00145
00146         for(const Context*p=this; p && p!=&s_main; p=p->_last) {
00147                 str << "- " << p->_ctx;
00148
00149                 if (!p->_obj.empty())
00150                         str << " obj=" << ANS(p->_obj);
00151
00152                 str << '\n';
00153         }
00154
00155         return str.str();
00156 }

String Context::toString ( ) const

Definition at line 130 of file utility.cpp.

References _ctx, _obj, and String::appendf().

Referenced by COMException::toString().

00131 {
00132         String str = _ctx;
00133
00134         if (!_obj.empty())
00135                 str.appendf(TEXT("\nObject: %s"), (LPCTSTR)_obj);
00136
00137         return str;
00138 }

Here is the call graph for this function:

Member Data Documentation

const char* Context::_ctx

Definition at line 1050 of file utility.h.

Referenced by getStackTrace(), and toString().

Context* Context::_last [protected]

Definition at line 1056 of file utility.h.

Referenced by getStackTrace().

String Context::_obj

Definition at line 1051 of file utility.h.

Referenced by getStackTrace(), and toString().

Context * Context::s_current = &Context::s_main [static, protected]

Definition at line 1058 of file utility.h.

Context Context::s_main [static, protected]

Todo:
use TLS

Definition at line 1059 of file utility.h.

Referenced by getStackTrace().

The documentation for this struct was generated from the following files:
  • utility.h
  • utility.cpp


ROS Explorer: Member List

Context Member List

This is the complete list of members for Context, including all inherited members.

_ctx | Context |
_last | Context | [protected]
_obj | Context |
Context(const char *ctx) | Context | [inline]
Context(const char *ctx, LPCSTR obj) | Context | [inline]
Context(const char *ctx, LPCWSTR obj) | Context | [inline]
Context(const Context &other) | Context | [inline]
current() | Context | [inline, static]
getStackTrace() const | Context |
s_current | Context | [protected, static]
s_main | Context | [protected, static]
toString() const | Context |
~Context() | Context | [inline]


ROS Explorer: CRITICAL_SECTION Class Reference

CRITICAL_SECTION Class Reference

Inheritance diagram for CRITICAL_SECTION:

[legend]
The documentation for this class was generated from the following file:
  • utility.h


ROS Explorer: CritSect Struct Reference

CritSect Struct Reference

critical section wrapper More...

#include <utility.h>

Inheritance diagram for CritSect:

[legend]
Collaboration diagram for CritSect:

[legend]
List of all members.

Public Member Functions

CritSect ()
~CritSect ()

Detailed Description

critical section wrapper

Definition at line 305 of file utility.h.

Constructor & Destructor Documentation

CritSect::CritSect ( ) [inline]

Definition at line 307 of file utility.h.

00308         {
00309                 InitializeCriticalSection(this);
00310         }

CritSect::~CritSect ( ) [inline]

Definition at line 312 of file utility.h.

00313         {
00314                 DeleteCriticalSection(this);
00315         }

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

CritSect Member List

This is the complete list of members for CritSect, including all inherited members.

CritSect() | CritSect | [inline]
~CritSect() | CritSect | [inline]


ROS Explorer: CtlColorParent< BASE > Struct Template Reference

CtlColorParent< BASE > Struct Template Reference

#include <window.h>

Inheritance diagram for CtlColorParent< BASE >:

[legend]
Collaboration diagram for CtlColorParent< BASE >:

[legend]
List of all members.

Public Types

typedef BASE | super

Public Member Functions

CtlColorParent (HWND hwnd)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Detailed Description

template<typename BASE>
struct CtlColorParent< BASE >

Definition at line 594 of file window.h.

Member Typedef Documentation

template<typename BASE>
typedef BASE CtlColorParent< BASE >::super

Reimplemented in ExplorerAboutDlg.

Definition at line 596 of file window.h.

Constructor & Destructor Documentation

template<typename BASE>
CtlColorParent< BASE >::CtlColorParent ( HWND hwnd ) [inline]

Definition at line 598 of file window.h.

00599          : super(hwnd) {}

Member Function Documentation

template<typename BASE>
LRESULT CtlColorParent< BASE >::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [inline]

Reimplemented in ExplorerAboutDlg.

Definition at line 601 of file window.h.

00602         {
00603                 switch(nmsg) {
00604                   case WM_CTLCOLOR:
00605                   case WM_CTLCOLORBTN:
00606                   case WM_CTLCOLORDLG:
00607                   case WM_CTLCOLORSCROLLBAR:
00608                   case WM_CTLCOLORSTATIC: {
00609                         HWND hctl = (HWND) lparam;
00610                         return SendMessage(hctl, PM_DISPATCH_CTLCOLOR, wparam, nmsg);
00611                   }
00612
00613                   default:
00614                         return super::WndProc(nmsg, wparam, lparam);
00615                 }
00616         }

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

CtlColorParent< BASE > Member List

This is the complete list of members for CtlColorParent< BASE >, including all inherited members.

CtlColorParent(HWND hwnd) | CtlColorParent< BASE > | [inline]
super typedef | CtlColorParent< BASE > |
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | CtlColorParent< BASE > | [inline]


ROS Explorer: CtxMenuInterfaces Struct Reference

CtxMenuInterfaces Struct Reference

#include <shellclasses.h>

Collaboration diagram for CtxMenuInterfaces:

[legend]
List of all members.

Public Member Functions

CtxMenuInterfaces ()
void | reset ()
bool | HandleMenuMsg (UINT nmsg, WPARAM wparam, LPARAM lparam)
IContextMenu * | query_interfaces (IContextMenu *pcm1)

Public Attributes

IContextMenu2 * | _pctxmenu2
IContextMenu3 * | _pctxmenu3

Detailed Description

Definition at line 1092 of file shellclasses.h.

Constructor & Destructor Documentation

CtxMenuInterfaces::CtxMenuInterfaces ( ) [inline]

Definition at line 1094 of file shellclasses.h.

01095         {
01096                 reset();
01097         }

Member Function Documentation

bool CtxMenuInterfaces::HandleMenuMsg | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) |

Definition at line 488 of file shellclasses.cpp.

References _pctxmenu2, and _pctxmenu3.

00489 {
00490 #ifndef __MINGW32__     // IContextMenu3 missing in MinGW (as of 6.2.2005)
00491         if (_pctxmenu3) {
00492                 if (SUCCEEDED(_pctxmenu3->HandleMenuMsg(nmsg, wparam, lparam)))
00493                         return true;
00494         }
00495 #endif
00496
00497         if (_pctxmenu2)
00498                 if (SUCCEEDED(_pctxmenu2->HandleMenuMsg(nmsg, wparam, lparam)))
00499                         return true;
00500
00501         return false;
00502 }

IContextMenu * CtxMenuInterfaces::query_interfaces ( IContextMenu * pcm1 )

Definition at line 504 of file shellclasses.cpp.

References _pctxmenu2, _pctxmenu3, and reset().

Referenced by DesktopShellView::DoDesktopContextMenu(), and ShellFolderContextMenu().

00505 {
00506         IContextMenu* pcm = NULL;
00507
00508         reset();
00509
00510          // Get the higher version context menu interfaces.
00511 #ifndef __MINGW32__     // IContextMenu3 missing in MinGW (as of 6.2.2005)
00512         if (pcm1->QueryInterface(IID_IContextMenu3, (void**)&pcm) == NOERROR)
00513                 _pctxmenu3 = (LPCONTEXTMENU3)pcm;
00514         else
00515 #endif
00516         if (pcm1->QueryInterface(IID_IContextMenu2, (void**)&pcm) == NOERROR)
00517                 _pctxmenu2 = (LPCONTEXTMENU2)pcm;
00518
00519         if (pcm) {
00520                 pcm1->Release();
00521                 return pcm;
00522         } else
00523                 return pcm1;
00524 }

Here is the call graph for this function:

void CtxMenuInterfaces::reset ( )

Definition at line 479 of file shellclasses.cpp.

Referenced by DesktopShellView::DoDesktopContextMenu(), query_interfaces(), and ShellFolderContextMenu().

00480 {
00481         _pctxmenu2 = NULL;
00482
00483 #ifndef __MINGW32__     // IContextMenu3 missing in MinGW (as of 6.2.2005)
00484         _pctxmenu3 = NULL;
00485 #endif
00486 }

Member Data Documentation

IContextMenu2* CtxMenuInterfaces::_pctxmenu2

Definition at line 1103 of file shellclasses.h.

Referenced by HandleMenuMsg(), and query_interfaces().

IContextMenu3* CtxMenuInterfaces::_pctxmenu3

Definition at line 1106 of file shellclasses.h.

Referenced by HandleMenuMsg(), and query_interfaces().

The documentation for this struct was generated from the following files:
  • shellclasses.h
  • shellclasses.cpp


ROS Explorer: Member List

CtxMenuInterfaces Member List

This is the complete list of members for CtxMenuInterfaces, including all inherited members.

_pctxmenu2 | CtxMenuInterfaces |
_pctxmenu3 | CtxMenuInterfaces |
CtxMenuInterfaces() | CtxMenuInterfaces | [inline]
HandleMenuMsg(UINT nmsg, WPARAM wparam, LPARAM lparam) | CtxMenuInterfaces |
query_interfaces(IContextMenu *pcm1) | CtxMenuInterfaces |
reset() | CtxMenuInterfaces |


ROS Explorer: DataStorage Struct Reference

DataStorage Struct Reference

structure containing information for one format of EnumFormatEtcImpl More...

#include <dragdropimpl.h>

Collaboration diagram for DataStorage:

[legend]
List of all members.

Public Attributes

FORMATETC * | _format
STGMEDIUM * | _medium

Detailed Description

structure containing information for one format of EnumFormatEtcImpl

Definition at line 18 of file dragdropimpl.h.

Member Data Documentation

FORMATETC* DataStorage::_format

Definition at line 19 of file dragdropimpl.h.

Referenced by IDataObjectImpl::SetData().

STGMEDIUM* DataStorage::_medium

Definition at line 20 of file dragdropimpl.h.

Referenced by IDataObjectImpl::SetData().

The documentation for this struct was generated from the following file:
  • dragdropimpl.h


ROS Explorer: Member List

DataStorage Member List

This is the complete list of members for DataStorage, including all inherited members.

_format | DataStorage
_medium | DataStorage


ROS Explorer: DEntry Union Reference

DEntry Union Reference

#include <fatfs.h>

Collaboration diagram for DEntry:

[legend]
List of all members.

Public Attributes

DEntry_E E
BYTE B [8+3+1+10+sizeof(struct ftime)+sizeof(struct fdate)+sizeof(WORD)+sizeof(DWORD)]

Detailed Description

Definition at line 159 of file fatfs.h.

Member Data Documentation

BYTE DEntry::B[8+3+1+10+sizeof(struct ftime)+sizeof(struct fdate)+sizeof(WORD)+sizeof(DWORD)]

Definition at line 161 of file fatfs.h.

DEntry_E DEntry::E

Definition at line 160 of file fatfs.h.

The documentation for this union was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

DEntry Member List

This is the complete list of members for DEntry, including all inherited members.

B | DEntry
E | DEntry


ROS Explorer: DEntry_E Struct Reference

DEntry_E Struct Reference

#include <fatfs.h>

Collaboration diagram for DEntry_E:

[legend]
List of all members.

Public Attributes

char | name [8]
char | ext [3]
char | attr
char | rsrvd [10]
ftime time
fdate date
WORD | fclus
DWORD | size

Detailed Description

Definition at line 148 of file fatfs.h.

Member Data Documentation

char DEntry_E::attr

Definition at line 151 of file fatfs.h.

struct fdate DEntry_E::date

Definition at line 154 of file fatfs.h.

char DEntry_E::ext[3]

Definition at line 150 of file fatfs.h.

WORD DEntry_E::fclus

Definition at line 155 of file fatfs.h.

char DEntry_E::name[8]

Definition at line 149 of file fatfs.h.

char DEntry_E::rsrvd[10]

Definition at line 152 of file fatfs.h.

DWORD DEntry_E::size

Definition at line 156 of file fatfs.h.

struct ftime DEntry_E::time

Definition at line 153 of file fatfs.h.

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

DEntry_E Member List

This is the complete list of members for DEntry_E, including all inherited members.

attr | DEntry_E
date | DEntry_E
ext | DEntry_E
fclus | DEntry_E
name | DEntry_E
rsrvd | DEntry_E
size | DEntry_E
time | DEntry_E


ROS Explorer: Desktop Struct Reference

Desktop Struct Reference

#include <globals.h>

Collaboration diagram for Desktop:

[legend]
List of all members.

Public Attributes

set< HWND > _windows
WindowHandle _hwndForeground
list< MinimizeStruct > _minimized

Detailed Description

Definition at line 205 of file globals.h.

Member Data Documentation

WindowHandle Desktop::_hwndForeground

Definition at line 208 of file globals.h.

Referenced by Desktops::SwitchToDesktop().

list<MinimizeStruct> Desktop::_minimized

Definition at line 209 of file globals.h.

set<HWND> Desktop::_windows

Definition at line 207 of file globals.h.

Referenced by Desktops::SwitchToDesktop().

The documentation for this struct was generated from the following file:
  • globals.h


ROS Explorer: Member List

Desktop Member List

This is the complete list of members for Desktop, including all inherited members.

_hwndForeground | Desktop
_minimized | Desktop
_windows | Desktop


ROS Explorer: DesktopBar Struct Reference

DesktopBar Struct Reference

desktop bar window, also known as "system tray" More...

#include <desktopbar.h>

Inheritance diagram for DesktopBar:

[legend]
Collaboration diagram for DesktopBar:

[legend]
List of all members.

Public Types

typedef OwnerDrawParent< Window > | super

Public Member Functions

DesktopBar (HWND hwnd)
~DesktopBar ()

Static Public Member Functions

static HWND | Create ()

Protected Member Functions

LRESULT | Init (LPCREATESTRUCT pcs)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Notify (int id, NMHDR *pnmh)
int | Command (int id, int code)
void | Resize (int cx, int cy)
void | ControlResize (WPARAM wparam, LPARAM lparam)
void | RegisterHotkeys ()
void | ProcessHotKey (int id_hotkey)
void | ShowStartMenu ()
LRESULT | ProcessCopyData (COPYDATASTRUCT *pcd)

Protected Attributes

RECT | _work_area_org
int | _taskbar_pos
WindowHandle _hwndTaskBar
WindowHandle _hwndNotify
WindowHandle _hwndQuickLaunch
WindowHandle _hwndrebar
StartMenuRoot * _startMenuRoot
const UINT | WM_TASKBARCREATED

Detailed Description

desktop bar window, also known as "system tray"

Definition at line 67 of file desktopbar.h.

Member Typedef Documentation

typedef OwnerDrawParent<Window> DesktopBar::super

Reimplemented from OwnerDrawParent< Window >.

Definition at line 79 of file desktopbar.h.

Constructor & Destructor Documentation

DesktopBar::DesktopBar ( HWND hwnd )

Definition at line 42 of file desktopbar.cpp.

References _work_area_org, IDI_REACTOS, and SetWindowIcon().

00043  :      super(hwnd),
00044 #ifdef _ROS_
00045         _trayIcon(hwnd, ID_TRAY_VOLUME)
00046 #else
00047         WM_TASKBARCREATED(RegisterWindowMessage(WINMSG_TASKBARCREATED))
00048 #endif
00049 {
00050         SetWindowIcon(hwnd, IDI_REACTOS);
00051
00052         SystemParametersInfo(SPI_GETWORKAREA, 0, &_work_area_org, 0);
00053 }

Here is the call graph for this function:

DesktopBar::~DesktopBar ( )

Definition at line 55 of file desktopbar.cpp.

References _work_area_org.

00056 {
00057          // restore work area to the previous size
00058         SystemParametersInfo(SPI_SETWORKAREA, 0, &_work_area_org, 0);
00059         PostMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETWORKAREA, 0);
00060
00061          // exit application after destroying desktop window
00062         PostQuitMessage(0);
00063 }

Member Function Documentation

int DesktopBar::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 391 of file desktopbar.cpp.

References ExplorerGlobals::_desktops, WindowHandle::_hwnd, _hwndQuickLaunch, explorer_about(), explorer_show_frame(), ExplorerPropertySheet(), g_Globals, ID_ABOUT_EXPLORER, ID_DESKTOPBAR_SETTINGS, ID_EXPLORE, ID_MINIMIZE_ALL, ID_SWITCH_DESKTOP_1, ID_TASKMGR, ID_TRAY_VOLUME, ID_VOLUME_PROPERTIES, launch_cpanel(), launch_file(), PM_UPDATE_DESKTOP, ShowStartMenu(), Desktops::SwitchToDesktop(), and Desktops::ToggleMinimize().

00392 {
00393         switch(id) {
00394           case IDC_START:
00395                 ShowStartMenu();
00396                 break;
00397
00398           case ID_ABOUT_EXPLORER:
00399                 explorer_about(_hwnd);
00400                 break;
00401
00402           case ID_DESKTOPBAR_SETTINGS:
00403                 ExplorerPropertySheet(_hwnd);
00404                 break;
00405
00406           case ID_MINIMIZE_ALL:
00407                 g_Globals._desktops.ToggleMinimize();
00408                 break;
00409
00410           case ID_EXPLORE:
00411                 explorer_show_frame(SW_SHOWNORMAL);
00412                 break;
00413
00414           case ID_TASKMGR:
00415                 launch_file(_hwnd, TEXT("taskmgr.exe"), SW_SHOWNORMAL);
00416                 break;
00417
00418           case ID_SWITCH_DESKTOP_1:
00419           case ID_SWITCH_DESKTOP_1+1:
00420           case ID_SWITCH_DESKTOP_1+2:
00421           case ID_SWITCH_DESKTOP_1+3: {
00422                 int desktop_idx = id - ID_SWITCH_DESKTOP_1;
00423
00424                 g_Globals._desktops.SwitchToDesktop(desktop_idx);
00425
00426                 if (_hwndQuickLaunch)
00427                         PostMessage(_hwndQuickLaunch, PM_UPDATE_DESKTOP, desktop_idx, 0);
00428                 break;}
00429
00430 #ifdef _ROS_
00431           case ID_TRAY_VOLUME:
00432                 launch_file(_hwnd, TEXT("sndvol32.exe"), SW_SHOWNORMAL);        // launch volume control application
00433                 break;
00434
00435           case ID_VOLUME_PROPERTIES:
00436                 launch_cpanel(_hwnd, TEXT("mmsys.cpl"));
00437                 break;
00438 #endif
00439
00440           default:
00441                 if (_hwndQuickLaunch)
00442                         return SendMessage(_hwndQuickLaunch, WM_COMMAND, MAKEWPARAM(id,code), 0);
00443                 else
00444                         return 1;
00445         }
00446
00447         return 0;
00448 }

Here is the call graph for this function:

void DesktopBar::ControlResize | ( | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected]

Todo:
write code for taskbar being at sides or top.

Definition at line 481 of file desktopbar.cpp.

References DESKTOPBARBAR_HEIGHT.

00482 {
00483         PRECT dragRect = (PRECT) lparam;
00484         //int screenWidth = GetSystemMetrics(SM_CXSCREEN);
00485         int screenHeight = GetSystemMetrics(SM_CYSCREEN);
00486
00488
00489         switch(wparam) {
00490           case WMSZ_BOTTOM: //@todo Taskbar is at the top of the screen
00491                 break;
00492
00493           case WMSZ_TOP:        // Taskbar is at the bottom of the screen
00494                 dragRect->top = screenHeight - (((screenHeight - dragRect->top) + DESKTOPBARBAR_HEIGHT/2) / DESKTOPBARBAR_HEIGHT) * DESKTOPBARBAR_HEIGHT;
00495                 if (dragRect->top < screenHeight / 2)
00496                         dragRect->top = screenHeight - (screenHeight/2 / DESKTOPBARBAR_HEIGHT * DESKTOPBARBAR_HEIGHT);
00497                 else if (dragRect->top > screenHeight - 5)
00498                         dragRect->top = screenHeight - 5;
00499                 break;
00500
00501           case WMSZ_RIGHT:      //@todo Taskbar is at the left of the screen
00502                 break;
00503
00504           case WMSZ_LEFT:       //@todo Taskbar is at the right of the screen
00505                 break;
00506         }
00507 }

HWND DesktopBar::Create ( ) [static]

Definition at line 66 of file desktopbar.cpp.

References CLASSNAME_EXPLORERBAR, Window::Create(), DESKTOPBARBAR_HEIGHT, TITLE_EXPLORERBAR, and WINDOW_CREATOR.

Referenced by DesktopWindow::Init().

00067 {
00068         static BtnWindowClass wcDesktopBar(CLASSNAME_EXPLORERBAR);
00069
00070         RECT rect;
00071
00072         rect.left = -2; // hide left border
00073 #ifdef TASKBAR_AT_TOP
00074         rect.top = -2;  // hide top border
00075 #else
00076         rect.top = GetSystemMetrics(SM_CYSCREEN) - DESKTOPBARBAR_HEIGHT;
00077 #endif
00078         rect.right = GetSystemMetrics(SM_CXSCREEN) + 2;
00079         rect.bottom = rect.top + DESKTOPBARBAR_HEIGHT + 2;
00080
00081         return Window::Create(WINDOW_CREATOR(DesktopBar), WS_EX_PALETTEWINDOW,
00082                                                         wcDesktopBar, TITLE_EXPLORERBAR,
00083                                                         WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN|WS_VISIBLE,
00084                                                         rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, 0);
00085 }

Here is the call graph for this function:

LRESULT DesktopBar::Init ( LPCREATESTRUCT pcs ) [protected, virtual]

Reimplemented from Window.

Definition at line 88 of file desktopbar.cpp.

References ExplorerGlobals::_hInstance, WindowHandle::_hwnd, _hwndNotify, _hwndQuickLaunch, _hwndrebar, _hwndTaskBar, _startMenuRoot, _taskbar_pos, StartMenuRoot::Create(), QuickLaunchBar::Create(), NotifyArea::Create(), TaskBar::Create(), g_Globals, GET_WINDOW, HWND, IDC_START, IDS_START, IDW_QUICKLAUNCHBAR, IDW_TASKTOOLBAR, Window::Init(), RBBS_HIDETITLE, REBARBAND_HEIGHT, RegisterHotkeys(), and WM_TASKBARCREATED.

00089 {
00090         if (super::Init(pcs))
00091                 return 1;
00092
00093          // create start button
00094         ResString start_str(IDS_START);
00095         WindowCanvas canvas(_hwnd);
00096         RECT rect = {0, 0};
00097         DrawText(canvas, start_str, -1, &rect, DT_SINGLELINE|DT_CALCRECT);
00098         int start_btn_width = rect.right+16+8;
00099
00100         _taskbar_pos = start_btn_width + 6;
00101
00102          // create "Start" button
00103         HWND hwndStart = Button(_hwnd, start_str, 1, 1, start_btn_width, REBARBAND_HEIGHT, IDC_START, WS_VISIBLE|WS_CHILD|BS_OWNERDRAW);
00104         new StartButton(hwndStart);
00105          // disable double clicks
00106         SetClassLong(hwndStart, GCL_STYLE, GetClassLong(hwndStart, GCL_STYLE) & ~CS_DBLCLKS);
00107
00108          // create task bar
00109         _hwndTaskBar = TaskBar::Create(_hwnd);
00110
00111 #ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003)
00112         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOTRAYITEMSDISPLAY))
00113 #endif
00114                  // create tray notification area
00115                 _hwndNotify = NotifyArea::Create(_hwnd);
00116
00117
00118          // notify all top level windows about the successfully created desktop bar
00119          //@@ Use SendMessage() instead of PostMessage() to avoid problems with delayed created shell service objects?
00120         PostMessage(HWND_BROADCAST, WM_TASKBARCREATED, 0, 0);
00121
00122
00123         _hwndQuickLaunch = QuickLaunchBar::Create(_hwnd);
00124
00125          // create rebar window to manage task and quick launch bar
00126 #ifndef _NO_REBAR
00127         _hwndrebar = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL,
00128                                         WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
00129                                         RBS_VARHEIGHT|RBS_AUTOSIZE|RBS_DBLCLKTOGGLE|    //|RBS_REGISTERDROP
00130                                         CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_TOP,
00131                                         0, 0, 0, 0, _hwnd, 0, g_Globals._hInstance, 0);
00132
00133         REBARBANDINFO rbBand;
00134
00135         rbBand.cbSize = sizeof(REBARBANDINFO);
00136         rbBand.fMask  = RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE|RBBIM_ID|RBBIM_IDEALSIZE;
00137 #ifndef RBBS_HIDETITLE // missing in MinGW headers as of 25.02.2004
00138 #define RBBS_HIDETITLE  0x400
00139 #endif
00140         rbBand.cyChild = REBARBAND_HEIGHT;
00141         rbBand.cyMaxChild = (ULONG)-1;
00142         rbBand.cyMinChild = REBARBAND_HEIGHT;
00143         rbBand.cyIntegral = REBARBAND_HEIGHT + 3;       //@@ OK?
00144         rbBand.cxMinChild = rbBand.cyIntegral * 3;
00145         rbBand.fStyle = RBBS_VARIABLEHEIGHT|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE;
00146
00147         rbBand.lpText = TEXT("Quicklaunch");
00148         rbBand.hwndChild = _hwndQuickLaunch;
00149         rbBand.cx = 250;
00150         rbBand.wID = IDW_QUICKLAUNCHBAR;
00151         SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
00152
00153         rbBand.lpText = TEXT("Taskbar");
00154         rbBand.hwndChild = _hwndTaskBar;
00155         rbBand.cx = 200;        //pcs->cx-_taskbar_pos-quicklaunch_width-(notifyarea_width+1);
00156         rbBand.wID = IDW_TASKTOOLBAR;
00157         SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
00158 #endif
00159
00160
00161         RegisterHotkeys();
00162
00163          // prepare Startmenu, but hide it for now
00164         _startMenuRoot = GET_WINDOW(StartMenuRoot, StartMenuRoot::Create(_hwnd, true)); //@@ _large_icons
00165
00166         return 0;
00167 }

Here is the call graph for this function:

int DesktopBar::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 342 of file desktopbar.cpp.

References IDW_TASKTOOLBAR.

00343 {
00344         if (pnmh->code == RBN_CHILDSIZE) {
00345                 /* align the task bands to the top, so it's in row with the Start button */
00346                 NMREBARCHILDSIZE* childSize = (NMREBARCHILDSIZE*)pnmh;
00347
00348                 if (childSize->wID == IDW_TASKTOOLBAR) {
00349                         int cy = childSize->rcChild.top - childSize->rcBand.top;
00350
00351                         if (cy) {
00352                                 childSize->rcChild.bottom -= cy;
00353                                 childSize->rcChild.top -= cy;
00354                         }
00355                 }
00356         }
00357
00358         return 0;
00359 }

LRESULT DesktopBar::ProcessCopyData ( COPYDATASTRUCT * pcd ) [protected]

Definition at line 465 of file desktopbar.cpp.

References _hwndNotify, GET_WINDOW, TrayNotifyCDS::nicon_data, and TrayNotifyCDS::notify_code.

00466 {
00467          // Is this a tray notification message?
00468         if (pcd->dwData == 1) {
00469                 TrayNotifyCDS* ptr = (TrayNotifyCDS*) pcd->lpData;
00470
00471                 NotifyArea* notify_area = GET_WINDOW(NotifyArea, _hwndNotify);
00472
00473                 if (notify_area)
00474                         return notify_area->ProcessTrayNotification(ptr->notify_code, &ptr->nicon_data);
00475         }
00476
00477         return FALSE;
00478 }

void DesktopBar::ProcessHotKey ( int id_hotkey ) [protected]

Todo:
implement all common hotkeys

Definition at line 243 of file desktopbar.cpp.

References explorer_show_frame().

00244 {
00245         switch(id_hotkey) {
00246           case 0:       explorer_show_frame(SW_SHOWNORMAL);
00247                 break;
00248
00250         }
00251 }

Here is the call graph for this function:

void DesktopBar::RegisterHotkeys ( ) [protected]

Todo:
register all common hotkeys

Definition at line 235 of file desktopbar.cpp.

References WindowHandle::_hwnd.

Referenced by Init().

00236 {
00237          // register hotkey WIN+E opening explorer
00238         RegisterHotKey(_hwnd, 0, MOD_WIN, 'E');
00239
00241 }

void DesktopBar::Resize | ( | int | cx,
 |  | int | cy
 | ) | [protected]

Todo:
general children resizing algorithm

Definition at line 361 of file desktopbar.cpp.

References WindowHandle::_hwnd, _hwndNotify, _hwndQuickLaunch, _hwndrebar, _hwndTaskBar, _taskbar_pos, and PM_GET_WIDTH.

00362 {
00364         int quicklaunch_width = SendMessage(_hwndQuickLaunch, PM_GET_WIDTH, 0, 0);
00365         int notifyarea_width = SendMessage(_hwndNotify, PM_GET_WIDTH, 0, 0);
00366
00367         HDWP hdwp = BeginDeferWindowPos(3);
00368
00369         if (_hwndrebar)
00370                 DeferWindowPos(hdwp, _hwndrebar, 0, _taskbar_pos, 1, cx-_taskbar_pos-(notifyarea_width+1), cy-2, SWP_NOZORDER|SWP_NOACTIVATE);
00371         else {
00372                 if (_hwndQuickLaunch)
00373                         DeferWindowPos(hdwp, _hwndQuickLaunch, 0, _taskbar_pos, 1, quicklaunch_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE);
00374
00375                 if (_hwndTaskBar)
00376                         DeferWindowPos(hdwp, _hwndTaskBar, 0, _taskbar_pos+quicklaunch_width, 0, cx-_taskbar_pos-quicklaunch_width-(notifyarea_width+1), cy, SWP_NOZORDER|SWP_NOACTIVATE);
00377         }
00378
00379         if (_hwndNotify)
00380                 DeferWindowPos(hdwp, _hwndNotify, 0, cx-(notifyarea_width+1), 1, notifyarea_width, cy-2, SWP_NOZORDER|SWP_NOACTIVATE);
00381
00382         EndDeferWindowPos(hdwp);
00383
00384         WindowRect rect(_hwnd);
00385         RECT work_area = {0, 0, GetSystemMetrics(SM_CXSCREEN), rect.top};
00386         SystemParametersInfo(SPI_SETWORKAREA, 0, &work_area, 0);        // don't use SPIF_SENDCHANGE because then we have to wait for any message being delivered
00387         PostMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETWORKAREA, 0);
00388 }

void DesktopBar::ShowStartMenu ( ) [protected]

Definition at line 451 of file desktopbar.cpp.

References _startMenuRoot, and StartMenuRoot::TrackStartmenu().

Referenced by Command().

00452 {
00453         if (_startMenuRoot)
00454                 _startMenuRoot->TrackStartmenu();
00455 }

Here is the call graph for this function:

LRESULT DesktopBar::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:
read desktop bar settings

Reimplemented from OwnerDrawParent< Window >.

Definition at line 254 of file desktopbar.cpp.

References OwnerDrawParent< Window >::WndProc().

00255 {
00256         switch(nmsg) {
00257           case WM_NCHITTEST: {
00258                 LRESULT res = super::WndProc(nmsg, wparam, lparam);
00259
00260                 if (res>=HTSIZEFIRST && res<=HTSIZELAST) {
00261 #ifdef TASKBAR_AT_TOP
00262                         if (res == HTBOTTOM)    // enable vertical resizing at the lower border
00263 #else
00264                         if (res == HTTOP)               // enable vertical resizing at the upper border
00265 #endif
00266                                 return res;
00267                         else
00268                                 return HTCLIENT;        // disable any other resizing
00269                 }
00270                 return res;}
00271
00272           case WM_SYSCOMMAND:
00273                 if ((wparam&0xFFF0) == SC_SIZE) {
00274 #ifdef TASKBAR_AT_TOP
00275                         if (wparam == SC_SIZE+6)// enable vertical resizing at the lower border
00276 #else
00277                         if (wparam == SC_SIZE+3)// enable vertical resizing at the upper border
00278 #endif
00279                                 goto def;
00280                         else
00281                                 return 0;                       // disable any other resizing
00282                 } else if (wparam == SC_TASKLIST)
00283                         ShowStartMenu();
00284                 goto def;
00285
00286           case WM_SIZE:
00287                 Resize(LOWORD(lparam), HIWORD(lparam));
00288                 break;
00289
00290           case WM_SIZING:
00291                 ControlResize(wparam, lparam);
00292                 break;
00293
00294           case PM_RESIZE_CHILDREN: {
00295                 ClientRect size(_hwnd);
00296                 Resize(size.right, size.bottom);
00297                 break;}
00298
00299           case WM_CLOSE:
00300                 ShowExitWindowsDialog(_hwnd);
00301                 break;
00302
00303           case WM_HOTKEY:
00304                 ProcessHotKey(wparam);
00305                 break;
00306
00307           case WM_COPYDATA:
00308                 return ProcessCopyData((COPYDATASTRUCT*)lparam);
00309
00310           case WM_CONTEXTMENU: {
00311                 PopupMenu menu(IDM_DESKTOPBAR);
00312                 SetMenuDefaultItem(menu, 0, MF_BYPOSITION);
00313                 menu.TrackPopupMenu(_hwnd, MAKEPOINTS(lparam));
00314                 break;}
00315
00316           case PM_GET_LAST_ACTIVE:
00317                 if (_hwndTaskBar)
00318                         return SendMessage(_hwndTaskBar, nmsg, wparam, lparam);
00319                 break;
00320
00321           case PM_REFRESH_CONFIG:
00322                 SendMessage(_hwndNotify, PM_REFRESH_CONFIG, 0, 0);
00323                 break;
00324
00325           case WM_TIMER:
00326                 if (wparam == ID_TRAY_VOLUME) {
00327                         KillTimer(_hwnd, wparam);
00328                         launch_file(_hwnd, TEXT("sndvol32.exe"), SW_SHOWNORMAL, TEXT("-t"));    // launch volume control in small mode
00329                 }
00330                 break;
00331
00332           case PM_GET_NOTIFYAREA:
00333                 return (LRESULT)(HWND)_hwndNotify;
00334
00335           default: def:
00336                 return super::WndProc(nmsg, wparam, lparam);
00337         }
00338
00339         return 0;
00340 }

Here is the call graph for this function:

Member Data Documentation

WindowHandle DesktopBar::_hwndNotify [protected]

Definition at line 104 of file desktopbar.h.

Referenced by Init(), ProcessCopyData(), and Resize().

WindowHandle DesktopBar::_hwndQuickLaunch [protected]

Definition at line 105 of file desktopbar.h.

Referenced by Command(), Init(), and Resize().

WindowHandle DesktopBar::_hwndrebar [protected]

Definition at line 106 of file desktopbar.h.

Referenced by Init(), and Resize().

WindowHandle DesktopBar::_hwndTaskBar [protected]

Definition at line 103 of file desktopbar.h.

Referenced by Init(), and Resize().

struct StartMenuRoot* DesktopBar::_startMenuRoot [protected]

Definition at line 108 of file desktopbar.h.

Referenced by Init(), and ShowStartMenu().

int DesktopBar::_taskbar_pos [protected]

Definition at line 89 of file desktopbar.h.

Referenced by Init(), and Resize().

RECT DesktopBar::_work_area_org [protected]

Definition at line 88 of file desktopbar.h.

Referenced by DesktopBar(), and ~DesktopBar().

const UINT DesktopBar::WM_TASKBARCREATED [protected]

Definition at line 117 of file desktopbar.h.

Referenced by Init().

The documentation for this struct was generated from the following files:
  • desktopbar.h
  • desktopbar.cpp


ROS Explorer: Member List

DesktopBar Member List

This is the complete list of members for DesktopBar, including all inherited members.

_hwnd | WindowHandle | [protected]
_hwndNotify | DesktopBar | [protected]
_hwndQuickLaunch | DesktopBar | [protected]
_hwndrebar | DesktopBar | [protected]
_hwndTaskBar | DesktopBar | [protected]
_startMenuRoot | DesktopBar | [protected]
_taskbar_pos | DesktopBar | [protected]
_work_area_org | DesktopBar | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | DesktopBar | [protected, virtual]
ControlResize(WPARAM wparam, LPARAM lparam) | DesktopBar | [protected]
Create() | DesktopBar | [static]
OwnerDrawParent< Window >::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
OwnerDrawParent< Window >::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DesktopBar(HWND hwnd) | DesktopBar |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | DesktopBar | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | DesktopBar | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< Window > | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
ProcessCopyData(COPYDATASTRUCT *pcd) | DesktopBar | [protected]
ProcessHotKey(int id_hotkey) | DesktopBar | [protected]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
RegisterHotkeys() | DesktopBar | [protected]
Resize(int cx, int cy) | DesktopBar | [protected]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
ShowStartMenu() | DesktopBar | [protected]
super typedef | DesktopBar |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WM_TASKBARCREATED | DesktopBar | [protected]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | DesktopBar | [protected, virtual]
~DesktopBar() | DesktopBar |
~Window() | Window | [virtual]


ROS Explorer: DesktopDropTarget Class Reference

DesktopDropTarget Class Reference

OLE drop target for the desktop window. More...

#include <desktop.h>

Inheritance diagram for DesktopDropTarget:

[legend]
Collaboration diagram for DesktopDropTarget:

[legend]
List of all members.

Public Member Functions

DesktopDropTarget (HWND hTargetWnd)
virtual bool | OnDrop (FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)
virtual HRESULT STDMETHODCALLTYPE | DragOver (DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
virtual HRESULT STDMETHODCALLTYPE | DragLeave (void)

Detailed Description

OLE drop target for the desktop window.

Definition at line 95 of file desktop.h.

Constructor & Destructor Documentation

DesktopDropTarget::DesktopDropTarget ( HWND hTargetWnd ) [inline]

Definition at line 100 of file desktop.h.

00100 : super(hTargetWnd) {}

Member Function Documentation

virtual HRESULT STDMETHODCALLTYPE DesktopDropTarget::DragLeave ( void ) [inline, virtual]

Reimplemented from IDropTargetImpl.

Definition at line 158 of file desktop.h.

00159         {
00160                 //@@ TreeView_SelectDropTarget(m_hTargetWnd, NULL);
00161
00162                 return super::DragLeave();
00163         }

virtual HRESULT STDMETHODCALLTYPE DesktopDropTarget::DragOver | ( | DWORD | grfKeyState,
 |  | POINTL | pt,
 |  | DWORD __RPC_FAR * | pdwEffect
 | ) | [inline, virtual]

Reimplemented from IDropTargetImpl.

Definition at line 138 of file desktop.h.

References ScreenToClient().

00142         {
00143                 TVHITTESTINFO hit;
00144                 hit.pt = (POINT&)pt;
00145                 ScreenToClient(m_hTargetWnd, &hit.pt);
00146                 hit.flags = TVHT_ONITEM;
00147
00148                 /*@@
00149                 HTREEITEM hItem = TreeView_HitTest(m_hTargetWnd,&hit);
00150
00151                 if (hItem != NULL)
00152                         TreeView_SelectDropTarget(m_hTargetWnd, hItem);
00153                 */
00154
00155                 return super::DragOver(grfKeyState, pt, pdwEffect);
00156         }

Here is the call graph for this function:

virtual bool DesktopDropTarget::OnDrop | ( | FORMATETC * | pFmtEtc,
 |  | STGMEDIUM & | medium,
 |  | DWORD * | pdwEffect
 | ) | [inline, virtual]

Todo:
Add the code to handle Copy
Todo:
Add the code to handle Move

Implements IDropTargetImpl.

Definition at line 102 of file desktop.h.

00103         {
00104                 if (pFmtEtc->cfFormat==CF_HDROP && medium.tymed==TYMED_HGLOBAL) {
00105                         HDROP hDrop = (HDROP)GlobalLock(medium.hGlobal);
00106
00107                         if (hDrop) {
00108                                 TCHAR szFileName[MAX_PATH];
00109
00110                                 UINT cFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
00111
00112                                 for(UINT i=0; i<cFiles; ++i) {
00113                                         DragQueryFile(hDrop, i, szFileName, sizeof(szFileName));
00114
00115                                         if (DROPEFFECT_COPY & *pdwEffect) {
00116                                                  // copy the file or dir
00117
00119
00120                                         } else if (DROPEFFECT_MOVE & *pdwEffect) {
00121                                                  // move the file or dir
00122
00124
00125                                         }
00126                                 }
00127                                 //DragFinish(hDrop); // base class calls ReleaseStgMedium
00128                         }
00129
00130                         GlobalUnlock(medium.hGlobal);
00131                 }
00132
00133                 //@@TreeView_SelectDropTarget(m_hTargetWnd, NULL);
00134
00135                 return true; //let base free the medium
00136         }

The documentation for this class was generated from the following file:
  • desktop.h


ROS Explorer: Member List

DesktopDropTarget Member List

This is the complete list of members for DesktopDropTarget, including all inherited members.

AddRef() | IDropTargetImpl | [inline, virtual]
AddSuportedFormat(FORMATETC &ftetc) | IDropTargetImpl | [inline]
DesktopDropTarget(HWND hTargetWnd) | DesktopDropTarget | [inline]
DragEnter(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) | IDropTargetImpl | [virtual]
DragLeave(void) | DesktopDropTarget | [inline, virtual]
DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) | DesktopDropTarget | [inline, virtual]
Drop(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) | IDropTargetImpl | [virtual]
IDropTargetImpl(HWND m_hTargetWnd) | IDropTargetImpl |
m_hTargetWnd | IDropTargetImpl | [protected]
OnDrop(FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect) | DesktopDropTarget | [inline, virtual]
QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect) | IDropTargetImpl |
QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject) | IDropTargetImpl | [virtual]
Release() | IDropTargetImpl | [virtual]
~IDropTargetImpl() | IDropTargetImpl | [virtual]


ROS Explorer: DesktopFolder Struct Reference

DesktopFolder Struct Reference

Shell folder of the desktop. More...

#include <shellclasses.h>

Inheritance diagram for DesktopFolder:

[legend]
Collaboration diagram for DesktopFolder:

[legend]
List of all members.

Detailed Description

Shell folder of the desktop.

Definition at line 997 of file shellclasses.h.

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

DesktopFolder Member List

This is the complete list of members for DesktopFolder, including all inherited members.

_p | SIfacePtr< IShellFolder > | [protected]
attach(IShellFolder *parent, LPCITEMIDLIST pidl) | ShellFolder |
CreateInstance(REFIID clsid, REFIID riid) | SIfacePtr< IShellFolder > | [inline]
empty() const | SIfacePtr< IShellFolder > | [inline]
Free() | SIfacePtr< IShellFolder > | [inline]
get() | SIfacePtr< IShellFolder > | [inline]
get_name(LPCITEMIDLIST pidl, SHGDNF flags=SHGDN_NORMAL) const | ShellFolder |
operator &() | SIfacePtr< IShellFolder > | [inline]
operator IShellFolder *() | SIfacePtr< IShellFolder > | [inline]
operator->() | SIfacePtr< IShellFolder > | [inline]
operator->() const | SIfacePtr< IShellFolder > | [inline]
operator=(IShellFolder *p) | SIfacePtr< IShellFolder > | [inline]
operator=(SIfacePtr const &o) | SIfacePtr< IShellFolder > | [inline]
QueryInterface(REFIID riid, I *p) | SIfacePtr< IShellFolder > | [inline]
ShellFolder() | ShellFolder |
ShellFolder(IShellFolder *p) | ShellFolder |
ShellFolder(IShellFolder *parent, LPCITEMIDLIST pidl) | ShellFolder |
ShellFolder(LPCITEMIDLIST pidl) | ShellFolder |
SIfacePtr() | SIfacePtr< IShellFolder > | [inline]
SIfacePtr(IShellFolder *p) | SIfacePtr< IShellFolder > | [inline]
SIfacePtr(IUnknown *unknown, REFIID riid) | SIfacePtr< IShellFolder > | [inline]
SIfacePtr(const SIfacePtr &o) | SIfacePtr< IShellFolder > | [inline, protected]
super typedef | ShellFolder |
~SIfacePtr() | SIfacePtr< IShellFolder > | [inline]


ROS Explorer: DesktopFolderPath Struct Reference

DesktopFolderPath Struct Reference

Shell folder path of the desktop. More...

#include <shellclasses.h>

Inheritance diagram for DesktopFolderPath:

[legend]
Collaboration diagram for DesktopFolderPath:

[legend]
List of all members.

Public Member Functions

DesktopFolderPath ()

Detailed Description

Shell folder path of the desktop.

Definition at line 979 of file shellclasses.h.

Constructor & Destructor Documentation

DesktopFolderPath::DesktopFolderPath ( ) [inline]

Definition at line 981 of file shellclasses.h.

00982          :      SpecialFolderPath(CSIDL_DESKTOP, 0)
00983         {
00984         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

DesktopFolderPath Member List

This is the complete list of members for DesktopFolderPath, including all inherited members.

_malloc | SShellPtr< ITEMIDLIST > | [mutable, protected]
_p | SShellPtr< ITEMIDLIST > | [protected]
assign(LPCITEMIDLIST pidl, size_t size) | ShellPath | [inline]
assign(LPCITEMIDLIST pidl) | ShellPath | [inline]
create_absolute_pidl(LPCITEMIDLIST parent_pidl) const | ShellPath |
DesktopFolderPath() | DesktopFolderPath | [inline]
Free() | SShellPtr< ITEMIDLIST > | [inline, protected]
get_folder() | ShellPath | [inline]
get_folder(IShellFolder *parent) | ShellPath | [inline]
GetUIObjectOf(REFIID riid, LPVOID *ppvOut, HWND hWnd=0, ShellFolder &sf=GetDesktopFolder()) | ShellPath |
operator *() const | SShellPtr< ITEMIDLIST > | [inline]
operator *() | SShellPtr< ITEMIDLIST > | [inline]
operator ITEMIDLIST const *() const | SShellPtr< ITEMIDLIST > | [inline]
operator+=(const SHITEMID &o) | ShellPath | [inline]
operator->() | SShellPtr< ITEMIDLIST > | [inline]
operator->() const | SShellPtr< ITEMIDLIST > | [inline]
operator=(const ShellPath &o) | ShellPath | [inline]
operator=(ITEMIDLIST *p) | ShellPath | [inline]
operator=(const SHITEMID &o) | ShellPath | [inline]
ShellPath() | ShellPath | [inline]
ShellPath(IShellFolder *folder, LPCWSTR path) | ShellPath | [inline]
ShellPath(LPCWSTR path) | ShellPath | [inline]
ShellPath(IShellFolder *folder, LPCSTR path) | ShellPath | [inline]
ShellPath(LPCSTR path) | ShellPath | [inline]
ShellPath(const ShellPath &o) | ShellPath | [inline]
ShellPath(LPITEMIDLIST p) | ShellPath | [inline, explicit]
ShellPath(LPCITEMIDLIST p) | ShellPath | [inline]
SpecialFolderPath(int folder, HWND hwnd) | SpecialFolderPath | [inline]
split(ShellPath &parent, ShellPath &obj) const | ShellPath |
SShellPtr() | SShellPtr< ITEMIDLIST > | [inline, protected]
SShellPtr(ITEMIDLIST *p) | SShellPtr< ITEMIDLIST > | [inline, protected]
super typedef | ShellPath |
~SShellPtr() | SShellPtr< ITEMIDLIST > | [inline]


ROS Explorer: Desktops Struct Reference

Desktops Struct Reference

#include <globals.h>

Inheritance diagram for Desktops:

[legend]
Collaboration diagram for Desktops:

[legend]
List of all members.

Public Member Functions

Desktops ()
~Desktops ()
void | init ()
void | SwitchToDesktop (int idx)
void | ToggleMinimize ()
minimize/restore all windows on the desktop

Public Attributes

int | _current_desktop

Detailed Description

Definition at line 218 of file globals.h.

Constructor & Destructor Documentation

Desktops::Desktops ( )

Definition at line 66 of file desktop.cpp.

00067  :      _current_desktop(0)
00068 {
00069 }

Desktops::~Desktops ( )

Definition at line 71 of file desktop.cpp.

00072 {
00073          // show all hidden windows
00074         for(iterator it_dsk=begin(); it_dsk!=end(); ++it_dsk)
00075                 for(WindowSet::iterator it=it_dsk->_windows.begin(); it!=it_dsk->_windows.end(); ++it)
00076                         ShowWindowAsync(*it, SW_SHOW);
00077 }

Member Function Documentation

void Desktops::init ( )

Definition at line 79 of file desktop.cpp.

References DESKTOP_COUNT.

Referenced by _tWinMain().

00080 {
00081         resize(DESKTOP_COUNT);
00082
00083 #ifdef _USE_HDESK
00084         DesktopPtr& desktop = (*this)[0];
00085
00086         desktop = DesktopPtr(new Desktop(OpenInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP)));
00087 #endif
00088 }

void Desktops::SwitchToDesktop ( int idx )

Definition at line 165 of file desktop.cpp.

References _current_desktop, ExplorerGlobals::_hwndDesktopBar, Desktop::_hwndForeground, Desktop::_windows, g_Globals, HWND, and PM_GET_LAST_ACTIVE.

Referenced by DesktopBar::Command().

00166 {
00167         if (_current_desktop == idx)
00168                 return;
00169
00170         Desktop& old_desktop = (*this)[_current_desktop];
00171         WindowSet& windows = old_desktop._windows;
00172         Desktop& desktop = (*this)[idx];
00173
00174         windows.clear();
00175
00176          // collect window handles of all other desktops
00177         WindowSet other_wnds;
00178         for(const_iterator it1=begin(); it1!=end(); ++it1)
00179                 for(WindowSet::const_iterator it2=it1->_windows.begin(); it2!=it1->_windows.end(); ++it2)
00180                         other_wnds.insert(*it2);
00181
00182          // save currently visible application windows
00183         EnumWindows(SwitchDesktopEnumFct, (LPARAM)&windows);
00184
00185         old_desktop._hwndForeground = (HWND)SendMessage(g_Globals._hwndDesktopBar, PM_GET_LAST_ACTIVE, 0, 0);
00186
00187          // hide all windows of the previous desktop
00188         for(WindowSet::iterator it=windows.begin(); it!=windows.end(); ++it)
00189                 ShowWindowAsync(*it, SW_HIDE);
00190
00191          // show all windows of the new desktop
00192         for(WindowSet::iterator it=desktop._windows.begin(); it!=desktop._windows.end(); ++it)
00193                 ShowWindowAsync(*it, SW_SHOW);
00194
00195         if (desktop._hwndForeground)
00196                 SetForegroundWindow(desktop._hwndForeground);
00197
00198          // remove the window handles of the other desktops from what we found on the previous desktop
00199         for(WindowSet::const_iterator it=other_wnds.begin(); it!=other_wnds.end(); ++it)
00200                 windows.erase(*it);
00201
00202          // We don't need to store the window handles of what's now visible the now current desktop.
00203         desktop._windows.clear();
00204
00205         _current_desktop = idx;
00206 }

void Desktops::ToggleMinimize ( )

minimize/restore all windows on the desktop

Definition at line 231 of file desktop.cpp.

References _current_desktop.

Referenced by DesktopBar::Command().

00232 {
00233         list<MinimizeStruct>& minimized = (*this)[_current_desktop]._minimized;
00234
00235         if (minimized.empty()) {
00236                 EnumWindows(MinimizeDesktopEnumFct, (LPARAM)&minimized);
00237         } else {
00238                 for(list<MinimizeStruct>::const_iterator it=minimized.begin(); it!=minimized.end(); ++it)
00239                         ShowWindowAsync(it->first, it->second&WS_MAXIMIZE? SW_MAXIMIZE: SW_RESTORE);
00240
00241                 minimized.clear();
00242         }
00243 }

Member Data Documentation

int Desktops::_current_desktop

Definition at line 231 of file globals.h.

Referenced by QuickLaunchBar::AddShortcuts(), SwitchToDesktop(), and ToggleMinimize().

The documentation for this struct was generated from the following files:
  • globals.h
  • desktop.cpp


ROS Explorer: Member List

Desktops Member List

This is the complete list of members for Desktops, including all inherited members.

_current_desktop | Desktops
Desktops() | Desktops
init() | Desktops
SwitchToDesktop(int idx) | Desktops
ToggleMinimize() | Desktops
~Desktops() | Desktops


ROS Explorer: DesktopSettingsDlg Struct Reference

DesktopSettingsDlg Struct Reference

"Desktopbar Settings" Property Sheet Dialog More...

#include <settings.h>

Inheritance diagram for DesktopSettingsDlg:

[legend]
Collaboration diagram for DesktopSettingsDlg:

[legend]
List of all members.

Public Types

typedef OwnerDrawParent< PropSheetPageDlg > | super

Public Member Functions

DesktopSettingsDlg (HWND hwnd)

Protected Member Functions

virtual int | Command (int id, int code)
virtual int | Notify (int id, NMHDR *pnmh)

Protected Attributes

ResBitmap _bmp0
ResBitmap _bmp1
ResBitmap _bmp2
ResBitmap _bmp3
ResBitmap _bmp4
ResBitmap _bmp5
ResBitmap _bmp6
ResBitmap _bmp7
ResBitmap _bmp8
ResBitmap _bmp9
ResBitmap _bmp10
int | _alignment_cur
int | _alignment_tmp
int | _display_version_org

Detailed Description

"Desktopbar Settings" Property Sheet Dialog

Definition at line 35 of file settings.h.

Member Typedef Documentation

typedef OwnerDrawParent<PropSheetPageDlg> DesktopSettingsDlg::super

Reimplemented from OwnerDrawParent< PropSheetPageDlg >.

Definition at line 37 of file settings.h.

Constructor & Destructor Documentation

DesktopSettingsDlg::DesktopSettingsDlg ( HWND hwnd )

Definition at line 66 of file settings.cpp.

References _alignment_cur, _alignment_tmp, _bmp0, _bmp1, _bmp10, _bmp2, _bmp3, _bmp4, _bmp5, _bmp6, _bmp7, _bmp8, _bmp9, _display_version_org, WindowHandle::_hwnd, ExplorerGlobals::_hwndShellView, g_Globals, ID_DESKTOP_VERSION, IDC_ICON_ALIGN_0, IDC_ICON_ALIGN_1, IDC_ICON_ALIGN_10, IDC_ICON_ALIGN_2, IDC_ICON_ALIGN_3, IDC_ICON_ALIGN_4, IDC_ICON_ALIGN_5, IDC_ICON_ALIGN_6, IDC_ICON_ALIGN_7, IDC_ICON_ALIGN_8, IDC_ICON_ALIGN_9, PM_DISPLAY_VERSION, and PM_GET_ICON_ALGORITHM.

00067  :      super(hwnd),
00068         _bmp0(IDB_ICON_ALIGN_0),
00069         _bmp1(IDB_ICON_ALIGN_1),
00070         _bmp2(IDB_ICON_ALIGN_2),
00071         _bmp3(IDB_ICON_ALIGN_3),
00072         _bmp4(IDB_ICON_ALIGN_4),
00073         _bmp5(IDB_ICON_ALIGN_5),
00074         _bmp6(IDB_ICON_ALIGN_6),
00075         _bmp7(IDB_ICON_ALIGN_7),
00076         _bmp8(IDB_ICON_ALIGN_8),
00077         _bmp9(IDB_ICON_ALIGN_9),
00078         _bmp10(IDB_ICON_ALIGN_10)
00079 {
00080         new PictureButton(_hwnd, IDC_ICON_ALIGN_0, _bmp0);
00081         new PictureButton(_hwnd, IDC_ICON_ALIGN_1, _bmp1);
00082         new PictureButton(_hwnd, IDC_ICON_ALIGN_2, _bmp2);
00083         new PictureButton(_hwnd, IDC_ICON_ALIGN_3, _bmp3);
00084         new PictureButton(_hwnd, IDC_ICON_ALIGN_4, _bmp4);
00085         new PictureButton(_hwnd, IDC_ICON_ALIGN_5, _bmp5);
00086         new PictureButton(_hwnd, IDC_ICON_ALIGN_6, _bmp6);
00087         new PictureButton(_hwnd, IDC_ICON_ALIGN_7, _bmp7);
00088         new PictureButton(_hwnd, IDC_ICON_ALIGN_8, _bmp8);
00089         new PictureButton(_hwnd, IDC_ICON_ALIGN_9, _bmp9);
00090         new PictureButton(_hwnd, IDC_ICON_ALIGN_10, _bmp10);
00091
00092         _alignment_cur = SendMessage(g_Globals._hwndShellView, PM_GET_ICON_ALGORITHM, 0, 0);
00093         _alignment_tmp = _alignment_cur;
00094
00095         _display_version_org = SendMessage(g_Globals._hwndShellView, PM_DISPLAY_VERSION, 0, MAKELONG(0,0));
00096         CheckDlgButton(hwnd, ID_DESKTOP_VERSION, _display_version_org? BST_CHECKED: BST_UNCHECKED);
00097 }

Member Function Documentation

int DesktopSettingsDlg::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from PropSheetPageDlg.

Definition at line 128 of file settings.cpp.

References _alignment_tmp, WindowHandle::_hwnd, ExplorerGlobals::_hwndShellView, g_Globals, IDC_ICON_ALIGN_0, IDC_ICON_ALIGN_10, PM_DISPLAY_VERSION, and PM_SET_ICON_ALGORITHM.

00129 {
00130         if (id>=IDC_ICON_ALIGN_0 && id<=IDC_ICON_ALIGN_10) {
00131                 int alignment = id - IDC_ICON_ALIGN_0;
00132
00133                 if (alignment != _alignment_tmp) {
00134                         _alignment_tmp = alignment;
00135
00136                         PropSheet_Changed(GetParent(_hwnd), _hwnd);
00137
00138                         SendMessage(g_Globals._hwndShellView, PM_SET_ICON_ALGORITHM, alignment, 0);
00139                 }
00140
00141                 return 0;
00142         }
00143
00144         switch(id) {
00145           case ID_DESKTOP_VERSION:
00146                 SendMessage(g_Globals._hwndShellView, PM_DISPLAY_VERSION, 0, MAKELONG(0,1));    // toggle version display flag
00147                 PropSheet_Changed(GetParent(_hwnd), _hwnd);
00148                 break;
00149
00150           default:
00151                 return 1;
00152         }
00153
00154         return 0;
00155 }

int DesktopSettingsDlg::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 103 of file settings.cpp.

References _alignment_cur, _alignment_tmp, _display_version_org, WindowHandle::_hwnd, ExplorerGlobals::_hwndShellView, g_Globals, IDC_ICON_ALIGN_0, Window::Notify(), PM_DISPLAY_VERSION, and PM_SET_ICON_ALGORITHM.

00104 {
00105         switch(pnmh->code) {
00106           case PSN_QUERYINITIALFOCUS:
00107                 SetWindowLong(_hwnd, DWL_MSGRESULT, (LPARAM)GetDlgItem(_hwnd, IDC_ICON_ALIGN_0+_alignment_cur));
00108                 break;
00109
00110           case PSN_APPLY:
00111                 _alignment_cur = _alignment_tmp;
00112                 _display_version_org = SendMessage(g_Globals._hwndShellView, PM_DISPLAY_VERSION, 0, MAKELONG(0,0));
00113                 break;
00114
00115           case PSN_RESET:
00116                 if (_alignment_tmp != _alignment_cur)
00117                         SendMessage(g_Globals._hwndShellView, PM_SET_ICON_ALGORITHM, _alignment_cur, 0);
00118                 SendMessage(g_Globals._hwndShellView, PM_DISPLAY_VERSION, _display_version_org, MAKELONG(1,0));
00119                 break;
00120
00121           default:
00122                 return super::Notify(id, pnmh);
00123         }
00124
00125         return 0;
00126 }

Here is the call graph for this function:

Member Data Documentation

int DesktopSettingsDlg::_alignment_cur [protected]

Definition at line 54 of file settings.h.

Referenced by DesktopSettingsDlg(), and Notify().

int DesktopSettingsDlg::_alignment_tmp [protected]

Definition at line 55 of file settings.h.

Referenced by Command(), DesktopSettingsDlg(), and Notify().

ResBitmap DesktopSettingsDlg::_bmp0 [protected]

Definition at line 42 of file settings.h.

Referenced by DesktopSettingsDlg().

ResBitmap DesktopSettingsDlg::_bmp1 [protected]

Definition at line 43 of file settings.h.

Referenced by DesktopSettingsDlg().

ResBitmap DesktopSettingsDlg::_bmp10 [protected]

Definition at line 52 of file settings.h.

Referenced by DesktopSettingsDlg().

ResBitmap DesktopSettingsDlg::_bmp2 [protected]

Definition at line 44 of file settings.h.

Referenced by DesktopSettingsDlg().

ResBitmap DesktopSettingsDlg::_bmp3 [protected]

Definition at line 45 of file settings.h.

Referenced by DesktopSettingsDlg().

ResBitmap DesktopSettingsDlg::_bmp4 [protected]

Definition at line 46 of file settings.h.

Referenced by DesktopSettingsDlg().

ResBitmap DesktopSettingsDlg::_bmp5 [protected]

Definition at line 47 of file settings.h.

Referenced by DesktopSettingsDlg().

ResBitmap DesktopSettingsDlg::_bmp6 [protected]

Definition at line 48 of file settings.h.

Referenced by DesktopSettingsDlg().

ResBitmap DesktopSettingsDlg::_bmp7 [protected]

Definition at line 49 of file settings.h.

Referenced by DesktopSettingsDlg().

ResBitmap DesktopSettingsDlg::_bmp8 [protected]

Definition at line 50 of file settings.h.

Referenced by DesktopSettingsDlg().

ResBitmap DesktopSettingsDlg::_bmp9 [protected]

Definition at line 51 of file settings.h.

Referenced by DesktopSettingsDlg().

int DesktopSettingsDlg::_display_version_org [protected]

Definition at line 57 of file settings.h.

Referenced by DesktopSettingsDlg(), and Notify().

The documentation for this struct was generated from the following files:
  • settings.h
  • settings.cpp


ROS Explorer: Member List

DesktopSettingsDlg Member List

This is the complete list of members for DesktopSettingsDlg, including all inherited members.

_alignment_cur | DesktopSettingsDlg | [protected]
_alignment_tmp | DesktopSettingsDlg | [protected]
_bmp0 | DesktopSettingsDlg | [protected]
_bmp1 | DesktopSettingsDlg | [protected]
_bmp10 | DesktopSettingsDlg | [protected]
_bmp2 | DesktopSettingsDlg | [protected]
_bmp3 | DesktopSettingsDlg | [protected]
_bmp4 | DesktopSettingsDlg | [protected]
_bmp5 | DesktopSettingsDlg | [protected]
_bmp6 | DesktopSettingsDlg | [protected]
_bmp7 | DesktopSettingsDlg | [protected]
_bmp8 | DesktopSettingsDlg | [protected]
_bmp9 | DesktopSettingsDlg | [protected]
_display_version_org | DesktopSettingsDlg | [protected]
_hwnd | WindowHandle | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | DesktopSettingsDlg | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DesktopSettingsDlg(HWND hwnd) | DesktopSettingsDlg |
Dialog(HWND) | Dialog |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | PropSheetPageDlg | [protected, static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0) | Dialog | [static]
DoModal(UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0) | Dialog | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | DesktopSettingsDlg | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< PropSheetPageDlg > | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropertySheetDialog | PropSheetPageDlg | [friend]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
PropSheetPage | PropSheetPageDlg | [friend]
PropSheetPageDlg(HWND) | PropSheetPageDlg |
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | DesktopSettingsDlg |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | OwnerDrawParent< PropSheetPageDlg > | [inline, virtual]
~Dialog() | Dialog |
~Window() | Window | [virtual]


ROS Explorer: DesktopShellView Struct Reference

DesktopShellView Struct Reference

subclassed ShellView window More...

#include <desktop.h>

Inheritance diagram for DesktopShellView:

[legend]
Collaboration diagram for DesktopShellView:

[legend]
List of all members.

Public Types

typedef ExtContextMenuHandlerT<
SubclassedWindow > 		super

Public Member Functions

DesktopShellView (HWND hwnd, IShellView *pShellView)
bool | InitDragDrop ()

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Command (int id, int code)
int | Notify (int id, NMHDR *pnmh)
bool | DoContextMenu (int x, int y)
HRESULT | DoDesktopContextMenu (int x, int y)
void | PositionIcons (int dir=1)

Protected Attributes

IShellView * | _pShellView
DesktopDropTarget * _pDropTarget
HWND _hwndListView
int | _icon_algo

Detailed Description

subclassed ShellView window

Definition at line 168 of file desktop.h.

Member Typedef Documentation

typedef ExtContextMenuHandlerT<SubclassedWindow> DesktopShellView::super

Reimplemented from ExtContextMenuHandlerT< SubclassedWindow >.

Definition at line 170 of file desktop.h.

Constructor & Destructor Documentation

DesktopShellView::DesktopShellView | ( | HWND | hwnd,
 |  | IShellView * | pShellView
 | ) |

Definition at line 479 of file desktop.cpp.

References _hwndListView, _icon_algo, InitDragDrop(), PositionIcons(), and SetWindowStyle.

00480  :      super(hwnd),
00481         _pShellView(pShellView)
00482 {
00483         _hwndListView = ::GetNextWindow(hwnd, GW_CHILD);
00484
00485         SetWindowStyle(_hwndListView, GetWindowStyle(_hwndListView)&~LVS_ALIGNMASK);//|LVS_ALIGNTOP|LVS_AUTOARRANGE);
00486
00487          // work around for Windows NT, Win 98, ...
00488          // Without this the desktop has mysteriously only a size of 800x600 pixels.
00489         ClientRect rect(hwnd);
00490         MoveWindow(_hwndListView, 0, 0, rect.right, rect.bottom, TRUE);
00491
00492          // subclass background window
00493         new BackgroundWindow(_hwndListView);
00494
00495         _icon_algo = 1; // default icon arrangement
00496
00497         PositionIcons();
00498         InitDragDrop();
00499 }

Here is the call graph for this function:

Member Function Documentation

int DesktopShellView::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from SubclassedWindow.

Definition at line 558 of file desktop.cpp.

References SubclassedWindow::Command().

00559 {
00560         return super::Command(id, code);
00561 }

Here is the call graph for this function:

bool DesktopShellView::DoContextMenu | ( | int | x,
 |  | int | y
 | ) | [protected]

Definition at line 568 of file desktop.cpp.

References ExtContextMenuHandlerT< SubclassedWindow >::_cm_ifs, WindowHandle::_hwnd, _pShellView, CHECKERROR, PIDList::GetData(), and ShellFolderContextMenu().

Referenced by WndProc().

00569 {
00570         IDataObject* selection;
00571
00572         HRESULT hr = _pShellView->GetItemObject(SVGIO_SELECTION, IID_IDataObject, (void**)&selection);
00573         if (FAILED(hr))
00574                 return false;
00575
00576         PIDList pidList;
00577
00578         hr = pidList.GetData(selection);
00579         if (FAILED(hr)) {
00580                 selection->Release();
00581                 //CHECKERROR(hr);
00582                 return false;
00583         }
00584
00585         LPIDA pida = pidList;
00586         if (!pida->cidl) {
00587                 selection->Release();
00588                 return false;
00589         }
00590
00591         LPCITEMIDLIST parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
00592
00593         LPCITEMIDLIST* apidl = (LPCITEMIDLIST*) alloca(pida->cidl*sizeof(LPCITEMIDLIST));
00594
00595         for(int i=pida->cidl; i>0; --i)
00596                 apidl[i-1] = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i]);
00597
00598         hr = ShellFolderContextMenu(ShellFolder(parent_pidl), _hwnd, pida->cidl, apidl, x, y, _cm_ifs);
00599
00600         selection->Release();
00601
00602         CHECKERROR(hr);
00603
00604         return true;
00605 }

Here is the call graph for this function:

HRESULT DesktopShellView::DoDesktopContextMenu | ( | int | x,
 |  | int | y
 | ) | [protected]

Definition at line 607 of file desktop.cpp.

References ExtContextMenuHandlerT< SubclassedWindow >::_cm_ifs, WindowHandle::_hwnd, explorer_about(), IDS_ABOUT_EXPLORER, CtxMenuInterfaces::query_interfaces(), and CtxMenuInterfaces::reset().

Referenced by WndProc().

00608 {
00609         IContextMenu* pcm;
00610
00611         HRESULT hr = DesktopFolder()->GetUIObjectOf(_hwnd, 0, NULL, IID_IContextMenu, NULL, (LPVOID*)&pcm);
00612
00613         if (SUCCEEDED(hr)) {
00614                 pcm = _cm_ifs.query_interfaces(pcm);
00615
00616                 HMENU hmenu = CreatePopupMenu();
00617
00618                 if (hmenu) {
00619                         hr = pcm->QueryContextMenu(hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST-1, CMF_NORMAL|CMF_EXPLORE);
00620
00621                         if (SUCCEEDED(hr)) {
00622                                 AppendMenu(hmenu, MF_SEPARATOR, 0, NULL);
00623                                 AppendMenu(hmenu, 0, FCIDM_SHVIEWLAST-1, ResString(IDS_ABOUT_EXPLORER));
00624
00625                                 UINT idCmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN|TPM_RETURNCMD|TPM_RIGHTBUTTON, x, y, 0, _hwnd, NULL);
00626
00627                                 _cm_ifs.reset();
00628
00629                                 if (idCmd == FCIDM_SHVIEWLAST-1) {
00630                                         explorer_about(_hwnd);
00631                                 } else if (idCmd) {
00632                                   CMINVOKECOMMANDINFO cmi;
00633
00634                                   cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
00635                                   cmi.fMask = 0;
00636                                   cmi.hwnd = _hwnd;
00637                                   cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - FCIDM_SHVIEWFIRST);
00638                                   cmi.lpParameters = NULL;
00639                                   cmi.lpDirectory = NULL;
00640                                   cmi.nShow = SW_SHOWNORMAL;
00641                                   cmi.dwHotKey = 0;
00642                                   cmi.hIcon = 0;
00643
00644                                   hr = pcm->InvokeCommand(&cmi);
00645                                 }
00646                         } else
00647                                 _cm_ifs.reset();
00648                 }
00649
00650                 pcm->Release();
00651         }
00652
00653         return hr;
00654 }

Here is the call graph for this function:

bool DesktopShellView::InitDragDrop ( )

Definition at line 501 of file desktop.cpp.

References WindowHandle::_hwnd, _pDropTarget, IDropTargetImpl::AddRef(), IDropTargetImpl::AddSuportedFormat(), CONTEXT, and IDropTargetImpl::Release().

Referenced by DesktopShellView().

00502 {
00503         CONTEXT("DesktopShellView::InitDragDrop()");
00504
00505         _pDropTarget = new DesktopDropTarget(_hwnd);
00506
00507         if (!_pDropTarget)
00508                 return false;
00509
00510         _pDropTarget->AddRef();
00511
00512         if (FAILED(RegisterDragDrop(_hwnd, _pDropTarget))) {
00513                 _pDropTarget->Release();
00514                 _pDropTarget = NULL;
00515                 return false;
00516         }
00517         else
00518                 _pDropTarget->Release();
00519
00520         FORMATETC ftetc;
00521
00522         ftetc.dwAspect = DVASPECT_CONTENT;
00523         ftetc.lindex = -1;
00524         ftetc.tymed = TYMED_HGLOBAL;
00525         ftetc.cfFormat = CF_HDROP;
00526
00527         _pDropTarget->AddSuportedFormat(ftetc);
00528
00529         return true;
00530 }

Here is the call graph for this function:

int DesktopShellView::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from SubclassedWindow.

Definition at line 563 of file desktop.cpp.

References SubclassedWindow::Notify().

00564 {
00565         return super::Notify(id, pnmh);
00566 }

Here is the call graph for this function:

void DesktopShellView::PositionIcons ( int dir = 1 ) [protected]

Todo:

Definition at line 709 of file desktop.cpp.

References _hwndListView, _icon_algo, ARRANGE_BORDER_DOWN, ARRANGE_BORDER_HV, and ARRANGE_ROUNDABOUT.

Referenced by DesktopShellView(), and WndProc().

00710 {
00711         DWORD spacing = ListView_GetItemSpacing(_hwndListView, FALSE);
00712
00713         RECT work_area;
00714         SystemParametersInfo(SPI_GETWORKAREA, 0, &work_area, 0);
00715
00716         const POINTS& dir1 = s_align_dir1[_icon_algo];
00717         const POINTS& dir2 = s_align_dir2[_icon_algo];
00718         const POINTS& start_pos = s_align_start[_icon_algo];
00719
00720         int dir_x1 = dir1.x;
00721         int dir_y1 = dir1.y;
00722         int dir_x2 = dir2.x;
00723         int dir_y2 = dir2.y;
00724
00725         int cx = LOWORD(spacing);
00726         int cy = HIWORD(spacing);
00727
00728         int dx1 = dir_x1 * cx;
00729         int dy1 = dir_y1 * cy;
00730         int dx2 = dir_x2 * cx;
00731         int dy2 = dir_y2 * cy;
00732
00733         int xoffset = (cx-32)/2;
00734         int yoffset = 4/*(cy-32)/2*/;
00735
00736         int start_x = start_pos.x * (work_area.right - cx) + xoffset;
00737         int start_y = start_pos.y * (work_area.bottom - cy) + yoffset;
00738
00739         int x = start_x;
00740         int y = start_y;
00741
00742         int all = ListView_GetItemCount(_hwndListView);
00743         int i1, i2;
00744
00745         if (dir > 0) {
00746                 i1 = 0;
00747                 i2 = all;
00748         } else {
00749                 i1 = all-1;
00750                 i2 = -1;
00751         }
00752
00753         IconMap pos_idx;
00754         int cnt = 0;
00755         int xhv = start_x;
00756         int yhv = start_y;
00757
00758         for(int idx=i1; idx!=i2; idx+=dir) {
00759                 pos_idx[IconPos(y, x)] = idx;
00760
00761                 if (_icon_algo == ARRANGE_BORDER_DOWN) {
00762                         if (++cnt & 1)
00763                                 x = work_area.right - x - cx + 2*xoffset;
00764                         else {
00765                                 y += dy1;
00766
00767                                 if (y + cy - 2 * yoffset > work_area.bottom) {
00768                                         y = start_y;
00769                                         start_x += dx2;
00770                                         x = start_x;
00771                                 }
00772                         }
00773
00774                         continue;
00775                 }
00776                 else if (_icon_algo == ARRANGE_BORDER_HV) {
00777                         if (++cnt & 1)
00778                                 x = work_area.right - x - cx + 2*xoffset;
00779                         else if (cnt & 2) {
00780                                 yhv += cy;
00781                                 y = yhv;
00782                                 x = start_x;
00783
00784                                 if (y + cy - 2 * yoffset > work_area.bottom) {
00785                                         start_x += cx;
00786                                         xhv = start_x;
00787                                         x = xhv;
00788                                         start_y += cy;
00789                                         yhv = start_y;
00790                                         y = yhv;
00791                                 }
00792                         } else {
00793                                 xhv += cx;
00794                                 x = xhv;
00795                                 y = start_y;
00796
00797                                 if (x + cx - 2 * xoffset > work_area.right) {
00798                                         start_x += cx;
00799                                         xhv = start_x;
00800                                         x = xhv;
00801                                         start_y += cy;
00802                                         yhv = start_y;
00803                                         y = yhv;
00804                                 }
00805                         }
00806
00807                         continue;
00808                 }
00809                 else if (_icon_algo == ARRANGE_ROUNDABOUT) {
00810
00812
00813                 }
00814
00815                 x += dx1;
00816                 y += dy1;
00817
00818                 if (x<0 || x+cx-2*xoffset>work_area.right) {
00819                         x = start_x;
00820                         y += dy2;
00821                 } else if (y<0 || y+cy-2*yoffset>work_area.bottom) {
00822                         y = start_y;
00823                         x += dx2;
00824                 }
00825         }
00826
00827          // use a little trick to get the icons where we want them to be...
00828
00829         for(IconMap::const_iterator it=pos_idx.end(); --it!=pos_idx.begin(); ) {
00830                 const IconPos& pos = it->first;
00831
00832                 ListView_SetItemPosition32(_hwndListView, it->second, pos.second, pos.first);
00833         }
00834
00835         for(IconMap::const_iterator it=pos_idx.begin(); it!=pos_idx.end(); ++it) {
00836                 const IconPos& pos = it->first;
00837
00838                 ListView_SetItemPosition32(_hwndListView, it->second, pos.second, pos.first);
00839         }
00840 }

LRESULT DesktopShellView::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from ExtContextMenuHandlerT< SubclassedWindow >.

Definition at line 532 of file desktop.cpp.

References _hwndListView, _icon_algo, DoContextMenu(), DoDesktopContextMenu(), PM_DISPLAY_VERSION, PM_GET_ICON_ALGORITHM, PM_SET_ICON_ALGORITHM, PositionIcons(), and ExtContextMenuHandlerT< SubclassedWindow >::WndProc().

00533 {
00534         switch(nmsg) {
00535           case WM_CONTEXTMENU:
00536                 if (!DoContextMenu(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)))
00537                         DoDesktopContextMenu(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
00538                 break;
00539
00540           case PM_SET_ICON_ALGORITHM:
00541                 _icon_algo = wparam;
00542                 PositionIcons();
00543                 break;
00544
00545           case PM_GET_ICON_ALGORITHM:
00546                 return _icon_algo;
00547
00548           case PM_DISPLAY_VERSION:
00549                 return SendMessage(_hwndListView, nmsg, wparam, lparam);
00550
00551           default:
00552                 return super::WndProc(nmsg, wparam, lparam);
00553         }
00554
00555         return 0;
00556 }

Here is the call graph for this function:

Member Data Documentation

HWND DesktopShellView::_hwndListView [protected]

Definition at line 188 of file desktop.h.

Referenced by DesktopShellView(), PositionIcons(), and WndProc().

int DesktopShellView::_icon_algo [protected]

Definition at line 189 of file desktop.h.

Referenced by DesktopShellView(), PositionIcons(), and WndProc().

DesktopDropTarget* DesktopShellView::_pDropTarget [protected]

Definition at line 187 of file desktop.h.

Referenced by InitDragDrop().

IShellView* DesktopShellView::_pShellView [protected]

Definition at line 177 of file desktop.h.

Referenced by DoContextMenu().

The documentation for this struct was generated from the following files:
  • desktop.h
  • desktop.cpp


ROS Explorer: Member List

DesktopShellView Member List

This is the complete list of members for DesktopShellView, including all inherited members.

_cm_ifs | ExtContextMenuHandlerT< SubclassedWindow > | [protected]
_hwnd | WindowHandle | [protected]
_hwndListView | DesktopShellView | [protected]
_icon_algo | DesktopShellView | [protected]
_orgWndProc | SubclassedWindow | [protected]
_pDropTarget | DesktopShellView | [protected]
_pShellView | DesktopShellView | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | DesktopShellView | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DesktopShellView(HWND hwnd, IShellView *pShellView) | DesktopShellView |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DoContextMenu(int x, int y) | DesktopShellView | [protected]
DoDesktopContextMenu(int x, int y) | DesktopShellView | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< SubclassedWindow > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< SubclassedWindow > | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
InitDragDrop() | DesktopShellView |
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | DesktopShellView | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PositionIcons(int dir=1) | DesktopShellView | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | DesktopShellView |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | DesktopShellView | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: DesktopWindow Struct Reference

DesktopWindow Struct Reference

Implementation of the Explorer desktop window. More...

#include <desktop.h>

Inheritance diagram for DesktopWindow:

[legend]
Collaboration diagram for DesktopWindow:

[legend]
List of all members.

Public Types

typedef Window | super

Public Member Functions

DesktopWindow (HWND hwnd)
~DesktopWindow ()
virtual HRESULT STDMETHODCALLTYPE | GetWindow (HWND *lphwnd)
virtual HRESULT STDMETHODCALLTYPE | QueryActiveShellView (IShellView **ppshv)
virtual HRESULT STDMETHODCALLTYPE | GetControlWindow (UINT id, HWND *lphwnd)
virtual HRESULT STDMETHODCALLTYPE | SendControlMsg (UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret)

Static Public Member Functions

static HWND | Create ()

Protected Member Functions

LRESULT | Init (LPCREATESTRUCT pcs)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual HRESULT | OnDefaultCommand (LPIDA pida)

Protected Attributes

IShellView * | _pShellView
WindowHandle _desktopBar

Detailed Description

Implementation of the Explorer desktop window.

Definition at line 51 of file desktop.h.

Member Typedef Documentation

typedef Window DesktopWindow::super

Definition at line 53 of file desktop.h.

Constructor & Destructor Documentation

DesktopWindow::DesktopWindow ( HWND hwnd )

Definition at line 311 of file desktop.cpp.

References _pShellView.

00312  :      super(hwnd)
00313 {
00314         _pShellView = NULL;
00315 }

DesktopWindow::~DesktopWindow ( )

Definition at line 317 of file desktop.cpp.

References _pShellView.

00318 {
00319         if (_pShellView)
00320                 _pShellView->Release();
00321 }

Member Function Documentation

HWND DesktopWindow::Create ( ) [static]

Definition at line 324 of file desktop.cpp.

References _desktopBar, Window::Create(), GET_WINDOW, HWND, IDI_REACTOS, and WINDOW_CREATOR.

Referenced by _tWinMain().

00325 {
00326         static IconWindowClass wcDesktop(TEXT("Progman"), IDI_REACTOS, CS_DBLCLKS);
00327         /* (disabled because of small ugly temporary artefacts when hiding start menu)
00328         wcDesktop.hbrBackground = (HBRUSH)(COLOR_BACKGROUND+1); */
00329
00330         int width = GetSystemMetrics(SM_CXSCREEN);
00331         int height = GetSystemMetrics(SM_CYSCREEN);
00332
00333         HWND hwndDesktop = Window::Create(WINDOW_CREATOR(DesktopWindow),
00334                                         WS_EX_TOOLWINDOW, wcDesktop, TEXT("Program Manager"), WS_POPUP|WS_VISIBLE,      //|WS_CLIPCHILDREN for SDI frames
00335                                         0, 0, width, height, 0);
00336
00337          // work around to display desktop bar in Wine
00338         ShowWindow(GET_WINDOW(DesktopWindow, hwndDesktop)->_desktopBar, SW_SHOW);
00339
00340          // work around for Windows NT, Win 98, ...
00341          // Without this the desktop has mysteriously only a size of 800x600 pixels.
00342         MoveWindow(hwndDesktop, 0, 0, width, height, TRUE);
00343
00344         return hwndDesktop;
00345 }

Here is the call graph for this function:

virtual HRESULT STDMETHODCALLTYPE DesktopWindow::GetControlWindow | ( | UINT | id,
 |  | HWND * | lphwnd
 | ) | [inline, virtual]

Definition at line 73 of file desktop.h.

00074         {
00075                 return E_NOTIMPL;
00076         }

virtual HRESULT STDMETHODCALLTYPE DesktopWindow::GetWindow ( HWND * lphwnd ) [inline, virtual]

Definition at line 60 of file desktop.h.

References WindowHandle::_hwnd.

00061         {
00062                 *lphwnd = _hwnd;
00063                 return S_OK;
00064         }

LRESULT DesktopWindow::Init ( LPCREATESTRUCT pcs ) [protected, virtual]

Todo:
use IShellBrowser::GetViewStateStream() to restore previous view state -> see SHOpenRegStream()

Reimplemented from Window.

Definition at line 348 of file desktop.cpp.

References _desktopBar, WindowHandle::_hwnd, ExplorerGlobals::_hwndDesktopBar, ExplorerGlobals::_hwndShellView, _pShellView, DesktopBar::Create(), g_Globals, GetDesktopFolder(), HWND, and Window::Init().

00349 {
00350         if (super::Init(pcs))
00351                 return 1;
00352
00353         HRESULT hr = GetDesktopFolder()->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView);
00354 /* also possible:
00355         SFV_CREATE sfv_create;
00356
00357         sfv_create.cbSize = sizeof(SFV_CREATE);
00358         sfv_create.pshf = GetDesktopFolder();
00359         sfv_create.psvOuter = NULL;
00360         sfv_create.psfvcb = NULL;
00361
00362         HRESULT hr = SHCreateShellFolderView(&sfv_create, &_pShellView);
00363 */
00364         HWND hWndView = 0;
00365
00366         if (SUCCEEDED(hr)) {
00367                 FOLDERSETTINGS fs;
00368
00369                 fs.ViewMode = FVM_ICON;
00370                 fs.fFlags = FWF_DESKTOP|FWF_NOCLIENTEDGE|FWF_NOSCROLL|FWF_BESTFITWINDOW|FWF_SNAPTOGRID; //|FWF_AUTOARRANGE;
00371
00372                 ClientRect rect(_hwnd);
00373
00374                 hr = _pShellView->CreateViewWindow(NULL, &fs, this, &rect, &hWndView);
00375
00377
00378                 if (SUCCEEDED(hr)) {
00379                         g_Globals._hwndShellView = hWndView;
00380
00381                          // subclass shellview window
00382                         new DesktopShellView(hWndView, _pShellView);
00383
00384                         _pShellView->UIActivate(SVUIA_ACTIVATE_FOCUS);
00385
00386                 /*
00387                         IShellView2* pShellView2;
00388
00389                         hr = _pShellView->QueryInterface(IID_IShellView2, (void**)&pShellView2);
00390
00391                         SV2CVW2_PARAMS params;
00392                         params.cbSize = sizeof(SV2CVW2_PARAMS);
00393                         params.psvPrev = _pShellView;
00394                         params.pfs = &fs;
00395                         params.psbOwner = this;
00396                         params.prcView = &rect;
00397                         params.pvid = params.pvid;//@@
00398
00399                         hr = pShellView2->CreateViewWindow2(&params);
00400                         params.pvid;
00401                 */
00402
00403                 /*
00404                         IFolderView* pFolderView;
00405
00406                         hr = _pShellView->QueryInterface(IID_IFolderView, (void**)&pFolderView);
00407
00408                         if (SUCCEEDED(hr)) {
00409                                 hr = pFolderView->GetAutoArrange();
00410                                 hr = pFolderView->SetCurrentViewMode(FVM_DETAILS);
00411                         }
00412                 */
00413                 }
00414         }
00415
00416         if (hWndView && SetShellWindowEx)
00417                 SetShellWindowEx(_hwnd, hWndView);
00418         else if (SetShellWindow)
00419                 SetShellWindow(_hwnd);
00420
00421          // create the explorer bar
00422         _desktopBar = DesktopBar::Create();
00423         g_Globals._hwndDesktopBar = _desktopBar;
00424
00425         return 0;
00426 }

Here is the call graph for this function:

HRESULT DesktopWindow::OnDefaultCommand ( LPIDA pida ) [protected, virtual]

Reimplemented from IShellBrowserImpl.

Definition at line 468 of file desktop.cpp.

References MainFrameBase::OpenShellFolders().

00469 {
00470 #ifndef ROSSHELL        // in shell-only-mode fall through and let shell32 handle the command
00471         if (MainFrameBase::OpenShellFolders(pida, 0))
00472                 return S_OK;
00473 #endif
00474
00475         return E_NOTIMPL;
00476 }

Here is the call graph for this function:

virtual HRESULT STDMETHODCALLTYPE DesktopWindow::QueryActiveShellView ( IShellView ** ppshv ) [inline, virtual]

Definition at line 66 of file desktop.h.

References _pShellView.

00067         {
00068                 _pShellView->AddRef();
00069                 *ppshv = _pShellView;
00070                 return S_OK;
00071         }

virtual HRESULT STDMETHODCALLTYPE DesktopWindow::SendControlMsg | ( | UINT | id,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam,
 |  | LRESULT * | pret
 | ) | [inline, virtual]

Definition at line 78 of file desktop.h.

00079         {
00080                 return E_NOTIMPL;
00081         }

LRESULT DesktopWindow::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:
use IShellBrowser::GetViewStateStream() and _pShellView->SaveViewState() to store view state

Reimplemented from Window.

Definition at line 429 of file desktop.cpp.

References _desktopBar, WindowHandle::_hwnd, explorer_show_frame(), ShowExitWindowsDialog(), WM_GETISHELLBROWSER, and Window::WndProc().

00430 {
00431         switch(nmsg) {
00432           case WM_LBUTTONDBLCLK:
00433           case WM_RBUTTONDBLCLK:
00434           case WM_MBUTTONDBLCLK:
00435                 explorer_show_frame(SW_SHOWNORMAL);
00436                 break;
00437
00438           case WM_GETISHELLBROWSER:
00439                 return (LRESULT)static_cast<IShellBrowser*>(this);
00440
00441           case WM_DESTROY:
00442
00444
00445                 if (SetShellWindow)
00446                         SetShellWindow(0);
00447                 break;
00448
00449           case WM_CLOSE:
00450                 ShowExitWindowsDialog(_hwnd);
00451                 break;
00452
00453           case WM_SYSCOMMAND:
00454                 if (wparam == SC_TASKLIST) {
00455                         if (_desktopBar)
00456                                 SendMessage(_desktopBar, nmsg, wparam, lparam);
00457                 }
00458                 goto def;
00459
00460           default: def:
00461                 return super::WndProc(nmsg, wparam, lparam);
00462         }
00463
00464         return 0;
00465 }

Here is the call graph for this function:

Member Data Documentation

WindowHandle DesktopWindow::_desktopBar [protected]

Definition at line 88 of file desktop.h.

Referenced by Create(), Init(), and WndProc().

IShellView* DesktopWindow::_pShellView [protected]

Definition at line 87 of file desktop.h.

Referenced by DesktopWindow(), Init(), QueryActiveShellView(), and ~DesktopWindow().

The documentation for this struct was generated from the following files:
  • desktop.h
  • desktop.cpp


ROS Explorer: Member List

DesktopWindow Member List

This is the complete list of members for DesktopWindow, including all inherited members.

_desktopBar | DesktopWindow | [protected]
_dwRef | IShellBrowserImpl | [protected]
_hwnd | WindowHandle | [protected]
_pShellView | DesktopWindow | [protected]
AddRef() | IShellBrowserImpl | [inline, virtual]
BrowseObject(LPCITEMIDLIST pidl, UINT wFlags) | IShellBrowserImpl | [inline, virtual]
CancelModes() | Window | [static]
Command(int id, int code) | Window | [protected, virtual]
ContextSensitiveHelp(BOOL fEnterMode) | IShellBrowserImpl | [inline, virtual]
Create() | DesktopWindow | [static]
Window::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Window::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DesktopWindow(HWND hwnd) | DesktopWindow |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
EnableModelessSB(BOOL fEnable) | IShellBrowserImpl | [inline, virtual]
Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) | IShellBrowserImpl | [virtual]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetControlWindow(UINT id, HWND *lphwnd) | DesktopWindow | [inline, virtual]
GetStaticWindowData() | Window | [protected, static]
GetViewStateStream(DWORD grfMode, LPSTREAM *ppStrm) | IShellBrowserImpl | [inline, virtual]
GetWindow(HWND *lphwnd) | DesktopWindow | [inline, virtual]
IncludeObject(IShellView *ppshv, LPCITEMIDLIST pidl) | IShellBrowserImpl | [inline, virtual]
Init(LPCREATESTRUCT pcs) | DesktopWindow | [protected, virtual]
InsertMenusSB(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) | IShellBrowserImpl | [inline, virtual]
IShellBrowserImpl() | IShellBrowserImpl | [inline]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
OnDefaultCommand(LPIDA pida) | DesktopWindow | [protected, virtual]
IShellBrowserImpl::OnDefaultCommand(IShellView *ppshv) | IShellBrowserImpl | [virtual]
OnStateChange(IShellView *ppshv, ULONG uChange) | IShellBrowserImpl | [inline, virtual]
OnViewWindowActive(IShellView *ppshv) | IShellBrowserImpl | [inline, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
QueryActiveShellView(IShellView **ppshv) | DesktopWindow | [inline, virtual]
QueryInterface(REFIID iid, void **ppvObject) | IShellBrowserImpl | [virtual]
QueryService(REFGUID guidService, REFIID riid, void **ppvObject) | IShellBrowserImpl | [virtual]
QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) | IShellBrowserImpl | [virtual]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
Release() | IShellBrowserImpl | [inline, virtual]
RemoveMenusSB(HMENU hmenuShared) | IShellBrowserImpl | [inline, virtual]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendControlMsg(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret) | DesktopWindow | [inline, virtual]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SetMenuSB(HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject) | IShellBrowserImpl | [inline, virtual]
SetStatusTextSB(LPCOLESTR lpszStatusText) | IShellBrowserImpl | [inline, virtual]
SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) | IShellBrowserImpl | [inline, virtual]
super typedef | DesktopWindow |
TranslateAcceleratorSB(LPMSG lpmsg, WORD wID) | IShellBrowserImpl | [inline, virtual]
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | DesktopWindow | [protected, virtual]
~DesktopWindow() | DesktopWindow |
~IShellBrowserImpl() | IShellBrowserImpl | [inline, virtual]
~Window() | Window | [virtual]


ROS Explorer: Dialog Struct Reference

Dialog Struct Reference

The class Dialog implements modal dialogs. More...

#include <window.h>

Inheritance diagram for Dialog:

[legend]
Collaboration diagram for Dialog:

[legend]
List of all members.

Public Types

typedef Window | super

Public Member Functions

Dialog (HWND)
~Dialog ()

Static Public Member Functions

static int | DoModal (UINT nid, CREATORFUNC creator, HWND hwndParent=0)
static int | DoModal (UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Command (int id, int code)

Detailed Description

The class Dialog implements modal dialogs.

A Dialog object should be constructed by calling Dialog::DoModal() and specifying the class using the WINDOW_CREATOR() macro.

Definition at line 370 of file window.h.

Member Typedef Documentation

typedef Window Dialog::super

Reimplemented in ExplorerAboutDlg, FindProgramDlg, DesktopSettingsDlg, TaskbarSettingsDlg, StartmenuSettingsDlg, MdiSdiDlg, TrayNotifyDlg, PropSheetPageDlg, ResizeController< Dialog >, CtlColorParent< OwnerDrawParent< Dialog > >, OwnerDrawParent< PropSheetPageDlg >, and OwnerDrawParent< Dialog >.

Definition at line 372 of file window.h.

Constructor & Destructor Documentation

Dialog::Dialog ( HWND )

Definition at line 677 of file window.cpp.

References Window::register_dialog().

00678  :      super(hwnd)
00679 {
00680         register_dialog(hwnd);
00681 }

Here is the call graph for this function:

Dialog::~Dialog ( )

Definition at line 683 of file window.cpp.

References WindowHandle::_hwnd, and Window::unregister_dialog().

00684 {
00685         unregister_dialog(_hwnd);
00686 }

Here is the call graph for this function:

Member Function Documentation

int Dialog::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Window.

Reimplemented in FindProgramDlg, DesktopSettingsDlg, TaskbarSettingsDlg, StartmenuSettingsDlg, MdiSdiDlg, TrayNotifyDlg, and PropSheetPageDlg.

Definition at line 752 of file window.cpp.

References WindowHandle::_hwnd.

Referenced by FindProgramDlg::Command().

00753 {
00754         if (code == BN_CLICKED) {
00755                 EndDialog(_hwnd, id);
00756                 return 0;       // message has been processed
00757         }
00758
00759         return 1;
00760 }

int Dialog::DoModal | ( | UINT | nid,
 |  | CREATORFUNC_INFO | creator,
 |  | const void * | info,
 |  | HWND | hwndParent = 0
 | ) | [static]

Todo:
call Window::pretranslate_msg()

Definition at line 700 of file window.cpp.

References ExplorerGlobals::_hInstance, Window::DialogProc(), g_Globals, Window::GetStaticWindowData(), Window::s_new_info, and Window::s_window_creator.

00701 {
00702         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00703
00704         s_window_creator = (CREATORFUNC) creator;
00705         s_new_info = NULL;
00706
00708
00709         return DialogBoxParam(g_Globals._hInstance, MAKEINTRESOURCE(nid), hwndParent, DialogProc, 0/*lpParam*/);
00710 }

Here is the call graph for this function:

int Dialog::DoModal | ( | UINT | nid,
 |  | CREATORFUNC | creator,
 |  | HWND | hwndParent = 0
 | ) | [static]

Todo:
call Window::pretranslate_msg()

Definition at line 688 of file window.cpp.

References ExplorerGlobals::_hInstance, Window::DialogProc(), g_Globals, Window::GetStaticWindowData(), Window::s_new_info, and Window::s_window_creator.

Referenced by NotifyArea::Command(), StartMenuHandler::Command(), TaskbarSettingsDlg::Command(), MainFrameBase::Command(), explorer_about(), and explorer_show_frame().

00689 {
00690         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00691
00692         s_window_creator = creator;
00693         s_new_info = NULL;
00694
00696
00697         return DialogBoxParam(g_Globals._hInstance, MAKEINTRESOURCE(nid), hwndParent, DialogProc, 0/*lpParam*/);
00698 }

Here is the call graph for this function:

LRESULT Dialog::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from Window.

Reimplemented in ExplorerAboutDlg, FindProgramDlg, TrayNotifyDlg, ResizeController< Dialog >, CtlColorParent< OwnerDrawParent< Dialog > >, OwnerDrawParent< PropSheetPageDlg >, and OwnerDrawParent< Dialog >.

Definition at line 747 of file window.cpp.

Referenced by PropSheetPageDlg::DialogProc().

00748 {
00749         return FALSE;   // message has not been processed
00750 }

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

Dialog Member List

This is the complete list of members for Dialog, including all inherited members.

_hwnd | WindowHandle | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | Dialog | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
Dialog(HWND) | Dialog |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0) | Dialog | [static]
DoModal(UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0) | Dialog | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | Dialog |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | Dialog | [protected, virtual]
~Dialog() | Dialog |
~Window() | Window | [virtual]


ROS Explorer: DialogWindow Struct Reference

DialogWindow Struct Reference

The class DialogWindow implements modeless dialogs, which are managed by Window::dispatch_dialog_msg() in Window::MessageLoop(). More...

#include <window.h>

Inheritance diagram for DialogWindow:

[legend]
Collaboration diagram for DialogWindow:

[legend]
List of all members.

Public Types

typedef Window super

Public Member Functions

DialogWindow (HWND hwnd)
~DialogWindow ()

Detailed Description

The class DialogWindow implements modeless dialogs, which are managed by Window::dispatch_dialog_msg() in Window::MessageLoop().

A DialogWindow object should be constructed by calling Window::Create() and specifying the class using the WINDOW_CREATOR() macro.

Definition at line 348 of file window.h.

Member Typedef Documentation

typedef Window DialogWindow::super

Definition at line 350 of file window.h.

Constructor & Destructor Documentation

DialogWindow::DialogWindow ( HWND hwnd ) [inline]

Definition at line 352 of file window.h.

References Window::register_dialog().

00353          :      super(hwnd)
00354         {
00355                 register_dialog(hwnd);
00356         }

Here is the call graph for this function:

DialogWindow::~DialogWindow ( ) [inline]

Definition at line 358 of file window.h.

References WindowHandle::_hwnd, and Window::unregister_dialog().

00359         {
00360                 unregister_dialog(_hwnd);
00361         }

Here is the call graph for this function:

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

DialogWindow Member List

This is the complete list of members for DialogWindow, including all inherited members.

_hwnd | WindowHandle | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | Window | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
DialogWindow(HWND hwnd) | DialogWindow | [inline]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | DialogWindow |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [protected, virtual]
~DialogWindow() | DialogWindow | [inline]
~Window() | Window | [virtual]


ROS Explorer: Directory Struct Reference

Directory Struct Reference

base for all directory entries More...

#include <entries.h>

Inheritance diagram for Directory:

[legend]
Collaboration diagram for Directory:

[legend]
List of all members.

Protected Member Functions

Directory ()
virtual | ~Directory ()

Protected Attributes

void * | _path

Detailed Description

base for all directory entries

Definition at line 137 of file entries.h.

Constructor & Destructor Documentation

Directory::Directory ( ) [inline, protected]

Definition at line 139 of file entries.h.

00139 : _path(NULL) {}

virtual Directory::~Directory ( ) [inline, protected, virtual]

Definition at line 140 of file entries.h.

00140 {}

Member Data Documentation

void* Directory::_path [protected]

Definition at line 142 of file entries.h.

Referenced by FATDirectory::FATDirectory(), NtObjDirectory::NtObjDirectory(), WinDirectory::read_directory(), RegDirectory::read_directory(), RegDirectory::RegDirectory(), RegistryRoot::RegistryRoot(), ShellDirectory::ShellDirectory(), WinDirectory::WinDirectory(), FATDirectory::~FATDirectory(), FATDrive::~FATDrive(), NtObjDirectory::~NtObjDirectory(), RegDirectory::~RegDirectory(), RegistryRoot::~RegistryRoot(), ShellDirectory::~ShellDirectory(), and WinDirectory::~WinDirectory().

The documentation for this struct was generated from the following file:
  • entries.h


ROS Explorer: Member List

Directory Member List

This is the complete list of members for Directory, including all inherited members.

_path | Directory | [protected]
Directory() | Directory | [inline, protected]
~Directory() | Directory | [inline, protected, virtual]


ROS Explorer: dirent Struct Reference

dirent Struct Reference

#include <fatfs.h>

Collaboration diagram for dirent:

[legend]
List of all members.

Public Attributes

DEntry ent [1]

Detailed Description

Definition at line 198 of file fatfs.h.

Member Data Documentation

union DEntry dirent::ent[1]

Definition at line 199 of file fatfs.h.

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

dirent Member List

This is the complete list of members for dirent, including all inherited members.

ent dirent


ROS Explorer: dirsecz Struct Reference

dirsecz Struct Reference

#include <fatfs.h>

Collaboration diagram for dirsecz:

[legend]
List of all members.

Public Attributes

DWORD s [32]

Detailed Description

Definition at line 202 of file fatfs.h.

Member Data Documentation

DWORD dirsecz::s[32]

Definition at line 203 of file fatfs.h.

Referenced by FATDirectory::read_dir().

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

dirsecz Member List

This is the complete list of members for dirsecz, including all inherited members.

s dirsecz


ROS Explorer: DragSourceHelper Class Reference

DragSourceHelper Class Reference

implementation of IDragSourceHelper interface More...

#include <dragdropimpl.h>

Collaboration diagram for DragSourceHelper:

[legend]
List of all members.

Public Member Functions

DragSourceHelper ()
virtual | ~DragSourceHelper ()
HRESULT | InitializeFromBitmap (HBITMAP hBitmap, POINT &pt, RECT &rc, IDataObject *pDataObject, COLORREF crColorKey=GetSysColor(COLOR_WINDOW))
HRESULT | InitializeFromWindow (HWND hwnd, POINT &pt, IDataObject *pDataObject)

Detailed Description

implementation of IDragSourceHelper interface

Definition at line 214 of file dragdropimpl.h.

Constructor & Destructor Documentation

DragSourceHelper::DragSourceHelper ( ) [inline]

Definition at line 219 of file dragdropimpl.h.

00220         {
00221                 if (FAILED(CoCreateInstance(CLSID_DragDropHelper,
00222                                                 NULL,
00223                                                 CLSCTX_INPROC_SERVER,
00224                                                 IID_IDragSourceHelper,
00225                                                 (void**)&pDragSourceHelper)))
00226                         pDragSourceHelper = NULL;
00227         }

virtual DragSourceHelper::~DragSourceHelper ( ) [inline, virtual]

Definition at line 229 of file dragdropimpl.h.

00230         {
00231                 if (pDragSourceHelper != NULL)
00232                 {
00233                         pDragSourceHelper->Release();
00234                         pDragSourceHelper=NULL;
00235                 }
00236         }

Member Function Documentation

HRESULT DragSourceHelper::InitializeFromBitmap | ( | HBITMAP | hBitmap,
 |  | POINT & | pt,
 |  | RECT & | rc,
 |  | IDataObject * | pDataObject,
 |  | COLORREF | crColorKey = GetSysColor(COLOR_WINDOW)
 | ) | [inline]

Definition at line 239 of file dragdropimpl.h.

00245         {
00246                 if (pDragSourceHelper == NULL)
00247                         return E_FAIL;
00248
00249                         SHDRAGIMAGE di;
00250                         BITMAP          bm;
00251                         GetObject(hBitmap, sizeof(bm), &bm);
00252                         di.sizeDragImage.cx = bm.bmWidth;
00253                         di.sizeDragImage.cy = bm.bmHeight;
00254                         di.hbmpDragImage = hBitmap;
00255                         di.crColorKey = crColorKey;
00256                         di.ptOffset.x = pt.x - rc.left;
00257                         di.ptOffset.y = pt.y - rc.top;
00258                 return pDragSourceHelper->InitializeFromBitmap(&di, pDataObject);
00259         }

HRESULT DragSourceHelper::InitializeFromWindow | ( | HWND | hwnd,
 |  | POINT & | pt,
 |  | IDataObject * | pDataObject
 | ) | [inline]

Definition at line 261 of file dragdropimpl.h.

00262         {
00263                 if (pDragSourceHelper == NULL)
00264                         return E_FAIL;
00265                 return pDragSourceHelper->InitializeFromWindow(hwnd, &pt, pDataObject);
00266         }

The documentation for this class was generated from the following file:
  • dragdropimpl.h


ROS Explorer: Member List

DragSourceHelper Member List

This is the complete list of members for DragSourceHelper, including all inherited members.

DragSourceHelper() | DragSourceHelper | [inline]
InitializeFromBitmap(HBITMAP hBitmap, POINT &pt, RECT &rc, IDataObject *pDataObject, COLORREF crColorKey=GetSysColor(COLOR_WINDOW)) | DragSourceHelper | [inline]
InitializeFromWindow(HWND hwnd, POINT &pt, IDataObject *pDataObject) | DragSourceHelper | [inline]
~DragSourceHelper() | DragSourceHelper | [inline, virtual]


ROS Explorer: dskrwblk Struct Reference

dskrwblk Struct Reference

#include <fatfs.h>

Collaboration diagram for dskrwblk:

[legend]
List of all members.

Public Attributes

DWORD | sec
WORD | anz
buffer far * | buf

Detailed Description

Definition at line 177 of file fatfs.h.

Member Data Documentation

WORD dskrwblk::anz

Definition at line 179 of file fatfs.h.

struct buffer far* dskrwblk::buf

Definition at line 180 of file fatfs.h.

DWORD dskrwblk::sec

Definition at line 178 of file fatfs.h.

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

dskrwblk Member List

This is the complete list of members for dskrwblk, including all inherited members.

anz | dskrwblk
buf | dskrwblk
sec | dskrwblk


ROS Explorer: DWebBrowserEvents2IF Struct Reference

DWebBrowserEvents2IF Struct Reference

#include <webchild.h>

Inheritance diagram for DWebBrowserEvents2IF:

[legend]
List of all members.

Public Member Functions

virtual | ~DWebBrowserEvents2IF ()
virtual void | StatusTextChange (const BStr &text)
virtual void | ProgressChange (long progress, long progressMax)
virtual void | WindowMove ()
virtual void | WindowResize ()
virtual void | WindowActivate ()
virtual void | PropertyChange (const BStr &property)
virtual void | DownloadComplete ()
virtual void | CommandStateChange (long command, bool enable)
virtual void | DownloadBegin ()
virtual void | NewWindow2 (IDispatch **ppDisp, VARIANT_BOOL &cancel)
virtual void | TitleChange (const BStr &text)
virtual void | TitleIconChange (const BStr &text)
virtual void | FrameBeforeNavigate (const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &cancel)
virtual void | FrameNavigateComplete (const BStr &url)
virtual void | FrameNewWindow (const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &processed)
virtual void | BeforeNavigate2 (IDispatch *pDisp, const Variant &url, const Variant &flags, const Variant &targetFrameName, const Variant &postData, const Variant &headers, VARIANT_BOOL &cancel)
virtual void | NavigateComplete2 (IDispatch *pDisp, const Variant &url)
virtual void | OnQuit ()
virtual void | OnVisible (bool Visible)
virtual void | OnToolbar (bool Visible)
virtual void | OnMenubar (bool Visible)
virtual void | OnStatusbar (bool Visible)
virtual void | OnFullscreen (bool Visible)
virtual void | DocumentComplete ()
virtual void | OnTheatermode (bool Visible)
virtual void | OnAddressbar (bool Visible)
virtual void | WindowSetResizable (bool Visible)
virtual void | WindowClosing (VARIANT_BOOL IsChildWindow, VARIANT_BOOL &cancel)
virtual void | WindowSetLeft (long Left)
virtual void | WindowSetTop (long Top)
virtual void | WindowSetWidth (long Width)
virtual void | WindowSetHeight (long Height)
virtual void | ClientToHostWindow (long &CX, long &CY)
virtual void | SetSecureLockIcon (long SecureLockIcon)
virtual void | FileDownload (Variant &cancel)
virtual void | NavigateError (IDispatch *pDisp, const Variant &url, const Variant &Frame, const Variant &StatusCode, VARIANT_BOOL &cancel)
virtual void | PrivacyImpactedStateChange (bool bImpacted)

Detailed Description

Definition at line 385 of file webchild.h.

Constructor & Destructor Documentation

virtual DWebBrowserEvents2IF::~DWebBrowserEvents2IF ( ) [inline, virtual]

Definition at line 387 of file webchild.h.

00387 {}

Member Function Documentation

virtual void DWebBrowserEvents2IF::BeforeNavigate2 | ( | IDispatch * | pDisp,
 |  | const Variant & | url,
 |  | const Variant & | flags,
 |  | const Variant & | targetFrameName,
 |  | const Variant & | postData,
 |  | const Variant & | headers,
 |  | VARIANT_BOOL & | cancel
 | ) | [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 434 of file webchild.h.

00437                 {}

virtual void DWebBrowserEvents2IF::ClientToHostWindow | ( | long & | CX,
 |  | long & | CY
 | ) | [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 487 of file webchild.h.

00488                 {}

virtual void DWebBrowserEvents2IF::CommandStateChange | ( | long | command,
 |  | bool | enable
 | ) | [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 410 of file webchild.h.

00411                 {}

virtual void DWebBrowserEvents2IF::DocumentComplete ( ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 460 of file webchild.h.

00461                 {}

virtual void DWebBrowserEvents2IF::DownloadBegin ( ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 413 of file webchild.h.

00414                 {}

virtual void DWebBrowserEvents2IF::DownloadComplete ( ) [inline, virtual]

Definition at line 407 of file webchild.h.

00408                 {}

virtual void DWebBrowserEvents2IF::FileDownload ( Variant & cancel ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 493 of file webchild.h.

00494                 {}

virtual void DWebBrowserEvents2IF::FrameBeforeNavigate | ( | const BStr & | url,
 |  | long | flags,
 |  | const BStr & | targetFrameName,
 |  | VARIANT * | postData,
 |  | const BStr & | headers,
 |  | VARIANT_BOOL & | cancel
 | ) | [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 425 of file webchild.h.

00426                 {}

virtual void DWebBrowserEvents2IF::FrameNavigateComplete ( const BStr & url ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 428 of file webchild.h.

00429                 {}

virtual void DWebBrowserEvents2IF::FrameNewWindow | ( | const BStr & | url,
 |  | long | flags,
 |  | const BStr & | targetFrameName,
 |  | VARIANT * | postData,
 |  | const BStr & | headers,
 |  | VARIANT_BOOL & | processed
 | ) | [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 431 of file webchild.h.

00432                 {}

virtual void DWebBrowserEvents2IF::NavigateComplete2 | ( | IDispatch * | pDisp,
 |  | const Variant & | url
 | ) | [inline, virtual]

Reimplemented in DWebBrowserEvents2Impl, and WebChildWindow.

Definition at line 439 of file webchild.h.

00440                 {}

virtual void DWebBrowserEvents2IF::NavigateError | ( | IDispatch * | pDisp,
 |  | const Variant & | url,
 |  | const Variant & | Frame,
 |  | const Variant & | StatusCode,
 |  | VARIANT_BOOL & | cancel
 | ) | [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 496 of file webchild.h.

00497                 {}

virtual void DWebBrowserEvents2IF::NewWindow2 | ( | IDispatch ** | ppDisp,
 |  | VARIANT_BOOL & | cancel
 | ) | [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 416 of file webchild.h.

00417                 {}

virtual void DWebBrowserEvents2IF::OnAddressbar ( bool Visible ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 466 of file webchild.h.

00467                 {}

virtual void DWebBrowserEvents2IF::OnFullscreen ( bool Visible ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 457 of file webchild.h.

00458                 {}

virtual void DWebBrowserEvents2IF::OnMenubar ( bool Visible ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 451 of file webchild.h.

00452                 {}

virtual void DWebBrowserEvents2IF::OnQuit ( ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 442 of file webchild.h.

00443                 {}

virtual void DWebBrowserEvents2IF::OnStatusbar ( bool Visible ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 454 of file webchild.h.

00455                 {}

virtual void DWebBrowserEvents2IF::OnTheatermode ( bool Visible ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 463 of file webchild.h.

00464                 {}

virtual void DWebBrowserEvents2IF::OnToolbar ( bool Visible ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 448 of file webchild.h.

00449                 {}

virtual void DWebBrowserEvents2IF::OnVisible ( bool Visible ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 445 of file webchild.h.

00446                 {}

virtual void DWebBrowserEvents2IF::PrivacyImpactedStateChange ( bool bImpacted ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 499 of file webchild.h.

00500                 {}

virtual void DWebBrowserEvents2IF::ProgressChange | ( | long | progress,
 |  | long | progressMax
 | ) | [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 392 of file webchild.h.

00393                 {}

virtual void DWebBrowserEvents2IF::PropertyChange ( const BStr & property ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 404 of file webchild.h.

00405                 {}

virtual void DWebBrowserEvents2IF::SetSecureLockIcon ( long SecureLockIcon ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 490 of file webchild.h.

00491                 {}

virtual void DWebBrowserEvents2IF::StatusTextChange ( const BStr & text ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 389 of file webchild.h.

00390                 {}

virtual void DWebBrowserEvents2IF::TitleChange ( const BStr & text ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 419 of file webchild.h.

00420                 {}

virtual void DWebBrowserEvents2IF::TitleIconChange ( const BStr & text ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 422 of file webchild.h.

00423                 {}

virtual void DWebBrowserEvents2IF::WindowActivate ( ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 401 of file webchild.h.

00402                 {}

virtual void DWebBrowserEvents2IF::WindowClosing | ( | VARIANT_BOOL | IsChildWindow,
 |  | VARIANT_BOOL & | cancel
 | ) | [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 472 of file webchild.h.

00473                 {}

virtual void DWebBrowserEvents2IF::WindowMove ( ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 395 of file webchild.h.

00396                 {}

virtual void DWebBrowserEvents2IF::WindowResize ( ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 398 of file webchild.h.

00399                 {}

virtual void DWebBrowserEvents2IF::WindowSetHeight ( long Height ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 484 of file webchild.h.

00485                 {}

virtual void DWebBrowserEvents2IF::WindowSetLeft ( long Left ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 475 of file webchild.h.

00476                 {}

virtual void DWebBrowserEvents2IF::WindowSetResizable ( bool Visible ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 469 of file webchild.h.

00470                 {}

virtual void DWebBrowserEvents2IF::WindowSetTop ( long Top ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 478 of file webchild.h.

00479                 {}

virtual void DWebBrowserEvents2IF::WindowSetWidth ( long Width ) [inline, virtual]

Reimplemented in WebChildWindow.

Definition at line 481 of file webchild.h.

00482                 {}

The documentation for this struct was generated from the following file:
  • webchild.h


ROS Explorer: Member List

DWebBrowserEvents2IF Member List

This is the complete list of members for DWebBrowserEvents2IF, including all inherited members.

BeforeNavigate2(IDispatch *pDisp, const Variant &url, const Variant &flags, const Variant &targetFrameName, const Variant &postData, const Variant &headers, VARIANT_BOOL &cancel) | DWebBrowserEvents2IF | [inline, virtual]
ClientToHostWindow(long &CX, long &CY) | DWebBrowserEvents2IF | [inline, virtual]
CommandStateChange(long command, bool enable) | DWebBrowserEvents2IF | [inline, virtual]
DocumentComplete() | DWebBrowserEvents2IF | [inline, virtual]
DownloadBegin() | DWebBrowserEvents2IF | [inline, virtual]
DownloadComplete() | DWebBrowserEvents2IF | [inline, virtual]
FileDownload(Variant &cancel) | DWebBrowserEvents2IF | [inline, virtual]
FrameBeforeNavigate(const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &cancel) | DWebBrowserEvents2IF | [inline, virtual]
FrameNavigateComplete(const BStr &url) | DWebBrowserEvents2IF | [inline, virtual]
FrameNewWindow(const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &processed) | DWebBrowserEvents2IF | [inline, virtual]
NavigateComplete2(IDispatch *pDisp, const Variant &url) | DWebBrowserEvents2IF | [inline, virtual]
NavigateError(IDispatch *pDisp, const Variant &url, const Variant &Frame, const Variant &StatusCode, VARIANT_BOOL &cancel) | DWebBrowserEvents2IF | [inline, virtual]
NewWindow2(IDispatch **ppDisp, VARIANT_BOOL &cancel) | DWebBrowserEvents2IF | [inline, virtual]
OnAddressbar(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnFullscreen(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnMenubar(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnQuit() | DWebBrowserEvents2IF | [inline, virtual]
OnStatusbar(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnTheatermode(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnToolbar(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnVisible(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
PrivacyImpactedStateChange(bool bImpacted) | DWebBrowserEvents2IF | [inline, virtual]
ProgressChange(long progress, long progressMax) | DWebBrowserEvents2IF | [inline, virtual]
PropertyChange(const BStr &property) | DWebBrowserEvents2IF | [inline, virtual]
SetSecureLockIcon(long SecureLockIcon) | DWebBrowserEvents2IF | [inline, virtual]
StatusTextChange(const BStr &text) | DWebBrowserEvents2IF | [inline, virtual]
TitleChange(const BStr &text) | DWebBrowserEvents2IF | [inline, virtual]
TitleIconChange(const BStr &text) | DWebBrowserEvents2IF | [inline, virtual]
WindowActivate() | DWebBrowserEvents2IF | [inline, virtual]
WindowClosing(VARIANT_BOOL IsChildWindow, VARIANT_BOOL &cancel) | DWebBrowserEvents2IF | [inline, virtual]
WindowMove() | DWebBrowserEvents2IF | [inline, virtual]
WindowResize() | DWebBrowserEvents2IF | [inline, virtual]
WindowSetHeight(long Height) | DWebBrowserEvents2IF | [inline, virtual]
WindowSetLeft(long Left) | DWebBrowserEvents2IF | [inline, virtual]
WindowSetResizable(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
WindowSetTop(long Top) | DWebBrowserEvents2IF | [inline, virtual]
WindowSetWidth(long Width) | DWebBrowserEvents2IF | [inline, virtual]
~DWebBrowserEvents2IF() | DWebBrowserEvents2IF | [inline, virtual]


ROS Explorer: DWebBrowserEvents2Impl Struct Reference

DWebBrowserEvents2Impl Struct Reference

#include <webchild.h>

Inheritance diagram for DWebBrowserEvents2Impl:

[legend]
Collaboration diagram for DWebBrowserEvents2Impl:

[legend]
List of all members.

Public Types

typedef IComSrvBase< FixedDWebBrowserEvents2,
DWebBrowserEvents2Impl > 		super

Public Member Functions

DWebBrowserEvents2Impl (BrowserNavigator &navigator)

Public Attributes

DWebBrowserEvents2IF * _callback
STDMETHOD( | GetTypeInfoCount )(UINT *pctinfo)
STDMETHOD( | GetTypeInfo )(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
STDMETHOD( | GetIDsOfNames )(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
STDMETHOD( | Invoke )(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr)

Protected Member Functions

void | NavigateComplete2 (IDispatch *pDisp, const Variant &url)

Protected Attributes

BrowserNavigator & _navigator

Detailed Description

Definition at line 533 of file webchild.h.

Member Typedef Documentation

typedef IComSrvBase<FixedDWebBrowserEvents2, DWebBrowserEvents2Impl> DWebBrowserEvents2Impl::super

Reimplemented from IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl >.

Reimplemented in WebChildWindow.

Definition at line 537 of file webchild.h.

Constructor & Destructor Documentation

DWebBrowserEvents2Impl::DWebBrowserEvents2Impl ( BrowserNavigator & navigator ) [inline]

Definition at line 543 of file webchild.h.

00544          :      super(DIID_DWebBrowserEvents2),
00545                 _navigator(navigator)
00546         {
00547                 _callback = this;
00548         }

Member Function Documentation

void DWebBrowserEvents2Impl::NavigateComplete2 | ( | IDispatch * | pDisp,
 |  | const Variant & | url
 | ) | [inline, protected, virtual]

Reimplemented from DWebBrowserEvents2IF.

Reimplemented in WebChildWindow.

Definition at line 819 of file webchild.h.

References BrowserNavigator::navigated().

00820         {
00821                 String adr = (BStr)url;
00822
00823                 _navigator.navigated(adr);
00824         }

Here is the call graph for this function:

Member Data Documentation

DWebBrowserEvents2IF* DWebBrowserEvents2Impl::_callback

Definition at line 540 of file webchild.h.

BrowserNavigator& DWebBrowserEvents2Impl::_navigator [protected]

Reimplemented in WebChildWindow.

Definition at line 817 of file webchild.h.

STDMETHOD( DWebBrowserEvents2Impl::GetIDsOfNames)(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) [inline]

Definition at line 570 of file webchild.h.

00571                 {return E_NOTIMPL;}

STDMETHOD( DWebBrowserEvents2Impl::GetTypeInfo)(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) [inline]

Definition at line 567 of file webchild.h.

00568                 {return E_NOTIMPL;}

STDMETHOD( DWebBrowserEvents2Impl::GetTypeInfoCount)(UINT *pctinfo) [inline]

Definition at line 564 of file webchild.h.

00565                 {return E_NOTIMPL;}

STDMETHOD( DWebBrowserEvents2Impl::Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr) [inline]

Definition at line 573 of file webchild.h.

00575         {
00576                 switch(dispIdMember) {
00577                   case DISPID_STATUSTEXTCHANGE:
00578                         _callback->StatusTextChange((BStr)Variant(pDispParams->rgvarg[0]));
00579                         break;
00580
00581                   case DISPID_COMMANDSTATECHANGE:
00582                         _callback->CommandStateChange(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
00583                         break;
00584
00585                   case DISPID_DOWNLOADBEGIN:
00586                         _callback->DownloadBegin();
00587                         break;
00588
00589                   case DISPID_PROGRESSCHANGE:   // sent when download progress is updated
00590                         _callback->ProgressChange(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
00591                         break;
00592
00593                   case DISPID_WINDOWMOVE:               // sent when main window has been moved
00594                         _callback->WindowMove();
00595                         break;
00596
00597                   case DISPID_WINDOWRESIZE:             // sent when main window has been sized
00598                         _callback->WindowResize();
00599                         break;
00600
00601                   case DISPID_WINDOWACTIVATE:   // sent when main window has been activated
00602                         _callback->WindowActivate();
00603                         break;
00604
00605                   case DISPID_PROPERTYCHANGE:   // sent when the PutProperty method is called
00606                         _callback->PropertyChange((BStr)Variant(pDispParams->rgvarg[0]));
00607                         break;
00608
00609                   case DISPID_TITLECHANGE:              // sent when the document title changes
00610                         _callback->TitleChange((BStr)Variant(pDispParams->rgvarg[0]));
00611                         break;
00612
00613                   case DISPID_TITLEICONCHANGE:  // sent when the top level window icon may have changed.
00614                         _callback->TitleIconChange((BStr)Variant(pDispParams->rgvarg[0]));
00615                         break;
00616
00617
00618                         // anything below here is not present in DWebBrowserEvents, only in DWebBrowserEvents2: ->
00619
00620                   case DISPID_FRAMEBEFORENAVIGATE:
00621                         if (pDispParams->cArgs != 6)
00622                                 return E_INVALIDARG;
00623                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00624                                 return E_INVALIDARG;
00625                         _callback->FrameBeforeNavigate(
00626                                                                   (BStr)Variant(&pDispParams->rgvarg[5]), Variant(&pDispParams->rgvarg[4]),
00627                                                                   (BStr)Variant(&pDispParams->rgvarg[3]), &pDispParams->rgvarg[2],
00628                                                                   (BStr)Variant(&pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0]));
00629                         break;
00630
00631                   case DISPID_FRAMENAVIGATECOMPLETE:
00632                         if (pDispParams->cArgs != 1)
00633                                 return E_INVALIDARG;
00634                         _callback->FrameNavigateComplete((BStr)Variant(pDispParams->rgvarg[0]));
00635                         break;
00636
00637                   case DISPID_FRAMENEWWINDOW:
00638                         if (pDispParams->cArgs != 6)
00639                                 return E_INVALIDARG;
00640                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00641                                 return E_INVALIDARG;
00642                         _callback->FrameNewWindow((BStr)Variant(&pDispParams->rgvarg[5]), Variant(&pDispParams->rgvarg[4]),
00643                                                                   (BStr)Variant(&pDispParams->rgvarg[3]), &pDispParams->rgvarg[2],
00644                                                                   (BStr)Variant(&pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0]));
00645                         break;
00646
00647                   case DISPID_BEFORENAVIGATE2:  // hyperlink clicked on
00648                         if (pDispParams->cArgs != 7)
00649                                 return E_INVALIDARG;
00650                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00651                                 return E_INVALIDARG;
00652                         _callback->BeforeNavigate2(Variant(pDispParams->rgvarg[6]),
00653                                                                   pDispParams->rgvarg[5], &pDispParams->rgvarg[4],
00654                                                                   pDispParams->rgvarg[3], &pDispParams->rgvarg[2],
00655                                                                   pDispParams->rgvarg[1], *V_BOOLREF(&pDispParams->rgvarg[0]));
00656                         break;
00657
00658                   case DISPID_NEWWINDOW2:               // sent when a new window should be created
00659                         if (pDispParams->cArgs != 2)
00660                                 return E_INVALIDARG;
00661                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00662                                 return E_INVALIDARG;
00663                         if (V_VT(&pDispParams->rgvarg[1]) != (VT_DISPATCH|VT_BYREF))
00664                                 return E_INVALIDARG;
00665                         _callback->NewWindow2(V_DISPATCHREF(&pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0]));
00666                         break;
00667
00668                   case DISPID_NAVIGATECOMPLETE2:// UIActivate new document
00669                         if (pDispParams->cArgs != 2)
00670                                 return E_INVALIDARG;
00671
00672                          // notify the navigator
00673                         NavigateComplete2(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
00674
00675                         _callback->NavigateComplete2(Variant(pDispParams->rgvarg[1]), Variant(pDispParams->rgvarg[0]));
00676                         break;
00677
00678                   case DISPID_ONQUIT:
00679                         _callback->OnQuit();
00680                         break;
00681
00682                   case DISPID_ONVISIBLE:                // sent when the window goes visible/hidden
00683                         if (pDispParams->cArgs != 1)
00684                                 return E_INVALIDARG;
00685                         _callback->OnVisible(Variant(pDispParams->rgvarg[0]));
00686                         break;
00687
00688                   case DISPID_ONTOOLBAR:                // sent when the toolbar should be shown/hidden
00689                         if (pDispParams->cArgs != 1)
00690                                 return E_INVALIDARG;
00691                         _callback->OnToolbar(Variant(pDispParams->rgvarg[0]));
00692                         break;
00693
00694                   case DISPID_ONMENUBAR:                // sent when the menubar should be shown/hidden
00695                         if (pDispParams->cArgs != 1)
00696                                 return E_INVALIDARG;
00697                         _callback->OnMenubar(Variant(pDispParams->rgvarg[0]));
00698                         break;
00699
00700                   case DISPID_ONSTATUSBAR:              // sent when the statusbar should be shown/hidden
00701                         if (pDispParams->cArgs != 1)
00702                                 return E_INVALIDARG;
00703                         _callback->OnStatusbar(Variant(pDispParams->rgvarg[0]));
00704                         break;
00705
00706                   case DISPID_ONFULLSCREEN:             // sent when kiosk mode should be on/off
00707                         if (pDispParams->cArgs != 1)
00708                                 return E_INVALIDARG;
00709                         _callback->OnFullscreen(Variant(pDispParams->rgvarg[0]));
00710                         break;
00711
00712                   case DISPID_DOCUMENTCOMPLETE:// new document goes ReadyState_Complete
00713                         _callback->DocumentComplete();
00714                         break;
00715
00716                   case DISPID_DOWNLOADCOMPLETE:
00717                         _callback->DownloadComplete();
00718                         break;
00719
00720                   case DISPID_ONTHEATERMODE:    // sent when theater mode should be on/off
00721                         if (pDispParams->cArgs != 1)
00722                                 return E_INVALIDARG;
00723                         _callback->OnTheatermode(Variant(pDispParams->rgvarg[0]));
00724                         break;
00725
00726                   case DISPID_ONADDRESSBAR:             // sent when the address bar should be shown/hidden
00727                         if (pDispParams->cArgs != 1)
00728                                 return E_INVALIDARG;
00729                         _callback->OnAddressbar(Variant(pDispParams->rgvarg[0]));
00730                         break;
00731
00732                   case DISPID_WINDOWSETRESIZABLE:// sent to set the style of the host window frame
00733                         if (pDispParams->cArgs != 1)
00734                                 return E_INVALIDARG;
00735                         _callback->WindowSetResizable(Variant(pDispParams->rgvarg[0]));
00736                         break;
00737
00738                   case DISPID_WINDOWCLOSING:    // sent before script window.close closes the window
00739                         if (pDispParams->cArgs != 2)
00740                                 return E_INVALIDARG;
00741                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00742                                 return E_INVALIDARG;
00743                         _callback->WindowClosing(Variant(pDispParams->rgvarg[1]), *V_BOOLREF(&pDispParams->rgvarg[0]));
00744                         break;
00745
00746                   case DISPID_WINDOWSETLEFT:    // sent when the put_left method is called on the WebOC
00747                         if (pDispParams->cArgs != 1)
00748                                 return E_INVALIDARG;
00749                         _callback->WindowSetLeft(Variant(pDispParams->rgvarg[0]));
00750                         break;
00751
00752                   case DISPID_WINDOWSETTOP:             // sent when the put_top method is called on the WebOC
00753                         if (pDispParams->cArgs != 1)
00754                                 return E_INVALIDARG;
00755                         _callback->WindowSetTop(Variant(pDispParams->rgvarg[0]));
00756                         break;
00757
00758                   case DISPID_WINDOWSETWIDTH:   // sent when the put_width method is called on the WebOC
00759                         if (pDispParams->cArgs != 1)
00760                                 return E_INVALIDARG;
00761                         _callback->WindowSetWidth(Variant(pDispParams->rgvarg[0]));
00762                         break;
00763
00764                   case DISPID_WINDOWSETHEIGHT:  // sent when the put_height method is called on the WebOC
00765                         if (pDispParams->cArgs != 1)
00766                                 return E_INVALIDARG;
00767                         _callback->WindowSetHeight(Variant(pDispParams->rgvarg[0]));
00768                         break;
00769
00770                   case DISPID_CLIENTTOHOSTWINDOW:// sent during window.open to request conversion of dimensions
00771                         if (pDispParams->cArgs != 2)
00772                                 return E_INVALIDARG;
00773                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_I4|VT_BYREF))
00774                                 return E_INVALIDARG;
00775                         if (V_VT(&pDispParams->rgvarg[1]) != (VT_I4|VT_BYREF))
00776                                 return E_INVALIDARG;
00777                         _callback->ClientToHostWindow(*V_I4REF(&pDispParams->rgvarg[1]), *V_I4REF(&pDispParams->rgvarg[0]));
00778                         break;
00779
00780                   case DISPID_SETSECURELOCKICON:// sent to suggest the appropriate security icon to show
00781                         if (pDispParams->cArgs != 1)
00782                                 return E_INVALIDARG;
00783                         _callback->SetSecureLockIcon(Variant(pDispParams->rgvarg[0]));
00784                         break;
00785
00786                   case DISPID_FILEDOWNLOAD: {   // Fired to indicate the File Download dialog is opening
00787                         if (pDispParams->cArgs != 1)    //@@ every time 2 ?!
00788                                 return E_INVALIDARG;
00789                         Variant var(pDispParams->rgvarg[0]);
00790                         _callback->FileDownload(var);}
00791                         break;
00792
00793                   case DISPID_NAVIGATEERROR:    // Fired to indicate the a binding error has occured
00794                         if (pDispParams->cArgs != 5)
00795                                 return E_INVALIDARG;
00796                         if (V_VT(&pDispParams->rgvarg[0]) != (VT_BOOL|VT_BYREF))
00797                                 return E_INVALIDARG;
00798                         _callback->NavigateError(Variant(pDispParams->rgvarg[4]), Variant(pDispParams->rgvarg[3]),
00799                                                                 Variant(pDispParams->rgvarg[2]), Variant(pDispParams->rgvarg[1]),
00800                                                                 *V_BOOLREF(&pDispParams->rgvarg[0]));
00801                         break;
00802
00803                   case DISPID_PRIVACYIMPACTEDSTATECHANGE:// Fired when the user's browsing experience is impacted
00804                         if (pDispParams->cArgs != 1)
00805                                 return E_INVALIDARG;
00806                         _callback->PrivacyImpactedStateChange(Variant(pDispParams->rgvarg[0]));
00807                         break;
00808
00809                   default:
00810                         return NOERROR;
00811                 }
00812
00813                 return S_OK;
00814         }

The documentation for this struct was generated from the following file:
  • webchild.h


ROS Explorer: Member List

DWebBrowserEvents2Impl Member List

This is the complete list of members for DWebBrowserEvents2Impl, including all inherited members.

_callback | DWebBrowserEvents2Impl |
_navigator | DWebBrowserEvents2Impl | [protected]
_ref | ComSrvObject | [protected]
_uuid_base | IComSrvQI< FixedDWebBrowserEvents2 > | [protected]
BeforeNavigate2(IDispatch *pDisp, const Variant &url, const Variant &flags, const Variant &targetFrameName, const Variant &postData, const Variant &headers, VARIANT_BOOL &cancel) | DWebBrowserEvents2IF | [inline, virtual]
ClientToHostWindow(long &CX, long &CY) | DWebBrowserEvents2IF | [inline, virtual]
CommandStateChange(long command, bool enable) | DWebBrowserEvents2IF | [inline, virtual]
ComSrvObject() | ComSrvObject | [inline, protected]
DecRef() | SimpleComObject | [inline]
DocumentComplete() | DWebBrowserEvents2IF | [inline, virtual]
DownloadBegin() | DWebBrowserEvents2IF | [inline, virtual]
DownloadComplete() | DWebBrowserEvents2IF | [inline, virtual]
DWebBrowserEvents2Impl(BrowserNavigator &navigator) | DWebBrowserEvents2Impl | [inline]
FileDownload(Variant &cancel) | DWebBrowserEvents2IF | [inline, virtual]
FrameBeforeNavigate(const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &cancel) | DWebBrowserEvents2IF | [inline, virtual]
FrameNavigateComplete(const BStr &url) | DWebBrowserEvents2IF | [inline, virtual]
FrameNewWindow(const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &processed) | DWebBrowserEvents2IF | [inline, virtual]
GetIDsOfNames | DWebBrowserEvents2Impl | [inline]
GetTypeInfo | DWebBrowserEvents2Impl | [inline]
GetTypeInfoCount | DWebBrowserEvents2Impl | [inline]
IComSrvBase(REFIID uuid_base) | IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl > | [inline, protected]
IComSrvQI(REFIID uuid_base) | IComSrvQI< FixedDWebBrowserEvents2 > | [inline]
IComSrvQI() | IComSrvQI< FixedDWebBrowserEvents2 > | [inline, protected]
IncRef() | SimpleComObject | [inline]
Invoke | DWebBrowserEvents2Impl | [inline]
NavigateComplete2(IDispatch *pDisp, const Variant &url) | DWebBrowserEvents2Impl | [inline, protected, virtual]
NavigateError(IDispatch *pDisp, const Variant &url, const Variant &Frame, const Variant &StatusCode, VARIANT_BOOL &cancel) | DWebBrowserEvents2IF | [inline, virtual]
NewWindow2(IDispatch **ppDisp, VARIANT_BOOL &cancel) | DWebBrowserEvents2IF | [inline, virtual]
OnAddressbar(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnFullscreen(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnMenubar(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnQuit() | DWebBrowserEvents2IF | [inline, virtual]
OnStatusbar(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnTheatermode(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnToolbar(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
OnVisible(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
PrivacyImpactedStateChange(bool bImpacted) | DWebBrowserEvents2IF | [inline, virtual]
ProgressChange(long progress, long progressMax) | DWebBrowserEvents2IF | [inline, virtual]
PropertyChange(const BStr &property) | DWebBrowserEvents2IF | [inline, virtual]
QueryInterface(REFIID riid, LPVOID *ppv) | IComSrvQI< FixedDWebBrowserEvents2 > | [inline]
SetSecureLockIcon(long SecureLockIcon) | DWebBrowserEvents2IF | [inline, virtual]
StatusTextChange(const BStr &text) | DWebBrowserEvents2IF | [inline, virtual]
STDMETHODIMP_(ULONG) AddRef() | IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl > | [inline]
STDMETHODIMP_(ULONG) Release() | IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl > | [inline]
super typedef | DWebBrowserEvents2Impl |
TitleChange(const BStr &text) | DWebBrowserEvents2IF | [inline, virtual]
TitleIconChange(const BStr &text) | DWebBrowserEvents2IF | [inline, virtual]
WindowActivate() | DWebBrowserEvents2IF | [inline, virtual]
WindowClosing(VARIANT_BOOL IsChildWindow, VARIANT_BOOL &cancel) | DWebBrowserEvents2IF | [inline, virtual]
WindowMove() | DWebBrowserEvents2IF | [inline, virtual]
WindowResize() | DWebBrowserEvents2IF | [inline, virtual]
WindowSetHeight(long Height) | DWebBrowserEvents2IF | [inline, virtual]
WindowSetLeft(long Left) | DWebBrowserEvents2IF | [inline, virtual]
WindowSetResizable(bool Visible) | DWebBrowserEvents2IF | [inline, virtual]
WindowSetTop(long Top) | DWebBrowserEvents2IF | [inline, virtual]
WindowSetWidth(long Width) | DWebBrowserEvents2IF | [inline, virtual]
~ComSrvObject() | ComSrvObject | [inline, protected, virtual]
~DWebBrowserEvents2IF() | DWebBrowserEvents2IF | [inline, virtual]
~IComSrvQI() | IComSrvQI< FixedDWebBrowserEvents2 > | [inline, protected, virtual]


ROS Explorer: DynamicFct< FCT > Struct Template Reference

DynamicFct< FCT > Struct Template Reference

link dynamicly to functions by using GetModuleHandle() and GetProcAddress() More...

#include <utility.h>

Collaboration diagram for DynamicFct< FCT >:

[legend]
List of all members.

Public Member Functions

DynamicFct (LPCTSTR moduleName, UINT ordinal)
DynamicFct (LPCTSTR moduleName, LPCSTR name)
FCT | operator * () const
operator bool () const

Protected Attributes

FCT | _fct

Detailed Description

template<typename FCT>
struct DynamicFct< FCT >

link dynamicly to functions by using GetModuleHandle() and GetProcAddress()

Definition at line 952 of file utility.h.

Constructor & Destructor Documentation

template<typename FCT>
DynamicFct< FCT >::DynamicFct | ( | LPCTSTR | moduleName,
 |  | UINT | ordinal
 | ) | [inline]

Definition at line 954 of file utility.h.

00955         {
00956                 HMODULE hModule = GetModuleHandle(moduleName);
00957
00958                 _fct = (FCT) GetProcAddress(hModule, (LPCSTR)ordinal);
00959         }

template<typename FCT>
DynamicFct< FCT >::DynamicFct | ( | LPCTSTR | moduleName,
 |  | LPCSTR | name
 | ) | [inline]

Definition at line 961 of file utility.h.

00962         {
00963                 HMODULE hModule = GetModuleHandle(moduleName);
00964
00965                 _fct = (FCT) GetProcAddress(hModule, name);
00966         }

Member Function Documentation

template<typename FCT>
FCT DynamicFct< FCT >::operator * ( ) const [inline]

Definition at line 968 of file utility.h.

00968 {return _fct;}

template<typename FCT>
DynamicFct< FCT >::operator bool ( ) const [inline]

Definition at line 969 of file utility.h.

00969 {return _fct? true: false;}

Member Data Documentation

template<typename FCT>
FCT DynamicFct< FCT >::_fct [protected]

Definition at line 972 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

DynamicFct< FCT > Member List

This is the complete list of members for DynamicFct< FCT >, including all inherited members.

_fct | DynamicFct< FCT > | [protected]
DynamicFct(LPCTSTR moduleName, UINT ordinal) | DynamicFct< FCT > | [inline]
DynamicFct(LPCTSTR moduleName, LPCSTR name) | DynamicFct< FCT > | [inline]
operator *() const | DynamicFct< FCT > | [inline]
operator bool() const | DynamicFct< FCT > | [inline]


ROS Explorer: DynamicLoadLibFct< FCT > Struct Template Reference

DynamicLoadLibFct< FCT > Struct Template Reference

link dynamicly to functions by using LoadLibrary() and GetProcAddress() More...

#include <utility.h>

Collaboration diagram for DynamicLoadLibFct< FCT >:

[legend]
List of all members.

Public Member Functions

DynamicLoadLibFct (LPCTSTR moduleName, UINT ordinal)
DynamicLoadLibFct (LPCTSTR moduleName, LPCSTR name)
~DynamicLoadLibFct ()
FCT | operator * () const
operator bool () const

Protected Attributes

HMODULE | _hModule
FCT | _fct

Detailed Description

template<typename FCT>
struct DynamicLoadLibFct< FCT >

link dynamicly to functions by using LoadLibrary() and GetProcAddress()

Definition at line 977 of file utility.h.

Constructor & Destructor Documentation

template<typename FCT>
DynamicLoadLibFct< FCT >::DynamicLoadLibFct | ( | LPCTSTR | moduleName,
 |  | UINT | ordinal
 | ) | [inline]

Definition at line 979 of file utility.h.

00980         {
00981                 _hModule = LoadLibrary(moduleName);
00982
00983                 _fct = (FCT) GetProcAddress(_hModule, (LPCSTR)ordinal);
00984         }

template<typename FCT>
DynamicLoadLibFct< FCT >::DynamicLoadLibFct | ( | LPCTSTR | moduleName,
 |  | LPCSTR | name
 | ) | [inline]

Definition at line 986 of file utility.h.

00987         {
00988                 _hModule = LoadLibrary(moduleName);
00989
00990                 _fct = (FCT) GetProcAddress(_hModule, name);
00991         }

template<typename FCT>
DynamicLoadLibFct< FCT >::~DynamicLoadLibFct ( ) [inline]

Definition at line 993 of file utility.h.

00994         {
00995                 FreeLibrary(_hModule);
00996         }

Member Function Documentation

template<typename FCT>
FCT DynamicLoadLibFct< FCT >::operator * ( ) const [inline]

Definition at line 998 of file utility.h.

00998 {return _fct;}

template<typename FCT>
DynamicLoadLibFct< FCT >::operator bool ( ) const [inline]

Definition at line 999 of file utility.h.

00999 {return _fct? true: false;}

Member Data Documentation

template<typename FCT>
FCT DynamicLoadLibFct< FCT >::_fct [protected]

Definition at line 1003 of file utility.h.

template<typename FCT>
HMODULE DynamicLoadLibFct< FCT >::_hModule [protected]

Definition at line 1002 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

DynamicLoadLibFct< FCT > Member List

This is the complete list of members for DynamicLoadLibFct< FCT >, including all inherited members.

_fct | DynamicLoadLibFct< FCT > | [protected]
_hModule | DynamicLoadLibFct< FCT > | [protected]
DynamicLoadLibFct(LPCTSTR moduleName, UINT ordinal) | DynamicLoadLibFct< FCT > | [inline]
DynamicLoadLibFct(LPCTSTR moduleName, LPCSTR name) | DynamicLoadLibFct< FCT > | [inline]
operator *() const | DynamicLoadLibFct< FCT > | [inline]
operator bool() const | DynamicLoadLibFct< FCT > | [inline]
~DynamicLoadLibFct() | DynamicLoadLibFct< FCT > | [inline]


ROS Explorer: EditController Struct Reference

EditController Struct Reference

#include <window.h>

Inheritance diagram for EditController:

[legend]
Collaboration diagram for EditController:

[legend]
List of all members.

Public Types

typedef SubclassedWindow | super

Public Member Functions

EditController (HWND hwnd)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Detailed Description

Definition at line 1101 of file window.h.

Member Typedef Documentation

typedef SubclassedWindow EditController::super

Reimplemented from SubclassedWindow.

Definition at line 1103 of file window.h.

Constructor & Destructor Documentation

EditController::EditController ( HWND hwnd ) [inline]

Definition at line 1105 of file window.h.

01106          :      super(hwnd)
01107         {
01108         }

Member Function Documentation

LRESULT EditController::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [inline, protected, virtual]

Reimplemented from SubclassedWindow.

Definition at line 1111 of file window.h.

References WindowHandle::_hwnd.

01112         {
01113                 if (nmsg==WM_KEYDOWN && wparam==VK_RETURN) {
01114                         SendParent(WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(_hwnd),1), (LPARAM)_hwnd);
01115                         return 0;
01116                 } else
01117                         return super::WndProc(nmsg, wparam, lparam);
01118         }

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

EditController Member List

This is the complete list of members for EditController, including all inherited members.

_hwnd | WindowHandle | [protected]
_orgWndProc | SubclassedWindow | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | SubclassedWindow | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
EditController(HWND hwnd) | EditController | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | SubclassedWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | EditController |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | EditController | [inline, protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: Entry Struct Reference

Entry Struct Reference

base of all file and directory entries More...

#include <entries.h>

Inheritance diagram for Entry:

[legend]
Collaboration diagram for Entry:

[legend]
List of all members.

Public Member Functions

virtual | ~Entry ()
void | free_subentries ()
void | read_directory_base (SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL)
Entry * | read_tree (const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL)
void | sort_directory (SORT_ORDER sortOrder)
void | smart_scan (SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL)
int | extract_icon (ICONCACHE_FLAGS flags=ICF_NORMAL)
int | safe_extract_icon (ICONCACHE_FLAGS flags=ICF_NORMAL)
virtual void | read_directory (int scan_flags=SCAN_ALL)
virtual const void * | get_next_path_component (const void *) const
virtual Entry * | find_entry (const void *)
virtual bool | get_path (PTSTR path, size_t path_count) const =0
virtual ShellPath | create_absolute_pidl () const
virtual HRESULT | GetUIObjectOf (HWND hWnd, REFIID riid, LPVOID *ppvOut)
virtual BOOL | launch_entry (HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL)
virtual HRESULT | do_context_menu (HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs)

Public Attributes

Entry * _next
Entry * _down
Entry * _up
bool | _expanded
bool | _scanned
int | _level
WIN32_FIND_DATA | _data
SFGAOF | _shell_attribs
LPTSTR | _display_name
LPTSTR | _type_name
LPTSTR | _content
ENTRY_TYPE _etype
int | _icon_id
BY_HANDLE_FILE_INFORMATION | _bhfi
bool | _bhfi_valid

Protected Member Functions

Entry (ENTRY_TYPE etype)
Entry (Entry *parent, ENTRY_TYPE etype)
Entry (const Entry &)
bool | get_path_base (PTSTR path, size_t path_count, ENTRY_TYPE etype) const

Detailed Description

base of all file and directory entries

Definition at line 82 of file entries.h.

Constructor & Destructor Documentation

Entry::Entry ( ENTRY_TYPE etype ) [protected]

Definition at line 35 of file entries.cpp.

References _bhfi_valid, _content, _data, _display_name, _down, _expanded, _icon_id, _level, _next, _scanned, _type_name, _up, and ICID_UNKNOWN.

00036  :      _etype(etype)
00037 {
00038         _up = NULL;
00039         _next = NULL;
00040         _down = NULL;
00041         _expanded = false;
00042         _scanned = false;
00043         _bhfi_valid = false;
00044         _level = 0;
00045         _icon_id = ICID_UNKNOWN;
00046         _display_name = _data.cFileName;
00047         _type_name = NULL;
00048         _content = NULL;
00049 }

Entry::Entry | ( | Entry * | parent,
 |  | ENTRY_TYPE | etype
 | ) | [protected]

Definition at line 51 of file entries.cpp.

References _bhfi_valid, _content, _data, _display_name, _down, _expanded, _icon_id, _level, _next, _scanned, _type_name, and ICID_UNKNOWN.

00052  :      _up(parent),
00053         _etype(etype)
00054 {
00055         _next = NULL;
00056         _down = NULL;
00057         _expanded = false;
00058         _scanned = false;
00059         _bhfi_valid = false;
00060         _level = 0;
00061         _icon_id = ICID_UNKNOWN;
00062         _display_name = _data.cFileName;
00063         _type_name = NULL;
00064         _content = NULL;
00065 }

Entry::Entry ( const Entry & ) [protected]

Definition at line 67 of file entries.cpp.

References _bhfi, _bhfi_valid, _content, _data, _display_name, _down, _etype, _expanded, _icon_id, _level, _next, _scanned, _shell_attribs, _type_name, and _up.

00068 {
00069         _next = NULL;
00070         _down = NULL;
00071         _up = NULL;
00072
00073         assert(!other._next);
00074         assert(!other._down);
00075         assert(!other._up);
00076
00077         _expanded = other._expanded;
00078         _scanned = other._scanned;
00079         _level = other._level;
00080
00081         _data = other._data;
00082
00083         _shell_attribs = other._shell_attribs;
00084         _display_name = other._display_name==other._data.cFileName? _data.cFileName: _tcsdup(other._display_name);
00085         _type_name = other._type_name? _tcsdup(other._type_name): NULL;
00086         _content = other._content? _tcsdup(other._content): NULL;
00087
00088         _etype = other._etype;
00089         _icon_id = other._icon_id;
00090
00091         _bhfi = other._bhfi;
00092         _bhfi_valid = other._bhfi_valid;
00093 }

Entry::~Entry ( ) [virtual]

Definition at line 96 of file entries.cpp.

References _content, _data, _display_name, ExplorerGlobals::_icon_cache, _icon_id, _type_name, IconCache::free_icon(), g_Globals, and ICID_NONE.

00097 {
00098         if (_icon_id > ICID_NONE)
00099                 g_Globals._icon_cache.free_icon(_icon_id);
00100
00101         if (_display_name != _data.cFileName)
00102                 free(_display_name);
00103
00104         if (_type_name)
00105                 free(_type_name);
00106
00107         if (_content)
00108                 free(_content);
00109 }

Here is the call graph for this function:

Member Function Documentation

virtual ShellPath Entry::create_absolute_pidl ( ) const [inline, virtual]

Reimplemented in FATEntry, ShellEntry, and WinEntry.

Definition at line 126 of file entries.h.

Referenced by StartMenu::ActivateEntry(), ShellEntry::create_absolute_pidl(), do_context_menu(), and extract_icon().

00126 {return (LPCITEMIDLIST)NULL;}

HRESULT Entry::do_context_menu | ( | HWND | hwnd,
 |  | const POINT & | pos,
 |  | CtxMenuInterfaces & | cm_ifs
 | ) | [virtual]

Definition at line 491 of file entries.cpp.

References create_absolute_pidl(), GetDesktopFolder(), and ShellFolderContextMenu().

Referenced by ShellBrowser::OnTreeItemRClick().

00492 {
00493         ShellPath shell_path = create_absolute_pidl();
00494         LPCITEMIDLIST pidl_abs = shell_path;
00495
00496         if (!pidl_abs)
00497                 return S_FALSE; // no action for registry entries, etc.
00498
00499 #ifdef USE_MY_SHBINDTOPARENT
00500         IShellFolder* parentFolder;
00501         LPCITEMIDLIST pidlLast;
00502
00503          // get and use the parent folder to display correct context menu in all cases -> correct "Properties" dialog for directories, ...
00504         HRESULT hr = my_SHBindToParent(pidl_abs, IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast);
00505
00506         if (SUCCEEDED(hr)) {
00507                 hr = ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pos.x, pos.y, cm_ifs);
00508
00509                 parentFolder->Release();
00510         }
00511
00512         return hr;
00513 #else
00514         static DynamicFct<HRESULT(WINAPI*)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*)> SHBindToParent(TEXT("SHELL32"), "SHBindToParent");
00515
00516         if (SHBindToParent) {
00517                 IShellFolder* parentFolder;
00518                 LPCITEMIDLIST pidlLast;
00519
00520                  // get and use the parent folder to display correct context menu in all cases -> correct "Properties" dialog for directories, ...
00521                 HRESULT hr = (*SHBindToParent)(pidl_abs, IID_IShellFolder, (LPVOID*)&parentFolder, &pidlLast);
00522
00523                 if (SUCCEEDED(hr)) {
00524                         hr = ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pos.x, pos.y, cm_ifs);
00525
00526                         parentFolder->Release();
00527                 }
00528
00529                 return hr;
00530         } else {
00547                 return ShellFolderContextMenu(GetDesktopFolder(), hwnd, 1, &pidl_abs, pos.x, pos.y, cm_ifs);
00548         }
00549 #endif
00550 }

Here is the call graph for this function:

int Entry::extract_icon ( ICONCACHE_FLAGS flags = ICF_NORMAL )

Definition at line 323 of file entries.cpp.

References ExplorerGlobals::_icon_cache, IconCache::add(), COUNTOF, create_absolute_pidl(), IconCache::extract(), g_Globals, get_path(), GetUIObjectOf(), ICF_LARGE, ICF_OPEN, ICF_OVERLAYS, and ICID_NONE.

Referenced by ShellDirectory::extract_icons(), and safe_extract_icon().

00324 {
00325         TCHAR path[MAX_PATH];
00326
00327         ICON_ID icon_id = ICID_NONE;
00328
00329         if (get_path(path, COUNTOF(path)) && _tcsncmp(path,TEXT("::{"),3))
00330                 icon_id = g_Globals._icon_cache.extract(path, flags);
00331
00332         if (icon_id == ICID_NONE) {
00333                 if (!(flags & (ICF_OPEN|ICF_OVERLAYS))) {
00334                         IExtractIcon* pExtract;
00335                         if (SUCCEEDED(GetUIObjectOf(0, IID_IExtractIcon, (LPVOID*)&pExtract))) {
00336                                 unsigned gil_flags;
00337                                 int idx;
00338
00339                                 if (SUCCEEDED(pExtract->GetIconLocation(GIL_FORSHELL, path, COUNTOF(path), &idx, &gil_flags))) {
00340                                         if (gil_flags & GIL_NOTFILENAME)
00341                                                 icon_id = g_Globals._icon_cache.extract(pExtract, path, idx, flags);
00342                                         else {
00343                                                 if (idx == -1)
00344                                                         idx = 0;        // special case for some control panel applications ("System")
00345
00346                                                 icon_id = g_Globals._icon_cache.extract(path, idx, flags);
00347                                         }
00348
00349                                 /* using create_absolute_pidl() [see below] results in more correct icons for some control panel applets (NVidia display driver).
00350                                         if (icon_id == ICID_NONE) {
00351                                                 SHFILEINFO sfi;
00352
00353                                                 if (SHGetFileInfo(path, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_SMALLICON))
00354                                                         icon_id = g_Globals._icon_cache.add(sfi.hIcon)._id;
00355                                         } */
00356                                 /*
00357                                         if (icon_id == ICID_NONE) {
00358                                                 LPBYTE b = (LPBYTE) alloca(0x10000);
00359                                                 SHFILEINFO sfi;
00360
00361                                                 FILE* file = fopen(path, "rb");
00362                                                 if (file) {
00363                                                         int l = fread(b, 1, 0x10000, file);
00364                                                         fclose(file);
00365
00366                                                         if (l)
00367                                                                 icon_id = g_Globals._icon_cache.add(CreateIconFromResourceEx(b, l, TRUE, 0x00030000, 16, 16, LR_DEFAULTCOLOR));
00368                                                 }
00369                                         } */
00370                                 }
00371                         }
00372                 }
00373
00374                 if (icon_id == ICID_NONE) {
00375                         SHFILEINFO sfi;
00376
00377                         const ShellPath& pidl_abs = create_absolute_pidl();
00378                         LPCITEMIDLIST pidl = pidl_abs;
00379
00380                         int shgfi_flags = SHGFI_SYSICONINDEX|SHGFI_PIDL;
00381
00382                         if (!(flags & ICF_LARGE))
00383                                 shgfi_flags |= SHGFI_SMALLICON;
00384
00385                         if (flags & ICF_OPEN)
00386                                 shgfi_flags |= SHGFI_OPENICON;
00387
00388                         // ICF_OVERLAYS is not supported in this case.
00389
00390                         HIMAGELIST himlSys = (HIMAGELIST) SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), shgfi_flags);
00391                         if (himlSys)
00392                                 icon_id = g_Globals._icon_cache.add(sfi.iIcon);
00393                         /*
00394                         if (SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_ICON|(g_Globals._large_icons? SHGFI_SMALLICON: 0)))
00395                                 icon_id = g_Globals._icon_cache.add(sfi.hIcon)._id;
00396                         */
00397                 }
00398         }
00399
00400         return icon_id;
00401 }

Here is the call graph for this function:

virtual Entry* Entry::find_entry ( const void * ) [inline, virtual]

Reimplemented in FATDirectory, NtObjDirectory, RegDirectory, ShellDirectory, and WinDirectory.

Definition at line 124 of file entries.h.

Referenced by ShellBrowser::jump_to(), and ShellBrowser::jump_to_pidl().

00124 {return NULL;}

void Entry::free_subentries ( )

Definition at line 712 of file entries.cpp.

References _down, _next, and free_subentries().

Referenced by free_subentries(), smart_scan(), Root::~Root(), and StartMenuDirectory::~StartMenuDirectory().

00713 {
00714         Entry *entry, *next=_down;
00715
00716         if (next) {
00717                 _down = 0;
00718
00719                 do {
00720                         entry = next;
00721                         next = entry->_next;
00722
00723                         entry->free_subentries();
00724                         delete entry;
00725                 } while(next);
00726         }
00727 }

Here is the call graph for this function:

virtual const void* Entry::get_next_path_component ( const void * ) const [inline, virtual]

Reimplemented in FATDirectory, RegDirectory, ShellDirectory, and WinDirectory.

Definition at line 123 of file entries.h.

Referenced by ShellBrowser::jump_to_pidl().

00123 {return NULL;}

virtual bool Entry::get_path | ( | PTSTR | path,
 |  | size_t | path_count
 | ) | const [pure virtual]

Implemented in FATEntry, NtObjEntry, RegEntry, ShellEntry, ShellDirectory, and WinEntry.

Referenced by StartMenu::ActivateEntry(), FindProgramDlg::collect_programs_callback(), extract_icon(), get_path_base(), GetUIObjectOf(), launch_entry(), and FileChildWindow::set_curdir().

bool Entry::get_path_base | ( | PTSTR | path,
 |  | size_t | path_count,
 |  | ENTRY_TYPE | etype
 | ) | const [protected]

Definition at line 610 of file entries.cpp.

References _data, _etype, _up, COUNTOF, ET_WINDOWS, and get_path().

Referenced by WinEntry::get_path(), RegEntry::get_path(), NtObjEntry::get_path(), and FATEntry::get_path().

00611 {
00612         int level = 0;
00613         size_t len = 0;
00614         size_t l = 0;
00615         LPCTSTR name = NULL;
00616         TCHAR buffer[MAX_PATH];
00617
00618         if (!path || path_count==0)
00619                 return false;
00620
00621         const Entry* entry;
00622         if ( path_count > 1 )
00623         {
00624                 for(entry=this; entry; level++) {
00625                         l = 0;
00626
00627                         if (entry->_etype == etype) {
00628                                 name = entry->_data.cFileName;
00629
00630                                 for(LPCTSTR s=name; *s && *s!=TEXT('/') && *s!=TEXT('\\'); s++)
00631                                         ++l;
00632
00633                                 if (!entry->_up)
00634                                         break;
00635                         } else {
00636                                 if (entry->get_path(buffer, COUNTOF(buffer))) {
00637                                         l = _tcslen(buffer);
00638                                         name = buffer;
00639
00640                                         /* special handling of drive names */
00641                                         if (l>0 && buffer[l-1]=='\\' && path[0]=='\\')
00642                                                 --l;
00643
00644                                         if ( len+l >= path_count )
00645                                         {
00646                                                 if ( l + 1 > path_count )
00647                                                         len = 0;
00648                                                 else
00649                                                         len = path_count - l - 1;
00650                                         }
00651                                         memmove(path+l, path, len*sizeof(TCHAR));
00652                                         if ( l+1 >= path_count )
00653                                                 l = path_count - 1;
00654                                         memcpy(path, name, l*sizeof(TCHAR));
00655                                         len += l;
00656                                 }
00657
00658                                 entry = NULL;
00659                                 break;
00660                         }
00661
00662                         if (l > 0) {
00663                                 if ( len+l+1 >= path_count )
00664                                 {
00665                                         /* compare to 2 here because of terminator plus the '\\' we prepend */
00666                                         if ( l + 2 > path_count )
00667                                                 len = 0;
00668                                         else
00669                                                 len = path_count - l - 2;
00670                                 }
00671                                 memmove(path+l+1, path, len*sizeof(TCHAR));
00672                                 /* compare to 2 here because of terminator plus the '\\' we prepend */
00673                                 if ( l+2 >= path_count )
00674                                         l = path_count - 2;
00675                                 memcpy(path+1, name, l*sizeof(TCHAR));
00676                                 len += l+1;
00677
00678                                 if ( etype == ET_WINDOWS && entry->_up && !(entry->_up->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))     // a NTFS stream?
00679                                         path[0] = TEXT(':');
00680                                 else
00681                                         path[0] = TEXT('\\');
00682                         }
00683
00684                         entry = entry->_up;
00685                 }
00686
00687                 if (entry) {
00688                         if ( len+l >= path_count )
00689                         {
00690                                 if ( l + 1 > path_count )
00691                                         len = 0;
00692                                 else
00693                                         len = path_count - l - 1;
00694                         }
00695                         memmove(path+l, path, len*sizeof(TCHAR));
00696                         if ( l+1 >= path_count )
00697                                 l = path_count - 1;
00698                         memcpy(path, name, l*sizeof(TCHAR));
00699                         len += l;
00700                 }
00701
00702                 if ( !level && (len+1 < path_count) )
00703                         path[len++] = TEXT('\\');
00704         }
00705
00706         path[len] = TEXT('\0');
00707
00708         return true;
00709 }

Here is the call graph for this function:

HRESULT Entry::GetUIObjectOf | ( | HWND | hWnd,
 |  | REFIID | riid,
 |  | LPVOID * | ppvOut
 | ) | [virtual]

Reimplemented in ShellEntry.

Definition at line 553 of file entries.cpp.

References _data, _up, COUNTOF, SIfacePtr< T >::Free(), and get_path().

Referenced by FindProgramDlg::collect_programs_callback(), and extract_icon().

00554 {
00555         TCHAR path[MAX_PATH];
00556 /*
00557         if (!get_path(path, COUNTOF(path)))
00558                 return E_FAIL;
00559
00560         ShellPath shell_path(path);
00561
00562         IShellFolder* pFolder;
00563         LPCITEMIDLIST pidl_last = NULL;
00564
00565         static DynamicFct<HRESULT(WINAPI*)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*)> SHBindToParent(TEXT("SHELL32"), "SHBindToParent");
00566
00567         if (!SHBindToParent)
00568                 return E_NOTIMPL;
00569
00570         HRESULT hr = (*SHBindToParent)(shell_path, IID_IShellFolder, (LPVOID*)&pFolder, &pidl_last);
00571         if (FAILED(hr))
00572                 return hr;
00573
00574         ShellFolder shell_folder(pFolder);
00575
00576         shell_folder->Release();
00577
00578         return shell_folder->GetUIObjectOf(hWnd, 1, &pidl_last, riid, NULL, ppvOut);
00579 */
00580         if (!_up)
00581                 return E_INVALIDARG;
00582
00583         if (!_up->get_path(path, COUNTOF(path)))
00584                 return E_FAIL;
00585
00586         ShellPath shell_path(path);
00587         ShellFolder shell_folder(shell_path);
00588
00589 #ifdef UNICODE
00590         LPWSTR wname = _data.cFileName;
00591 #else
00592         WCHAR wname[MAX_PATH];
00593         MultiByteToWideChar(CP_ACP, 0, _data.cFileName, -1, wname, COUNTOF(wname));
00594 #endif
00595
00596         LPITEMIDLIST pidl_last = NULL;
00597         HRESULT hr = shell_folder->ParseDisplayName(hWnd, NULL, wname, NULL, &pidl_last, NULL);
00598
00599         if (FAILED(hr))
00600                 return hr;
00601
00602         hr = shell_folder->GetUIObjectOf(hWnd, 1, (LPCITEMIDLIST*)&pidl_last, riid, NULL, ppvOut);
00603
00604         ShellMalloc()->Free((void*)pidl_last);
00605
00606         return hr;
00607 }

Here is the call graph for this function:

BOOL Entry::launch_entry | ( | HWND | hwnd,
 |  | UINT | nCmdShow = SW_SHOWNORMAL
 | ) | [virtual]

Reimplemented in NtObjEntry, RegEntry, and ShellEntry.

Definition at line 415 of file entries.cpp.

References COUNTOF, get_path(), and launch_file().

Referenced by FileChildWindow::activate_entry(), QuickLaunchBar::Command(), and FindProgramDlg::LaunchSelected().

00416 {
00417         TCHAR cmd[MAX_PATH];
00418
00419         if (!get_path(cmd, COUNTOF(cmd)))
00420                 return FALSE;
00421
00422          // add path to the recent file list
00423         SHAddToRecentDocs(SHARD_PATH, cmd);
00424
00425           // start program, open document...
00426         return launch_file(hwnd, cmd, nCmdShow);
00427 }

Here is the call graph for this function:

virtual void Entry::read_directory ( int scan_flags = SCAN_ALL ) [inline, virtual]

Reimplemented in FATDirectory, NtObjDirectory, RegDirectory, RegistryRoot, ShellDirectory, and WinDirectory.

Definition at line 122 of file entries.h.

Referenced by ShellBrowser::Init(), and read_directory_base().

00122 {}

void Entry::read_directory_base | ( | SORT_ORDER | sortOrder = SORT_NAME,
 |  | int | scan_flags = SCAN_ALL
 | ) |

Definition at line 137 of file entries.cpp.

References _data, _down, _next, ExplorerGlobals::_prescan_nodes, CONTEXT, g_Globals, read_directory(), and sort_directory().

Referenced by smart_scan().

00138 {
00139         CONTEXT("Entry::read_directory_base()");
00140
00141          // call into subclass
00142         read_directory(scan_flags);
00143
00144 #ifndef ROSSHELL
00145         if (g_Globals._prescan_nodes) { //@todo _prescan_nodes should not be used for reading the start menu.
00146                 for(Entry*entry=_down; entry; entry=entry->_next)
00147                         if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00148                                 entry->read_directory(scan_flags);
00149                                 entry->sort_directory(sortOrder);
00150                         }
00151         }
00152 #endif
00153
00154         sort_directory(sortOrder);
00155 }

Here is the call graph for this function:

Entry * Entry::read_tree | ( | const void * | path,
 |  | SORT_ORDER | sortOrder = SORT_NAME,
 |  | int | scan_flags = SCAN_ALL
 | ) |

Definition at line 113 of file entries.cpp.

References CONTEXT.

Referenced by Root::read_tree().

00114 {
00115         CONTEXT("Entry::read_tree()");
00116
00117         WaitCursor wait;
00118
00119         Entry* entry = this;
00120
00121         for(const void*p=path; p && entry; ) {
00122                 entry->smart_scan(sortOrder, scan_flags);
00123
00124                 if (entry->_down)
00125                         entry->_expanded = true;
00126
00127                 Entry* found = entry->find_entry(p);
00128                 p = entry->get_next_path_component(p);
00129
00130                 entry = found;
00131         }
00132
00133         return entry;
00134 }

int Entry::safe_extract_icon ( ICONCACHE_FLAGS flags = ICF_NORMAL )

Definition at line 403 of file entries.cpp.

References extract_icon(), and ICID_NONE.

Referenced by QuickLaunchBar::AddShortcuts(), ShellBrowser::OnTreeGetDispInfo(), and StartMenu::UpdateIcons().

00404 {
00405         try {
00406                 return extract_icon(flags);
00407         } catch(COMException&) {
00408                 // ignore unexpected exceptions while extracting icons
00409         }
00410
00411         return ICID_NONE;
00412 }

Here is the call graph for this function:

void Entry::smart_scan | ( | SORT_ORDER | sortOrder = SORT_NAME,
 |  | int | scan_flags = SCAN_ALL
 | ) |

Todo:
We could use IShellFolder2::GetDefaultColumn to determine sort order.

Definition at line 311 of file entries.cpp.

References _scanned, CONTEXT, free_subentries(), and read_directory_base().

Referenced by QuickLaunchBar::AddShortcuts(), CollectProgramsThread::collect_programs(), BookmarkList::import_IE_favorites(), ShellBrowser::InsertSubitems(), ShellBrowser::jump_to_pidl(), ShellBrowser::OnDefaultCommand(), and Root::read_tree().

00312 {
00313         CONTEXT("Entry::smart_scan()");
00314
00315         if (!_scanned) {
00316                 free_subentries();
00317                 read_directory_base(sortOrder, scan_flags);
00318         }
00319 }

Here is the call graph for this function:

void Entry::sort_directory ( SORT_ORDER sortOrder )

Definition at line 279 of file entries.cpp.

References _next, and SORT_NONE.

Referenced by read_directory_base().

00280 {
00281         if (sortOrder != SORT_NONE) {
00282                 Entry* entry = _down;
00283                 Entry** array, **p;
00284                 int len;
00285
00286                 len = 0;
00287                 for(entry=_down; entry; entry=entry->_next)
00288                         ++len;
00289
00290                 if (len) {
00291                         array = (Entry**) alloca(len*sizeof(Entry*));
00292
00293                         p = array;
00294                         for(entry=_down; entry; entry=entry->_next)
00295                                 *p++ = entry;
00296
00297                          // call qsort with the appropriate compare function
00298                         qsort(array, len, sizeof(array[0]), sortFunctions[sortOrder]);
00299
00300                         _down = array[0];
00301
00302                         for(p=array; --len; p++)
00303                                 (*p)->_next = p[1];
00304
00305                         (*p)->_next = 0;
00306                 }
00307         }
00308 }

Member Data Documentation

BY_HANDLE_FILE_INFORMATION Entry::_bhfi

Definition at line 110 of file entries.h.

Referenced by Pane::draw_item(), Entry(), WinDirectory::read_directory(), ShellDirectory::read_directory(), and NtObjDirectory::read_directory().

bool Entry::_bhfi_valid

Definition at line 111 of file entries.h.

Referenced by Pane::draw_item(), Entry(), WinDirectory::read_directory(), ShellDirectory::read_directory(), and NtObjDirectory::read_directory().

LPTSTR Entry::_content

Definition at line 105 of file entries.h.

Referenced by Pane::draw_item(), Entry(), NtObjDirectory::read_directory(), and ~Entry().

WIN32_FIND_DATA Entry::_data

Definition at line 100 of file entries.h.

Referenced by FileChildWindow::activate_entry(), StartMenu::ActivateEntry(), StartMenu::AddEntry(), Pane::draw_item(), Entry(), MDIShellBrowserChild::entry_selected(), SDIMainFrame::entry_selected(), FileChildWindow::expand_entry(), WinDirectory::find_entry(), RegDirectory::find_entry(), NtObjDirectory::find_entry(), FATDirectory::find_entry(), get_path_base(), GetUIObjectOf(), Pane::insert_entries(), ShellBrowser::OnDefaultCommand(), WinDirectory::read_directory(), ShellDirectory::read_directory(), RegistryRoot::read_directory(), RegDirectory::read_directory(), NtObjDirectory::read_directory(), read_directory_base(), RegDirectory::RegDirectory(), FileTypeManager::set_type(), ShellDirectory::ShellDirectory(), and ~Entry().

LPTSTR Entry::_display_name

Definition at line 103 of file entries.h.

Referenced by StartMenu::ActivateEntry(), FindProgramDlg::add_entry(), StartMenu::AddEntry(), FindProgramDlg::CompareFunc(), Pane::draw_item(), Entry(), ShellBrowser::OnTreeGetDispInfo(), ShellDirectory::read_directory(), FileTypeManager::set_type(), and ~Entry().

Entry* Entry::_down

Definition at line 93 of file entries.h.

Referenced by FileChildWindow::activate_entry(), QuickLaunchBar::AddShortcuts(), CollectProgramsThread::collect_programs(), Pane::draw_item(), Entry(), FileChildWindow::expand_entry(), ShellDirectory::extract_icons(), WinDirectory::find_entry(), ShellDirectory::find_entry(), RegDirectory::find_entry(), NtObjDirectory::find_entry(), FATDirectory::find_entry(), free_subentries(), BookmarkList::import_IE_favorites(), Pane::insert_entries(), WinDirectory::read_directory(), RegistryRoot::read_directory(), read_directory_base(), ScanNTFSStreams(), and FileChildWindow::set_curdir().

ENTRY_TYPE Entry::_etype

Definition at line 107 of file entries.h.

Referenced by StartMenu::ActivateEntry(), ShellEntry::create_absolute_pidl(), Entry(), MDIShellBrowserChild::entry_selected(), SDIMainFrame::entry_selected(), ShellDirectory::find_entry(), get_path_base(), BookmarkList::import_IE_favorites(), FileChildWindow::jump_to_int(), and ShellBrowser::OnDefaultCommand().

bool Entry::_expanded

Definition at line 96 of file entries.h.

Referenced by Entry(), FileChildWindow::expand_entry(), and Pane::insert_entries().

int Entry::_icon_id

Definition at line 108 of file entries.h.

Referenced by StartMenu::AddEntry(), QuickLaunchBar::AddShortcuts(), Pane::draw_item(), Entry(), ShellDirectory::extract_icons(), FindProgramDlg::Notify(), ShellDirectory::read_directory(), StartMenu::UpdateIcons(), and ~Entry().

int Entry::_level

Definition at line 98 of file entries.h.

Referenced by FileChildWindow::collapse_entry(), Entry(), WinDirectory::read_directory(), ShellDirectory::read_directory(), RegistryRoot::read_directory(), RegDirectory::read_directory(), NtObjDirectory::read_directory(), and FileChildWindow::scan_entry().

Entry* Entry::_next

Definition at line 92 of file entries.h.

Referenced by QuickLaunchBar::AddShortcuts(), CollectProgramsThread::collect_programs(), Pane::draw_item(), Entry(), FileChildWindow::expand_entry(), ShellDirectory::extract_icons(), WinDirectory::find_entry(), ShellDirectory::find_entry(), RegDirectory::find_entry(), NtObjDirectory::find_entry(), FATDirectory::find_entry(), free_subentries(), BookmarkList::import_IE_favorites(), Pane::insert_entries(), WinDirectory::read_directory(), ShellDirectory::read_directory(), RegistryRoot::read_directory(), RegDirectory::read_directory(), NtObjDirectory::read_directory(), read_directory_base(), ScanNTFSStreams(), and sort_directory().

bool Entry::_scanned

Definition at line 97 of file entries.h.

Referenced by FileChildWindow::activate_entry(), Entry(), WinDirectory::read_directory(), ShellDirectory::read_directory(), RegistryRoot::read_directory(), FileChildWindow::set_curdir(), and smart_scan().

SFGAOF Entry::_shell_attribs

Definition at line 102 of file entries.h.

Referenced by Entry(), BookmarkList::import_IE_favorites(), ShellBrowser::OnTreeItemExpanding(), ShellDirectory::read_directory(), and ShellDirectory::ShellDirectory().

LPTSTR Entry::_type_name

Definition at line 104 of file entries.h.

Referenced by Pane::draw_item(), Entry(), RegDirectory::read_directory(), NtObjDirectory::read_directory(), FileTypeManager::set_type(), and ~Entry().

Entry* Entry::_up

Definition at line 94 of file entries.h.

Referenced by FileChildWindow::activate_entry(), ShellEntry::create_absolute_pidl(), ShellEntry::do_context_menu(), Pane::draw_item(), Entry(), ShellEntry::get_parent_folder(), get_path_base(), and GetUIObjectOf().

The documentation for this struct was generated from the following files:
  • entries.h
  • entries.cpp


ROS Explorer: Member List

Entry Member List

This is the complete list of members for Entry, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_scanned | Entry |
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | Entry | [inline, virtual]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
find_entry(const void *) | Entry | [inline, virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | Entry | [inline, virtual]
get_path(PTSTR path, size_t path_count) const =0 | Entry | [pure virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL) | Entry | [virtual]
read_directory(int scan_flags=SCAN_ALL) | Entry | [inline, virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Entry() | Entry | [virtual]


ROS Explorer: EnumFormatEtcImpl Class Reference

EnumFormatEtcImpl Class Reference

implementation of IEnumFORMATETC interface More...

#include <dragdropimpl.h>

Inheritance diagram for EnumFormatEtcImpl:

[legend]
Collaboration diagram for EnumFormatEtcImpl:

[legend]
List of all members.

Public Member Functions

EnumFormatEtcImpl (const FormatArray &ArrFE)
EnumFormatEtcImpl (const StorageArray &ArrFE)
virtual | ~EnumFormatEtcImpl ()
virtual HRESULT STDMETHODCALLTYPE | Next (ULONG, LPFORMATETC, ULONG *)
virtual HRESULT STDMETHODCALLTYPE | Skip (ULONG)
virtual HRESULT STDMETHODCALLTYPE | Reset (void)
virtual HRESULT STDMETHODCALLTYPE | Clone (IEnumFORMATETC **)

Detailed Description

implementation of IEnumFORMATETC interface

Definition at line 27 of file dragdropimpl.h.

Constructor & Destructor Documentation

EnumFormatEtcImpl::EnumFormatEtcImpl ( const FormatArray & ArrFE )

Referenced by Clone().

EnumFormatEtcImpl::EnumFormatEtcImpl ( const StorageArray & ArrFE )

virtual EnumFormatEtcImpl::~EnumFormatEtcImpl ( ) [inline, virtual]

Definition at line 40 of file dragdropimpl.h.

00040 {}

Member Function Documentation

STDMETHODIMP EnumFormatEtcImpl::Clone ( IEnumFORMATETC ** ) [virtual]

Definition at line 311 of file dragdropimpl.cpp.

References EnumFormatEtcImpl(), and m_iCur.

00312 {
00313   if (ppCloneEnumFormatEtc == NULL)
00314         return E_POINTER;
00315
00316   EnumFormatEtcImpl* newEnum = new EnumFormatEtcImpl(m_pFmtEtc);
00317
00318   if (!newEnum)
00319         return E_OUTOFMEMORY;
00320
00321   newEnum->AddRef();
00322   newEnum->m_iCur = m_iCur;
00323   *ppCloneEnumFormatEtc = newEnum;
00324
00325   return S_OK;
00326 }

Here is the call graph for this function:

STDMETHODIMP EnumFormatEtcImpl::Next | ( | ULONG | ,
 |  | LPFORMATETC | ,
 |  | ULONG * |
 | ) | [virtual]

Definition at line 272 of file dragdropimpl.cpp.

00273 {
00274    if (pceltFetched != NULL)
00275            *pceltFetched=0;
00276
00277    ULONG cReturn = celt;
00278
00279    if (celt <= 0 || lpFormatEtc == NULL || m_iCur >= m_pFmtEtc.size())
00280           return S_FALSE;
00281
00282    if (pceltFetched == NULL && celt != 1) // pceltFetched can be NULL only for 1 item request
00283           return S_FALSE;
00284
00285         while (m_iCur < m_pFmtEtc.size() && cReturn > 0)
00286         {
00287                 *lpFormatEtc++ = m_pFmtEtc[m_iCur++];
00288                 --cReturn;
00289         }
00290         if (pceltFetched != NULL)
00291                 *pceltFetched = celt - cReturn;
00292
00293         return (cReturn == 0) ? S_OK : S_FALSE;
00294 }

STDMETHODIMP EnumFormatEtcImpl::Reset ( void ) [virtual]

Definition at line 305 of file dragdropimpl.cpp.

00306 {
00307    m_iCur = 0;
00308    return S_OK;
00309 }

STDMETHODIMP EnumFormatEtcImpl::Skip ( ULONG ) [virtual]

Definition at line 296 of file dragdropimpl.cpp.

00297 {
00298         if ((m_iCur + int(celt)) >= m_pFmtEtc.size())
00299                 return S_FALSE;
00300
00301         m_iCur += celt;
00302         return S_OK;
00303 }

The documentation for this class was generated from the following files:
  • dragdropimpl.h
  • dragdropimpl.cpp


ROS Explorer: Member List

EnumFormatEtcImpl Member List

This is the complete list of members for EnumFormatEtcImpl, including all inherited members.

_ref | ComSrvObject | [protected]
_uuid_base | IComSrvQI< IEnumFORMATETC > | [protected]
Clone(IEnumFORMATETC **) | EnumFormatEtcImpl | [virtual]
ComSrvObject() | ComSrvObject | [inline, protected]
DecRef() | SimpleComObject | [inline]
EnumFormatEtcImpl(const FormatArray &ArrFE) | EnumFormatEtcImpl |
EnumFormatEtcImpl(const StorageArray &ArrFE) | EnumFormatEtcImpl |
IComSrvBase(REFIID uuid_base) | IComSrvBase< IEnumFORMATETC, EnumFormatEtcImpl > | [inline, protected]
IComSrvQI(REFIID uuid_base) | IComSrvQI< IEnumFORMATETC > | [inline]
IComSrvQI() | IComSrvQI< IEnumFORMATETC > | [inline, protected]
IncRef() | SimpleComObject | [inline]
Next(ULONG, LPFORMATETC, ULONG *) | EnumFormatEtcImpl | [virtual]
QueryInterface(REFIID riid, LPVOID *ppv) | IComSrvQI< IEnumFORMATETC > | [inline]
Reset(void) | EnumFormatEtcImpl | [virtual]
Skip(ULONG) | EnumFormatEtcImpl | [virtual]
STDMETHODIMP_(ULONG) AddRef() | IComSrvBase< IEnumFORMATETC, EnumFormatEtcImpl > | [inline]
STDMETHODIMP_(ULONG) Release() | IComSrvBase< IEnumFORMATETC, EnumFormatEtcImpl > | [inline]
~ComSrvObject() | ComSrvObject | [inline, protected, virtual]
~EnumFormatEtcImpl() | EnumFormatEtcImpl | [inline, virtual]
~IComSrvQI() | IComSrvQI< IEnumFORMATETC > | [inline, protected, virtual]


ROS Explorer: EventConnection Struct Reference

EventConnection Struct Reference

#include <webchild.h>

Inheritance diagram for EventConnection:

[legend]
Collaboration diagram for EventConnection:

[legend]
List of all members.

Public Member Functions

EventConnection (IConnectionPoint *connectionpoint, IUnknown *sink)
template<typename T>
EventConnection (T &connectionpoint, IUnknown *sink)
~EventConnection ()

Protected Attributes

SIfacePtr< IConnectionPoint > | _connectionpoint
DWORD | _cookie

Detailed Description

Definition at line 94 of file webchild.h.

Constructor & Destructor Documentation

EventConnection::EventConnection | ( | IConnectionPoint * | connectionpoint,
 |  | IUnknown * | sink
 | ) | [inline]

Definition at line 96 of file webchild.h.

References CheckError().

00097         {
00098                 CheckError(connectionpoint->Advise(sink, &_cookie));
00099                 _connectionpoint = connectionpoint;
00100         }

Here is the call graph for this function:

template<typename T>
EventConnection::EventConnection | ( | T & | connectionpoint,
 |  | IUnknown * | sink
 | ) | [inline]

Definition at line 102 of file webchild.h.

References CheckError().

00103         {
00104                 CheckError(connectionpoint->Advise(sink, &_cookie));
00105                 _connectionpoint = connectionpoint;
00106         }

Here is the call graph for this function:

EventConnection::~EventConnection ( ) [inline]

Definition at line 120 of file webchild.h.

00121         {
00122                 if (_connectionpoint)
00123                         _connectionpoint->Unadvise(_cookie);
00124         }

Member Data Documentation

SIfacePtr<IConnectionPoint> EventConnection::_connectionpoint [protected]

Definition at line 127 of file webchild.h.

DWORD EventConnection::_cookie [protected]

Definition at line 128 of file webchild.h.

The documentation for this struct was generated from the following file:
  • webchild.h


ROS Explorer: Member List

EventConnection Member List

This is the complete list of members for EventConnection, including all inherited members.

_connectionpoint | EventConnection | [protected]
_cookie | EventConnection | [protected]
EventConnection(IConnectionPoint *connectionpoint, IUnknown *sink) | EventConnection | [inline]
EventConnection(T &connectionpoint, IUnknown *sink) | EventConnection | [inline]
~EventConnection() | EventConnection | [inline]


ROS Explorer: EventConnector Struct Reference

EventConnector Struct Reference

#include <webchild.h>

Inheritance diagram for EventConnector:

[legend]
Collaboration diagram for EventConnector:

[legend]
List of all members.

Public Member Functions

EventConnector (IUnknown *unknown, REFIID riid, IUnknown *sink)

Detailed Description

Definition at line 131 of file webchild.h.

Constructor & Destructor Documentation

EventConnector::EventConnector | ( | IUnknown * | unknown,
 |  | REFIID | riid,
 |  | IUnknown * | sink
 | ) | [inline]

Definition at line 133 of file webchild.h.

00134          :      EventConnection(ConnectionPoint<IConnectionPoint>(
00135                                 SIfacePtr<IConnectionPointContainer>(unknown, IID_IConnectionPointContainer), riid), sink)
00136         {
00137         }

The documentation for this struct was generated from the following file:
  • webchild.h


ROS Explorer: Member List

EventConnector Member List

This is the complete list of members for EventConnector, including all inherited members.

_connectionpoint | EventConnection | [protected]
_cookie | EventConnection | [protected]
EventConnection(IConnectionPoint *connectionpoint, IUnknown *sink) | EventConnection | [inline]
EventConnection(T &connectionpoint, IUnknown *sink) | EventConnection | [inline]
EventConnector(IUnknown *unknown, REFIID riid, IUnknown *sink) | EventConnector | [inline]
~EventConnection() | EventConnection | [inline]


ROS Explorer: ExecuteDialog Struct Reference

ExecuteDialog Struct Reference

The "Execute..."-dialog lets the user enter a command line to launch. More...

#include <filechild.h>

Collaboration diagram for ExecuteDialog:

[legend]
List of all members.

Static Public Member Functions

static INT_PTR CALLBACK | WndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)

Public Attributes

TCHAR | cmd [MAX_PATH]
int | cmdshow

Detailed Description

The "Execute..."-dialog lets the user enter a command line to launch.

Definition at line 131 of file filechild.h.

Member Function Documentation

INT_PTR CALLBACK ExecuteDialog::WndProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 96 of file filechild.cpp.

References cmd, cmdshow, and COUNTOF.

Referenced by MainFrameBase::Command().

00097 {
00098         static struct ExecuteDialog* dlg;
00099
00100         switch(nmsg) {
00101           case WM_INITDIALOG:
00102                 dlg = (struct ExecuteDialog*) lparam;
00103                 return 1;
00104
00105           case WM_COMMAND: {
00106                 int id = (int)wparam;
00107
00108                 if (id == IDOK) {
00109                         GetWindowText(GetDlgItem(hwnd, 201), dlg->cmd, COUNTOF(dlg->cmd));
00110                         dlg->cmdshow = Button_GetState(GetDlgItem(hwnd,214))&BST_CHECKED?
00111                                                                                         SW_SHOWMINIMIZED: SW_SHOWNORMAL;
00112                         EndDialog(hwnd, id);
00113                 } else if (id == IDCANCEL)
00114                         EndDialog(hwnd, id);
00115
00116                 return 1;}
00117         }
00118
00119         return 0;
00120 }

Member Data Documentation

TCHAR ExecuteDialog::cmd[MAX_PATH]

Todo:
use class Dialog

Definition at line 132 of file filechild.h.

Referenced by WndProc().

int ExecuteDialog::cmdshow

Definition at line 133 of file filechild.h.

Referenced by WndProc().

The documentation for this struct was generated from the following files:
  • filechild.h
  • filechild.cpp


ROS Explorer: Member List

ExecuteDialog Member List

This is the complete list of members for ExecuteDialog, including all inherited members.

cmd | ExecuteDialog |
cmdshow | ExecuteDialog |
WndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | ExecuteDialog | [static]


ROS Explorer: ExplorerAboutDlg Struct Reference

ExplorerAboutDlg Struct Reference

"About Explorer" Dialog More...

Inheritance diagram for ExplorerAboutDlg:

[legend]
Collaboration diagram for ExplorerAboutDlg:

[legend]
List of all members.

Public Types

typedef CtlColorParent< OwnerDrawParent<
Dialog > > 		super

Public Member Functions

ExplorerAboutDlg (HWND hwnd)
~ExplorerAboutDlg ()
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
void | Paint ()

Protected Attributes

HFONT | _hfont

Detailed Description

"About Explorer" Dialog

Definition at line 754 of file explorer.cpp.

Member Typedef Documentation

typedef CtlColorParent< OwnerDrawParent<Dialog> > ExplorerAboutDlg::super

Reimplemented from CtlColorParent< OwnerDrawParent< Dialog > >.

Definition at line 761 of file explorer.cpp.

Constructor & Destructor Documentation

ExplorerAboutDlg::ExplorerAboutDlg ( HWND hwnd ) [inline]

Definition at line 763 of file explorer.cpp.

References _hfont, CenterWindow(), get_windows_version_str(), HWND, IDC_ROS_EXPLORER, IDC_VERSION_TXT, IDC_WIN_VERSION, IDC_WWW, IDI_REACTOS, IDS_EXPLORER_VERSION_STR, IDS_VERSION_STR, and SetWindowIcon().

00764          :      super(hwnd)
00765         {
00766                 SetWindowIcon(hwnd, IDI_REACTOS);
00767
00768                 new FlatButton(hwnd, IDOK);
00769
00770                 _hfont = CreateFont(20, 0, 0, 0, FW_BOLD, TRUE, 0, 0, 0, 0, 0, 0, 0, TEXT("Sans Serif"));
00771                 new ColorStatic(hwnd, IDC_ROS_EXPLORER, RGB(32,32,128), 0, _hfont);
00772
00773                 new HyperlinkCtrl(hwnd, IDC_WWW);
00774
00775                 FmtString ver_txt(ResString(IDS_EXPLORER_VERSION_STR), (LPCTSTR)ResString(IDS_VERSION_STR));
00776                 SetWindowText(GetDlgItem(hwnd, IDC_VERSION_TXT), ver_txt);
00777
00778                 HWND hwnd_winver = GetDlgItem(hwnd, IDC_WIN_VERSION);
00779                 SetWindowText(hwnd_winver, get_windows_version_str());
00780                 SetWindowFont(hwnd_winver, GetStockFont(DEFAULT_GUI_FONT), FALSE);
00781
00782                 CenterWindow(hwnd);
00783         }

Here is the call graph for this function:

ExplorerAboutDlg::~ExplorerAboutDlg ( ) [inline]

Definition at line 785 of file explorer.cpp.

References _hfont.

00786         {
00787                 DeleteObject(_hfont);
00788         }

Member Function Documentation

void ExplorerAboutDlg::Paint ( ) [inline]

Definition at line 804 of file explorer.cpp.

References ExplorerGlobals::_hInstance, and IDI_REACTOS_BIG.

Referenced by WndProc().

00805         {
00806                 PaintCanvas canvas(_hwnd);
00807
00808                 HICON hicon = (HICON) LoadImage(g_Globals._hInstance, MAKEINTRESOURCE(IDI_REACTOS_BIG), IMAGE_ICON, 0, 0, LR_SHARED);
00809
00810                 DrawIconEx(canvas, 20, 10, hicon, 0, 0, 0, 0, DI_NORMAL);
00811         }

LRESULT ExplorerAboutDlg::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [inline, virtual]

Reimplemented from CtlColorParent< OwnerDrawParent< Dialog > >.

Definition at line 790 of file explorer.cpp.

References Paint(), and CtlColorParent< OwnerDrawParent< Dialog > >::WndProc().

00791         {
00792                 switch(nmsg) {
00793                   case WM_PAINT:
00794                         Paint();
00795                         break;
00796
00797                   default:
00798                         return super::WndProc(nmsg, wparam, lparam);
00799                 }
00800
00801                 return 0;
00802         }

Here is the call graph for this function:

Member Data Documentation

HFONT ExplorerAboutDlg::_hfont [protected]

Definition at line 814 of file explorer.cpp.

Referenced by ExplorerAboutDlg(), and ~ExplorerAboutDlg().

The documentation for this struct was generated from the following file:
  • explorer.cpp


ROS Explorer: Member List

ExplorerAboutDlg Member List

This is the complete list of members for ExplorerAboutDlg, including all inherited members.

_hfont | ExplorerAboutDlg | [protected]
_hwnd | WindowHandle | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | Dialog | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
CtlColorParent(HWND hwnd) | CtlColorParent< OwnerDrawParent< Dialog > > | [inline]
Dialog(HWND) | Dialog |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0) | Dialog | [static]
DoModal(UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0) | Dialog | [static]
ExplorerAboutDlg(HWND hwnd) | ExplorerAboutDlg | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< Dialog > | [inline]
Paint() | ExplorerAboutDlg | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | ExplorerAboutDlg |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | ExplorerAboutDlg | [inline, virtual]
~Dialog() | Dialog |
~ExplorerAboutDlg() | ExplorerAboutDlg | [inline]
~Window() | Window | [virtual]


ROS Explorer: ExplorerCmd Struct Reference

ExplorerCmd Struct Reference

Explorer command line parser. More...

#include <explorer.h>

Collaboration diagram for ExplorerCmd:

[legend]
List of all members.

Public Member Functions

ExplorerCmd ()
ExplorerCmd (LPCTSTR url, bool mdi)
bool | ParseCmdLine (LPCTSTR lpCmdLine)
bool | EvaluateOption (LPCTSTR option)
bool | IsValidPath () const

Public Attributes

String _path
int | _flags
int | _cmdShow
bool | _mdi
bool | _valid_path

Detailed Description

Explorer command line parser.

Definition at line 81 of file explorer.h.

Constructor & Destructor Documentation

ExplorerCmd::ExplorerCmd ( ) [inline]

Definition at line 83 of file explorer.h.

00084          :      _flags(0),
00085                 _cmdShow(SW_SHOWNORMAL),
00086                 _mdi(false),
00087                 _valid_path(false)
00088         {
00089         }

ExplorerCmd::ExplorerCmd | ( | LPCTSTR | url,
 |  | bool | mdi
 | ) | [inline]

Definition at line 91 of file explorer.h.

00092          :      _path(url),
00093                 _flags(0),
00094                 _cmdShow(SW_SHOWNORMAL),
00095                 _mdi(mdi),
00096                 _valid_path(true)       //@@
00097         {
00098         }

Member Function Documentation

bool ExplorerCmd::EvaluateOption ( LPCTSTR option )

Definition at line 682 of file explorer.cpp.

References _flags, _mdi, _path, OWM_EXPLORE, and OWM_ROOTED.

Referenced by ParseCmdLine().

00683 {
00684         String opt_str;
00685
00686          // Remove quote characters, as they are evaluated at this point.
00687         for(; *option; ++option)
00688                 if (*option != '"')
00689                         opt_str += *option;
00690
00691         option = opt_str;
00692
00693         if (option[0] == '/') {
00694                 ++option;
00695
00696                  // option /e for windows in explorer mode
00697                 if (!_tcsicmp(option, TEXT("e")))
00698                         _flags |= OWM_EXPLORE;
00699                  // option /root for rooted explorer windows
00700                 else if (!_tcsicmp(option, TEXT("root")))
00701                         _flags |= OWM_ROOTED;
00702                  // non-standard options: /mdi, /sdi
00703                 else if (!_tcsicmp(option, TEXT("mdi")))
00704                         _mdi = true;
00705                 else if (!_tcsicmp(option, TEXT("sdi")))
00706                         _mdi = false;
00707                 else
00708                         return false;
00709         } else {
00710                 if (!_path.empty())
00711                         return false;
00712
00713                 _path = opt_str;
00714         }
00715
00716         return true;
00717 }

bool ExplorerCmd::IsValidPath ( ) const

Definition at line 719 of file explorer.cpp.

References _path, explorer_show_frame(), and launch_file().

Referenced by MainFrameBase::Create().

00720 {
00721         if (!_path.empty()) {
00722                 DWORD attribs = GetFileAttributes(_path);
00723
00724                 if (attribs!=INVALID_FILE_ATTRIBUTES && (attribs&FILE_ATTRIBUTE_DIRECTORY))
00725                         return true;    // file system path
00726                 else if (*_path==':' && _path.at(1)==':')
00727                         return true;    // text encoded IDL
00728         }
00729
00730         return false;
00731 }

Here is the call graph for this function:

bool ExplorerCmd::ParseCmdLine ( LPCTSTR lpCmdLine )

Definition at line 638 of file explorer.cpp.

References EvaluateOption().

Referenced by explorer_show_frame().

00639 {
00640         bool ok = true;
00641
00642         LPCTSTR b = lpCmdLine;
00643         LPCTSTR p = b;
00644
00645         while(*b) {
00646                  // remove leading space
00647                 while(_istspace((unsigned)*b))
00648                         ++b;
00649
00650                 p = b;
00651
00652                 bool quote = false;
00653
00654                  // options are separated by ','
00655                 for(; *p; ++p) {
00656                         if (*p == '"')  // Quote characters may appear at any position in the command line.
00657                                 quote = !quote;
00658                         else if (*p==',' && !quote)
00659                                 break;
00660                 }
00661
00662                 if (p > b) {
00663                         int l = p - b;
00664
00665                          // remove trailing space
00666                         while(l>0 && _istspace((unsigned)b[l-1]))
00667                                 --l;
00668
00669                         if (!EvaluateOption(String(b, l)))
00670                                 ok = false;
00671
00672                         if (*p)
00673                                 ++p;
00674
00675                         b = p;
00676                 }
00677         }
00678
00679         return ok;
00680 }

Here is the call graph for this function:

Member Data Documentation

int ExplorerCmd::_cmdShow

Definition at line 106 of file explorer.h.

Referenced by MainFrameBase::Create(), and explorer_show_frame().

int ExplorerCmd::_flags

Definition at line 105 of file explorer.h.

Referenced by MainFrameBase::Create(), and EvaluateOption().

bool ExplorerCmd::_mdi

Definition at line 107 of file explorer.h.

Referenced by MainFrameBase::Create(), EvaluateOption(), and explorer_show_frame().

String ExplorerCmd::_path

Definition at line 104 of file explorer.h.

Referenced by MainFrameBase::Create(), EvaluateOption(), and IsValidPath().

bool ExplorerCmd::_valid_path

Definition at line 108 of file explorer.h.

The documentation for this struct was generated from the following files:
  • explorer.h
  • explorer.cpp


ROS Explorer: Member List

ExplorerCmd Member List

This is the complete list of members for ExplorerCmd, including all inherited members.

_cmdShow | ExplorerCmd |
_flags | ExplorerCmd |
_mdi | ExplorerCmd |
_path | ExplorerCmd |
_valid_path | ExplorerCmd |
EvaluateOption(LPCTSTR option) | ExplorerCmd |
ExplorerCmd() | ExplorerCmd | [inline]
ExplorerCmd(LPCTSTR url, bool mdi) | ExplorerCmd | [inline]
IsValidPath() const | ExplorerCmd |
ParseCmdLine(LPCTSTR lpCmdLine) | ExplorerCmd |


ROS Explorer: ExplorerGlobals Struct Reference

ExplorerGlobals Struct Reference

structure containing global variables of Explorer More...

#include <globals.h>

Collaboration diagram for ExplorerGlobals:

[legend]
List of all members.

Public Member Functions

ExplorerGlobals ()
void | init (HINSTANCE hInstance)
void | read_persistent ()
void | write_persistent ()
XMLPos get_cfg ()
XMLPos | get_cfg (const char *path)
DWORD (STDAPICALLTYPE *_SHRestricted)(RESTRICTIONS)

Public Attributes

HINSTANCE | _hInstance
UINT | _cfStrFName
ATOM | _hframeClass
HWND _hMainWnd
bool | _desktop_mode
bool | _prescan_nodes
FILE * | _log
FileTypeManager _ftype_mgr
IconCache _icon_cache
HWND _hwndDesktopBar
HWND _hwndShellView
HWND _hwndDesktop
Desktops _desktops
XMLDoc _cfg
String _cfg_dir
String _cfg_path
Favorites _favorites
String _favorites_path

Detailed Description

structure containing global variables of Explorer

Definition at line 236 of file globals.h.

Constructor & Destructor Documentation

ExplorerGlobals::ExplorerGlobals ( )

Definition at line 56 of file explorer.cpp.

References _cfStrFName, _desktop_mode, _hframeClass, _hInstance, _hMainWnd, _hwndDesktop, _hwndDesktopBar, _hwndShellView, _log, and _prescan_nodes.

00057 {
00058         _hInstance = 0;
00059         _cfStrFName = 0;
00060
00061 #ifndef ROSSHELL
00062         _hframeClass = 0;
00063         _hMainWnd = 0;
00064         _desktop_mode = false;
00065         _prescan_nodes = false;
00066 #endif
00067
00068         _log = NULL;
00069 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
00070         _SHRestricted = 0;
00071 #endif
00072         _hwndDesktopBar = 0;
00073         _hwndShellView = 0;
00074         _hwndDesktop = 0;
00075 }

Member Function Documentation

ExplorerGlobals::DWORD ( STDAPICALLTYPE * _SHRestricted )

Referenced by init().

XMLPos ExplorerGlobals::get_cfg ( const char * path )

Definition at line 132 of file explorer.cpp.

References _cfg, XMLStorage::XMLPos::create_relative(), and XMLStorage::XMLPos::smart_create().

00133 {
00134         XMLPos cfg_pos(&_cfg);
00135
00136         cfg_pos.smart_create("explorer-cfg");
00137         cfg_pos.create_relative(path);
00138
00139         return cfg_pos;
00140 }

Here is the call graph for this function:

XMLPos ExplorerGlobals::get_cfg ( )

Definition at line 123 of file explorer.cpp.

References _cfg, and XMLStorage::XMLPos::smart_create().

Referenced by StartMenuHandler::Command(), MdiSdiDlg::Command(), TaskbarSettingsDlg::Command(), explorer_show_frame(), MdiSdiDlg::MdiSdiDlg(), MainFrameBase::OpenShellFolders(), NotifyArea::read_config(), TaskbarSettingsDlg::TaskbarSettingsDlg(), and NotifyArea::write_config().

00124 {
00125         XMLPos cfg_pos(&_cfg);
00126
00127         cfg_pos.smart_create("explorer-cfg");
00128
00129         return cfg_pos;
00130 }

Here is the call graph for this function:

void ExplorerGlobals::init ( HINSTANCE hInstance )

Definition at line 78 of file explorer.cpp.

References _hInstance, _icon_cache, DWORD(), and IconCache::init().

Referenced by _tWinMain().

00079 {
00080         _hInstance = hInstance;
00081
00082 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
00083         _SHRestricted = (DWORD(STDAPICALLTYPE*)(RESTRICTIONS)) GetProcAddress(GetModuleHandle(TEXT("SHELL32")), "SHRestricted");
00084 #endif
00085
00086         _icon_cache.init();
00087 }

Here is the call graph for this function:

void ExplorerGlobals::read_persistent ( )

Definition at line 90 of file explorer.cpp.

References _cfg, _cfg_dir, _cfg_path, _hwndDesktop, XMLStorage::XMLDoc::_last_error, XMLStorage::XMLDoc::_last_error_msg, String::printf(), and XMLStorage::XMLDoc::read().

Referenced by _tWinMain().

00091 {
00092          // read configuration file
00093         _cfg_dir.printf(TEXT("%s\\ReactOS"), (LPCTSTR)SpecialFolderFSPath(CSIDL_APPDATA,0));
00094         _cfg_path.printf(TEXT("%s\\ros-explorer-cfg.xml"), _cfg_dir.c_str());
00095
00096         if (!_cfg.read(_cfg_path)) {
00097                 if (_cfg._last_error != XML_ERROR_NO_ELEMENTS)
00098                         MessageBox(g_Globals._hwndDesktop, String(_cfg._last_error_msg.c_str()),
00099                                                 TEXT("ROS Explorer - reading user settings"), MB_OK);
00100
00101                 _cfg.read(TEXT("explorer-cfg-template.xml"));
00102         }
00103
00104          // read bookmarks
00105         _favorites_path.printf(TEXT("%s\\ros-explorer-bookmarks.xml"), _cfg_dir.c_str());
00106
00107         if (!_favorites.read(_favorites_path)) {
00108                 _favorites.import_IE_favorites(0);
00109                 _favorites.write(_favorites_path);
00110         }
00111 }

Here is the call graph for this function:

void ExplorerGlobals::write_persistent ( )

Definition at line 113 of file explorer.cpp.

References _cfg, _cfg_dir, _cfg_path, _favorites, _favorites_path, RecursiveCreateDirectory(), Favorites::write(), and XMLStorage::XMLDoc::write().

Referenced by _tWinMain().

00114 {
00115          // write configuration file
00116         RecursiveCreateDirectory(_cfg_dir);
00117
00118         _cfg.write(_cfg_path);
00119         _favorites.write(_favorites_path);
00120 }

Here is the call graph for this function:

Member Data Documentation

XMLDoc ExplorerGlobals::_cfg

Definition at line 273 of file globals.h.

Referenced by get_cfg(), TaskbarSettingsDlg::Notify(), read_persistent(), and write_persistent().

String ExplorerGlobals::_cfg_dir

Definition at line 274 of file globals.h.

Referenced by read_persistent(), and write_persistent().

String ExplorerGlobals::_cfg_path

Definition at line 275 of file globals.h.

Referenced by read_persistent(), and write_persistent().

UINT ExplorerGlobals::_cfStrFName

Definition at line 249 of file globals.h.

Referenced by ExplorerGlobals(), and ShellDirectory::fill_w32fdata_shell().

bool ExplorerGlobals::_desktop_mode

Definition at line 254 of file globals.h.

Referenced by _tWinMain(), ExplorerGlobals(), and MainFrameBase::~MainFrameBase().

Desktops ExplorerGlobals::_desktops

Definition at line 271 of file globals.h.

Referenced by _tWinMain(), QuickLaunchBar::AddShortcuts(), and DesktopBar::Command().

Favorites ExplorerGlobals::_favorites

Definition at line 277 of file globals.h.

Referenced by StartMenuHandler::Command(), MainFrameBase::FillBookmarks(), and write_persistent().

String ExplorerGlobals::_favorites_path

Definition at line 278 of file globals.h.

Referenced by write_persistent().

FileTypeManager ExplorerGlobals::_ftype_mgr

Definition at line 264 of file globals.h.

Referenced by WinDirectory::read_directory(), and ShellDirectory::read_directory().

ATOM ExplorerGlobals::_hframeClass

Definition at line 252 of file globals.h.

Referenced by SDIMainFrame::Create(), MDIMainFrame::Create(), and ExplorerGlobals().

HINSTANCE ExplorerGlobals::_hInstance

Definition at line 248 of file globals.h.

Referenced by MainFrameBase::Command(), ChildWindow::create(), Window::Create(), SDIMainFrame::Create(), MDIMainFrame::Create(), FileChildWindow::create(), Pane::create_header(), Dialog::DoModal(), ExplorerGlobals(), FindProgramDlg::FindProgramDlg(), Pane::init(), init(), DesktopBar::Init(), MainFrameBase::MainFrameBase(), MDIMainFrame::MDIMainFrame(), ExplorerAboutDlg::Paint(), PopupMenu::PopupMenu(), PropertySheetDialog::PropertySheetDialog(), PropSheetPage::PropSheetPage(), TrayNotifyDlg::RefreshProperties(), ResBitmap::ResBitmap(), ResIcon::ResIcon(), ResIconEx::ResIconEx(), ResString::ResString(), SmallIcon::SmallIcon(), TrayNotifyDlg::TrayNotifyDlg(), and WindowClass::WindowClass().

HWND ExplorerGlobals::_hMainWnd

Definition at line 253 of file globals.h.

Referenced by MainFrameBase::Create(), explorer_show_frame(), ExplorerGlobals(), ShellBrowser::InsertSubitems(), MainFrameBase::OpenShellFolders(), MainFrameBase::ProcessMessage(), and MainFrameBase::~MainFrameBase().

HWND ExplorerGlobals::_hwndDesktop

Definition at line 269 of file globals.h.

Referenced by _tWinMain(), explorer_show_frame(), ExplorerGlobals(), Favorites::read(), read_persistent(), and BackgroundWindow::WndProc().

HWND ExplorerGlobals::_hwndDesktopBar

Definition at line 267 of file globals.h.

Referenced by StartMenuHandler::Command(), TaskbarSettingsDlg::Command(), ExplorerGlobals(), DesktopWindow::Init(), TaskbarSettingsDlg::Notify(), and Desktops::SwitchToDesktop().

HWND ExplorerGlobals::_hwndShellView

Definition at line 268 of file globals.h.

Referenced by DesktopSettingsDlg::Command(), DesktopSettingsDlg::DesktopSettingsDlg(), ExplorerGlobals(), DesktopWindow::Init(), and DesktopSettingsDlg::Notify().

IconCache ExplorerGlobals::_icon_cache

Definition at line 265 of file globals.h.

Referenced by Icon::add_to_imagelist(), StartMenu::AddButton(), FavoritesMenu::AddEntries(), QuickLaunchBar::AddShortcuts(), Icon::create_bitmap(), Icon::draw(), Pane::draw_item(), Entry::extract_icon(), BookmarkList::fill_tree(), MainFrameBase::FillBookmarks(), FindProgramDlg::FindProgramDlg(), ShellBrowser::get_image_idx(), init(), ShellBrowser::invalidate_cache(), FindProgramDlg::Notify(), and Entry::~Entry().

FILE* ExplorerGlobals::_log

Definition at line 258 of file globals.h.

Referenced by _log_(), _tWinMain(), and ExplorerGlobals().

bool ExplorerGlobals::_prescan_nodes

Definition at line 255 of file globals.h.

Referenced by explorer_show_frame(), ExplorerGlobals(), and Entry::read_directory_base().

The documentation for this struct was generated from the following files:
  • globals.h
  • explorer.cpp


ROS Explorer: Member List

ExplorerGlobals Member List

This is the complete list of members for ExplorerGlobals, including all inherited members.

_cfg | ExplorerGlobals
_cfg_dir | ExplorerGlobals
_cfg_path | ExplorerGlobals
_cfStrFName | ExplorerGlobals
_desktop_mode | ExplorerGlobals
_desktops | ExplorerGlobals
_favorites | ExplorerGlobals
_favorites_path | ExplorerGlobals
_ftype_mgr | ExplorerGlobals
_hframeClass | ExplorerGlobals
_hInstance | ExplorerGlobals
_hMainWnd | ExplorerGlobals
_hwndDesktop | ExplorerGlobals
_hwndDesktopBar | ExplorerGlobals
_hwndShellView | ExplorerGlobals
_icon_cache | ExplorerGlobals
_log | ExplorerGlobals
_prescan_nodes | ExplorerGlobals
DWORD(STDAPICALLTYPE *_SHRestricted)(RESTRICTIONS) | ExplorerGlobals
ExplorerGlobals() | ExplorerGlobals
get_cfg() | ExplorerGlobals
get_cfg(const char *path) | ExplorerGlobals
init(HINSTANCE hInstance) | ExplorerGlobals
read_persistent() | ExplorerGlobals
write_persistent() | ExplorerGlobals


ROS Explorer: ExtContextMenuHandlerT< BASE > Struct Template Reference

ExtContextMenuHandlerT< BASE > Struct Template Reference

#include <shellclasses.h>

Inheritance diagram for ExtContextMenuHandlerT< BASE >:

[legend]
Collaboration diagram for ExtContextMenuHandlerT< BASE >:

[legend]
List of all members.

Public Types

typedef BASE | super

Public Member Functions

ExtContextMenuHandlerT (HWND hwnd)
template<typename PARA>
ExtContextMenuHandlerT (HWND hwnd, const PARA &info)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Protected Attributes

CtxMenuInterfaces _cm_ifs

Detailed Description

template<typename BASE>
struct ExtContextMenuHandlerT< BASE >

Definition at line 1110 of file shellclasses.h.

Member Typedef Documentation

template<typename BASE>
typedef BASE ExtContextMenuHandlerT< BASE >::super

Reimplemented in DesktopShellView, FileChildWindow, SDIMainFrame, MDIShellBrowserChild, QuickLaunchBar, StartMenu, StartMenuHandler, StartMenuRoot, SettingsMenu, BrowseMenu, SearchMenu, RecentStartMenu, and FavoritesMenu.

Definition at line 1113 of file shellclasses.h.

Constructor & Destructor Documentation

template<typename BASE>
ExtContextMenuHandlerT< BASE >::ExtContextMenuHandlerT ( HWND hwnd ) [inline]

Definition at line 1115 of file shellclasses.h.

01116          :      super(hwnd)
01117         {
01118         }

template<typename BASE>
template<typename PARA>
ExtContextMenuHandlerT< BASE >::ExtContextMenuHandlerT | ( | HWND | hwnd,
 |  | const PARA & | info
 | ) | [inline]

Definition at line 1120 of file shellclasses.h.

01121          :      super(hwnd, info)
01122         {
01123         }

Member Function Documentation

template<typename BASE>
LRESULT ExtContextMenuHandlerT< BASE >::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [inline]

Reimplemented in DesktopShellView, FileChildWindow, SDIMainFrame, MDIShellBrowserChild, QuickLaunchBar, StartMenu, and StartMenuRoot.

Definition at line 1125 of file shellclasses.h.

01126         {
01127                 switch(nmsg) {
01128                   case WM_DRAWITEM:
01129                   case WM_MEASUREITEM:
01130                         if (!wparam)    // Is the message menu-related?
01131                                 if (_cm_ifs.HandleMenuMsg(nmsg, wparam, lparam))
01132                                         return TRUE;
01133
01134                         break;
01135
01136                   case WM_INITMENUPOPUP:
01137                         if (_cm_ifs.HandleMenuMsg(nmsg, wparam, lparam))
01138                                 return 0;
01139
01140                         break;
01141
01142 #ifndef __MINGW32__     // IContextMenu3 missing in MinGW (as of 6.2.2005)
01143                   case WM_MENUCHAR:     // only supported by IContextMenu3
01144                    if (_cm_ifs._pctxmenu3) {
01145                            LRESULT lResult = 0;
01146
01147                            _cm_ifs._pctxmenu3->HandleMenuMsg2(nmsg, wparam, lparam, &lResult);
01148
01149                            return lResult;
01150                    }
01151
01152                    return 0;
01153 #endif
01154                 }
01155
01156                 return super::WndProc(nmsg, wparam, lparam);
01157         }

Member Data Documentation

template<typename BASE>
CtxMenuInterfaces ExtContextMenuHandlerT< BASE >::_cm_ifs [protected]

Definition at line 1160 of file shellclasses.h.

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

ExtContextMenuHandlerT< BASE > Member List

This is the complete list of members for ExtContextMenuHandlerT< BASE >, including all inherited members.

_cm_ifs | ExtContextMenuHandlerT< BASE > | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< BASE > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< BASE > | [inline]
super typedef | ExtContextMenuHandlerT< BASE > |
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | ExtContextMenuHandlerT< BASE > | [inline]


ROS Explorer: FAT_attribute Union Reference

FAT_attribute Union Reference

#include <fatfs.h>

Collaboration diagram for FAT_attribute:

[legend]
List of all members.

Public Attributes

char b
fattr a

Detailed Description

Definition at line 143 of file fatfs.h.

Member Data Documentation

fattr FAT_attribute::a

Definition at line 145 of file fatfs.h.

char FAT_attribute::b

Definition at line 144 of file fatfs.h.

The documentation for this union was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

FAT_attribute Member List

This is the complete list of members for FAT_attribute, including all inherited members.

a | FAT_attribute
b | FAT_attribute


ROS Explorer: FATChildWndInfo Struct Reference

FATChildWndInfo Struct Reference

information structure for creation of FileChildWindow More...

#include <filechild.h>

Inheritance diagram for FATChildWndInfo:

[legend]
Collaboration diagram for FATChildWndInfo:

[legend]
List of all members.

Public Types

typedef FileChildWndInfo super

Public Member Functions

FATChildWndInfo (HWND hmdiclient, LPCTSTR path)

Detailed Description

information structure for creation of FileChildWindow

Definition at line 71 of file filechild.h.

Member Typedef Documentation

typedef FileChildWndInfo FATChildWndInfo::super

Reimplemented from FileChildWndInfo.

Definition at line 73 of file filechild.h.

Constructor & Destructor Documentation

FATChildWndInfo::FATChildWndInfo | ( | HWND | hmdiclient,
 |  | LPCTSTR | path
 | ) |

Definition at line 84 of file filechild.cpp.

00085  :      FileChildWndInfo(hmdiclient, path, ET_FAT)
00086 {
00087 }

The documentation for this struct was generated from the following files:
  • filechild.h
  • filechild.cpp


ROS Explorer: Member List

FATChildWndInfo Member List

This is the complete list of members for FATChildWndInfo, including all inherited members.

_etype | FileChildWndInfo |
_hmdiclient | ChildWndInfo |
_open_mode | FileChildWndInfo |
_path | FileChildWndInfo |
_pos | FileChildWndInfo |
ChildWndInfo(HWND hmdiclient) | ChildWndInfo | [inline]
FATChildWndInfo(HWND hmdiclient, LPCTSTR path) | FATChildWndInfo |
FileChildWndInfo(HWND hmdiclient, LPCTSTR path, ENTRY_TYPE etype=ET_UNKNOWN) | FileChildWndInfo |
super typedef | FATChildWndInfo |


ROS Explorer: FATDirectory Struct Reference

FATDirectory Struct Reference

FAT file system directory-entry. More...

#include <fatfs.h>

Inheritance diagram for FATDirectory:

[legend]
Collaboration diagram for FATDirectory:

[legend]
List of all members.

Public Member Functions

FATDirectory (FATDrive &drive, LPCTSTR root_path)
FATDirectory (FATDrive &drive, Entry *parent, LPCTSTR path, unsigned cluster)
~FATDirectory ()
virtual void | read_directory (int scan_flags=SCAN_ALL)
virtual const void * | get_next_path_component (const void *) const
virtual Entry * | find_entry (const void *)

Protected Member Functions

bool | read_dir ()

Protected Attributes

FATDrive & _drive
dirsecz * _secarr
int | _cur_bufs
int | _ents
dirent * _dir
Kette * _alloc

Detailed Description

FAT file system directory-entry.

Definition at line 47 of file fatfs.h.

Constructor & Destructor Documentation

FATDirectory::FATDirectory | ( | FATDrive & | drive,
 |  | LPCTSTR | root_path
 | ) |

Definition at line 270 of file fatfs.cpp.

References FATEntry::_cluster, _cur_bufs, _dir, _ents, Directory::_path, and _secarr.

00271  :      FATEntry(),
00272         _drive(drive)
00273 {
00274         _path = _tcsdup(root_path);
00275
00276         _secarr         = NULL;
00277         _cur_bufs       = 0;
00278         _ents           = 0;
00279         _dir            = NULL;
00280         _cluster        = 0;
00281 }

FATDirectory::FATDirectory | ( | FATDrive & | drive,
 |  | Entry * | parent,
 |  | LPCTSTR | path,
 |  | unsigned | cluster
 | ) |

Definition at line 283 of file fatfs.cpp.

References _cur_bufs, _dir, _ents, Directory::_path, and _secarr.

00284  :      FATEntry(parent, cluster),
00285         _drive(drive)
00286 {
00287         _path = _tcsdup(path);
00288
00289         _secarr         = NULL;
00290         _cur_bufs       = 0;
00291         _ents           = 0;
00292         _dir            = NULL;
00293 }

FATDirectory::~FATDirectory ( )

Definition at line 295 of file fatfs.cpp.

References Directory::_path.

00296 {
00297         free(_path);
00298         _path = NULL;
00299 }

Member Function Documentation

Entry * FATDirectory::find_entry ( const void * ) [virtual]

Reimplemented from Entry.

Definition at line 222 of file fatfs.cpp.

References Entry::_data, Entry::_down, and Entry::_next.

00223 {
00224         LPCTSTR name = (LPCTSTR)p;
00225
00226         for(Entry*entry=_down; entry; entry=entry->_next) {
00227                 LPCTSTR p = name;
00228                 LPCTSTR q = entry->_data.cFileName;
00229
00230                 do {
00231                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00232                                 return entry;
00233                 } while(tolower(*p++) == tolower(*q++));
00234
00235                 p = name;
00236                 q = entry->_data.cAlternateFileName;
00237
00238                 do {
00239                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00240                                 return entry;
00241                 } while(tolower(*p++) == tolower(*q++));
00242         }
00243
00244         return NULL;
00245 }

const void * FATDirectory::get_next_path_component ( const void * ) const [virtual]

Reimplemented from Entry.

Definition at line 205 of file fatfs.cpp.

00206 {
00207         LPCTSTR s = (LPCTSTR) p;
00208
00209         while(*s && *s!=TEXT('\\') && *s!=TEXT('/'))
00210                 ++s;
00211
00212         while(*s==TEXT('\\') || *s==TEXT('/'))
00213                 ++s;
00214
00215         if (!*s)
00216                 return NULL;
00217
00218         return s;
00219 }

bool FATDirectory::read_dir ( ) [protected]

Definition at line 301 of file fatfs.cpp.

References FATDrive::_boot_sector, FATDrive::_bufents, FATDrive::_bufl, FATEntry::_cluster, _cur_bufs, _dir, _drive, _ents, FATDrive::_SClus, _secarr, AddP, BootSector::BytesPerSector, BootSector::NumberFATs, FATDrive::read_FAT(), FATDrive::read_sector(), BootSector::ReservedSectors, BootSector::RootEntries, BootSector32::RootSectors, dirsecz::s, BootSector::SectorsPerFAT, and BootSector32::SectorsPerFAT32.

Referenced by read_directory().

00302 {
00303         int i;
00304
00305         if (_cluster == 0) {
00306                 if (!_drive._boot_sector.SectorsPerFAT) {       // FAT32? [boot_sector32->reserved0==0]
00307                         BootSector32* boot_sector32 = (BootSector32*) &_drive._boot_sector;
00308                         DWORD sect = _drive._boot_sector.ReservedSectors + _drive._boot_sector.NumberFATs*boot_sector32->SectorsPerFAT32;  // lese Root-Directory ein
00309                         int RootEntries = boot_sector32->RootSectors * 32;      //@@
00310
00311                         _secarr = (struct dirsecz*)malloc(sizeof(DWORD) * (_cur_bufs = (int)((_ents=RootEntries)/_drive._bufents)));
00312
00313                         for(i=0; i<_cur_bufs; i++)
00314                                 _secarr->s[i] = sect+i;
00315
00316                         _dir = (struct dirent*)malloc((size_t)(_ents+16)*sizeof(union DEntry));
00317                         if (!_dir)
00318                                 return false;
00319
00320                         if (!(_drive.read_sector(*_secarr->s,(Buffer*)_dir,_cur_bufs)))
00321                                 return false;
00322                 } else {
00323                         DWORD sect = _drive._boot_sector.ReservedSectors + _drive._boot_sector.NumberFATs*_drive._boot_sector.SectorsPerFAT;  // read in root directory
00324
00325                         _secarr = (struct dirsecz*)malloc(sizeof(DWORD) * (_cur_bufs = (int)((_ents=_drive._boot_sector.RootEntries)/_drive._bufents)));
00326
00327                         for(i=0; i<_cur_bufs; i++)
00328                                 _secarr->s[i] = sect+i;
00329
00330                         _dir = (struct dirent*)malloc((size_t)(_ents+16)*sizeof(union DEntry));
00331                         if (!_dir)
00332                                 return false;
00333
00334                         if (!_drive.read_sector(*_secarr->s,(Buffer*)_dir,_cur_bufs))
00335                                 return false;
00336                 }
00337         } else {
00338                 Buffer* buf;
00339                 bool ok;
00340
00341                 DWORD h = _cluster;
00342
00343                 _cur_bufs = 0;
00344
00345                 do {
00346                         h = _drive.read_FAT(h, ok);
00347
00348                         if (!ok)
00349                                 return false;
00350
00351                         _cur_bufs++;
00352                 } while (h<0x0ffffff0 && h);
00353
00354                 _secarr = (struct dirsecz*) malloc(sizeof(DWORD) * _cur_bufs);
00355
00356                 if (!_secarr)
00357                         return false;
00358
00359                 _ents = _drive._bufents * (size_t)_cur_bufs * _drive._SClus;
00360
00361                 if ((buf=(Buffer*)(_dir=(struct dirent*)malloc((size_t) (_ents+16)*sizeof(union DEntry)))) == NULL)
00362                         return false;
00363
00364                 h = _cluster;
00365
00366                 DWORD fdatsec;
00367
00368                 if (!_drive._boot_sector.SectorsPerFAT) {       // FAT32 ?
00369                         BootSector32* boot_sector32 = (BootSector32*) &_drive._boot_sector;
00370                         //int RootEntries = boot_sector32->RootSectors * 32;    //@@
00371                         //fdatsec = _drive._boot_sector.ReservedSectors + _drive._boot_sector.NumberFATs*boot_sector32->SectorsPerFAT32 + RootEntries*sizeof(DEntry)/_drive._boot_sector.BytesPerSector;        // dpb.fdirsec
00372                         fdatsec = _drive._boot_sector.ReservedSectors +
00373                                                 _drive._boot_sector.NumberFATs*boot_sector32->SectorsPerFAT32 + boot_sector32->RootSectors;
00374                 } else
00375                         fdatsec = _drive._boot_sector.ReservedSectors +
00376                                                 _drive._boot_sector.NumberFATs*_drive._boot_sector.SectorsPerFAT +
00377                                                 _drive._boot_sector.RootEntries*sizeof(DEntry)/_drive._boot_sector.BytesPerSector;      // dpb.fdirsec
00378
00379                         for(i=0; i<_cur_bufs; i++) {
00380                                 _secarr->s[i] = fdatsec + (DWORD)_drive._SClus*(h-2);
00381
00382                                 h = _drive.read_FAT(h, ok);
00383
00384                                 if (!ok)
00385                                         return false;
00386                         }
00387
00388                         for(i=0; i<_cur_bufs; i++) {
00389                                 if ((ok = (_drive.read_sector(_secarr->s[i], buf, _drive._SClus))) == true)
00390                                         AddP(buf, _drive._bufl*_drive._SClus)
00391                                 else {
00392                                         //@@FPara = _secarr->s[i];
00393                                         return false;
00394                                 }
00395                         }
00396
00397                 buf->dat[0] = 0;         // Endekennzeichen für Rekurs setzen
00398         }
00399
00400         return true;
00401 }

Here is the call graph for this function:

void FATDirectory::read_directory ( int scan_flags = SCAN_ALL ) [virtual]

Reimplemented from Entry.

Definition at line 52 of file fatfs.cpp.

References _dir, AddP, CONTEXT, and read_dir().

00053 {
00054         CONTEXT("FATDirectory::read_directory()");
00055
00056         read_dir();
00057
00058         union DEntry* p = (union DEntry*) _dir;
00059         int i = 0;
00060
00061         do {
00062 /*              if (!IS_LNAME(p->E.attr) && p->E.name[0]!=FAT_DEL_CHAR)
00063                         gesBytes += p->E.size;
00064 */
00065
00066                 AddP(p, sizeof(union DEntry));
00067         } while(++i<_ents && p->E.name[0]);
00068
00069         _alloc = (struct Kette*) malloc((size_t)((_ents=i)+8)*sizeof(struct Kette));
00070         if (!_alloc)
00071                 return;
00072
00073         link_dir_entries(_dir, _alloc, i);
00074
00075         Entry* first_entry = NULL;
00076         int level = _level + 1;
00077
00078         Entry* last = NULL;
00079
00080         WIN32_FIND_DATA w32fd;
00081         FAT_attribute attr;
00082         String long_name;
00083
00084         TCHAR buffer[MAX_PATH];
00085
00086         _tcscpy(buffer, (LPCTSTR)_path);
00087         LPTSTR pname = buffer + _tcslen(buffer);
00088         int plen = COUNTOF(buffer) - _tcslen(buffer);
00089
00090         *pname++ = '\\';
00091         --plen;
00092
00093         for(Kette*p=_alloc; p; p=p->Vorw) {
00094                 memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00095
00096                 DEntry_E& e = p->Ent->E;
00097
00098                  // get file/directory attributes
00099                 attr.b = e.attr;
00100
00101                 if (attr.b & (_A_DELETED | _A_ILLEGAL))
00102                         attr.b |= _A_ILLEGAL;
00103
00104                 const char* s = e.name;
00105                 LPTSTR d = w32fd.cFileName;
00106
00107                 if (!IS_LNAME(attr.b) || e.name[0]==FAT_DEL_CHAR) {
00108                         if (e.name[0] == FAT_DEL_CHAR)
00109                                 w32fd.dwFileAttributes |= ATTRIBUTE_ERASED;
00110                         else if (IS_LNAME(attr.b))
00111                                 w32fd.dwFileAttributes |= ATTRIBUTE_LONGNAME;
00112                         else if (attr.a.directory)
00113                                 w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00114                         else if (attr.a.volume)
00115                                 w32fd.dwFileAttributes |= ATTRIBUTE_VOLNAME;    //@@ -> in Volume-Name der Root kopieren
00116
00117                          // get file name
00118                         *d++ = *s==FAT_DEL_CHAR? '?': *s;
00119                         ++s;
00120
00121                         for(i=0; i<7; ++i)
00122                                 *d++ = *s++;
00123
00124                         while(d>w32fd.cFileName && d[-1]==' ')
00125                                 --d;
00126
00127                         *d++ = '.';
00128
00129                         for(; i<10; ++i)
00130                                 *d++ = *s++;
00131
00132                         while(d>w32fd.cFileName && d[-1]==' ')
00133                                 --d;
00134
00135                         if (d>w32fd.cFileName && d[-1]=='.')
00136                                 --d;
00137
00138                         *d = '\0';
00139                 } else {
00140                          // read long file name
00141                         TCHAR lname[] = {s[1], s[3], s[5], s[7], s[9], s[14], s[16], s[18], s[20], s[22], s[24], s[28], s[30]};
00142
00143                         long_name = String(lname, 13) + long_name;
00144                 }
00145
00146                 if (!IS_LNAME(attr.b) && !attr.a.volume) {
00147                          // get file size
00148                         w32fd.nFileSizeLow = e.size;
00149
00150                          // convert date/time attribute into FILETIME
00151                         const fdate& date = e.date;
00152                         const ftime& time = e.time;
00153                         SYSTEMTIME stime;
00154                         FILETIME ftime;
00155
00156                         stime.wYear = date.year + 1980;
00157                         stime.wMonth = date.month;
00158                         stime.wDayOfWeek = (WORD)-1;
00159                         stime.wDay = date.day;
00160                         stime.wHour = time.hour;
00161                         stime.wMinute = time.min;
00162                         stime.wSecond = time.sec2 * 2;
00163                         stime.wMilliseconds = 0;
00164
00165                         if (SystemTimeToFileTime(&stime, &ftime))
00166                                 LocalFileTimeToFileTime(&ftime, &w32fd.ftLastWriteTime);
00167
00168                         if (!(w32fd.dwFileAttributes & ATTRIBUTE_ERASED)) { //@@
00169                                 Entry* entry;
00170
00171                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
00172                                         _tcscpy_s(pname, plen, w32fd.cFileName);
00173                                         entry = new FATDirectory(_drive, this, buffer, e.fclus);
00174                                 } else
00175                                         entry = new FATEntry(this, e.fclus);
00176
00177                                 memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00178
00179                                 if (!long_name.empty()) {
00180                                         entry->_content = _tcsdup(long_name);
00181                                         long_name.erase();
00182                                 }
00183
00184                                 if (!first_entry)
00185                                         first_entry = entry;
00186
00187                                 if (last)
00188                                         last->_next = entry;
00189
00190                                 entry->_level = level;
00191
00192                                 last = entry;
00193                         }
00194                 }
00195         }
00196
00197         if (last)
00198                 last->_next = NULL;
00199
00200         _down = first_entry;
00201         _scanned = true;
00202 }

Here is the call graph for this function:

Member Data Documentation

struct Kette* FATDirectory::_alloc [protected]

Definition at line 64 of file fatfs.h.

int FATDirectory::_cur_bufs [protected]

Definition at line 61 of file fatfs.h.

Referenced by FATDirectory(), and read_dir().

struct dirent* FATDirectory::_dir [protected]

Definition at line 63 of file fatfs.h.

Referenced by FATDirectory(), read_dir(), and read_directory().

FATDrive& FATDirectory::_drive [protected]

Definition at line 58 of file fatfs.h.

Referenced by read_dir(), FATDrive::read_sector(), and FATDrive::small_cache().

int FATDirectory::_ents [protected]

Definition at line 62 of file fatfs.h.

Referenced by FATDirectory(), and read_dir().

struct dirsecz* FATDirectory::_secarr [protected]

Definition at line 60 of file fatfs.h.

Referenced by FATDirectory(), and read_dir().

The documentation for this struct was generated from the following files:
  • fatfs.h
  • fatfs.cpp


ROS Explorer: Member List

FATDirectory Member List

This is the complete list of members for FATDirectory, including all inherited members.

_alloc | FATDirectory | [protected]
_bhfi | Entry |
_bhfi_valid | Entry |
_cluster | FATEntry | [protected]
_content | Entry |
_cur_bufs | FATDirectory | [protected]
_data | Entry |
_dir | FATDirectory | [protected]
_display_name | Entry |
_down | Entry |
_drive | FATDirectory | [protected]
_ents | FATDirectory | [protected]
_etype | Entry |
_expanded | Entry |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_path | Directory | [protected]
_scanned | Entry |
_secarr | FATDirectory | [protected]
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | FATEntry | [protected, virtual]
Directory() | Directory | [inline, protected]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
FATDirectory(FATDrive &drive, LPCTSTR root_path) | FATDirectory |
FATDirectory(FATDrive &drive, Entry *parent, LPCTSTR path, unsigned cluster) | FATDirectory |
FATEntry(Entry *parent, unsigned cluster) | FATEntry | [inline]
FATEntry() | FATEntry | [inline, protected]
find_entry(const void *) | FATDirectory | [virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | FATDirectory | [virtual]
get_path(PTSTR path, size_t path_count) const | FATEntry | [protected, virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL) | Entry | [virtual]
read_dir() | FATDirectory | [protected]
read_directory(int scan_flags=SCAN_ALL) | FATDirectory | [virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Directory() | Directory | [inline, protected, virtual]
~Entry() | Entry | [virtual]
~FATDirectory() | FATDirectory |


ROS Explorer: FATDrive Struct Reference

FATDrive Struct Reference

FAT drive root entry. More...

#include <fatfs.h>

Inheritance diagram for FATDrive:

[legend]
Collaboration diagram for FATDrive:

[legend]
List of all members.

Public Member Functions

FATDrive (LPCTSTR path)
~FATDrive ()
bool | read_sector (DWORD sec, Buffer *buf, int len)
DWORD | read_FAT (DWORD Clus, bool &ok)
void | small_cache ()
void | reset_cache ()
bool | read_cache (DWORD sec, Buffer **bufptr)
int | get_cache_buffer ()

Public Attributes

HANDLE | _hDrive
BootSector _boot_sector
int | _bufl
int | _bufents
int | _SClus
Cache * _FATCache
int | _CacheCount
DWORD * | _CacheSec
int * | _CacheCnt
bool * | _CacheDty
int | _Caches
bool | _cache_empty
int | _read_ahead

Detailed Description

FAT drive root entry.

Definition at line 225 of file fatfs.h.

Constructor & Destructor Documentation

FATDrive::FATDrive ( LPCTSTR path )

Definition at line 408 of file fatfs.cpp.

References _boot_sector, _bufents, _bufl, _CacheCnt, _CacheCount, _CacheDty, _Caches, _CacheSec, _FATCache, _hDrive, _SClus, BootSector::BytesPerSector, read_sector(), and small_cache().

00409  :      FATDirectory(*this, TEXT("\\"))
00410 {
00411         _bufl = 0;
00412         _bufents = 0;
00413         _SClus = 0;
00414         _FATCache = NULL;
00415         _CacheCount = 0;
00416         _CacheSec = NULL;
00417         _CacheCnt = NULL;
00418         _CacheDty = NULL;
00419         _Caches = 0;
00420
00421         _hDrive = CreateFile(path, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
00422
00423         if (_hDrive != INVALID_HANDLE_VALUE) {
00424                 _boot_sector.BytesPerSector = 512;
00425
00426                 if (read_sector(0, (Buffer*)&_boot_sector, 1)) {
00427                         _bufl = _boot_sector.BytesPerSector;
00428                         _SClus = _boot_sector.SectorsPerCluster;
00429                         _bufents = _bufl / sizeof(union DEntry);
00430                 }
00431
00432                 small_cache();
00433         }
00434 }

Here is the call graph for this function:

FATDrive::~FATDrive ( )

Definition at line 436 of file fatfs.cpp.

References _hDrive, and Directory::_path.

00437 {
00438         if (_hDrive != INVALID_HANDLE_VALUE)
00439                 CloseHandle(_hDrive);
00440
00441         free(_path);
00442         _path = NULL;
00443 }

Member Function Documentation

int FATDrive::get_cache_buffer ( )

Todo:
enable write back if (CacheDty[j]) // Dirty-Flag gesetzt? if (writesec(_CacheSec[j], (Buffer*) &_FATCache[j], 1)) FPara = _CacheSec[j], Frag(SecWriteErr);

Definition at line 601 of file fatfs.cpp.

References _cache_empty, _CacheCnt, and _CacheSec.

Referenced by read_cache().

00602 {
00603  int i, j, minCnt;
00604
00605  for(i=0; i<_Caches; i++)
00606   if (_CacheSec[i])
00607    break;
00608
00609  _cache_empty = i==_Caches? true: false;
00610
00611  for(i=0; _CacheSec[i] && i<_Caches; )
00612   ++i;
00613
00614  if (i < _Caches)
00615   j = i;
00616  else
00617   {
00618    minCnt = 0;                  // search for least used buffer
00619
00620    for(j=i=0; i<_Caches; i++)
00621         if (minCnt < _CacheCnt[i]) {
00622          minCnt = _CacheCnt[i];
00623          j = i;
00624         }
00625
00631   }
00632
00633  return j;
00634 }

bool FATDrive::read_cache | ( | DWORD | sec,
 |  | Buffer ** | bufptr
 | ) |

Definition at line 553 of file fatfs.cpp.

References _boot_sector, _cache_empty, _CacheCnt, _CacheCount, _CacheDty, _Caches, _CacheSec, _FATCache, _read_ahead, BufLen, BootSector::BytesPerSector, get_cache_buffer(), BootSector::NumberFATs, read_sector(), and BootSector::SectorsPerFAT.

Referenced by read_FAT().

00554 {
00555  int i, C, anz;
00556
00557  if (_boot_sector.BytesPerSector != BufLen)  // no standard sector size?
00558   return read_sector(sec, *bufptr=(Buffer*)&_FATCache[0], 1);
00559
00560  _CacheCount++;
00561
00562  for(i=0; _CacheSec[i]!=sec && i<_Caches; )
00563   ++i;
00564
00565  if (i < _Caches)
00566   {
00567    *bufptr = (Buffer*) &_FATCache[i];    // FAT-Sektor schon gepuffert
00568    _CacheCnt[i]++;
00569    return true;
00570   }
00571
00572  i = get_cache_buffer();
00573
00574  if (_cache_empty)              // von get_cache_buffer() gesetzt
00575   {
00576    C = _CacheCount-1;
00577    anz = _boot_sector.SectorsPerFAT*_boot_sector.NumberFATs - sec;
00578
00579    if (anz > _read_ahead)
00580         anz = _read_ahead;
00581
00582    for(i=0; i<anz; i++) {
00583         _CacheSec[i] = sec++;
00584         _CacheCnt[i] = C;
00585         _CacheDty[i] = 0;
00586    }
00587
00588    _CacheCnt[0] = _CacheCount;
00589
00590    return read_sector(_CacheSec[0], *bufptr=(Buffer*) &_FATCache[0], anz);
00591   }
00592  else
00593   {
00594    _CacheDty[i] = 0;
00595    _CacheCnt[i] = _CacheCount;
00596
00597    return read_sector(_CacheSec[i]=sec, *bufptr=(Buffer*) &_FATCache[i], 1);
00598   }
00599 }

Here is the call graph for this function:

DWORD FATDrive::read_FAT | ( | DWORD | cluster,
 |  | bool & | ok
 | ) |

Todo:
cache result

Definition at line 497 of file fatfs.cpp.

References _boot_sector, BootSector::BytesPerSector, Buffer::dat, dpeek, read_cache(), BootSector::ReservedSectors, BootSector::Sectors16, BootSector::Sectors32, BootSector::SectorsPerCluster, and wpeek.

Referenced by FATDirectory::read_dir().

00498 {
00499         DWORD nClus;
00500         Buffer* FATBuf;
00501
00502         DWORD nclus = (_boot_sector.Sectors32? _boot_sector.Sectors32: _boot_sector.Sectors16) / _boot_sector.SectorsPerCluster;
00503
00504         if (cluster > nclus) {
00505                 ok = false;
00506                 return (DWORD)-1;
00507         }
00508
00509         if (nclus >= 65536) {           // FAT32
00510                 DWORD FATsec = cluster / (_boot_sector.BytesPerSector/4);
00511                 DWORD z = (cluster - _boot_sector.BytesPerSector/4 * FATsec)*4;
00512                 FATsec += _boot_sector.ReservedSectors;
00513                 if (!read_cache(FATsec, &FATBuf))
00514                         ok = false;
00515                 nClus = dpeek(&FATBuf->dat[z]);
00516         } else if (nclus >= 4096) {     // 16 Bit-FAT
00517                 DWORD FATsec = cluster / (_boot_sector.BytesPerSector/2);
00518                 DWORD z = (cluster - _boot_sector.BytesPerSector/2 * FATsec)*2;
00519                 FATsec += _boot_sector.ReservedSectors;
00520                 if (!read_cache(FATsec, &FATBuf))
00521                         ok = false;
00522                 nClus = wpeek(&FATBuf->dat[z]);
00523
00524                 if (nClus >= 0xfff0)
00525                         nClus |= 0x0fff0000;
00526         } else {                                                // 12 Bit-FAT
00527                 DWORD FATsec = cluster*3 / (_boot_sector.BytesPerSector*2);
00528                 DWORD z = (cluster*3 - _boot_sector.BytesPerSector*2*FATsec)/2;
00529                 FATsec += _boot_sector.ReservedSectors;
00530                 if (!read_cache(FATsec,&FATBuf))
00531                         ok = false;
00532                 BYTE a = FATBuf->dat[z++];
00533
00534                 if (z >= _boot_sector.BytesPerSector)
00535                         if (!read_cache(FATsec+1,&FATBuf))
00536                                 ok = false;
00537                 z = 0;
00538
00539                 BYTE b = FATBuf->dat[z];
00540
00541                 if (cluster & 1)
00542                         nClus = (a>>4) | (b<<4);
00543                 else
00544                         nClus = a | ((b & 0xf)<<8);
00545
00546                 if (nClus >= 0xff0)
00547                         nClus |= 0x0ffff000;
00548         }
00549
00550         return nClus;
00551 }

Here is the call graph for this function:

bool FATDrive::read_sector | ( | DWORD | sec,
 |  | Buffer * | buf,
 |  | int | len
 | ) |

Definition at line 482 of file fatfs.cpp.

References _boot_sector, FATDirectory::_drive, _hDrive, and BootSector::BytesPerSector.

Referenced by FATDrive(), read_cache(), and FATDirectory::read_dir().

00483 {
00484         sec += 63;      //@@ jump to first partition
00485
00486         if (SetFilePointer(_hDrive, sec*_drive._boot_sector.BytesPerSector, 0, 0) == INVALID_SET_FILE_POINTER)
00487                 return false;
00488
00489         DWORD read;
00490
00491         if (!ReadFile(_hDrive, buf, len*_drive._boot_sector.BytesPerSector, &read, 0))
00492                 return false;
00493
00494         return true;
00495 }

void FATDrive::reset_cache ( )

Definition at line 462 of file fatfs.cpp.

References _CacheCnt, _CacheDty, _Caches, _CacheSec, and _read_ahead.

Referenced by small_cache().

00463 {
00464         int i;
00465
00466         if (!_CacheSec) {
00467                 _CacheSec = (DWORD*) malloc(_Caches * sizeof(DWORD));
00468                 _CacheCnt = (int*) malloc(_Caches * sizeof(int));
00469                 _CacheDty = (bool*) malloc(_Caches * sizeof(bool));
00470         } else {
00471                 _CacheSec = (DWORD*) realloc(_CacheSec, _Caches * sizeof(DWORD));
00472                 _CacheCnt = (int*) realloc(_CacheCnt, _Caches * sizeof(int));
00473                 _CacheDty = (bool*) realloc(_CacheDty, _Caches * sizeof(bool));
00474         }
00475
00476         for(i=0; i<_Caches; i++)
00477                 _CacheSec[i] = 0;
00478
00479         _read_ahead = (_Caches+1) / 2;
00480 }

void FATDrive::small_cache ( )

Definition at line 445 of file fatfs.cpp.

References _bufl, _CacheCnt, _CacheDty, _Caches, _CacheSec, FATDirectory::_drive, _FATCache, CACHE_SIZE_LOW, and reset_cache().

Referenced by FATDrive().

00446 {
00447         if (_FATCache)
00448                 free(_FATCache);
00449
00450         if (_CacheSec) {
00451                 free(_CacheSec), _CacheSec = NULL;
00452                 free(_CacheCnt);
00453                 free(_CacheDty);
00454         }
00455
00456         _Caches = CACHE_SIZE_LOW;
00457         _FATCache = (struct Cache *) malloc((_Caches+1) * _drive._bufl);
00458
00459         reset_cache();
00460 }

Here is the call graph for this function:

Member Data Documentation

BootSector FATDrive::_boot_sector

Definition at line 238 of file fatfs.h.

Referenced by FATDrive(), read_cache(), FATDirectory::read_dir(), read_FAT(), and read_sector().

int FATDrive::_bufents

Definition at line 240 of file fatfs.h.

Referenced by FATDrive(), and FATDirectory::read_dir().

int FATDrive::_bufl

Definition at line 239 of file fatfs.h.

Referenced by FATDrive(), FATDirectory::read_dir(), and small_cache().

bool FATDrive::_cache_empty

Definition at line 250 of file fatfs.h.

Referenced by get_cache_buffer(), and read_cache().

int* FATDrive::_CacheCnt

Definition at line 247 of file fatfs.h.

Referenced by FATDrive(), get_cache_buffer(), read_cache(), reset_cache(), and small_cache().

int FATDrive::_CacheCount

Definition at line 245 of file fatfs.h.

Referenced by FATDrive(), and read_cache().

bool* FATDrive::_CacheDty

Definition at line 248 of file fatfs.h.

Referenced by FATDrive(), read_cache(), reset_cache(), and small_cache().

int FATDrive::_Caches

Definition at line 249 of file fatfs.h.

Referenced by FATDrive(), read_cache(), reset_cache(), and small_cache().

DWORD* FATDrive::_CacheSec

Definition at line 246 of file fatfs.h.

Referenced by FATDrive(), get_cache_buffer(), read_cache(), reset_cache(), and small_cache().

Cache* FATDrive::_FATCache

Definition at line 244 of file fatfs.h.

Referenced by FATDrive(), read_cache(), and small_cache().

HANDLE FATDrive::_hDrive

Definition at line 237 of file fatfs.h.

Referenced by FATDrive(), read_sector(), and ~FATDrive().

int FATDrive::_read_ahead

Definition at line 251 of file fatfs.h.

Referenced by read_cache(), and reset_cache().

int FATDrive::_SClus

Definition at line 241 of file fatfs.h.

Referenced by FATDrive(), and FATDirectory::read_dir().

The documentation for this struct was generated from the following files:
  • fatfs.h
  • fatfs.cpp


ROS Explorer: Member List

FATDrive Member List

This is the complete list of members for FATDrive, including all inherited members.

_alloc | FATDirectory | [protected]
_bhfi | Entry |
_bhfi_valid | Entry |
_boot_sector | FATDrive |
_bufents | FATDrive |
_bufl | FATDrive |
_cache_empty | FATDrive |
_CacheCnt | FATDrive |
_CacheCount | FATDrive |
_CacheDty | FATDrive |
_Caches | FATDrive |
_CacheSec | FATDrive |
_cluster | FATEntry | [protected]
_content | Entry |
_cur_bufs | FATDirectory | [protected]
_data | Entry |
_dir | FATDirectory | [protected]
_display_name | Entry |
_down | Entry |
_drive | FATDirectory | [protected]
_ents | FATDirectory | [protected]
_etype | Entry |
_expanded | Entry |
_FATCache | FATDrive |
_hDrive | FATDrive |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_path | Directory | [protected]
_read_ahead | FATDrive |
_scanned | Entry |
_SClus | FATDrive |
_secarr | FATDirectory | [protected]
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | FATEntry | [protected, virtual]
Directory() | Directory | [inline, protected]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
FATDirectory(FATDrive &drive, LPCTSTR root_path) | FATDirectory |
FATDirectory(FATDrive &drive, Entry *parent, LPCTSTR path, unsigned cluster) | FATDirectory |
FATDrive(LPCTSTR path) | FATDrive |
FATEntry(Entry *parent, unsigned cluster) | FATEntry | [inline]
FATEntry() | FATEntry | [inline, protected]
find_entry(const void *) | FATDirectory | [virtual]
free_subentries() | Entry |
get_cache_buffer() | FATDrive |
get_next_path_component(const void *) const | FATDirectory | [virtual]
get_path(PTSTR path, size_t path_count) const | FATEntry | [protected, virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL) | Entry | [virtual]
read_cache(DWORD sec, Buffer **bufptr) | FATDrive |
read_dir() | FATDirectory | [protected]
read_directory(int scan_flags=SCAN_ALL) | FATDirectory | [virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_FAT(DWORD Clus, bool &ok) | FATDrive |
read_sector(DWORD sec, Buffer *buf, int len) | FATDrive |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
reset_cache() | FATDrive |
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
small_cache() | FATDrive |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Directory() | Directory | [inline, protected, virtual]
~Entry() | Entry | [virtual]
~FATDirectory() | FATDirectory |
~FATDrive() | FATDrive |


ROS Explorer: FATEntry Struct Reference

FATEntry Struct Reference

FAT file system file-entry. More...

#include <fatfs.h>

Inheritance diagram for FATEntry:

[legend]
Collaboration diagram for FATEntry:

[legend]
List of all members.

Public Member Functions

FATEntry (Entry *parent, unsigned cluster)

Protected Member Functions

FATEntry ()
virtual bool | get_path (PTSTR path, size_t path_count) const
virtual ShellPath | create_absolute_pidl () const

Protected Attributes

DWORD | _cluster

Detailed Description

FAT file system file-entry.

Definition at line 30 of file fatfs.h.

Constructor & Destructor Documentation

FATEntry::FATEntry | ( | Entry * | parent,
 |  | unsigned | cluster
 | ) | [inline]

Definition at line 32 of file fatfs.h.

00032 : Entry(parent, ET_FAT), _cluster(cluster) {}

FATEntry::FATEntry ( ) [inline, protected]

Definition at line 35 of file fatfs.h.

00035 : Entry(ET_FAT) {}

Member Function Documentation

ShellPath FATEntry::create_absolute_pidl ( ) const [protected, virtual]

Reimplemented from Entry.

Definition at line 254 of file fatfs.cpp.

References CONTEXT.

00255 {
00256         CONTEXT("WinEntry::create_absolute_pidl()");
00257
00258         return (LPCITEMIDLIST)NULL;
00259 /* prepend root path if the drive is currently actually mounted in the file system -> return working PIDL
00260         TCHAR path[MAX_PATH];
00261
00262         if (get_path(path, COUNTOF(path)))
00263                 return ShellPath(path);
00264
00265         return ShellPath();
00266 */
00267 }

bool FATEntry::get_path | ( | PTSTR | path,
 |  | size_t | path_count
 | ) | const [protected, virtual]

Implements Entry.

Definition at line 249 of file fatfs.cpp.

References ET_FAT, and Entry::get_path_base().

00250 {
00251         return get_path_base ( path, path_count, ET_FAT );
00252 }

Here is the call graph for this function:

Member Data Documentation

DWORD FATEntry::_cluster [protected]

Definition at line 40 of file fatfs.h.

Referenced by FATDirectory::FATDirectory(), and FATDirectory::read_dir().

The documentation for this struct was generated from the following files:
  • fatfs.h
  • fatfs.cpp


ROS Explorer: Member List

FATEntry Member List

This is the complete list of members for FATEntry, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_cluster | FATEntry | [protected]
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_scanned | Entry |
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | FATEntry | [protected, virtual]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
FATEntry(Entry *parent, unsigned cluster) | FATEntry | [inline]
FATEntry() | FATEntry | [inline, protected]
find_entry(const void *) | Entry | [inline, virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | Entry | [inline, virtual]
get_path(PTSTR path, size_t path_count) const | FATEntry | [protected, virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL) | Entry | [virtual]
read_directory(int scan_flags=SCAN_ALL) | Entry | [inline, virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Entry() | Entry | [virtual]


ROS Explorer: fattr Struct Reference

fattr Struct Reference

#include <fatfs.h>

Collaboration diagram for fattr:

[legend]
List of all members.

Public Attributes

unsigned | readonly: 1
unsigned | hidden: 1
unsigned | system: 1
unsigned | volume: 1
unsigned | directory: 1
unsigned | archived: 1
unsigned | deleted: 1

Detailed Description

Definition at line 133 of file fatfs.h.

Member Data Documentation

unsigned fattr::archived

Definition at line 139 of file fatfs.h.

unsigned fattr::deleted

Definition at line 140 of file fatfs.h.

unsigned fattr::directory

Definition at line 138 of file fatfs.h.

unsigned fattr::hidden

Definition at line 135 of file fatfs.h.

unsigned fattr::readonly

Definition at line 134 of file fatfs.h.

unsigned fattr::system

Definition at line 136 of file fatfs.h.

unsigned fattr::volume

Definition at line 137 of file fatfs.h.

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

fattr Member List

This is the complete list of members for fattr, including all inherited members.

archived | fattr
deleted | fattr
directory | fattr
hidden | fattr
readonly | fattr
system | fattr
volume | fattr


ROS Explorer: Favorites Struct Reference

Favorites Struct Reference

#include <favorites.h>

Inheritance diagram for Favorites:

[legend]
Collaboration diagram for Favorites:

[legend]
List of all members.

Public Types

typedef BookmarkList | super

Public Member Functions

bool | read (LPCTSTR path)
read XBEL bookmark file
void | write (LPCTSTR path) const
write XBEL bookmark file
bool | import_IE_favorites (HWND hwnd)
import Internet Explorer bookmarks from Favorites folder

Detailed Description

Definition at line 96 of file favorites.h.

Member Typedef Documentation

typedef BookmarkList Favorites::super

Definition at line 98 of file favorites.h.

Member Function Documentation

bool Favorites::import_IE_favorites ( HWND hwnd )

import Internet Explorer bookmarks from Favorites folder

Definition at line 466 of file favorites.cpp.

References GetDesktopFolder(), and BookmarkList::import_IE_favorites().

00467 {
00468         WaitCursor wait;
00469
00470         StartMenuShellDirs dirs;
00471
00472         try {
00473                 dirs.push_back(ShellDirectory(GetDesktopFolder(), SpecialFolderPath(CSIDL_COMMON_FAVORITES, hwnd), hwnd));
00474                 dirs.push_back(ShellDirectory(GetDesktopFolder(), SpecialFolderPath(CSIDL_FAVORITES, hwnd), hwnd));
00475         } catch(COMException&) {
00476         }
00477
00478         for(StartMenuShellDirs::iterator it=dirs.begin(); it!=dirs.end(); ++it) {
00479                 StartMenuDirectory& smd = *it;
00480                 ShellDirectory& dir = smd._dir;
00481
00482                 try {
00483                         super::import_IE_favorites(dir, hwnd);
00484                 } catch(COMException&) {
00485                 }
00486         }
00487
00488         return true;
00489 }

Here is the call graph for this function:

bool Favorites::read ( LPCTSTR path )

read XBEL bookmark file

Definition at line 425 of file favorites.cpp.

References ExplorerGlobals::_hwndDesktop, XMLStorage::XMLDoc::_last_error, XMLStorage::XMLDoc::_last_error_msg, g_Globals, XMLStorage::XMLPos::go_down(), BookmarkList::read(), and XMLStorage::XMLDoc::read().

00426 {
00427         XMLDoc xbel;
00428
00429         if (!xbel.read(path))
00430                 if (xbel._last_error == XML_ERROR_NO_ELEMENTS)
00431                         return false;
00432                 else
00433                         MessageBox(g_Globals._hwndDesktop, String(xbel._last_error_msg.c_str()),
00434                                                 TEXT("ROS Explorer - reading bookmark file"), MB_OK);
00435
00436         const_XMLPos pos(&xbel);
00437
00438         if (!pos.go_down("xbel"))
00439                 return false;
00440
00441         super::read(pos);
00442
00443         pos.back();
00444
00445         return true;
00446 }

Here is the call graph for this function:

void Favorites::write ( LPCTSTR path ) const

write XBEL bookmark file

Definition at line 449 of file favorites.cpp.

References XMLStorage::XMLHeader::_doctype, XMLStorage::XMLDoc::_header, XMLStorage::XMLPos::back(), XMLStorage::XMLPos::create(), XMLStorage::XMLDoc::write(), and BookmarkList::write().

Referenced by ExplorerGlobals::write_persistent().

00450 {
00451         XMLDoc xbel;
00452
00453         XMLPos pos(&xbel);
00454         pos.create("xbel");
00455         super::write(pos);
00456         pos.back();
00457
00458         xbel._header._doctype = "<!DOCTYPE xbel"
00459                 " PUBLIC \"+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML\"\n"
00460                 " \"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd\">";
00461
00462         xbel.write(path);
00463 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • favorites.h
  • favorites.cpp


ROS Explorer: Member List

Favorites Member List

This is the complete list of members for Favorites, including all inherited members.

fill_tree(HWND hwnd, HTREEITEM parent, HIMAGELIST, HDC hdc_wnd) const | BookmarkList
import_IE_favorites(HWND hwnd) | Favorites
BookmarkList::import_IE_favorites(struct ShellDirectory &dir, HWND hwnd) | BookmarkList
read(LPCTSTR path) | Favorites
BookmarkList::read(const_XMLPos &pos) | BookmarkList
super typedef | Favorites
write(LPCTSTR path) const | Favorites
BookmarkList::write(XMLPos &pos) const | BookmarkList


ROS Explorer: FavoritesMenu Struct Reference

FavoritesMenu Struct Reference

Bookmarks sub-startmenu. More...

#include <startmenu.h>

Inheritance diagram for FavoritesMenu:

[legend]
Collaboration diagram for FavoritesMenu:

[legend]
List of all members.

Public Types

typedef StartMenu | super

Public Member Functions

FavoritesMenu (HWND hwnd, const StartMenuCreateInfo &create_info)

Protected Member Functions

virtual int | Command (int id, int code)
virtual void | AddEntries ()

Protected Attributes

BookmarkList _bookmarks
BookmarkMap _entries

Detailed Description

Bookmarks sub-startmenu.

Definition at line 455 of file startmenu.h.

Member Typedef Documentation

typedef StartMenu FavoritesMenu::super

Reimplemented from StartMenu.

Definition at line 457 of file startmenu.h.

Constructor & Destructor Documentation

FavoritesMenu::FavoritesMenu | ( | HWND | hwnd,
 |  | const StartMenuCreateInfo & | create_info
 | ) | [inline]

Definition at line 459 of file startmenu.h.

00460          :      super(hwnd, create_info),
00461                 _bookmarks(*(BookmarkList*)create_info._info)
00462         {
00463         }

Member Function Documentation

void FavoritesMenu::AddEntries ( ) [protected, virtual]

Reimplemented from StartMenu.

Definition at line 2225 of file startmenu.cpp.

References _bookmarks, StartMenu::_create_info, Bookmark::_description, _entries, StartMenuCreateInfo::_filter, ExplorerGlobals::_icon_cache, Bookmark::_icon_idx, Bookmark::_icon_path, Bookmark::_name, BookmarkFolder::_name, StartMenu::_next_id, Bookmark::_url, StartMenu::AddButton(), StartMenu::AddEntries(), BookmarkNode::BMNT_BOOKMARK, BookmarkNode::BMNT_FOLDER, IconCache::extract(), g_Globals, ICID_FOLDER, ICID_NONE, and String::toLower().

02226 {
02227         super::AddEntries();
02228
02229         String lwr_filter = _create_info._filter;
02230         lwr_filter.toLower();
02231
02232         for(BookmarkList::iterator it=_bookmarks.begin(); it!=_bookmarks.end(); ++it) {
02233                 BookmarkNode& node = *it;
02234
02235                 int id = ++_next_id;
02236
02237                 _entries[id] = node;
02238
02239                 if (node._type == BookmarkNode::BMNT_FOLDER) {
02240                         BookmarkFolder& folder = *node._pfolder;
02241
02242                         AddButton(folder._name, ICID_FOLDER, true, id);
02243                 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
02244                         Bookmark& bookmark = *node._pbookmark;
02245
02246                         ICON_ID icon = ICID_NONE;
02247
02248                         if (!bookmark._icon_path.empty())
02249                                 icon = g_Globals._icon_cache.extract(bookmark._icon_path, bookmark._icon_idx);
02250
02251                          // filter non-directory entries
02252                         if (!lwr_filter.empty()) {
02253                                 String lwr_name = bookmark._name;
02254                                 String lwr_desc = bookmark._description;
02255                                 String lwr_url = bookmark._url;
02256
02257                                 lwr_name.toLower();
02258                                 lwr_desc.toLower();
02259                                 lwr_url.toLower();
02260
02261                                 if (!_tcsstr(lwr_name,lwr_filter) && !_tcsstr(lwr_desc,lwr_filter) && !_tcsstr(lwr_url,lwr_filter))
02262                                         continue;
02263                         }
02264
02265                         AddButton(bookmark._name, icon!=ICID_NONE?icon:ICID_BOOKMARK, false, id);
02266                 }
02267         }
02268 }

Here is the call graph for this function:

int FavoritesMenu::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from StartMenu.

Definition at line 2270 of file startmenu.cpp.

References BookmarkFolder::_bookmarks, _entries, WindowHandle::_hwnd, BookmarkFolder::_name, Bookmark::_url, BookmarkNode::BMNT_BOOKMARK, BookmarkNode::BMNT_FOLDER, StartMenu::CloseOtherSubmenus(), StartMenu::CloseStartMenu(), StartMenu::CreateSubmenu(), HWND, launch_file(), and STARTMENU_CREATOR.

02271 {
02272         BookmarkMap::iterator found = _entries.find(id);
02273
02274         if (found != _entries.end()) {
02275                 BookmarkNode& node = found->second;
02276
02277                 if (node._type == BookmarkNode::BMNT_FOLDER) {
02278                         BookmarkFolder& folder = *node._pfolder;
02279
02280                         if (CloseOtherSubmenus(id))
02281                                 CreateSubmenu(id, folder._name, STARTMENU_CREATOR(FavoritesMenu), &static_cast<BookmarkList&>(folder._bookmarks));
02282                 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
02283                         Bookmark& bookmark = *node._pbookmark;
02284
02285                         String url = bookmark._url;
02286                         HWND hparent = GetParent(_hwnd);
02287
02288                         CloseStartMenu(id);
02289
02290                         launch_file(hparent, url, SW_SHOWNORMAL);
02291                 }
02292
02293                 return 0;
02294         }
02295
02296         return super::Command(id, code);
02297 }

Here is the call graph for this function:

Member Data Documentation

BookmarkList FavoritesMenu::_bookmarks [protected]

Definition at line 469 of file startmenu.h.

Referenced by AddEntries().

BookmarkMap FavoritesMenu::_entries [protected]

Reimplemented from StartMenu.

Definition at line 470 of file startmenu.h.

Referenced by AddEntries(), and Command().

The documentation for this struct was generated from the following files:
  • startmenu.h
  • startmenu.cpp


ROS Explorer: Member List

FavoritesMenu Member List

This is the complete list of members for FavoritesMenu, including all inherited members.

_arrow_btns | StartMenu | [protected]
_bookmarks | FavoritesMenu | [protected]
_border_left | StartMenu | [protected]
_border_top | StartMenu | [protected]
_bottom_max | StartMenu | [protected]
_buttons | StartMenu | [protected]
_cm_ifs | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [protected]
_create_info | StartMenu | [protected]
_dirs | StartMenu | [protected]
_entries | FavoritesMenu | [protected]
_floating_btn | StartMenu | [protected]
_hwnd | WindowHandle | [protected]
_invisible_lines | StartMenu | [protected]
_large_icons | StartMenu | [protected]
_last_mouse_pos | StartMenu | [protected]
_last_pos | StartMenu | [protected]
_next_id | StartMenu | [protected]
_scroll_mode | StartMenu | [protected]
_scroll_pos | StartMenu | [protected]
_selected_id | StartMenu | [protected]
_submenu | StartMenu | [protected]
_submenu_id | StartMenu | [protected]
ActivateEntry(int id, const ShellEntrySet &entries) | StartMenu | [protected]
AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true) | StartMenu | [protected]
AddEntries() | FavoritesMenu | [protected, virtual]
AddEntry(const String &title, ICON_ID icon_id, Entry *entry) | StartMenu | [protected]
AddEntry(const String &title, ICON_ID icon_id=ICID_NONE, int id=-1) | StartMenu | [protected]
AddEntry(const ShellFolder folder, ShellEntry *entry) | StartMenu | [protected]
AddEntry(const ShellFolder folder, Entry *entry) | StartMenu | [protected]
AddSeparator() | StartMenu | [protected]
AddShellEntries(const ShellDirectory &dir, int max=-1, const String &ignore="") | StartMenu | [protected]
ButtonHitTest(POINT pt) | StartMenu | [protected]
CancelModes() | Window | [static]
CloseOtherSubmenus(int id=0) | StartMenu | [protected]
CloseStartMenu(int id=0) | StartMenu | [protected, virtual]
CloseSubmenus() | StartMenu | [inline, protected]
Command(int id, int code) | FavoritesMenu | [protected, virtual]
Create(int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="") | StartMenu | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawArrows(HDC hdc, bool large_icons) | StartMenu | [protected]
DrawFloatingButton(HDC hdc) | StartMenu | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
FavoritesMenu(HWND hwnd, const StartMenuCreateInfo &create_info) | FavoritesMenu | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down, bool large_icons) | StartMenu | [protected]
GetButtonInfo(int id) const | StartMenu | [protected]
GetButtonRect(int id, PRECT prect) const | StartMenu | [protected]
GetFloatingButtonRect(LPRECT prect) | StartMenu | [protected]
GetSelectionIndex() | StartMenu | [protected]
GetStaticWindowData() | Window | [protected, static]
GetWndClasss() | StartMenu | [protected, static]
Init(LPCREATESTRUCT pcs) | StartMenu | [protected, virtual]
InvalidateSelection() | StartMenu | [protected]
JumpToNextShortcut(char c) | StartMenu | [protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Navigate(int step) | StartMenu | [protected]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
OpenSubmenu(bool select_first=false) | StartMenu | [protected]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< Window > | [inline]
Paint(PaintCanvas &canvas) | StartMenu | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
ProcessKey(int vk) | StartMenu | [protected, virtual]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeButtons(int cx) | StartMenu | [protected]
ResizeToButtons() | StartMenu | [protected]
s_def_creator | StartMenu | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SCROLL_DOWN enum value | StartMenu | [protected]
SCROLL_MODE enum name | StartMenu | [protected]
SCROLL_NOT enum value | StartMenu | [protected]
SCROLL_UP enum value | StartMenu | [protected]
SelectButton(int id, bool open_sub=true) | StartMenu | [protected]
SelectButtonIndex(int idx, bool open_sub=true) | StartMenu | [protected]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
StartMenu(HWND hwnd, bool large_icons=false) | StartMenu |
StartMenu(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenu |
super typedef | FavoritesMenu |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
UpdateIcons() | StartMenu | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | StartMenu | [protected, virtual]
~StartMenu() | StartMenu |
~Window() | Window | [virtual]


ROS Explorer: fdate Struct Reference

fdate Struct Reference

#include <fatfs.h>

Collaboration diagram for fdate:

[legend]
List of all members.

Public Attributes

WORD | day: 5
WORD | month: 4
WORD | year: 7

Detailed Description

Definition at line 127 of file fatfs.h.

Member Data Documentation

WORD fdate::day

Definition at line 128 of file fatfs.h.

WORD fdate::month

Definition at line 129 of file fatfs.h.

WORD fdate::year

Definition at line 130 of file fatfs.h.

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

fdate Member List

This is the complete list of members for fdate, including all inherited members.

day | fdate
month | fdate
year | fdate


ROS Explorer: FileChildWindow Struct Reference

FileChildWindow Struct Reference

MDI child window displaying file lists. More...

#include <filechild.h>

Inheritance diagram for FileChildWindow:

[legend]
Collaboration diagram for FileChildWindow:

[legend]
List of all members.

Public Types

typedef ExtContextMenuHandlerT<
ChildWindow > 		super

Public Member Functions

FileChildWindow (HWND hwnd, const FileChildWndInfo &info)
const Root & | get_root () const
void | set_focus_pane (Pane *pane)
void | switch_focus_pane ()

Static Public Member Functions

static FileChildWindow * | create (const FileChildWndInfo &info)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Command (int id, int code)
int | Notify (int id, NMHDR *pnmh)
virtual void | resize_children (int cx, int cy)
virtual String | jump_to_int (LPCTSTR url)
void | scan_entry (Entry *entry)
bool | expand_entry (Entry *dir)
void | set_curdir (Entry *entry)
void | activate_entry (Pane *pane)

Static Protected Member Functions

static void | collapse_entry (Pane *pane, Entry *dir)

Protected Attributes

Root _root
Pane * _left
Pane * _right
TCHAR | _path [MAX_PATH]
bool | _header_wdths_ok

Detailed Description

MDI child window displaying file lists.

Definition at line 88 of file filechild.h.

Member Typedef Documentation

typedef ExtContextMenuHandlerT<ChildWindow> FileChildWindow::super

Reimplemented from ExtContextMenuHandlerT< ChildWindow >.

Definition at line 90 of file filechild.h.

Constructor & Destructor Documentation

FileChildWindow::FileChildWindow | ( | HWND | hwnd,
 |  | const FileChildWndInfo & | info
 | ) |

Todo:
use OWM_ROOTED flag
Todo:
Is not-explore-mode for FileChildWindow completely implemented?

Definition at line 125 of file filechild.cpp.

References Root::_drive_type, Root::_entry, FileChildWndInfo::_etype, Root::_fs, Root::_fs_flags, _left, _MAX_DRIVE, _right, _root, ShellChildWndInfo::_shell_path, Root::_sort_order, Root::_volname, CONTEXT, GetDesktopFolder(), Root::read_tree(), and SORT_NAME.

00126  :      super(hwnd, info)
00127 {
00128         CONTEXT("FileChildWindow::FileChildWindow()");
00129
00130         TCHAR drv[_MAX_DRIVE+1];
00131         Entry* entry = NULL;
00132
00133         _left = NULL;
00134         _right = NULL;
00135
00136         switch(info._etype) {
00137           case ET_SHELL: {      //@@ separate FileChildWindow into ShellChildWindow, WinChildWindow, UnixChildWindow ?
00138                 _root._drive_type = DRIVE_UNKNOWN;
00139                 _root._sort_order = SORT_NAME;
00140
00141                 lstrcpy(drv, TEXT("\\"));
00142                 lstrcpy(_root._volname, TEXT("Desktop"));
00143                 _root._fs_flags = 0;
00144                 lstrcpy(_root._fs, TEXT("Shell"));
00145
00146                 _root._entry = new ShellDirectory(GetDesktopFolder(), DesktopFolderPath(), hwnd);
00147                 const ShellChildWndInfo& shell_info = static_cast<const ShellChildWndInfo&>(info);
00148                 entry = _root.read_tree(&*shell_info._shell_path);
00149                 break;}
00150
00151 #ifdef __WINE__
00152           case ET_UNIX:
00153                 _root._drive_type = GetDriveType(info._path);
00154                 _root._sort_order = SORT_NAME;
00155
00156                 _tsplitpath(info._path, drv, NULL, NULL, NULL);
00157                 lstrcat(drv, TEXT("/"));
00158                 lstrcpy(_root._volname, TEXT("root fs"));
00159                 _root._fs_flags = 0;
00160                 lstrcpy(_root._fs, TEXT("unixfs"));
00161                 lstrcpy(_root._path, TEXT("/"));
00162                 _root._entry = new UnixDirectory(_root._path);
00163                 entry = _root.read_tree(info._path+_tcslen(_root._path));
00164                 break;
00165 #endif
00166
00167           case ET_NTOBJS:
00168                 _root._drive_type = DRIVE_UNKNOWN;
00169                 _root._sort_order = SORT_NAME;
00170
00171                 _tsplitpath_s(info._path, drv, COUNTOF(drv), NULL, 0, NULL, 0, NULL, 0);
00172                 lstrcat(drv, TEXT("\\"));
00173                 lstrcpy(_root._volname, TEXT("NT Object Namespace"));
00174                 lstrcpy(_root._fs, TEXT("NTOBJ"));
00175                 lstrcpy(_root._path, drv);
00176                 _root._entry = new NtObjDirectory(_root._path);
00177                 entry = _root.read_tree(info._path+_tcslen(_root._path));
00178                 break;
00179
00180           case ET_REGISTRY:
00181                 _root._drive_type = DRIVE_UNKNOWN;
00182                 _root._sort_order = SORT_NONE;
00183
00184                 _tsplitpath_s(info._path, drv, COUNTOF(drv), NULL, 0, NULL, 0, NULL, 0);
00185                 lstrcat(drv, TEXT("\\"));
00186                 lstrcpy(_root._volname, TEXT("Registry"));
00187                 lstrcpy(_root._fs, TEXT("Registry"));
00188                 lstrcpy(_root._path, drv);
00189                 _root._entry = new RegistryRoot();
00190                 entry = _root.read_tree(info._path+_tcslen(_root._path));
00191                 break;
00192
00193           case ET_FAT: {
00194                 _root._drive_type = DRIVE_UNKNOWN;
00195                 _root._sort_order = SORT_NONE;
00196
00197                 _tsplitpath_s(info._path, drv, COUNTOF(drv), NULL, 0, NULL, 0, NULL, 0);
00198                 lstrcat(drv, TEXT("\\"));
00199                 lstrcpy(_root._volname, TEXT("FAT XXX"));       //@@
00200                 lstrcpy(_root._fs, TEXT("FAT"));
00201                 lstrcpy(_root._path, drv);
00202                 FATDrive* drive = new FATDrive(TEXT("c:/reactos-emu/c.img"));   //TEXT("\\\\.\\F:"));   //@@
00203
00204                 if (drive->_hDrive != INVALID_HANDLE_VALUE) {
00205                         _root._entry = drive;
00206                         entry = _root.read_tree(info._path+_tcslen(_root._path));
00207                 }
00208                 break;}
00209
00210           default:      // ET_WINDOWS
00211                 _root._drive_type = GetDriveType(info._path);
00212                 _root._sort_order = SORT_NAME;
00213
00214                 _tsplitpath_s(info._path, drv, COUNTOF(drv), NULL, 0, NULL, 0, NULL, 0);
00215                 lstrcat(drv, TEXT("\\"));
00216                 GetVolumeInformation(drv, _root._volname, _MAX_FNAME, 0, 0, &_root._fs_flags, _root._fs, COUNTOF(_root._fs));
00217                 lstrcpy(_root._path, drv);
00218                 _root._entry = new WinDirectory(_root._path);
00219                 entry = _root.read_tree(info._path+_tcslen(_root._path));
00220         }
00221
00222         if (_root._entry) {
00223                 if (info._etype != ET_SHELL)
00224                         wsprintf(_root._entry->_data.cFileName, TEXT("%s - %s"), drv, _root._fs);
00225         /*@@else
00226                         lstrcpy(_root._entry->_data.cFileName, TEXT("GetDesktopFolder"));*/
00227
00228                 _root._entry->_data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
00229
00230
00232
00233                 if (info._open_mode & OWM_EXPLORE)
00234                         _left_hwnd = *(_left=new Pane(_hwnd, IDW_TREE_LEFT, IDW_HEADER_LEFT, _root._entry, true, COL_CONTENT));
00235
00236                 _right_hwnd = *(_right=new Pane(_hwnd, IDW_TREE_RIGHT, IDW_HEADER_RIGHT, NULL, false,
00237                                                                                 COL_TYPE|COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_INDEX|COL_LINKS|COL_CONTENT));
00238         }
00239
00240         _header_wdths_ok = false;
00241
00242         if (entry)
00243                 set_curdir(entry);
00244         else
00245                 set_curdir(_root._entry);
00246
00247         if (_left_hwnd) {
00248                 int idx = ListBox_FindItemData(_left_hwnd, ListBox_GetCurSel(_left_hwnd), _left->_cur);
00249                 ListBox_SetCurSel(_left_hwnd, idx);
00250                 //SetFocus(_left_hwnd);
00251         }
00252
00253          // store path into history
00254         if (info._path && *info._path)
00255                 _url_history.push(info._path);
00256 }

Here is the call graph for this function:

Member Function Documentation

void FileChildWindow::activate_entry ( Pane * pane ) [protected]

Todo:
enable using RETURN key accelerator

Definition at line 551 of file filechild.cpp.

References Pane::_cur, Entry::_data, Entry::_down, _left, ChildWindow::_left_hwnd, Entry::_scanned, Pane::_treePane, Entry::_up, Pane::calc_widths(), collapse_entry(), expand_entry(), Entry::launch_entry(), scan_entry(), set_curdir(), and Pane::set_header().

00552 {
00553         Entry* entry = pane->_cur;
00554
00555         if (!entry)
00556                 return;
00557
00558         WaitCursor wait;
00559
00560         if ((entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||       // a directory?
00561                 entry->_down)   // a file with NTFS sub-streams?
00562         {
00563                 int scanned_old = entry->_scanned;
00564
00565                 if (!scanned_old)
00566                         scan_entry(entry);
00567
00568                 if (entry->_data.cFileName[0]==TEXT('.') && entry->_data.cFileName[1]==TEXT('\0'))
00569                         return;
00570
00571                 if (entry->_data.cFileName[0]==TEXT('.') && entry->_data.cFileName[1]==TEXT('.') && entry->_data.cFileName[2]==TEXT('\0')) {
00572                         entry = _left->_cur->_up;
00573                         collapse_entry(_left, entry);
00574                         goto focus_entry;
00575                 } else if (entry->_expanded)
00576                         collapse_entry(pane, _left->_cur);
00577                 else {
00578                         expand_entry(_left->_cur);
00579
00580                         if (!pane->_treePane) focus_entry: {
00581                                 int idx = ListBox_FindItemData(_left_hwnd, ListBox_GetCurSel(_left_hwnd), entry);
00582                                 ListBox_SetCurSel(_left_hwnd, idx);
00583
00584                                 set_curdir(entry);
00585                         }
00586                 }
00587
00588                 if (!scanned_old) {
00589                         pane->calc_widths(false);
00590
00591                         pane->set_header();
00592                 }
00593         } else {
00594                 entry->launch_entry(_hwnd);
00595         }
00596 }

Here is the call graph for this function:

void FileChildWindow::collapse_entry | ( | Pane * | pane,
 |  | Entry * | dir
 | ) | [static, protected]

Definition at line 345 of file filechild.cpp.

References Entry::_level.

Referenced by activate_entry().

00346 {
00347         int idx = ListBox_FindItemData(*pane, 0, dir);
00348
00349         SendMessage(*pane, WM_SETREDRAW, FALSE, 0);     //ShowWindow(*pane, SW_HIDE);
00350
00351          // hide sub entries
00352         for(;;) {
00353                 LRESULT res = ListBox_GetItemData(*pane, idx+1);
00354                 Entry* sub = (Entry*) res;
00355
00356                 if (res==LB_ERR || !sub || sub->_level<=dir->_level)
00357                         break;
00358
00359                 ListBox_DeleteString(*pane, idx+1);
00360         }
00361
00362         dir->_expanded = false;
00363
00364         SendMessage(*pane, WM_SETREDRAW, TRUE, 0);      //ShowWindow(*pane, SW_SHOW);
00365 }

int FileChildWindow::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 527 of file filechild.cpp.

References Pane::_cur, _left, ChildWindow::_left_hwnd, _right, and set_curdir().

00528 {
00529         Pane* pane = GetFocus()==_left_hwnd? _left: _right;
00530
00531         switch(code) {
00532           case LBN_SELCHANGE: {
00533                 int idx = ListBox_GetCurSel(*pane);
00534                 Entry* entry = (Entry*) ListBox_GetItemData(*pane, idx);
00535
00536                 if (pane == _left)
00537                         set_curdir(entry);
00538                 else
00539                         pane->_cur = entry;
00540                 break;}
00541
00542           case LBN_DBLCLK:
00543                 activate_entry(pane);
00544                 break;
00545         }
00546
00547         return 0;
00548 }

Here is the call graph for this function:

FileChildWindow * FileChildWindow::create ( const FileChildWndInfo & info ) [static]

Definition at line 368 of file filechild.cpp.

References ExplorerGlobals::_hInstance, FileChildWndInfo::_path, FileChildWndInfo::_pos, CLASSNAME_WINEFILETREE, CONTEXT, Window::create_mdi_child(), g_Globals, and WINDOW_CREATOR_INFO.

Referenced by MDIMainFrame::Command().

00369 {
00370         CONTEXT("FileChildWindow::create()");
00371
00372         MDICREATESTRUCT mcs;
00373
00374         mcs.szClass = CLASSNAME_WINEFILETREE;
00375         mcs.szTitle = (LPTSTR)info._path;
00376         mcs.hOwner      = g_Globals._hInstance;
00377         mcs.x           = info._pos.rcNormalPosition.left;
00378         mcs.y           = info._pos.rcNormalPosition.top;
00379         mcs.cx          = info._pos.rcNormalPosition.right - info._pos.rcNormalPosition.left;
00380         mcs.cy          = info._pos.rcNormalPosition.bottom - info._pos.rcNormalPosition.top;
00381         mcs.style       = 0;
00382         mcs.lParam      = 0;
00383
00384         FileChildWindow* child = static_cast<FileChildWindow*>(
00385                 create_mdi_child(info, mcs, WINDOW_CREATOR_INFO(FileChildWindow,FileChildWndInfo)));
00386
00387         return child;
00388 }

Here is the call graph for this function:

bool FileChildWindow::expand_entry ( Entry * dir ) [protected]

Definition at line 301 of file filechild.cpp.

References Entry::_data, Entry::_down, Entry::_expanded, _header_wdths_ok, _left, ChildWindow::_left_hwnd, Entry::_next, Pane::calc_widths(), Pane::insert_entries(), and Pane::set_header().

Referenced by activate_entry().

00302 {
00303         int idx;
00304         Entry* p;
00305
00306         if (!dir || dir->_expanded || !dir->_down)
00307                 return false;
00308
00309         p = dir->_down;
00310
00311         if (p->_data.cFileName[0]=='.' && p->_data.cFileName[1]=='\0' && p->_next) {
00312                 p = p->_next;
00313
00314                 if (p->_data.cFileName[0]=='.' && p->_data.cFileName[1]=='.' &&
00315                                 p->_data.cFileName[2]=='\0' && p->_next)
00316                         p = p->_next;
00317         }
00318
00319          // no subdirectories ?
00320         if (!(p->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&  // not a directory?
00321                 !p->_down)      // not a file with NTFS sub-streams?
00322                 return FALSE;
00323
00324         idx = ListBox_FindItemData(_left_hwnd, 0, dir);
00325
00326         dir->_expanded = true;
00327
00328          // insert entries in left pane
00329         HiddenWindow hide(_left_hwnd);
00330
00331         _left->insert_entries(p, idx);
00332
00333         if (!_header_wdths_ok) {
00334                 if (_left->calc_widths(false)) {
00335                         _left->set_header();
00336
00337                         _header_wdths_ok = true;
00338                 }
00339         }
00340
00341         return true;
00342 }

Here is the call graph for this function:

const Root& FileChildWindow::get_root ( ) const [inline]

Definition at line 120 of file filechild.h.

References _root.

Referenced by MDIMainFrame::activate_child_window(), and MDIMainFrame::activate_drive_window().

00120 {return _root;}

String FileChildWindow::jump_to_int ( LPCTSTR url ) [protected, virtual]

Todo:
use fname

Implements ChildWindow.

Definition at line 643 of file filechild.cpp.

References Root::_entry, Entry::_etype, Root::_path, _root, Root::read_tree(), and SplitFileSysURL().

00644 {
00645         String dir, fname;
00646
00647         if (SplitFileSysURL(url, dir, fname)) {
00648                 Entry* entry = NULL;
00649
00650                  // call read_tree() to iterate through the hierarchy and open all folders to reach dir
00651                 if (_root._entry)
00652                         switch(_root._entry->_etype) {
00653                           case ET_SHELL: {      //@@ separate into FileChildWindow in ShellChildWindow, WinChildWindow, UnixChildWindow ?
00654                                 ShellPath shell_path(dir);
00655                                 entry = _root.read_tree(&*shell_path);
00656                                 break;}
00657
00658 #ifdef __WINE__
00659                           case ET_UNIX: {
00660                                 LPCTSTR path = dir;
00661
00662                                 if (!_tcsicmp(path, _root._path, _tcslen(_root._path)))
00663                                         path += _tcslen(_root._path);
00664
00665                                 entry = _root.read_tree(path);
00666                                 break;}
00667 #endif
00668
00669                           default: { // ET_NTOBJS, ET_REGISTRY, ET_FAT, ET_WINDOWS
00670                                 LPCTSTR path = dir;
00671
00672                                 if (!_tcsnicmp(path, _root._path, _tcslen(_root._path)))
00673                                         path += _tcslen(_root._path);
00674
00675                                 entry = _root.read_tree(path);
00676                                 break;}
00677                         }
00678
00679                         if (entry) {
00680                                  // refresh left pane entries
00681                                 HiddenWindow hide(_left_hwnd);
00682
00683                                 ListBox_ResetContent(_left_hwnd);
00684
00685                                 _left->insert_entries(_root._entry);
00686
00687                                 if (!_header_wdths_ok) {
00688                                         if (_left->calc_widths(false)) {
00689                                                 _left->set_header();
00690
00691                                                 _header_wdths_ok = true;
00692                                         }
00693                                 }
00694
00695                                 set_curdir(entry);
00696
00697                                 if (_left_hwnd) {
00698                                         int idx = ListBox_FindItemData(_left_hwnd, -1, entry);
00699
00700                                         if (idx != -1) { // The item should always be found.
00701                                                 ListBox_SetCurSel(_left_hwnd, idx);
00702                                                 SetFocus(_left_hwnd);
00703                                         }
00704                                 }
00705
00707
00708                                 return dir;     //FmtString(TEXT("file://%s"), (LPCTSTR)dir);
00709                         }
00710         }
00711
00712         return String();
00713 }

Here is the call graph for this function:

int FileChildWindow::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 637 of file filechild.cpp.

References _right, and IDW_HEADER_LEFT.

00638 {
00639         return (pnmh->idFrom==IDW_HEADER_LEFT? _left: _right)->Notify(id, pnmh);
00640 }

void FileChildWindow::resize_children | ( | int | cx,
 |  | int | cy
 | ) | [protected, virtual]

Reimplemented from ChildWindow.

Definition at line 391 of file filechild.cpp.

References Pane::_hwndHeader, _left, ChildWindow::_left_hwnd, _right, ChildWindow::_right_hwnd, ChildWindow::_split_pos, and SPLIT_WIDTH.

00392 {
00393         HDWP hdwp = BeginDeferWindowPos(4);
00394         RECT rt;
00395
00396         rt.left   = 0;
00397         rt.top    = 0;
00398         rt.right  = cx;
00399         rt.bottom = cy;
00400
00401         cx = _split_pos + SPLIT_WIDTH/2;
00402
00403         if (_left && _right) {
00404                 WINDOWPOS wp;
00405                 HD_LAYOUT hdl;
00406
00407                 hdl.prc   = &rt;
00408                 hdl.pwpos = &wp;
00409
00410                 Header_Layout(_left->_hwndHeader, &hdl);
00411
00412                 hdwp = DeferWindowPos(hdwp, _left->_hwndHeader, wp.hwndInsertAfter,
00413                                                         wp.x-1, wp.y, _split_pos-SPLIT_WIDTH/2+1, wp.cy, wp.flags);
00414
00415                 hdwp = DeferWindowPos(hdwp, _right->_hwndHeader, wp.hwndInsertAfter,
00416                                                                 rt.left+cx+1, wp.y, wp.cx-cx+2, wp.cy, wp.flags);
00417         }
00418
00419         if (_left_hwnd)
00420                 hdwp = DeferWindowPos(hdwp, _left_hwnd, 0, rt.left, rt.top, _split_pos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
00421
00422         if (_right_hwnd)
00423                 hdwp = DeferWindowPos(hdwp, _right_hwnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
00424
00425         EndDeferWindowPos(hdwp);
00426 }

void FileChildWindow::scan_entry ( Entry * entry ) [protected]

Todo:
use modifyable sort order instead of fixed file system default

Definition at line 599 of file filechild.cpp.

References ChildWindow::_left_hwnd, Entry::_level, and CONTEXT.

Referenced by activate_entry(), and set_curdir().

00600 {
00601         CONTEXT("FileChildWindow::scan_entry()");
00602
00603         int idx = ListBox_GetCurSel(_left_hwnd);
00604
00605          // delete sub entries in left pane
00606         for(;;) {
00607                 LRESULT res = ListBox_GetItemData(_left_hwnd, idx+1);
00608                 Entry* sub = (Entry*) res;
00609
00610                 if (res==LB_ERR || !sub || sub->_level<=entry->_level)
00611                         break;
00612
00613                 ListBox_DeleteString(_left_hwnd, idx+1);
00614         }
00615
00616          // empty right pane
00617         ListBox_ResetContent(_right_hwnd);
00618
00619          // release memory
00620         entry->free_subentries();
00621         entry->_expanded = false;
00622
00623          // read contents from disk
00624         entry->read_directory_base(_root._sort_order);
00625
00626          // insert found entries in right pane
00627         HiddenWindow hide(_right_hwnd);
00628         _right->insert_entries(entry->_down);
00629
00630         _right->calc_widths(false);
00631         _right->set_header();
00632
00633         _header_wdths_ok = false;
00634 }

void FileChildWindow::set_curdir ( Entry * entry ) [protected]

Todo:
make configurable (This call takes really _very_ long compared to all other processing!)

Definition at line 259 of file filechild.cpp.

References Pane::_cur, Entry::_down, WindowHandle::_hwnd, _left, _path, _right, ChildWindow::_right_hwnd, Pane::_root, Entry::_scanned, Pane::calc_widths(), CONTEXT, COUNTOF, Entry::get_path(), Pane::insert_entries(), scan_entry(), Pane::set_header(), and ChildWindow::set_url().

Referenced by activate_entry(), and Command().

00260 {
00261         CONTEXT("FileChildWindow::set_curdir()");
00262
00263         _path[0] = TEXT('\0');
00264
00265         _left->_cur = entry;
00266         _right->_root = entry&&entry->_down? entry->_down: entry;
00267         _right->_cur = entry;
00268
00269         if (entry) {
00270                 WaitCursor wait;
00271
00272                 if (!entry->_scanned)
00273                         scan_entry(entry);
00274                 else {
00275                         HiddenWindow hide(_right_hwnd);
00276
00277                         ListBox_ResetContent(_right_hwnd);
00278                         _right->insert_entries(entry->_down);
00279
00280                         _right->calc_widths(false);
00281
00282                         _right->set_header();
00283                 }
00284
00285                 entry->get_path(_path, COUNTOF(_path));
00286         }
00287
00288         if (_hwnd)      // only change window title if the window already exists
00289                 SetWindowText(_hwnd, _path);
00290
00291         if (_path[0])
00292                 if (SetCurrentDirectory(_path))
00293                         set_url(_path); //set_url(FmtString(TEXT("file://%s"), _path));
00294                 else
00295                         _path[0] = TEXT('\0');
00296 }

Here is the call graph for this function:

void FileChildWindow::set_focus_pane ( Pane * pane ) [inline]

Definition at line 122 of file filechild.h.

References ChildWindow::_focus_pane, and _right.

Referenced by Pane::WndProc().

00123                 {_focus_pane = pane==_right? 1: 0;}

void FileChildWindow::switch_focus_pane ( ) [inline]

Definition at line 125 of file filechild.h.

References ChildWindow::_focus_pane, and _right.

Referenced by Pane::WndProc().

00126                 {SetFocus(_focus_pane? *_left: *_right);}

LRESULT FileChildWindow::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:

Reimplemented from ExtContextMenuHandlerT< ChildWindow >.

Definition at line 429 of file filechild.cpp.

References _left, _right, Pane::draw_item(), IDW_TREE_LEFT, and IDW_TREE_RIGHT.

00430 {
00431         switch(nmsg) {
00432                 case WM_DRAWITEM: {
00433                         LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lparam;
00434                         Entry* entry = (Entry*) dis->itemData;
00435
00436                         if (dis->CtlID == IDW_TREE_LEFT) {
00437                                 _left->draw_item(dis, entry);
00438                                 return TRUE;
00439                         } else if (dis->CtlID == IDW_TREE_RIGHT) {
00440                                 _right->draw_item(dis, entry);
00441                                 return TRUE;
00442                         }
00443
00444                         goto def;}
00445
00446                 case WM_SIZE:
00447                         if (wparam != SIZE_MINIMIZED)
00448                                 resize_children(LOWORD(lparam), HIWORD(lparam));
00449                         return DefMDIChildProc(_hwnd, nmsg, wparam, lparam);
00450
00451                 case PM_GET_FILEWND_PTR:
00452                         return (LRESULT)this;
00453
00454                 case WM_SETFOCUS: {
00455                         TCHAR path[MAX_PATH];
00456
00457                         if (_left && _left->_cur) {
00458                                 _left->_cur->get_path(path, COUNTOF(path));
00459                                 SetCurrentDirectory(path);
00460                         }
00461
00462                         SetFocus(_focus_pane? _right_hwnd: _left_hwnd);
00463                         goto def;}
00464
00465                 case PM_DISPATCH_COMMAND: {
00466                         Pane* pane = GetFocus()==_left_hwnd? _left: _right;
00467
00468                         switch(LOWORD(wparam)) {
00469                           case ID_WINDOW_NEW: {CONTEXT("FileChildWindow PM_DISPATCH_COMMAND ID_WINDOW_NEW");
00470                                 if (_root._entry->_etype == ET_SHELL)
00471                                         FileChildWindow::create(ShellChildWndInfo(GetParent(_hwnd)/*_hmdiclient*/, _path, DesktopFolderPath()));
00472                                 else
00473                                         FileChildWindow::create(FileChildWndInfo(GetParent(_hwnd)/*_hmdiclient*/, _path));
00474                                 break;}
00475
00476                           case ID_REFRESH: {CONTEXT("ID_REFRESH");
00477                                 WaitCursor wait;
00478                                 bool expanded = _left->_cur->_expanded;
00479
00480                                 scan_entry(_left->_cur);
00481
00482                                 if (expanded)
00483                                         expand_entry(_left->_cur);
00484                                 break;}
00485
00486                           case ID_ACTIVATE: {CONTEXT("ID_ACTIVATE");
00487                                 activate_entry(pane);
00488                                 break;}
00489
00490                           default:
00491                                 if (pane->command(LOWORD(wparam)))
00492                                         return TRUE;
00493                                 else
00494                                         return super::WndProc(nmsg, wparam, lparam);
00495                         }
00496
00497                         return TRUE;}
00498
00499                 case WM_CONTEXTMENU: {
00500                          // first select the current item in the listbox
00501                         HWND hpanel = (HWND) wparam;
00502                         const POINTS& pos = MAKEPOINTS(lparam);
00503                         POINT pt; POINTSTOPOINT(pt, pos);
00504                         POINT pt_screen = pt;
00505                         ScreenToClient(hpanel, &pt);
00506                         SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt.x, pt.y));
00507                         SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt.x, pt.y));
00508
00509                          // now create the popup menu using shell namespace and IContextMenu
00510                         Pane* pane = GetFocus()==_left_hwnd? _left: _right;
00511                         int idx = ListBox_GetCurSel(*pane);
00512                         if (idx != -1) {
00513                                 Entry* entry = (Entry*) ListBox_GetItemData(*pane, idx);
00514
00515                                 CHECKERROR(entry->do_context_menu(_hwnd, pt_screen, _cm_ifs));
00516                         }
00517                         break;}
00518
00519                 default: def:
00520                         return super::WndProc(nmsg, wparam, lparam);
00521         }
00522
00523         return 0;
00524 }

Here is the call graph for this function:

Member Data Documentation

bool FileChildWindow::_header_wdths_ok [protected]

Definition at line 117 of file filechild.h.

Referenced by expand_entry().

Pane* FileChildWindow::_left [protected]

Definition at line 114 of file filechild.h.

Referenced by activate_entry(), Command(), expand_entry(), FileChildWindow(), resize_children(), set_curdir(), and WndProc().

TCHAR FileChildWindow::_path[MAX_PATH] [protected]

Definition at line 116 of file filechild.h.

Referenced by set_curdir().

Pane* FileChildWindow::_right [protected]

Definition at line 115 of file filechild.h.

Referenced by Command(), FileChildWindow(), Notify(), resize_children(), set_curdir(), set_focus_pane(), switch_focus_pane(), and WndProc().

Root FileChildWindow::_root [protected]

Definition at line 113 of file filechild.h.

Referenced by FileChildWindow(), get_root(), and jump_to_int().

The documentation for this struct was generated from the following files:
  • filechild.h
  • filechild.cpp


ROS Explorer: Member List

FileChildWindow Member List

This is the complete list of members for FileChildWindow, including all inherited members.

_cm_ifs | ExtContextMenuHandlerT< ChildWindow > | [protected]
_focus_pane | ChildWindow | [protected]
_header_wdths_ok | FileChildWindow | [protected]
_hwnd | WindowHandle | [protected]
_hwndFrame | ChildWindow | [protected]
_last_split | ChildWindow | [protected]
_left | FileChildWindow | [protected]
_left_hwnd | ChildWindow | [protected]
_menu_info | ChildWindow | [protected]
_path | FileChildWindow | [protected]
_right | FileChildWindow | [protected]
_right_hwnd | ChildWindow | [protected]
_root | FileChildWindow | [protected]
_split_pos | ChildWindow | [protected]
_statusText | ChildWindow | [protected]
_url | ChildWindow | [protected]
_url_history | ChildWindow | [protected]
activate_entry(Pane *pane) | FileChildWindow | [protected]
CancelModes() | Window | [static]
ChildWindow(HWND hwnd, const ChildWndInfo &info) | ChildWindow |
collapse_entry(Pane *pane, Entry *dir) | FileChildWindow | [protected, static]
Command(int id, int code) | FileChildWindow | [protected, virtual]
create(const FileChildWndInfo &info) | FileChildWindow | [static]
ExtContextMenuHandlerT< ChildWindow >::create(const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0) | ChildWindow | [static]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
expand_entry(Entry *dir) | FileChildWindow | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< ChildWindow > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< ChildWindow > | [inline]
FileChildWindow(HWND hwnd, const FileChildWndInfo &info) | FileChildWindow |
get_root() const | FileChildWindow | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
go_to(LPCTSTR url) | ChildWindow |
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
jump_to_int(LPCTSTR url) | FileChildWindow | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | FileChildWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
resize_children(int cx, int cy) | FileChildWindow | [protected, virtual]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
scan_entry(Entry *entry) | FileChildWindow | [protected]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
set_curdir(Entry *entry) | FileChildWindow | [protected]
set_focus_pane(Pane *pane) | FileChildWindow | [inline]
set_url(LPCTSTR url) | ChildWindow | [protected]
super typedef | FileChildWindow |
switch_focus_pane() | FileChildWindow | [inline]
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | FileChildWindow | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: FileChildWndInfo Struct Reference

FileChildWndInfo Struct Reference

information structure for creation of FileChildWindow More...

#include <filechild.h>

Inheritance diagram for FileChildWndInfo:

[legend]
Collaboration diagram for FileChildWndInfo:

[legend]
List of all members.

Public Types

typedef ChildWndInfo | super

Public Member Functions

FileChildWndInfo (HWND hmdiclient, LPCTSTR path, ENTRY_TYPE etype=ET_UNKNOWN)

Public Attributes

ENTRY_TYPE _etype
LPCTSTR | _path
WINDOWPLACEMENT | _pos
int | _open_mode

Detailed Description

information structure for creation of FileChildWindow

Definition at line 30 of file filechild.h.

Member Typedef Documentation

typedef ChildWndInfo FileChildWndInfo::super

Reimplemented in ShellChildWndInfo, NtObjChildWndInfo, RegistryChildWndInfo, FATChildWndInfo, and WebChildWndInfo.

Definition at line 32 of file filechild.h.

Constructor & Destructor Documentation

FileChildWndInfo::FileChildWndInfo | ( | HWND | hmdiclient,
 |  | LPCTSTR | path,
 |  | ENTRY_TYPE | etype = ET_UNKNOWN
 | ) |

Definition at line 38 of file filechild.cpp.

References _etype, _open_mode, _path, _pos, ET_UNKNOWN, ET_WINDOWS, OWM_DETAILS, and OWM_EXPLORE.

00039  :      super(hmdiclient),
00040         _etype(etype)
00041 {
00042         if (etype == ET_UNKNOWN)
00043 #ifdef __WINE__
00044                 if (*path == '/')
00045                         _etype = ET_UNIX;
00046                 else
00047 #endif
00048                         _etype = ET_WINDOWS;
00049
00050         _path = path;
00051
00052         _pos.length = sizeof(WINDOWPLACEMENT);
00053         _pos.flags = 0;
00054         _pos.showCmd = SW_SHOWNORMAL;
00055         _pos.rcNormalPosition.left = CW_USEDEFAULT;
00056         _pos.rcNormalPosition.top = CW_USEDEFAULT;
00057         _pos.rcNormalPosition.right = CW_USEDEFAULT;
00058         _pos.rcNormalPosition.bottom = CW_USEDEFAULT;
00059
00060         _open_mode = OWM_EXPLORE|OWM_DETAILS;
00061 }

Member Data Documentation

ENTRY_TYPE FileChildWndInfo::_etype

Definition at line 36 of file filechild.h.

Referenced by FileChildWindow::FileChildWindow(), and FileChildWndInfo().

int FileChildWndInfo::_open_mode

Definition at line 40 of file filechild.h.

Referenced by FileChildWndInfo(), and MDIMainFrame::WndProc().

LPCTSTR FileChildWndInfo::_path

Definition at line 37 of file filechild.h.

Referenced by FileChildWindow::create(), FileChildWndInfo(), and WebChildWindow::WebChildWindow().

WINDOWPLACEMENT FileChildWndInfo::_pos

Definition at line 39 of file filechild.h.

Referenced by WebChildWindow::create(), MDIShellBrowserChild::create(), FileChildWindow::create(), FileChildWndInfo(), and MDIMainFrame::WndProc().

The documentation for this struct was generated from the following files:
  • filechild.h
  • filechild.cpp


ROS Explorer: Member List

FileChildWndInfo Member List

This is the complete list of members for FileChildWndInfo, including all inherited members.

_etype | FileChildWndInfo |
_hmdiclient | ChildWndInfo |
_open_mode | FileChildWndInfo |
_path | FileChildWndInfo |
_pos | FileChildWndInfo |
ChildWndInfo(HWND hmdiclient) | ChildWndInfo | [inline]
FileChildWndInfo(HWND hmdiclient, LPCTSTR path, ENTRY_TYPE etype=ET_UNKNOWN) | FileChildWndInfo |
super typedef | FileChildWndInfo |


ROS Explorer: XMLStorage::FileHolder Struct Reference

XMLStorage::FileHolder

XMLStorage::FileHolder Struct Reference

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::FileHolder:

[legend]
Collaboration diagram for XMLStorage::FileHolder:

[legend]
List of all members.

Public Member Functions

FileHolder (LPCTSTR path, LPCTSTR mode)
~FileHolder ()

Protected Attributes

FILE * _pfile

Detailed Description

Definition at line 273 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::FileHolder::FileHolder | ( | LPCTSTR | path,
 |  | LPCTSTR | mode
 | ) | [inline]

Definition at line 275 of file xmlstorage.h.

References _pfile.

00276         {
00277 #ifdef __STDC_WANT_SECURE_LIB__ // secure CRT functions using VS 2005
00278                 if (_tfopen_s(&_pfile, path, mode) != 0)
00279                         _pfile = NULL;
00280 #else
00281                 _pfile = _tfopen(path, mode);
00282 #endif
00283         }

XMLStorage::FileHolder::~FileHolder ( ) [inline]

Definition at line 285 of file xmlstorage.h.

References _pfile.

00286         {
00287                 if (_pfile)
00288                         fclose(_pfile);
00289         }

Member Data Documentation

FILE* XMLStorage::FileHolder::_pfile [protected]

Definition at line 292 of file xmlstorage.h.

Referenced by FileHolder(), and ~FileHolder().

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::FileHolder Member List

This is the complete list of members for XMLStorage::FileHolder, including all inherited members.

_pfile | XMLStorage::FileHolder | [protected]
FileHolder(LPCTSTR path, LPCTSTR mode) | XMLStorage::FileHolder | [inline]
~FileHolder() | XMLStorage::FileHolder | [inline]


ROS Explorer: FileSysShellPath Class Reference

FileSysShellPath Class Reference

Retrieval of file system paths of ShellPath objects. More...

#include <shellclasses.h>

Inheritance diagram for FileSysShellPath:

[legend]
Collaboration diagram for FileSysShellPath:

[legend]
List of all members.

Public Member Functions

FileSysShellPath (const ShellPath &o)
operator LPCTSTR ()

Protected Member Functions

FileSysShellPath ()

Detailed Description

Retrieval of file system paths of ShellPath objects.

Definition at line 920 of file shellclasses.h.

Constructor & Destructor Documentation

FileSysShellPath::FileSysShellPath ( ) [inline, protected]

Definition at line 925 of file shellclasses.h.

00925 {_fullpath[0] = '\0';}

FileSysShellPath::FileSysShellPath ( const ShellPath & o ) [inline]

Definition at line 928 of file shellclasses.h.

00928 : ShellPath(o) {_fullpath[0] = '\0';}

Member Function Documentation

FileSysShellPath::operator LPCTSTR ( ) [inline]

Definition at line 930 of file shellclasses.h.

00930 {if (!SHGetPathFromIDList(_p, _fullpath)) return NULL; return _fullpath;}

The documentation for this class was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

FileSysShellPath Member List

This is the complete list of members for FileSysShellPath, including all inherited members.

_malloc | SShellPtr< ITEMIDLIST > | [mutable, protected]
_p | SShellPtr< ITEMIDLIST > | [protected]
assign(LPCITEMIDLIST pidl, size_t size) | ShellPath | [inline]
assign(LPCITEMIDLIST pidl) | ShellPath | [inline]
create_absolute_pidl(LPCITEMIDLIST parent_pidl) const | ShellPath |
FileSysShellPath() | FileSysShellPath | [inline, protected]
FileSysShellPath(const ShellPath &o) | FileSysShellPath | [inline]
Free() | SShellPtr< ITEMIDLIST > | [inline, protected]
get_folder() | ShellPath | [inline]
get_folder(IShellFolder *parent) | ShellPath | [inline]
GetUIObjectOf(REFIID riid, LPVOID *ppvOut, HWND hWnd=0, ShellFolder &sf=GetDesktopFolder()) | ShellPath |
operator *() const | SShellPtr< ITEMIDLIST > | [inline]
operator *() | SShellPtr< ITEMIDLIST > | [inline]
operator ITEMIDLIST const *() const | SShellPtr< ITEMIDLIST > | [inline]
operator LPCTSTR() | FileSysShellPath | [inline]
operator+=(const SHITEMID &o) | ShellPath | [inline]
operator->() | SShellPtr< ITEMIDLIST > | [inline]
operator->() const | SShellPtr< ITEMIDLIST > | [inline]
operator=(const ShellPath &o) | ShellPath | [inline]
operator=(ITEMIDLIST *p) | ShellPath | [inline]
operator=(const SHITEMID &o) | ShellPath | [inline]
ShellPath() | ShellPath | [inline]
ShellPath(IShellFolder *folder, LPCWSTR path) | ShellPath | [inline]
ShellPath(LPCWSTR path) | ShellPath | [inline]
ShellPath(IShellFolder *folder, LPCSTR path) | ShellPath | [inline]
ShellPath(LPCSTR path) | ShellPath | [inline]
ShellPath(const ShellPath &o) | ShellPath | [inline]
ShellPath(LPITEMIDLIST p) | ShellPath | [inline, explicit]
ShellPath(LPCITEMIDLIST p) | ShellPath | [inline]
split(ShellPath &parent, ShellPath &obj) const | ShellPath |
SShellPtr() | SShellPtr< ITEMIDLIST > | [inline, protected]
SShellPtr(ITEMIDLIST *p) | SShellPtr< ITEMIDLIST > | [inline, protected]
super typedef | ShellPath |
~SShellPtr() | SShellPtr< ITEMIDLIST > | [inline]


ROS Explorer: FileTypeInfo Struct Reference

FileTypeInfo Struct Reference

management of file types More...

#include <globals.h>

Collaboration diagram for FileTypeInfo:

[legend]
List of all members.

Public Attributes

String _classname
String _displayname
bool _neverShowExt

Detailed Description

management of file types

Definition at line 37 of file globals.h.

Member Data Documentation

String FileTypeInfo::_classname

Definition at line 38 of file globals.h.

Referenced by FileTypeManager::operator[]().

String FileTypeInfo::_displayname

Definition at line 39 of file globals.h.

Referenced by FileTypeManager::operator[](), and FileTypeManager::set_type().

bool FileTypeInfo::_neverShowExt

Definition at line 40 of file globals.h.

Referenced by FileTypeManager::operator[](), and FileTypeManager::set_type().

The documentation for this struct was generated from the following file:
  • globals.h


ROS Explorer: Member List

FileTypeInfo Member List

This is the complete list of members for FileTypeInfo, including all inherited members.

_classname | FileTypeInfo
_displayname | FileTypeInfo
_neverShowExt | FileTypeInfo


ROS Explorer: FileTypeManager Struct Reference

FileTypeManager Struct Reference

#include <globals.h>

Inheritance diagram for FileTypeManager:

[legend]
Collaboration diagram for FileTypeManager:

[legend]
List of all members.

Public Types

typedef map< String, FileTypeInfo > | super

Public Member Functions

const FileTypeInfo & | operator[] (String ext)
LPCTSTR | set_type (struct Entry *entry, bool dont_hide_ext=false)

Static Public Member Functions

static bool | is_exe_file (LPCTSTR ext)

Detailed Description

Definition at line 43 of file globals.h.

Member Typedef Documentation

typedef map<String, FileTypeInfo> FileTypeManager::super

Definition at line 45 of file globals.h.

Member Function Documentation

bool FileTypeManager::is_exe_file ( LPCTSTR ext ) [static]

Definition at line 154 of file explorer.cpp.

References _MAX_EXT.

Referenced by set_type().

00155 {
00156         static const LPCTSTR s_executable_extensions[] = {
00157                 TEXT("COM"),
00158                 TEXT("EXE"),
00159                 TEXT("BAT"),
00160                 TEXT("CMD"),
00161                 TEXT("CMM"),
00162                 TEXT("BTM"),
00163                 TEXT("AWK"),
00164                 0
00165         };
00166
00167         TCHAR ext_buffer[_MAX_EXT];
00168         const LPCTSTR* p;
00169         LPCTSTR s;
00170         LPTSTR d;
00171
00172         for(s=ext+1,d=ext_buffer; (*d=toupper(*s)); s++)
00173                 ++d;
00174
00175         for(p=s_executable_extensions; *p; p++)
00176                 if (!lstrcmp(ext_buffer, *p))
00177                         return true;
00178
00179         return false;
00180 }

const FileTypeInfo & FileTypeManager::operator[] ( String ext )

Definition at line 183 of file explorer.cpp.

References FileTypeInfo::_classname, FileTypeInfo::_displayname, and FileTypeInfo::_neverShowExt.

00184 {
00185         ext.toLower();
00186
00187         iterator found = find(ext);
00188         if (found != end())
00189                 return found->second;
00190
00191         FileTypeInfo& ftype = super::operator[](ext);
00192
00193         ftype._neverShowExt = false;
00194
00195         HKEY hkey;
00196         TCHAR value[MAX_PATH], display_name[MAX_PATH];
00197         LONG valuelen = sizeof(value);
00198
00199         if (!RegQueryValue(HKEY_CLASSES_ROOT, ext, value, &valuelen)) {
00200                 ftype._classname = value;
00201
00202                 valuelen = sizeof(display_name);
00203                 if (!RegQueryValue(HKEY_CLASSES_ROOT, ftype._classname, display_name, &valuelen))
00204                         ftype._displayname = display_name;
00205
00206                 if (!RegOpenKey(HKEY_CLASSES_ROOT, ftype._classname, &hkey)) {
00207                         if (!RegQueryValueEx(hkey, TEXT("NeverShowExt"), 0, NULL, NULL, NULL))
00208                                 ftype._neverShowExt = true;
00209
00210                         RegCloseKey(hkey);
00211                 }
00212         }
00213
00214         return ftype;
00215 }

LPCTSTR FileTypeManager::set_type | ( | struct Entry * | entry,
 |  | bool | dont_hide_ext = false
 | ) |

Definition at line 217 of file explorer.cpp.

References Entry::_data, Entry::_display_name, FileTypeInfo::_displayname, FileTypeInfo::_neverShowExt, _tcsrchr, Entry::_type_name, ATTRIBUTE_EXECUTABLE, and is_exe_file().

Referenced by WinDirectory::read_directory(), and ShellDirectory::read_directory().

00218 {
00219         LPCTSTR ext = _tcsrchr(entry->_data.cFileName, TEXT('.'));
00220
00221         if (ext) {
00222                 const FileTypeInfo& type = (*this)[ext];
00223
00224                 if (!type._displayname.empty())
00225                         entry->_type_name = _tcsdup(type._displayname);
00226
00227                  // hide some file extensions
00228                 if (type._neverShowExt && !dont_hide_ext) {
00229                         int len = ext - entry->_data.cFileName;
00230                         entry->_display_name = (LPTSTR) malloc((len+1)*sizeof(TCHAR));
00231                         lstrcpyn(entry->_display_name, entry->_data.cFileName, len + 1);
00232                 }
00233
00234                 if (is_exe_file(ext))
00235                         entry->_data.dwFileAttributes |= ATTRIBUTE_EXECUTABLE;
00236         }
00237
00238         return ext;
00239 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • globals.h
  • explorer.cpp


ROS Explorer: Member List

FileTypeManager Member List

This is the complete list of members for FileTypeManager, including all inherited members.

is_exe_file(LPCTSTR ext) | FileTypeManager | [static]
operator[](String ext) | FileTypeManager |
set_type(struct Entry *entry, bool dont_hide_ext=false) | FileTypeManager |
super typedef | FileTypeManager |


ROS Explorer: FindProgramDlg Struct Reference

FindProgramDlg Struct Reference

Dialog to work with the complete list of start menu entries. More...

#include <searchprogram.h>

Inheritance diagram for FindProgramDlg:

[legend]
Collaboration diagram for FindProgramDlg:

[legend]
List of all members.

Public Types

typedef ResizeController<
Dialog > 		super

Public Member Functions

FindProgramDlg (HWND hwnd)
~FindProgramDlg ()

Protected Member Functions

virtual LRESULT | WndProc (UINT, WPARAM, LPARAM)
virtual int | Command (int id, int code)
virtual int | Notify (int id, NMHDR *pnmh)
void | Refresh (bool delete_cache=false)
void | add_entry (const FPDEntry &cache_entry)
void | LaunchSelected ()
void | CheckEntries ()

Static Protected Member Functions

static void | collect_programs_callback (Entry *entry, void *param)
static int CALLBACK | CompareFunc (LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort)

Protected Attributes

HWND _list_ctrl
HACCEL | _haccel
String _lwr_filter
CollectProgramsThread _thread
FPDCache _cache
String _common_programs
String _user_programs
ListSort _sort

Detailed Description

Dialog to work with the complete list of start menu entries.

Definition at line 78 of file searchprogram.h.

Member Typedef Documentation

typedef ResizeController<Dialog> FindProgramDlg::super

Reimplemented from ResizeController< Dialog >.

Definition at line 80 of file searchprogram.h.

Constructor & Destructor Documentation

FindProgramDlg::FindProgramDlg ( HWND hwnd )

Definition at line 90 of file searchprogram.cpp.

References _common_programs, _haccel, ExplorerGlobals::_hInstance, ExplorerGlobals::_icon_cache, _list_ctrl, ResizeController< Dialog >::_resize_mgr, _user_programs, ResizeManager::Add(), CenterWindow(), g_Globals, IconCache::get_sys_imagelist(), IDA_SEARCH_PROGRAM, IDC_CHECK_ENTRIES, IDC_FILTER, IDC_PROGRAMS_FOUND, IDI_SEARCH, MOVE_X, Refresh(), Window::register_pretranslate(), ResizeManager::Resize(), RESIZE, RESIZE_X, and SetWindowIcon().

00091  :      super(hwnd),
00092         _list_ctrl(GetDlgItem(hwnd, IDC_PROGRAMS_FOUND)),
00093         _thread(collect_programs_callback, hwnd, this),
00094         _sort(_list_ctrl, CompareFunc/*, (LPARAM)this*/)
00095 {
00096         SetWindowIcon(hwnd, IDI_SEARCH);
00097
00098         _resize_mgr.Add(IDC_FILTER,                     RESIZE_X);
00099         _resize_mgr.Add(IDC_CHECK_ENTRIES,      MOVE_X);
00100         _resize_mgr.Add(IDC_PROGRAMS_FOUND,     RESIZE);
00101
00102         _resize_mgr.Resize(+520, +300);
00103
00104         _haccel = LoadAccelerators(g_Globals._hInstance, MAKEINTRESOURCE(IDA_SEARCH_PROGRAM));
00105
00106         (void)ListView_SetImageList(_list_ctrl, g_Globals._icon_cache.get_sys_imagelist(), LVSIL_SMALL);
00107
00108         LV_COLUMN column = {LVCF_FMT|LVCF_WIDTH|LVCF_TEXT, LVCFMT_LEFT, 250};
00109
00110         column.pszText = _T("Name");
00111         ListView_InsertColumn(_list_ctrl, 0, &column);
00112
00113         column.cx = 300;
00114         column.pszText = _T("Path");
00115         ListView_InsertColumn(_list_ctrl, 1, &column);
00116
00117         column.cx = 400;
00118         column.pszText = _T("Menu Path");
00119         ListView_InsertColumn(_list_ctrl, 2, &column);
00120
00121         ListView_SetExtendedListViewStyleEx(_list_ctrl, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
00122
00123         _common_programs = SpecialFolderFSPath(CSIDL_COMMON_PROGRAMS, hwnd);
00124         if (!_common_programs.empty())
00125                 _common_programs.append(_T("\\"));
00126
00127         _user_programs = SpecialFolderFSPath(CSIDL_PROGRAMS, hwnd);
00128         if (!_user_programs.empty())
00129                 _user_programs.append(_T("\\"));
00130
00131         CenterWindow(hwnd);
00132
00133         Refresh();
00134
00135         register_pretranslate(hwnd);
00136 }

Here is the call graph for this function:

FindProgramDlg::~FindProgramDlg ( )

Definition at line 138 of file searchprogram.cpp.

References WindowHandle::_hwnd, _thread, Thread::Stop(), and Window::unregister_pretranslate().

00139 {
00140         _thread.Stop();
00141
00142         unregister_pretranslate(_hwnd);
00143 }

Here is the call graph for this function:

Member Function Documentation

void FindProgramDlg::add_entry ( const FPDEntry & cache_entry ) [protected]

Definition at line 226 of file searchprogram.cpp.

References Entry::_display_name, FPDEntry::_entry, FPDEntry::_idxIcon, _list_ctrl, _lwr_filter, FPDEntry::_menu_path, FPDEntry::_path, and String::toLower().

Referenced by collect_programs_callback(), and Refresh().

00227 {
00228         String lwr_path = cache_entry._path;
00229         String lwr_name = cache_entry._entry->_display_name;
00230
00231         lwr_path.toLower();
00232         lwr_name.toLower();
00233
00234         if (_lwr_filter.empty())
00235                 if (_tcsstr(lwr_name, _T("uninstal")) || _tcsstr(lwr_name, _T("deinstal")))     // filter out deinstallation links
00236                         return;
00237
00238         if (!_tcsstr(lwr_path, _lwr_filter) && !_tcsstr(lwr_name, _lwr_filter))
00239                 return;
00240
00241         LV_ITEM item = {LVIF_TEXT|LVIF_IMAGE|LVIF_PARAM, INT_MAX};
00242
00243         item.pszText = cache_entry._entry->_display_name;
00244         item.iImage = cache_entry._idxIcon;
00245         item.lParam = (LPARAM) &cache_entry;
00246         item.iItem = ListView_InsertItem(_list_ctrl, &item);    // We could use the information in _sort to enable manual sorting while populating the list.
00247
00248         item.mask = LVIF_TEXT;
00249         item.iSubItem = 1;
00250         item.pszText = (LPTSTR)(LPCTSTR)cache_entry._path;
00251         ListView_SetItem(_list_ctrl, &item);
00252
00253         item.iSubItem = 2;
00254         item.pszText = (LPTSTR)(LPCTSTR)cache_entry._menu_path;
00255         ListView_SetItem(_list_ctrl, &item);
00256 }

Here is the call graph for this function:

void FindProgramDlg::CheckEntries ( ) [protected]

Todo:
check all entries for existing targets, display a list of not working entries and ask the user for permission to delete them

Definition at line 414 of file searchprogram.cpp.

Referenced by Command().

00415 {
00417 }

void FindProgramDlg::collect_programs_callback | ( | Entry * | entry,
 |  | void * | param
 | ) | [static, protected]

Definition at line 170 of file searchprogram.cpp.

References _cache, _common_programs, Thread::_crit_sect, FPDEntry::_entry, WindowHandle::_hwnd, FPDEntry::_idxIcon, FPDEntry::_menu_path, FPDEntry::_path, _thread, _user_programs, add_entry(), COUNTOF, Entry::get_path(), Entry::GetUIObjectOf(), IDS_ALL_USERS, and Thread::is_alive().

00171 {
00172         FindProgramDlg* pThis = (FindProgramDlg*) param;
00173
00174         IShellLink* pShellLink;
00175         HRESULT hr = entry->GetUIObjectOf(pThis->_hwnd, IID_IShellLink, (LPVOID*)&pShellLink);
00176
00177         if (SUCCEEDED(hr)) {
00178                 ShellLinkPtr shell_link(pShellLink);
00179
00180                 shell_link->Release();
00181
00182                 /*hr = pShellLink->Resolve(pThis->_hwnd, SLR_NO_UI);
00183                 if (SUCCEEDED(hr))*/ {
00184                         WIN32_FIND_DATA wfd;
00185                         TCHAR path[MAX_PATH];
00186
00187                         hr = pShellLink->GetPath(path, COUNTOF(path)-1, &wfd, SLGP_UNCPRIORITY);
00188
00189                         if (SUCCEEDED(hr)) {
00190                                 TCHAR entry_path[MAX_PATH];
00191
00192                                 entry->get_path(entry_path, COUNTOF(entry_path));
00193
00194                                 String menu_path;
00195
00196                                 int len = pThis->_common_programs.size();
00197
00198                                 if (len && !_tcsnicmp(entry_path, pThis->_common_programs, len))
00199                                         menu_path = ResString(IDS_ALL_USERS) + (String(entry_path)+len);
00200                                 else if ((len=pThis->_user_programs.size()) && !_tcsnicmp(entry_path, pThis->_user_programs, len))
00201                                         menu_path = String(entry_path)+len;
00202
00203                                  // store info in cache
00204                                 FPDEntry new_entry;
00205
00206                                 new_entry._entry = entry;
00207                                 new_entry._menu_path = menu_path;
00208                                 new_entry._path = path;
00209                                 new_entry._idxIcon = I_IMAGECALLBACK;
00210
00211                                 pThis->_cache.push_front(new_entry);
00212                                 FPDEntry& cache_entry = pThis->_cache.front();
00213
00214                                 Lock lock(pThis->_thread._crit_sect);
00215
00216                                  // resolve deadlocks while executing Thread::Stop()
00217                                 if (!pThis->_thread.is_alive())
00218                                         return;
00219
00220                                 pThis->add_entry(cache_entry);
00221                         }
00222                 }
00223         }
00224 }

Here is the call graph for this function:

int FindProgramDlg::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Dialog.

Definition at line 280 of file searchprogram.cpp.

References CheckEntries(), Dialog::Command(), IDC_CHECK_ENTRIES, LaunchSelected(), and Refresh().

00281 {
00282         if (code == BN_CLICKED) {
00283                 switch(id) {
00284                   case ID_REFRESH:
00285                         Refresh(true);
00286                         break;
00287
00288                   case IDOK:
00289                         LaunchSelected();
00290                         break;
00291
00292                   case IDC_CHECK_ENTRIES:
00293                         CheckEntries();
00294                         break;
00295
00296                   default:
00297                         return super::Command(id, code);
00298                 }
00299
00300                 return 0;
00301         }
00302         else if (code == EN_CHANGE) {
00303                 switch(id) {
00304                   case IDC_FILTER:
00305                         Refresh();
00306                         break;
00307                 }
00308
00309                 return 0;
00310         }
00311
00312         return 1;
00313 }

Here is the call graph for this function:

int CALLBACK FindProgramDlg::CompareFunc | ( | LPARAM | lparam1,
 |  | LPARAM | lparam2,
 |  | LPARAM | lparamSort
 | ) | [static, protected]

Definition at line 389 of file searchprogram.cpp.

References ListSort::_direction, Entry::_display_name, FPDEntry::_entry, FPDEntry::_menu_path, FPDEntry::_path, and ListSort::_sort_crit.

00390 {
00391         ListSort* sort = (ListSort*)lparamSort;
00392
00393         FPDEntry& a = *(FPDEntry*)lparam1;
00394         FPDEntry& b = *(FPDEntry*)lparam2;
00395
00396         int cmp = 0;
00397
00398         switch(sort->_sort_crit) {
00399           case 0:
00400                 cmp = _tcsicoll(a._entry->_display_name, b._entry->_display_name);
00401                 break;
00402
00403           case 1:
00404                 cmp = _tcsicoll(a._path, b._path);
00405                 break;
00406
00407           case 2:
00408                 cmp = _tcsicoll(a._menu_path, b._menu_path);
00409         }
00410
00411         return sort->_direction? -cmp: cmp;
00412 }

void FindProgramDlg::LaunchSelected ( ) [protected]

Definition at line 315 of file searchprogram.cpp.

References Thread::_crit_sect, FPDEntry::_entry, WindowHandle::_hwnd, _list_ctrl, _thread, IDS_LAUNCH_MANY_PROGRAMS, IDS_TITLE, Entry::launch_entry(), and ListView_GetItemData().

Referenced by Command().

00316 {
00317         Lock lock(_thread._crit_sect);
00318
00319         int count = ListView_GetSelectedCount(_list_ctrl);
00320
00321         if (count > 1)
00322                 if (MessageBox(_hwnd, ResString(IDS_LAUNCH_MANY_PROGRAMS), ResString(IDS_TITLE), MB_OKCANCEL) != IDOK)
00323                         return;
00324
00325         for(int idx=-1; (idx=ListView_GetNextItem(_list_ctrl, idx, LVNI_SELECTED))!=-1; ) {
00326                 LPARAM lparam = ListView_GetItemData(_list_ctrl, idx);
00327
00328                 if (lparam) {
00329                         FPDEntry& cache_entry = *(FPDEntry*)lparam;
00330                         cache_entry._entry->launch_entry(_hwnd);
00331                 }
00332         }
00333 }

Here is the call graph for this function:

int FindProgramDlg::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 335 of file searchprogram.cpp.

References FPDEntry::_entry, ExplorerGlobals::_icon_cache, Entry::_icon_id, _list_ctrl, g_Globals, IconCache::get_icon(), Icon::get_sysiml_idx(), ICF_SYSCACHE, and ICID_UNKNOWN.

00336 {
00337         switch(pnmh->code) {
00338           case LVN_GETDISPINFO: {
00339                 LV_DISPINFO* pDispInfo = (LV_DISPINFO*) pnmh;
00340
00341                 if (pnmh->hwndFrom == _list_ctrl) {
00342                         if (pDispInfo->item.mask & LVIF_IMAGE) {
00343                                 FPDEntry& cache_entry = *(FPDEntry*)pDispInfo->item.lParam;
00344                                 Entry* entry = cache_entry._entry;
00345
00346                                 if (entry->_icon_id == ICID_UNKNOWN)
00347                                         entry->_icon_id = entry->extract_icon(ICF_SYSCACHE);
00348
00349                                 pDispInfo->item.iImage = g_Globals._icon_cache.get_icon(entry->_icon_id).get_sysiml_idx();
00350                                 pDispInfo->item.mask |= LVIF_DI_SETITEM;
00351
00352                                 return 1;
00353                         }
00354                 }}
00355                 break;
00356
00357           case NM_DBLCLK:
00358                 if (pnmh->hwndFrom == _list_ctrl)
00359                         LaunchSelected();
00360                 /*{
00361                         Lock lock(_thread._crit_sect);
00362
00363                         LPNMLISTVIEW pnmv = (LPNMLISTVIEW) pnmh;
00364                         LPARAM lparam = ListView_GetItemData(pnmh->hwndFrom, pnmv->iItem);
00365
00366                         if (lparam) {
00367                                 FPDEntry& cache_entry = *(FPDEntry*)lparam;
00368                                 cache_entry._entry->launch_entry(_hwnd);
00369                         }
00370                 }*/
00371                 break;
00372
00373           case HDN_ITEMCLICK: {
00374                 WaitCursor wait;
00375                 NMHEADER* phdr = (NMHEADER*)pnmh;
00376
00377                 if (GetParent(pnmh->hwndFrom) == _list_ctrl) {
00378                         if (_thread._cache_valid) {     // disable manual sorting while populating the list
00379                                 _sort.toggle_sort(phdr->iItem);
00380                                 _sort.sort();
00381                         }
00382                 }
00383                 break;}
00384         }
00385
00386         return 0;
00387 }

Here is the call graph for this function:

void FindProgramDlg::Refresh ( bool delete_cache = false ) [protected]

Definition at line 146 of file searchprogram.cpp.

References _cache, CollectProgramsThread::_cache_valid, WindowHandle::_hwnd, _list_ctrl, _lwr_filter, _thread, add_entry(), COUNTOF, CollectProgramsThread::free_dirs(), IDC_FILTER, Thread::Start(), and Thread::Stop().

Referenced by Command(), and FindProgramDlg().

00147 {
00148         WaitCursor wait;
00149
00150         _thread.Stop();
00151
00152         TCHAR buffer[1024];
00153         GetWindowText(GetDlgItem(_hwnd, IDC_FILTER), buffer, COUNTOF(buffer));
00154         CharLower(buffer);
00155         _lwr_filter = buffer;
00156
00157         HiddenWindow hide_listctrl(_list_ctrl);
00158
00159         ListView_DeleteAllItems(_list_ctrl);
00160
00161         if (delete_cache || !_thread._cache_valid) {
00162                 _thread.free_dirs();
00163                 _thread.Start();
00164         } else {
00165                 for(FPDCache::const_iterator it=_cache.begin(); it!=_cache.end(); ++it)
00166                         add_entry(*it);
00167         }
00168 }

Here is the call graph for this function:

LRESULT FindProgramDlg::WndProc | ( | UINT | ,
 |  | WPARAM | ,
 |  | LPARAM |
 | ) | [protected, virtual]

Reimplemented from ResizeController< Dialog >.

Definition at line 258 of file searchprogram.cpp.

References _haccel, WindowHandle::_hwnd, _list_ctrl, PM_TRANSLATE_MSG, and ResizeController< Dialog >::WndProc().

00259 {
00260         switch(nmsg) {
00261           case WM_CLOSE:
00262                 (void)ListView_SetImageList(_list_ctrl, 0, LVSIL_SMALL);        // detach system image list
00263                 goto def;
00264
00265           case PM_TRANSLATE_MSG: {
00266                 MSG* pmsg = (MSG*) lparam;
00267
00268                 if (TranslateAccelerator(_hwnd, _haccel, pmsg))
00269                         return TRUE;
00270
00271                 return FALSE;}
00272
00273           default: def:
00274                 return super::WndProc(nmsg, wparam, lparam);
00275         }
00276
00277         return 0;
00278 }

Here is the call graph for this function:

Member Data Documentation

FPDCache FindProgramDlg::_cache [protected]

Definition at line 91 of file searchprogram.h.

Referenced by collect_programs_callback(), and Refresh().

String FindProgramDlg::_common_programs [protected]

Definition at line 93 of file searchprogram.h.

Referenced by collect_programs_callback(), and FindProgramDlg().

HACCEL FindProgramDlg::_haccel [protected]

Definition at line 87 of file searchprogram.h.

Referenced by FindProgramDlg(), and WndProc().

HWND FindProgramDlg::_list_ctrl [protected]

Definition at line 86 of file searchprogram.h.

Referenced by add_entry(), FindProgramDlg(), LaunchSelected(), Notify(), Refresh(), and WndProc().

String FindProgramDlg::_lwr_filter [protected]

Definition at line 88 of file searchprogram.h.

Referenced by add_entry(), and Refresh().

ListSort FindProgramDlg::_sort [protected]

Definition at line 95 of file searchprogram.h.

CollectProgramsThread FindProgramDlg::_thread [protected]

Definition at line 90 of file searchprogram.h.

Referenced by collect_programs_callback(), LaunchSelected(), Refresh(), and ~FindProgramDlg().

String FindProgramDlg::_user_programs [protected]

Definition at line 93 of file searchprogram.h.

Referenced by collect_programs_callback(), and FindProgramDlg().

The documentation for this struct was generated from the following files:
  • searchprogram.h
  • searchprogram.cpp


ROS Explorer: Member List

FindProgramDlg Member List

This is the complete list of members for FindProgramDlg, including all inherited members.

_cache | FindProgramDlg | [protected]
_common_programs | FindProgramDlg | [protected]
_haccel | FindProgramDlg | [protected]
_hwnd | WindowHandle | [protected]
_list_ctrl | FindProgramDlg | [protected]
_lwr_filter | FindProgramDlg | [protected]
_resize_mgr | ResizeController< Dialog > | [protected]
_sort | FindProgramDlg | [protected]
_thread | FindProgramDlg | [protected]
_user_programs | FindProgramDlg | [protected]
add_entry(const FPDEntry &cache_entry) | FindProgramDlg | [protected]
CancelModes() | Window | [static]
CheckEntries() | FindProgramDlg | [protected]
collect_programs_callback(Entry *entry, void *param) | FindProgramDlg | [protected, static]
Command(int id, int code) | FindProgramDlg | [protected, virtual]
CompareFunc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort) | FindProgramDlg | [protected, static]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
Dialog(HWND) | Dialog |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0) | Dialog | [static]
DoModal(UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0) | Dialog | [static]
FindProgramDlg(HWND hwnd) | FindProgramDlg |
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetClientSpace(PRECT prect) | ResizeController< Dialog > | [inline, virtual]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
LaunchSelected() | FindProgramDlg | [protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | FindProgramDlg | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
Refresh(bool delete_cache=false) | FindProgramDlg | [protected]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeController(HWND hwnd) | ResizeController< Dialog > | [inline]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | FindProgramDlg |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT, WPARAM, LPARAM) | FindProgramDlg | [protected, virtual]
~Dialog() | Dialog |
~FindProgramDlg() | FindProgramDlg |
~Window() | Window | [virtual]


ROS Explorer: FixedDWebBrowserEvents2 Class Reference

FixedDWebBrowserEvents2 Class Reference

Inheritance diagram for FixedDWebBrowserEvents2:

[legend]
The documentation for this class was generated from the following file:
  • shellclasses.h


ROS Explorer: FlatButton Struct Reference

FlatButton Struct Reference

Subclass button controls to paint colored text labels. More...

#include <window.h>

Inheritance diagram for FlatButton:

[legend]
Collaboration diagram for FlatButton:

[legend]
List of all members.

Public Types

typedef OwnerdrawnButton | super

Public Member Functions

FlatButton (HWND hwnd)
FlatButton (HWND owner, int id)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual void | DrawItem (LPDRAWITEMSTRUCT dis)

Protected Attributes

COLORREF | _textColor
COLORREF | _activeColor
bool | _active

Detailed Description

Subclass button controls to paint colored text labels.

The owning window should use the OwnerDrawParent template to route owner draw messages to the buttons.

Definition at line 691 of file window.h.

Member Typedef Documentation

typedef OwnerdrawnButton FlatButton::super

Reimplemented from OwnerdrawnButton.

Definition at line 693 of file window.h.

Constructor & Destructor Documentation

FlatButton::FlatButton ( HWND hwnd ) [inline]

Definition at line 695 of file window.h.

00696          : super(hwnd), _active(false) {}

FlatButton::FlatButton | ( | HWND | owner,
 |  | int | id
 | ) | [inline]

Definition at line 698 of file window.h.

00699          : super(GetDlgItem(owner, IDOK)), _active(false) {}

Member Function Documentation

void FlatButton::DrawItem ( LPDRAWITEMSTRUCT dis ) [protected, virtual]

Implements OwnerdrawnButton.

Definition at line 1037 of file window.cpp.

References _active, WindowHandle::_hwnd, _textColor, and BUFFER_LEN.

01038 {
01039         UINT style = DFCS_BUTTONPUSH;
01040
01041         if (dis->itemState & ODS_DISABLED)
01042                 style |= DFCS_INACTIVE;
01043
01044         RECT textRect = {dis->rcItem.left+2, dis->rcItem.top+2, dis->rcItem.right-4, dis->rcItem.bottom-4};
01045
01046         if (dis->itemState & ODS_SELECTED) {
01047                 style |= DFCS_PUSHED;
01048                 ++textRect.left;        ++textRect.top;
01049                 ++textRect.right;       ++textRect.bottom;
01050         }
01051
01052         FillRect(dis->hDC, &dis->rcItem, GetSysColorBrush(COLOR_BTNFACE));
01053
01054          // highlight the button?
01055         if (_active)
01056                 DrawEdge(dis->hDC, &dis->rcItem, EDGE_ETCHED, BF_RECT);
01057         else if (GetWindowStyle(_hwnd) & BS_FLAT)       // Only with BS_FLAT there will be drawn a frame to show highlighting.
01058                 DrawEdge(dis->hDC, &dis->rcItem, EDGE_RAISED, BF_RECT|BF_FLAT);
01059
01060         TCHAR txt[BUFFER_LEN];
01061         int txt_len = GetWindowText(_hwnd, txt, BUFFER_LEN);
01062
01063         if (dis->itemState & (ODS_DISABLED|ODS_GRAYED)) {
01064                 COLORREF gray = GetSysColor(COLOR_GRAYTEXT);
01065
01066                 if (gray) {
01067                         {
01068                         TextColor lcColor(dis->hDC, GetSysColor(COLOR_BTNHIGHLIGHT));
01069                         RECT shadowRect = {textRect.left+1, textRect.top+1, textRect.right+1, textRect.bottom+1};
01070                         DrawText(dis->hDC, txt, txt_len, &shadowRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
01071                         }
01072
01073                         BkMode mode(dis->hDC, TRANSPARENT);
01074                         TextColor lcColor(dis->hDC, gray);
01075                         DrawText(dis->hDC, txt, txt_len, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
01076                 } else {
01077                         int old_r = textRect.right;
01078                         int old_b = textRect.bottom;
01079                         DrawText(dis->hDC, txt, txt_len, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER|DT_CALCRECT);
01080                         int x = textRect.left + (old_r-textRect.right)/2;
01081                         int y = textRect.top + (old_b-textRect.bottom)/2;
01082                         int w = textRect.right-textRect.left;
01083                         int h = textRect.bottom-textRect.top;
01084                         s_MyDrawText_Rect.right = w;
01085                         s_MyDrawText_Rect.bottom = h;
01086                         GrayString(dis->hDC, GetSysColorBrush(COLOR_GRAYTEXT), MyDrawText, (LPARAM)txt, txt_len, x, y, w, h);
01087                 }
01088         } else {
01089                 TextColor lcColor(dis->hDC, _active? _activeColor: _textColor);
01090                 DrawText(dis->hDC, txt, txt_len, &textRect, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
01091         }
01092
01093         if (dis->itemState & ODS_FOCUS) {
01094                 RECT rect = {
01095                         dis->rcItem.left+3, dis->rcItem.top+3,
01096                         dis->rcItem.right-dis->rcItem.left-4, dis->rcItem.bottom-dis->rcItem.top-4
01097                 };
01098                 if (dis->itemState & ODS_SELECTED) {
01099                         ++rect.left;    ++rect.top;
01100                         ++rect.right;   ++rect.bottom;
01101                 }
01102                 DrawFocusRect(dis->hDC, &rect);
01103         }
01104 }

LRESULT FlatButton::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from OwnerdrawnButton.

Definition at line 1106 of file window.cpp.

References _active, WindowHandle::_hwnd, HWND, and OwnerdrawnButton::WndProc().

01107 {
01108         switch(nmsg) {
01109           case WM_MOUSEMOVE: {
01110                 bool active = false;
01111
01112                 if (IsWindowEnabled(_hwnd)) {
01113                         DWORD pid_foreground;
01114                         HWND hwnd_foreground = GetForegroundWindow();   //@@ may be better look for WM_ACTIVATEAPP ?
01115                         GetWindowThreadProcessId(hwnd_foreground, &pid_foreground);
01116
01117                         if (GetCurrentProcessId() == pid_foreground) {
01118                                 POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)};
01119                                 ClientRect clntRect(_hwnd);
01120
01121                                  // highlight the button?
01122                                 if (pt.x>=clntRect.left && pt.x<clntRect.right && pt.y>=clntRect.top && pt.y<clntRect.bottom)
01123                                         active = true;
01124                         }
01125                 }
01126
01127                 if (active != _active) {
01128                         _active = active;
01129
01130                         if (active) {
01131                                 TRACKMOUSEEVENT tme = {sizeof(tme), /*TME_HOVER|*/TME_LEAVE, _hwnd/*, HOVER_DEFAULT*/};
01132                                 _TrackMouseEvent(&tme);
01133                         }
01134
01135                         InvalidateRect(_hwnd, NULL, TRUE);
01136                 }
01137
01138                 return 0;}
01139
01140           case WM_LBUTTONUP: {
01141                 POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)};
01142                 ClientRect clntRect(_hwnd);
01143
01144                  // no more in the active rectangle?
01145                 if (pt.x<clntRect.left || pt.x>=clntRect.right || pt.y<clntRect.top || pt.y>=clntRect.bottom)
01146                         goto cancel_press;
01147
01148                 goto def;}
01149
01150           case WM_CANCELMODE:
01151           cancel_press: {
01152                 TRACKMOUSEEVENT tme = {sizeof(tme), /*TME_HOVER|*/TME_LEAVE|TME_CANCEL, _hwnd/*, HOVER_DEFAULT*/};
01153                 _TrackMouseEvent(&tme);
01154                 _active = false;
01155                 ReleaseCapture();}
01156                 // fall through
01157
01158           case WM_MOUSELEAVE:
01159                 if (_active) {
01160                         _active = false;
01161
01162                         InvalidateRect(_hwnd, NULL, TRUE);
01163                 }
01164
01165                 return 0;
01166
01167           default: def:
01168                 return super::WndProc(nmsg, wparam, lparam);
01169         }
01170 }

Here is the call graph for this function:

Member Data Documentation

bool FlatButton::_active [protected]

Definition at line 707 of file window.h.

Referenced by DrawItem(), and WndProc().

COLORREF FlatButton::_activeColor [protected]

Definition at line 706 of file window.h.

COLORREF FlatButton::_textColor [protected]

Definition at line 705 of file window.h.

Referenced by DrawItem().

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

FlatButton Member List

This is the complete list of members for FlatButton, including all inherited members.

_active | FlatButton | [protected]
_activeColor | FlatButton | [protected]
_hwnd | WindowHandle | [protected]
_orgWndProc | SubclassedWindow | [protected]
_textColor | FlatButton | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | SubclassedWindow | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawItem(LPDRAWITEMSTRUCT dis) | FlatButton | [protected, virtual]
FlatButton(HWND hwnd) | FlatButton | [inline]
FlatButton(HWND owner, int id) | FlatButton | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | SubclassedWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerdrawnButton(HWND hwnd) | OwnerdrawnButton | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | FlatButton |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | FlatButton | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: FmtString Struct Reference

FmtString Struct Reference

#include <utility.h>

Inheritance diagram for FmtString:

[legend]
Collaboration diagram for FmtString:

[legend]
List of all members.

Public Member Functions

FmtString (LPCTSTR fmt,...)

Detailed Description

Definition at line 879 of file utility.h.

Constructor & Destructor Documentation

FmtString::FmtString | ( | LPCTSTR | fmt,
 |  |  | ...
 | ) | [inline]

Definition at line 881 of file utility.h.

00882         {
00883                 va_list l;
00884
00885                 va_start(l, fmt);
00886                 vprintf(fmt, l);
00887                 va_end(l);
00888         }

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

FmtString Member List

This is the complete list of members for FmtString, including all inherited members.

appendf(LPCTSTR fmt,...) | String | [inline]
assign(LPCWSTR s) | String | [inline]
assign(LPCWSTR s, int l) | String | [inline]
assign(const BStr &s) | String | [inline]
assign(LPCTSTR s) | String | [inline]
assign(LPCTSTR s, int l) | String | [inline]
FmtString(LPCTSTR fmt,...) | FmtString | [inline]
operator LPCTSTR() const | String | [inline]
operator wstring() const | String | [inline]
operator=(LPCWSTR s) | String | [inline]
operator=(const BStr &s) | String | [inline]
operator=(LPCTSTR s) | String | [inline]
operator=(const super &s) | String | [inline]
printf(LPCTSTR fmt,...) | String | [inline]
str() | String | [inline]
String() | String | [inline]
String(LPCTSTR s) | String | [inline]
String(LPCTSTR s, int l) | String | [inline]
String(const super &other) | String | [inline]
String(const String &other) | String | [inline]
String(LPCWSTR s) | String | [inline]
String(LPCWSTR s, int l) | String | [inline]
String(const wstring &other) | String | [inline]
String(const BStr &s) | String | [inline]
super typedef | String |
toLower() | String | [inline]
vappendf(LPCTSTR fmt, va_list l) | String | [inline]
vprintf(LPCTSTR fmt, va_list l) | String | [inline]


ROS Explorer: FolderBrowser Struct Reference

FolderBrowser Struct Reference

Browse dialog operating on shell namespace. More...

#include <shellclasses.h>

Inheritance diagram for FolderBrowser:

[legend]
Collaboration diagram for FolderBrowser:

[legend]
List of all members.

Public Member Functions

FolderBrowser (HWND owner, UINT flags, LPCTSTR title, LPCITEMIDLIST root=0)
LPCTSTR | GetDisplayName ()
bool | IsOK ()

Detailed Description

Browse dialog operating on shell namespace.

Definition at line 935 of file shellclasses.h.

Constructor & Destructor Documentation

FolderBrowser::FolderBrowser | ( | HWND | owner,
 |  | UINT | flags,
 |  | LPCTSTR | title,
 |  | LPCITEMIDLIST | root = 0
 | ) | [inline]

Definition at line 937 of file shellclasses.h.

00938         {
00939                 _displayname[0] = '\0';
00940                 _browseinfo.hwndOwner = owner;
00941                 _browseinfo.pidlRoot = root;
00942                 _browseinfo.pszDisplayName = _displayname;
00943                 _browseinfo.lpszTitle = title;
00944                 _browseinfo.ulFlags = flags;
00945                 _browseinfo.lpfn = 0;
00946                 _browseinfo.lParam = 0;
00947                 _browseinfo.iImage = 0;
00948
00949                 _p = SHBrowseForFolder(&_browseinfo);
00950         }

Member Function Documentation

LPCTSTR FolderBrowser::GetDisplayName ( ) [inline]

Definition at line 952 of file shellclasses.h.

00953         {
00954                 return _displayname;
00955         }

bool FolderBrowser::IsOK ( ) [inline]

Definition at line 957 of file shellclasses.h.

Referenced by main().

00958         {
00959                 return _p != 0;
00960         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

FolderBrowser Member List

This is the complete list of members for FolderBrowser, including all inherited members.

_malloc | SShellPtr< ITEMIDLIST > | [mutable, protected]
_p | SShellPtr< ITEMIDLIST > | [protected]
assign(LPCITEMIDLIST pidl, size_t size) | ShellPath | [inline]
assign(LPCITEMIDLIST pidl) | ShellPath | [inline]
create_absolute_pidl(LPCITEMIDLIST parent_pidl) const | ShellPath |
FileSysShellPath() | FileSysShellPath | [inline, protected]
FileSysShellPath(const ShellPath &o) | FileSysShellPath | [inline]
FolderBrowser(HWND owner, UINT flags, LPCTSTR title, LPCITEMIDLIST root=0) | FolderBrowser | [inline]
Free() | SShellPtr< ITEMIDLIST > | [inline, protected]
get_folder() | ShellPath | [inline]
get_folder(IShellFolder *parent) | ShellPath | [inline]
GetDisplayName() | FolderBrowser | [inline]
GetUIObjectOf(REFIID riid, LPVOID *ppvOut, HWND hWnd=0, ShellFolder &sf=GetDesktopFolder()) | ShellPath |
IsOK() | FolderBrowser | [inline]
operator *() const | SShellPtr< ITEMIDLIST > | [inline]
operator *() | SShellPtr< ITEMIDLIST > | [inline]
operator ITEMIDLIST const *() const | SShellPtr< ITEMIDLIST > | [inline]
operator LPCTSTR() | FileSysShellPath | [inline]
operator+=(const SHITEMID &o) | ShellPath | [inline]
operator->() | SShellPtr< ITEMIDLIST > | [inline]
operator->() const | SShellPtr< ITEMIDLIST > | [inline]
operator=(const ShellPath &o) | ShellPath | [inline]
operator=(ITEMIDLIST *p) | ShellPath | [inline]
operator=(const SHITEMID &o) | ShellPath | [inline]
ShellPath() | ShellPath | [inline]
ShellPath(IShellFolder *folder, LPCWSTR path) | ShellPath | [inline]
ShellPath(LPCWSTR path) | ShellPath | [inline]
ShellPath(IShellFolder *folder, LPCSTR path) | ShellPath | [inline]
ShellPath(LPCSTR path) | ShellPath | [inline]
ShellPath(const ShellPath &o) | ShellPath | [inline]
ShellPath(LPITEMIDLIST p) | ShellPath | [inline, explicit]
ShellPath(LPCITEMIDLIST p) | ShellPath | [inline]
split(ShellPath &parent, ShellPath &obj) const | ShellPath |
SShellPtr() | SShellPtr< ITEMIDLIST > | [inline, protected]
SShellPtr(ITEMIDLIST *p) | SShellPtr< ITEMIDLIST > | [inline, protected]
super typedef | ShellPath |
~SShellPtr() | SShellPtr< ITEMIDLIST > | [inline]


ROS Explorer: FontSelection Struct Reference

FontSelection Struct Reference

FontSelection locally selects a font for drawing. More...

#include <utility.h>

Collaboration diagram for FontSelection:

[legend]
List of all members.

Public Member Functions

FontSelection (HDC hdc, HFONT hFont)
~FontSelection ()

Protected Attributes

HDC | _hdc
HFONT | _old_hFont

Detailed Description

FontSelection locally selects a font for drawing.

Definition at line 615 of file utility.h.

Constructor & Destructor Documentation

FontSelection::FontSelection | ( | HDC | hdc,
 |  | HFONT | hFont
 | ) | [inline]

Definition at line 617 of file utility.h.

00618          : _hdc(hdc), _old_hFont(SelectFont(hdc, hFont)) {}

FontSelection::~FontSelection ( ) [inline]

Definition at line 620 of file utility.h.

00620 {SelectFont(_hdc, _old_hFont);}

Member Data Documentation

HDC FontSelection::_hdc [protected]

Definition at line 623 of file utility.h.

HFONT FontSelection::_old_hFont [protected]

Definition at line 624 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

FontSelection Member List

This is the complete list of members for FontSelection, including all inherited members.

_hdc | FontSelection | [protected]
_old_hFont | FontSelection | [protected]
FontSelection(HDC hdc, HFONT hFont) | FontSelection | [inline]
~FontSelection() | FontSelection | [inline]


ROS Explorer: FPDEntry Struct Reference

FPDEntry Struct Reference

entry for the list in "find program" dialogs More...

#include <searchprogram.h>

Collaboration diagram for FPDEntry:

[legend]
List of all members.

Public Attributes

Entry * _entry
int _idxIcon
String _menu_path
String _path

Detailed Description

entry for the list in "find program" dialogs

Definition at line 66 of file searchprogram.h.

Member Data Documentation

Entry* FPDEntry::_entry

Definition at line 68 of file searchprogram.h.

Referenced by FindProgramDlg::add_entry(), FindProgramDlg::collect_programs_callback(), FindProgramDlg::CompareFunc(), FindProgramDlg::LaunchSelected(), and FindProgramDlg::Notify().

int FPDEntry::_idxIcon

Definition at line 69 of file searchprogram.h.

Referenced by FindProgramDlg::add_entry(), and FindProgramDlg::collect_programs_callback().

String FPDEntry::_menu_path

Definition at line 70 of file searchprogram.h.

Referenced by FindProgramDlg::add_entry(), FindProgramDlg::collect_programs_callback(), and FindProgramDlg::CompareFunc().

String FPDEntry::_path

Definition at line 71 of file searchprogram.h.

Referenced by FindProgramDlg::add_entry(), FindProgramDlg::collect_programs_callback(), and FindProgramDlg::CompareFunc().

The documentation for this struct was generated from the following file:
  • searchprogram.h


ROS Explorer: Member List

FPDEntry Member List

This is the complete list of members for FPDEntry, including all inherited members.

_entry | FPDEntry
_idxIcon | FPDEntry
_menu_path | FPDEntry
_path | FPDEntry


ROS Explorer: ftime Struct Reference

ftime Struct Reference

#include <fatfs.h>

Collaboration diagram for ftime:

[legend]
List of all members.

Public Attributes

WORD | sec2: 5
WORD | min: 6
WORD | hour: 5

Detailed Description

Definition at line 121 of file fatfs.h.

Member Data Documentation

WORD ftime::hour

Definition at line 124 of file fatfs.h.

WORD ftime::min

Definition at line 123 of file fatfs.h.

WORD ftime::sec2

Definition at line 122 of file fatfs.h.

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

ftime Member List

This is the complete list of members for ftime, including all inherited members.

hour | ftime
min | ftime
sec2 | ftime


ROS Explorer: FullScreenParameters Struct Reference

FullScreenParameters Struct Reference

structure containing information about full screen display of the frame window More...

#include <utility.h>

Collaboration diagram for FullScreenParameters:

[legend]
List of all members.

Public Member Functions

FullScreenParameters ()

Public Attributes

BOOL | _mode
RECT | _orgPos
BOOL | _wasZoomed

Detailed Description

structure containing information about full screen display of the frame window

Definition at line 459 of file utility.h.

Constructor & Destructor Documentation

FullScreenParameters::FullScreenParameters ( ) [inline]

Definition at line 461 of file utility.h.

00462          :      _mode(FALSE)
00463         {
00464         }

Member Data Documentation

BOOL FullScreenParameters::_mode

Definition at line 466 of file utility.h.

Referenced by MainFrameBase::toggle_child(), and MainFrameBase::toggle_fullscreen().

RECT FullScreenParameters::_orgPos

Definition at line 467 of file utility.h.

Referenced by MainFrameBase::toggle_fullscreen().

BOOL FullScreenParameters::_wasZoomed

Definition at line 468 of file utility.h.

Referenced by MainFrameBase::toggle_fullscreen().

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

FullScreenParameters Member List

This is the complete list of members for FullScreenParameters, including all inherited members.

_mode | FullScreenParameters |
_orgPos | FullScreenParameters |
_wasZoomed | FullScreenParameters |
FullScreenParameters() | FullScreenParameters | [inline]


ROS Explorer: HiddenWindow Struct Reference

HiddenWindow Struct Reference

locally hide a window More...

#include <utility.h>

Inheritance diagram for HiddenWindow:

[legend]
Collaboration diagram for HiddenWindow:

[legend]
List of all members.

Public Member Functions

HiddenWindow (HWND hwnd)
~HiddenWindow ()

Detailed Description

locally hide a window

Definition at line 286 of file utility.h.

Constructor & Destructor Documentation

HiddenWindow::HiddenWindow ( HWND hwnd ) [inline]

Definition at line 288 of file utility.h.

00289          :      WindowHandle(IsWindowVisible(hwnd)? hwnd: 0)
00290         {
00291                 if (_hwnd)
00292                         SetWindowPos(_hwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW|SWP_NOREDRAW|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER);
00293         }

HiddenWindow::~HiddenWindow ( ) [inline]

Definition at line 295 of file utility.h.

00296         {
00297                 if (_hwnd)
00298                         SetWindowPos(_hwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER);
00299         }

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

HiddenWindow Member List

This is the complete list of members for HiddenWindow, including all inherited members.

_hwnd | WindowHandle | [protected]
HiddenWindow(HWND hwnd) | HiddenWindow | [inline]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
~HiddenWindow() | HiddenWindow | [inline]


ROS Explorer: HyperlinkCtrl Struct Reference

HyperlinkCtrl Struct Reference

Hyperlink Controls. More...

#include <window.h>

Inheritance diagram for HyperlinkCtrl:

[legend]
Collaboration diagram for HyperlinkCtrl:

[legend]
List of all members.

Public Types

typedef SubclassedWindow | super

Public Member Functions

HyperlinkCtrl (HWND hwnd, COLORREF colorLink=RGB(0, 0, 255), COLORREF colorVisited=RGB(128, 0, 128))
HyperlinkCtrl (HWND owner, int id, COLORREF colorLink=RGB(0, 0, 255), COLORREF colorVisited=RGB(128, 0, 128))
~HyperlinkCtrl ()

Public Attributes

String _cmd

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
void | init ()
bool | LaunchLink ()

Protected Attributes

COLORREF | _textColor
COLORREF | _colorVisited
HFONT | _hfont
HCURSOR | _crsr_link

Detailed Description

Hyperlink Controls.

Definition at line 815 of file window.h.

Member Typedef Documentation

typedef SubclassedWindow HyperlinkCtrl::super

Reimplemented from SubclassedWindow.

Definition at line 817 of file window.h.

Constructor & Destructor Documentation

HyperlinkCtrl::HyperlinkCtrl | ( | HWND | hwnd,
 |  | COLORREF | colorLink = RGB(0, 0, 255),
 |  | COLORREF | colorVisited = RGB(128, 0, 128)
 | ) |

Definition at line 1173 of file window.cpp.

References init().

01174  :      super(hwnd),
01175         _cmd(ResString(GetDlgCtrlID(hwnd))),
01176         _textColor(colorLink),
01177         _colorVisited(colorVisited),
01178         _hfont(0),
01179         _crsr_link(0)
01180 {
01181         init();
01182 }

Here is the call graph for this function:

HyperlinkCtrl::HyperlinkCtrl | ( | HWND | owner,
 |  | int | id,
 |  | COLORREF | colorLink = RGB(0, 0, 255),
 |  | COLORREF | colorVisited = RGB(128, 0, 128)
 | ) |

Definition at line 1184 of file window.cpp.

References init().

01185  :      super(GetDlgItem(owner, id)),
01186         _cmd(ResString(id)),
01187         _textColor(colorLink),
01188         _colorVisited(colorVisited),
01189         _hfont(0),
01190         _crsr_link(0)
01191 {
01192         init();
01193 }

Here is the call graph for this function:

HyperlinkCtrl::~HyperlinkCtrl ( )

Definition at line 1203 of file window.cpp.

References _hfont.

01204 {
01205         if (_hfont)
01206                 DeleteObject(_hfont);
01207 }

Member Function Documentation

void HyperlinkCtrl::init ( ) [protected]

Definition at line 1195 of file window.cpp.

References _cmd, WindowHandle::_hwnd, String::assign(), and BUFFER_LEN.

Referenced by HyperlinkCtrl().

01196 {
01197         if (_cmd.empty()) {
01198                 TCHAR txt[BUFFER_LEN];
01199                 _cmd.assign(txt, GetWindowText(_hwnd, txt, BUFFER_LEN));
01200         }
01201 }

Here is the call graph for this function:

bool HyperlinkCtrl::LaunchLink ( ) [inline, protected]

Definition at line 836 of file window.h.

References WindowHandle::_hwnd.

00837         {
00838                 if (!_cmd.empty()) {
00839                         HINSTANCE hinst = ShellExecute(GetParent(_hwnd), _T("open"), _cmd, 0, 0, SW_SHOWNORMAL);
00840                         return (int)hinst > HINSTANCE_ERROR;
00841                 }
00842
00843                 return true;
00844         }

LRESULT HyperlinkCtrl::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from SubclassedWindow.

Definition at line 1209 of file window.cpp.

References _hfont, WindowHandle::_hwnd, and _textColor.

01210 {
01211         switch(nmsg) {
01212           case PM_DISPATCH_CTLCOLOR: {
01213                 if (!_hfont) {
01214                         HFONT hfont = (HFONT) SendMessage(_hwnd, WM_GETFONT, 0, 0);
01215                         LOGFONT lf; GetObject(hfont, sizeof(lf), &lf);
01216                         lf.lfUnderline = TRUE;
01217                         _hfont = CreateFontIndirect(&lf);
01218                 }
01219
01220                 HDC hdc = (HDC) wparam;
01221                 SetTextColor(hdc, _textColor);  //@@
01222                 SelectFont(hdc, _hfont);
01223                 SetBkMode(hdc, TRANSPARENT);
01224                 return (LRESULT)GetStockObject(HOLLOW_BRUSH);
01225           }
01226
01227           case WM_SETCURSOR:
01228                 if (!_crsr_link)
01229                         _crsr_link = LoadCursor(0, IDC_HAND);
01230
01231                 if (_crsr_link)
01232                         SetCursor(_crsr_link);
01233                 return 0;
01234
01235           case WM_NCHITTEST:
01236                 return HTCLIENT;        // Aktivierung von Maus-Botschaften
01237
01238           case WM_LBUTTONDOWN:
01239                 if (LaunchLink()) {
01240                         _textColor = _colorVisited;
01241                         InvalidateRect(_hwnd, NULL, FALSE);
01242                 } else
01243                         MessageBeep(0);
01244                 return 0;
01245
01246           default:
01247                 return super::WndProc(nmsg, wparam, lparam);
01248         }
01249 }

Member Data Documentation

String HyperlinkCtrl::_cmd

Definition at line 824 of file window.h.

Referenced by init().

COLORREF HyperlinkCtrl::_colorVisited [protected]

Definition at line 828 of file window.h.

HCURSOR HyperlinkCtrl::_crsr_link [protected]

Definition at line 830 of file window.h.

HFONT HyperlinkCtrl::_hfont [protected]

Definition at line 829 of file window.h.

Referenced by WndProc(), and ~HyperlinkCtrl().

COLORREF HyperlinkCtrl::_textColor [protected]

Definition at line 827 of file window.h.

Referenced by WndProc().

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

HyperlinkCtrl Member List

This is the complete list of members for HyperlinkCtrl, including all inherited members.

_cmd | HyperlinkCtrl |
_colorVisited | HyperlinkCtrl | [protected]
_crsr_link | HyperlinkCtrl | [protected]
_hfont | HyperlinkCtrl | [protected]
_hwnd | WindowHandle | [protected]
_orgWndProc | SubclassedWindow | [protected]
_textColor | HyperlinkCtrl | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | SubclassedWindow | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
HyperlinkCtrl(HWND hwnd, COLORREF colorLink=RGB(0, 0, 255), COLORREF colorVisited=RGB(128, 0, 128)) | HyperlinkCtrl |
HyperlinkCtrl(HWND owner, int id, COLORREF colorLink=RGB(0, 0, 255), COLORREF colorVisited=RGB(128, 0, 128)) | HyperlinkCtrl |
init() | HyperlinkCtrl | [protected]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
LaunchLink() | HyperlinkCtrl | [inline, protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | SubclassedWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | HyperlinkCtrl |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | HyperlinkCtrl | [protected, virtual]
~HyperlinkCtrl() | HyperlinkCtrl |
~Window() | Window | [virtual]


ROS Explorer: ICommDlgBrowser Class Reference

ICommDlgBrowser Class Reference

Inheritance diagram for ICommDlgBrowser:

[legend]
The documentation for this class was generated from the following file:
  • shellbrowserimpl.h


ROS Explorer: IComSrvBase< BASE, OBJ > Class Template Reference

IComSrvBase< BASE, OBJ > Class Template Reference

#include <shellclasses.h>

Inheritance diagram for IComSrvBase< BASE, OBJ >:

[legend]
Collaboration diagram for IComSrvBase< BASE, OBJ >:

[legend]
List of all members.

Public Member Functions

STDMETHODIMP_ (ULONG) AddRef()
STDMETHODIMP_ (ULONG) Release()

Protected Member Functions

IComSrvBase (REFIID uuid_base)

Detailed Description

template<typename BASE, typename OBJ>
class IComSrvBase< BASE, OBJ >

Definition at line 509 of file shellclasses.h.

Constructor & Destructor Documentation

template<typename BASE, typename OBJ>
IComSrvBase< BASE, OBJ >::IComSrvBase ( REFIID uuid_base ) [inline, protected]

Definition at line 514 of file shellclasses.h.

00515          :      super(uuid_base)
00516         {
00517         }

Member Function Documentation

template<typename BASE, typename OBJ>
IComSrvBase< BASE, OBJ >::STDMETHODIMP_ ( ULONG ) [inline]

Definition at line 521 of file shellclasses.h.

00521 {return static_cast<OBJ*>(this)->DecRef();}

template<typename BASE, typename OBJ>
IComSrvBase< BASE, OBJ >::STDMETHODIMP_ ( ULONG ) [inline]

Definition at line 520 of file shellclasses.h.

00520 {return static_cast<OBJ*>(this)->IncRef();}

The documentation for this class was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

IComSrvBase< BASE, OBJ > Member List

This is the complete list of members for IComSrvBase< BASE, OBJ >, including all inherited members.

_uuid_base | IComSrvQI< BASE > | [protected]
IComSrvBase(REFIID uuid_base) | IComSrvBase< BASE, OBJ > | [inline, protected]
IComSrvQI(REFIID uuid_base) | IComSrvQI< BASE > | [inline]
IComSrvQI() | IComSrvQI< BASE > | [inline, protected]
QueryInterface(REFIID riid, LPVOID *ppv) | IComSrvQI< BASE > | [inline]
STDMETHODIMP_(ULONG) AddRef() | IComSrvBase< BASE, OBJ > | [inline]
STDMETHODIMP_(ULONG) Release() | IComSrvBase< BASE, OBJ > | [inline]
~IComSrvQI() | IComSrvQI< BASE > | [inline, protected, virtual]


ROS Explorer: IComSrvQI< BASE > Struct Template Reference

IComSrvQI< BASE > Struct Template Reference

#include <shellclasses.h>

Inheritance diagram for IComSrvQI< BASE >:

[legend]
Collaboration diagram for IComSrvQI< BASE >:

[legend]
List of all members.

Public Member Functions

IComSrvQI (REFIID uuid_base)
STDMETHODIMP | QueryInterface (REFIID riid, LPVOID *ppv)

Protected Member Functions

IComSrvQI ()
virtual | ~IComSrvQI ()

Protected Attributes

REFIID _uuid_base

Detailed Description

template<typename BASE>
struct IComSrvQI< BASE >

Definition at line 466 of file shellclasses.h.

Constructor & Destructor Documentation

template<typename BASE>
IComSrvQI< BASE >::IComSrvQI ( REFIID uuid_base ) [inline]

Definition at line 468 of file shellclasses.h.

00469          :      _uuid_base(uuid_base)
00470         {
00471         }

template<typename BASE>
IComSrvQI< BASE >::IComSrvQI ( ) [inline, protected]

Definition at line 484 of file shellclasses.h.

00484 {}

template<typename BASE>
virtual IComSrvQI< BASE >::~IComSrvQI ( ) [inline, protected, virtual]

Definition at line 485 of file shellclasses.h.

00485 {}

Member Function Documentation

template<typename BASE>
STDMETHODIMP IComSrvQI< BASE >::QueryInterface | ( | REFIID | riid,
 |  | LPVOID * | ppv
 | ) | [inline]

Definition at line 473 of file shellclasses.h.

00474         {
00475                 *ppv = NULL;
00476
00477                 if (IsEqualIID(riid, _uuid_base) || IsEqualIID(riid, IID_IUnknown))
00478                         {*ppv=static_cast<BASE*>(this); this->AddRef(); return S_OK;}
00479
00480                 return E_NOINTERFACE;
00481         }

Member Data Documentation

template<typename BASE>
REFIID IComSrvQI< BASE >::_uuid_base [protected]

Definition at line 487 of file shellclasses.h.

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

IComSrvQI< BASE > Member List

This is the complete list of members for IComSrvQI< BASE >, including all inherited members.

_uuid_base | IComSrvQI< BASE > | [protected]
IComSrvQI(REFIID uuid_base) | IComSrvQI< BASE > | [inline]
IComSrvQI() | IComSrvQI< BASE > | [inline, protected]
QueryInterface(REFIID riid, LPVOID *ppv) | IComSrvQI< BASE > | [inline]
~IComSrvQI() | IComSrvQI< BASE > | [inline, protected, virtual]


ROS Explorer: IComSrvQI< IUnknown > Struct Template Reference

IComSrvQI< IUnknown > Struct Template Reference

#include <shellclasses.h>

Inheritance diagram for IComSrvQI< IUnknown >:

[legend]
Collaboration diagram for IComSrvQI< IUnknown >:

[legend]
List of all members.

Public Member Functions

STDMETHODIMP | QueryInterface (REFIID riid, LPVOID *ppv)

Protected Member Functions

IComSrvQI ()
virtual | ~IComSrvQI ()

Detailed Description

template<>
struct IComSrvQI< IUnknown >

Definition at line 490 of file shellclasses.h.

Constructor & Destructor Documentation

virtual IComSrvQI< IUnknown >::~IComSrvQI ( ) [inline, protected, virtual]

Member Function Documentation

IComSrvQI< IUnknown >::IComSrvQI ( ) [inline, protected]

STDMETHODIMP IComSrvQI< IUnknown >::QueryInterface | ( | REFIID | riid,
 |  | LPVOID * | ppv
 | ) | [inline]

Definition at line 492 of file shellclasses.h.

00493         {
00494                 *ppv = NULL;
00495
00496                 if (IsEqualIID(riid, IID_IUnknown))
00497                         {*ppv=this; AddRef(); return S_OK;}
00498
00499                 return E_NOINTERFACE;
00500         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

IComSrvQI< IUnknown > Member List

This is the complete list of members for IComSrvQI< IUnknown >, including all inherited members.

IComSrvQI() | IComSrvQI< IUnknown > | [inline, protected]
QueryInterface(REFIID riid, LPVOID *ppv) | IComSrvQI< IUnknown > | [inline]
~IComSrvQI() | IComSrvQI< IUnknown > | [inline, protected, virtual]


ROS Explorer: Icon Struct Reference

Icon Struct Reference

#include <globals.h>

Inheritance diagram for Icon:

[legend]
Collaboration diagram for Icon:

[legend]
List of all members.

Public Member Functions

Icon ()
Icon (ICON_ID id, UINT nid)
Icon (ICON_TYPE itype, int id, HICON hIcon)
Icon (ICON_TYPE itype, int id, int sys_idx)
operator ICON_ID () const
void | draw (HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const
HBITMAP | create_bitmap (COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const
int | add_to_imagelist (HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const
int | get_sysiml_idx () const
HICON | get_hicon () const
bool | destroy ()

Protected Attributes

ICON_ID _id
ICON_TYPE _itype
HICON | _hicon
int | _sys_idx

Detailed Description

Definition at line 88 of file globals.h.

Constructor & Destructor Documentation

Icon::Icon ( )

Definition at line 242 of file explorer.cpp.

00243  :      _id(ICID_UNKNOWN),
00244         _itype(IT_STATIC),
00245         _hicon(0)
00246 {
00247 }

Icon::Icon | ( | ICON_ID | id,
 |  | UINT | nid
 | ) |

Definition at line 249 of file explorer.cpp.

00250  :      _id(id),
00251         _itype(IT_STATIC),
00252         _hicon(ResIcon(nid))    // ResIconEx(nid, cx, cy)
00253 {
00254 }

Icon::Icon | ( | ICON_TYPE | itype,
 |  | int | id,
 |  | HICON | hIcon
 | ) |

Definition at line 256 of file explorer.cpp.

00257  :      _id((ICON_ID)id),
00258         _itype(itype),
00259         _hicon(hIcon)
00260 {
00261 }

Icon::Icon | ( | ICON_TYPE | itype,
 |  | int | id,
 |  | int | sys_idx
 | ) |

Definition at line 263 of file explorer.cpp.

00264  :      _id((ICON_ID)id),
00265         _itype(itype),
00266         _sys_idx(sys_idx)
00267 {
00268 }

Member Function Documentation

int Icon::add_to_imagelist | ( | HIMAGELIST | himl,
 |  | HDC | hdc_wnd,
 |  | COLORREF | bk_color = GetSysColor(COLOR_WINDOW),
 |  | HBRUSH | bk_brush = GetSysColorBrush(COLOR_WINDOW)
 | ) | const

Definition at line 299 of file explorer.cpp.

References _hicon, ExplorerGlobals::_icon_cache, _itype, _sys_idx, IconCache::get_sys_imagelist(), ImageList_AddAlphaIcon(), and IT_SYSCACHE.

Referenced by BookmarkList::fill_tree(), and MainFrameBase::FillBookmarks().

00300 {
00301         int ret;
00302
00303         if (_itype == IT_SYSCACHE) {
00304                 HIMAGELIST himl = g_Globals._icon_cache.get_sys_imagelist();
00305
00306                 int cx, cy;
00307                 ImageList_GetIconSize(himl, &cx, &cy);
00308
00309                 HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
00310                 HDC hdc = CreateCompatibleDC(hdc_wnd);
00311                 HBITMAP hbmp_old = SelectBitmap(hdc, hbmp);
00312                 ImageList_DrawEx(himl, _sys_idx, hdc, 0, 0, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL);
00313                 SelectBitmap(hdc, hbmp_old);
00314                 DeleteDC(hdc);
00315
00316                 ret = ImageList_Add(himl, hbmp, 0);
00317
00318                 DeleteObject(hbmp);
00319         } else
00320                 ret = ImageList_AddAlphaIcon(himl, _hicon, bk_brush, hdc_wnd);
00321
00322         return ret;
00323 }

Here is the call graph for this function:

HBITMAP Icon::create_bitmap | ( | COLORREF | bk_color,
 |  | HBRUSH | hbrBkgnd,
 |  | HDC | hdc_wnd
 | ) | const

Definition at line 278 of file explorer.cpp.

References _hicon, ExplorerGlobals::_icon_cache, _itype, _sys_idx, create_bitmap_from_icon(), IconCache::get_sys_imagelist(), and IT_SYSCACHE.

Referenced by QuickLaunchBar::AddShortcuts().

00279 {
00280         if (_itype == IT_SYSCACHE) {
00281                 HIMAGELIST himl = g_Globals._icon_cache.get_sys_imagelist();
00282
00283                 int cx, cy;
00284                 ImageList_GetIconSize(himl, &cx, &cy);
00285
00286                 HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
00287                 HDC hdc = CreateCompatibleDC(hdc_wnd);
00288                 HBITMAP hbmp_old = SelectBitmap(hdc, hbmp);
00289                 ImageList_DrawEx(himl, _sys_idx, hdc, 0, 0, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL);
00290                 SelectBitmap(hdc, hbmp_old);
00291                 DeleteDC(hdc);
00292
00293                 return hbmp;
00294         } else
00295                 return create_bitmap_from_icon(_hicon, hbrBkgnd, hdc_wnd);
00296 }

Here is the call graph for this function:

bool Icon::destroy ( ) [inline]

Definition at line 103 of file globals.h.

References _hicon, _itype, and IT_DYNAMIC.

00103 {if (_itype == IT_DYNAMIC) {DestroyIcon(_hicon); return true;} else return false;}

void Icon::draw | ( | HDC | hdc,
 |  | int | x,
 |  | int | y,
 |  | int | cx,
 |  | int | cy,
 |  | COLORREF | bk_color,
 |  | HBRUSH | bk_brush
 | ) | const

Definition at line 270 of file explorer.cpp.

References _hicon, ExplorerGlobals::_icon_cache, _itype, _sys_idx, IconCache::get_sys_imagelist(), and IT_SYSCACHE.

Referenced by Pane::draw_item().

00271 {
00272         if (_itype == IT_SYSCACHE)
00273                 ImageList_DrawEx(g_Globals._icon_cache.get_sys_imagelist(), _sys_idx, hdc, x, y, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL);
00274         else
00275                 DrawIconEx(hdc, x, y, _hicon, cx, cy, 0, bk_brush, DI_NORMAL);
00276 }

Here is the call graph for this function:

HICON Icon::get_hicon ( ) const [inline]

Definition at line 101 of file globals.h.

References _hicon, _itype, and IT_SYSCACHE.

Referenced by ShellBrowser::get_image_idx().

00101 {return _itype!=IT_SYSCACHE? _hicon: 0;}

int Icon::get_sysiml_idx ( ) const [inline]

Definition at line 100 of file globals.h.

References _itype, _sys_idx, and IT_SYSCACHE.

Referenced by FindProgramDlg::Notify().

00100 {return _itype==IT_SYSCACHE? _sys_idx: -1;}

Icon::operator ICON_ID ( ) const [inline]

Definition at line 94 of file globals.h.

References _id.

00094 {return _id;}

Member Data Documentation

HICON Icon::_hicon [protected]

Definition at line 108 of file globals.h.

Referenced by add_to_imagelist(), create_bitmap(), destroy(), draw(), and get_hicon().

ICON_ID Icon::_id [protected]

Definition at line 106 of file globals.h.

Referenced by operator ICON_ID().

ICON_TYPE Icon::_itype [protected]

Definition at line 107 of file globals.h.

Referenced by add_to_imagelist(), create_bitmap(), destroy(), draw(), get_hicon(), and get_sysiml_idx().

int Icon::_sys_idx [protected]

Definition at line 109 of file globals.h.

Referenced by add_to_imagelist(), create_bitmap(), draw(), and get_sysiml_idx().

The documentation for this struct was generated from the following files:
  • globals.h
  • explorer.cpp


ROS Explorer: Member List

Icon Member List

This is the complete list of members for Icon, including all inherited members.

_hicon | Icon | [protected]
_id | Icon | [protected]
_itype | Icon | [protected]
_sys_idx | Icon | [protected]
add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const | Icon |
create_bitmap(COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const | Icon |
destroy() | Icon | [inline]
draw(HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const | Icon |
get_hicon() const | Icon | [inline]
get_sysiml_idx() const | Icon | [inline]
Icon() | Icon |
Icon(ICON_ID id, UINT nid) | Icon |
Icon(ICON_TYPE itype, int id, HICON hIcon) | Icon |
Icon(ICON_TYPE itype, int id, int sys_idx) | Icon |
operator ICON_ID() const | Icon | [inline]


ROS Explorer: IconCache Struct Reference

IconCache Struct Reference

#include <globals.h>

Collaboration diagram for IconCache:

[legend]
List of all members.

Public Member Functions

IconCache ()
void | init ()
const Icon & | extract (LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL)
const Icon & | extract (LPCTSTR path, int idx, ICONCACHE_FLAGS flags=ICF_HICON)
const Icon & | extract (IExtractIcon *pExtract, LPCTSTR path, int idx, ICONCACHE_FLAGS flags=ICF_HICON)
const Icon & | add (HICON hIcon, ICON_TYPE type=IT_DYNAMIC)
const Icon & | add (int sys_idx)
const Icon & | get_icon (int icon_id)
HIMAGELIST | get_sys_imagelist () const
void | free_icon (int icon_id)

Protected Types

typedef map< int, Icon > | IconMap
typedef pair< String, int > | CacheKey
typedef map< CacheKey, ICON_ID > | PathCacheMap
typedef pair< String, pair<
int, int > > 		IdxCacheKey
typedef map< IdxCacheKey,
ICON_ID > 		IdxCacheMap

Protected Attributes

IconMap _icons
PathCacheMap _pathCache
IdxCacheMap _idxCache
HIMAGELIST | _himlSys_small

Static Protected Attributes

static int | s_next_id = ICID_DYNAMIC

Detailed Description

Definition at line 117 of file globals.h.

Member Typedef Documentation

typedef pair<String,int> IconCache::CacheKey [protected]

Definition at line 141 of file globals.h.

typedef map<int, Icon> IconCache::IconMap [protected]

Definition at line 138 of file globals.h.

typedef pair<String,pair<int,int> > IconCache::IdxCacheKey [protected]

Definition at line 145 of file globals.h.

typedef map<IdxCacheKey, ICON_ID> IconCache::IdxCacheMap [protected]

Definition at line 146 of file globals.h.

typedef map<CacheKey, ICON_ID> IconCache::PathCacheMap [protected]

Definition at line 142 of file globals.h.

Constructor & Destructor Documentation

IconCache::IconCache ( ) [inline]

Definition at line 118 of file globals.h.

00118 : _himlSys_small(0) {}

Member Function Documentation

const Icon & IconCache::add ( int sys_idx )

Definition at line 534 of file explorer.cpp.

References _icons, and s_next_id.

00535 {
00536         int id = ++s_next_id;
00537
00538         return _icons[id] = SysCacheIcon(id, sys_idx);
00539 }

const Icon & IconCache::add | ( | HICON | hIcon,
 |  | ICON_TYPE | type = IT_DYNAMIC
 | ) |

Definition at line 527 of file explorer.cpp.

References _icons, and s_next_id.

Referenced by extract(), and Entry::extract_icon().

00528 {
00529         int id = ++s_next_id;
00530
00531         return _icons[id] = Icon(type, id, hIcon);
00532 }

const Icon & IconCache::extract | ( | IExtractIcon * | pExtract,
 |  | LPCTSTR | path,
 |  | int | idx,
 |  | ICONCACHE_FLAGS | flags = ICF_HICON
 | ) |

Definition at line 501 of file explorer.cpp.

References _icons, add(), ICF_LARGE, ICID_NONE, and ICON_SIZE_X.

00502 {
00503         HICON hIconLarge = 0;
00504         HICON hIcon;
00505
00506         bool large_icons = flags & ICF_LARGE;
00507         HRESULT hr = pExtract->Extract(path, idx, &hIconLarge, &hIcon, MAKELONG(GetSystemMetrics(SM_CXICON), ICON_SIZE_X));
00508
00509         if (hr == NOERROR) {    //@@ oder SUCCEEDED(hr) ?
00510                 if (large_icons) {      //@@ OK?
00511                         if (hIcon)
00512                                 DestroyIcon(hIcon);
00513
00514                         hIcon = hIconLarge;
00515                 } else {
00516                         if (hIconLarge)
00517                                 DestroyIcon(hIconLarge);
00518                 }
00519
00520                 if (hIcon)
00521                         return add(hIcon);      //@@ When do we want not to free this icons?
00522         }
00523
00524         return _icons[ICID_NONE];
00525 }

Here is the call graph for this function:

const Icon & IconCache::extract | ( | LPCTSTR | path,
 |  | int | idx,
 |  | ICONCACHE_FLAGS | flags = ICF_HICON
 | ) |

Todo:
retreive "http://.../favicon.ico" format icons

Definition at line 474 of file explorer.cpp.

References _icons, _idxCache, add(), ICF_HICON, ICF_SYSCACHE, ICID_NONE, and IT_CACHED.

00475 {
00476         IdxCacheKey key(path, make_pair(idx, (flags|ICF_HICON)&~ICF_SYSCACHE));
00477
00478         key.first.toLower();
00479
00480         IdxCacheMap::iterator found = _idxCache.find(key);
00481
00482         if (found != _idxCache.end())
00483                 return _icons[found->second];
00484
00485         HICON hIcon;
00486
00487         if ((int)ExtractIconEx(path, idx, NULL, &hIcon, 1) > 0) {
00488                 const Icon& icon = add(hIcon, IT_CACHED);
00489
00490                 _idxCache[key] = icon;
00491
00492                 return icon;
00493         } else {
00494
00496
00497                 return _icons[ICID_NONE];
00498         }
00499 }

Here is the call graph for this function:

const Icon & IconCache::extract | ( | LPCTSTR | path,
 |  | ICONCACHE_FLAGS | flags = ICF_NORMAL
 | ) |

Todo:
limit cache size
Todo:
limit cache size

Definition at line 399 of file explorer.cpp.

References _himlSys_small, _icons, _pathCache, add(), ICF_HICON, ICF_LARGE, ICF_OPEN, ICF_OVERLAYS, ICF_SYSCACHE, ICID_NONE, IT_CACHED, and SHGFI_ADDOVERLAYS.

Referenced by FavoritesMenu::AddEntries(), Entry::extract_icon(), and BookmarkList::fill_tree().

00400 {
00401          // search for matching icon with unchanged flags in the cache
00402         CacheKey mapkey(path, flags);
00403         PathCacheMap::iterator found = _pathCache.find(mapkey);
00404
00405         if (found != _pathCache.end())
00406                 return _icons[found->second];
00407
00408          // search for matching icon with handle
00409         CacheKey mapkey_hicon(path, flags|ICF_HICON);
00410         if (flags != mapkey_hicon.second) {
00411                 found = _pathCache.find(mapkey_hicon);
00412
00413                 if (found != _pathCache.end())
00414                         return _icons[found->second];
00415         }
00416
00417          // search for matching icon in the system image list cache
00418         CacheKey mapkey_syscache(path, flags|ICF_SYSCACHE);
00419         if (flags != mapkey_syscache.second) {
00420                 found = _pathCache.find(mapkey_syscache);
00421
00422                 if (found != _pathCache.end())
00423                         return _icons[found->second];
00424         }
00425
00426         SHFILEINFO sfi;
00427
00428         int shgfi_flags = 0;
00429
00430         if (flags & ICF_OPEN)
00431                 shgfi_flags |= SHGFI_OPENICON;
00432
00433         if ((flags&(ICF_LARGE|ICF_OVERLAYS|ICF_HICON)) && !(flags&ICF_SYSCACHE)) {
00434                 shgfi_flags |= SHGFI_ICON;
00435
00436                 if (!(flags & ICF_LARGE))
00437                         shgfi_flags |= SHGFI_SMALLICON;
00438
00439                 if (flags & ICF_OVERLAYS)
00440                         shgfi_flags |= SHGFI_ADDOVERLAYS;
00441
00442                  // get small/big icons with/without overlays
00443                 if (SHGetFileInfo(path, 0, &sfi, sizeof(sfi), shgfi_flags)) {
00444                         const Icon& icon = add(sfi.hIcon, IT_CACHED);
00445
00447                         _pathCache[mapkey_hicon] = icon;
00448
00449                         return icon;
00450                 }
00451         } else {
00452                 assert(!(flags&ICF_OVERLAYS));
00453
00454                 shgfi_flags |= SHGFI_SYSICONINDEX|SHGFI_SMALLICON;
00455
00456                  // use system image list - the "search program dialog" needs it
00457                 HIMAGELIST himlSys_small = (HIMAGELIST) SHGetFileInfo(path, 0, &sfi, sizeof(sfi), shgfi_flags);
00458
00459                 if (himlSys_small) {
00460                         _himlSys_small = himlSys_small;
00461
00462                         const Icon& icon = add(sfi.iIcon/*, IT_SYSCACHE*/);
00463
00465                         _pathCache[mapkey_syscache] = icon;
00466
00467                         return icon;
00468                 }
00469         }
00470
00471         return _icons[ICID_NONE];
00472 }

Here is the call graph for this function:

void IconCache::free_icon ( int icon_id )

Definition at line 546 of file explorer.cpp.

References _icons.

Referenced by ShellBrowser::invalidate_cache(), and Entry::~Entry().

00547 {
00548         IconMap::iterator found = _icons.find(icon_id);
00549
00550         if (found != _icons.end()) {
00551                 Icon& icon = found->second;
00552
00553                 if (icon.destroy())
00554                         _icons.erase(found);
00555         }
00556 }

const Icon & IconCache::get_icon ( int icon_id )

Definition at line 541 of file explorer.cpp.

References _icons.

Referenced by StartMenu::AddButton(), QuickLaunchBar::AddShortcuts(), Pane::draw_item(), MainFrameBase::FillBookmarks(), ShellBrowser::get_image_idx(), and FindProgramDlg::Notify().

00542 {
00543         return _icons[id];
00544 }

HIMAGELIST IconCache::get_sys_imagelist ( ) const [inline]

Definition at line 131 of file globals.h.

References _himlSys_small.

Referenced by Icon::add_to_imagelist(), Icon::create_bitmap(), Icon::draw(), and FindProgramDlg::FindProgramDlg().

00131 {return _himlSys_small;}

void IconCache::init ( )

Definition at line 374 of file explorer.cpp.

References _icons, ICID_ACTION, ICID_APP, ICID_APPS, ICID_BOOKMARK, ICID_COMPUTER, ICID_CONFIG, ICID_DOCUMENTS, ICID_EXPLORER, ICID_FAVORITES, ICID_FOLDER, ICID_INFO, ICID_LOGOFF, ICID_NETWORK, ICID_NONE, ICID_PRINTER, ICID_SEARCH, ICID_SEARCH_DOC, IDI_ACTION, IDI_APPICON, IDI_APPS, IDI_COMPUTER, IDI_CONFIG, IDI_DOCUMENTS, IDI_DOT_TRANS, IDI_EXPLORER, IDI_FAVORITES, IDI_FOLDER, IDI_INFO, IDI_LOGOFF, IDI_NETWORK, IDI_PRINTER, IDI_SEARCH, IDI_SEARCH_DOC, and IT_STATIC.

Referenced by ExplorerGlobals::init().

00375 {
00376         _icons[ICID_NONE]               = Icon(IT_STATIC, ICID_NONE, (HICON)0);
00377
00378         _icons[ICID_FOLDER]             = Icon(ICID_FOLDER,             IDI_FOLDER);
00379         //_icons[ICID_DOCUMENT] = Icon(ICID_DOCUMENT,   IDI_DOCUMENT);
00380         _icons[ICID_EXPLORER]   = Icon(ICID_EXPLORER,   IDI_EXPLORER);
00381         _icons[ICID_APP]                = Icon(ICID_APP,                IDI_APPICON);
00382
00383         _icons[ICID_CONFIG]             = Icon(ICID_CONFIG,             IDI_CONFIG);
00384         _icons[ICID_DOCUMENTS]  = Icon(ICID_DOCUMENTS,  IDI_DOCUMENTS);
00385         _icons[ICID_FAVORITES]  = Icon(ICID_FAVORITES,  IDI_FAVORITES);
00386         _icons[ICID_INFO]               = Icon(ICID_INFO,               IDI_INFO);
00387         _icons[ICID_APPS]               = Icon(ICID_APPS,               IDI_APPS);
00388         _icons[ICID_SEARCH]             = Icon(ICID_SEARCH,             IDI_SEARCH);
00389         _icons[ICID_ACTION]             = Icon(ICID_ACTION,             IDI_ACTION);
00390         _icons[ICID_SEARCH_DOC] = Icon(ICID_SEARCH_DOC, IDI_SEARCH_DOC);
00391         _icons[ICID_PRINTER]    = Icon(ICID_PRINTER,    IDI_PRINTER);
00392         _icons[ICID_NETWORK]    = Icon(ICID_NETWORK,    IDI_NETWORK);
00393         _icons[ICID_COMPUTER]   = Icon(ICID_COMPUTER,   IDI_COMPUTER);
00394         _icons[ICID_LOGOFF]             = Icon(ICID_LOGOFF,             IDI_LOGOFF);
00395         _icons[ICID_BOOKMARK]   = Icon(ICID_BOOKMARK,   IDI_DOT_TRANS);
00396 }

Member Data Documentation

HIMAGELIST IconCache::_himlSys_small [protected]

Definition at line 149 of file globals.h.

Referenced by extract(), and get_sys_imagelist().

IconMap IconCache::_icons [protected]

Definition at line 139 of file globals.h.

Referenced by add(), extract(), free_icon(), get_icon(), and init().

IdxCacheMap IconCache::_idxCache [protected]

Definition at line 147 of file globals.h.

Referenced by extract().

PathCacheMap IconCache::_pathCache [protected]

Definition at line 143 of file globals.h.

Referenced by extract().

int IconCache::s_next_id = ICID_DYNAMIC [static, protected]

Definition at line 136 of file globals.h.

Referenced by add().

The documentation for this struct was generated from the following files:
  • globals.h
  • explorer.cpp


ROS Explorer: Member List

IconCache Member List

This is the complete list of members for IconCache, including all inherited members.

_himlSys_small | IconCache | [protected]
_icons | IconCache | [protected]
_idxCache | IconCache | [protected]
_pathCache | IconCache | [protected]
add(HICON hIcon, ICON_TYPE type=IT_DYNAMIC) | IconCache |
add(int sys_idx) | IconCache |
CacheKey typedef | IconCache | [protected]
extract(LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL) | IconCache |
extract(LPCTSTR path, int idx, ICONCACHE_FLAGS flags=ICF_HICON) | IconCache |
extract(IExtractIcon *pExtract, LPCTSTR path, int idx, ICONCACHE_FLAGS flags=ICF_HICON) | IconCache |
free_icon(int icon_id) | IconCache |
get_icon(int icon_id) | IconCache |
get_sys_imagelist() const | IconCache | [inline]
IconCache() | IconCache | [inline]
IconMap typedef | IconCache | [protected]
IdxCacheKey typedef | IconCache | [protected]
IdxCacheMap typedef | IconCache | [protected]
init() | IconCache |
PathCacheMap typedef | IconCache | [protected]
s_next_id | IconCache | [protected, static]


ROS Explorer: IconWindowClass Struct Reference

IconWindowClass Struct Reference

window class with specified icon from resources More...

#include <window.h>

Inheritance diagram for IconWindowClass:

[legend]
Collaboration diagram for IconWindowClass:

[legend]
List of all members.

Public Member Functions

IconWindowClass (LPCTSTR classname, UINT nid, UINT style=0, WNDPROC wndproc=Window::WindowWndProc)

Detailed Description

window class with specified icon from resources

Definition at line 258 of file window.h.

Constructor & Destructor Documentation

IconWindowClass::IconWindowClass | ( | LPCTSTR | classname,
 |  | UINT | nid,
 |  | UINT | style = 0,
 |  | WNDPROC | wndproc = Window::WindowWndProc
 | ) |

Definition at line 50 of file window.cpp.

00051  :      WindowClass(classname, style, wndproc)
00052 {
00053         hIcon = ResIcon(nid);
00054         hIconSm = SmallIcon(nid);
00055 }

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

IconWindowClass Member List

This is the complete list of members for IconWindowClass, including all inherited members.

_atomClass | WindowClass | [protected]
IconWindowClass(LPCTSTR classname, UINT nid, UINT style=0, WNDPROC wndproc=Window::WindowWndProc) | IconWindowClass |
operator ATOM() | WindowClass | [inline]
operator LPCTSTR() | WindowClass | [inline]
Register() | WindowClass | [inline]
WindowClass(LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc) | WindowClass |


ROS Explorer: IDataObject Class Reference

IDataObject Class Reference

Inheritance diagram for IDataObject:

[legend]
The documentation for this class was generated from the following file:
  • shellclasses.h


ROS Explorer: IDataObjectImpl Class Reference

IDataObjectImpl Class Reference

implementation of IDataObject interface More...

#include <dragdropimpl.h>

Inheritance diagram for IDataObjectImpl:

[legend]
Collaboration diagram for IDataObjectImpl:

[legend]
List of all members.

Public Member Functions

IDataObjectImpl (IDropSourceImpl *pDropSource)
virtual | ~IDataObjectImpl ()
void | CopyMedium (STGMEDIUM *pMedDest, STGMEDIUM *pMedSrc, FORMATETC *pFmtSrc)
virtual HRESULT STDMETHODCALLTYPE | GetData (FORMATETC __RPC_FAR *pformatetcIn, STGMEDIUM __RPC_FAR *pmedium)
virtual HRESULT STDMETHODCALLTYPE | GetDataHere (FORMATETC __RPC_FAR *pformatetc, STGMEDIUM __RPC_FAR *pmedium)
virtual HRESULT STDMETHODCALLTYPE | QueryGetData (FORMATETC __RPC_FAR *pformatetc)
virtual HRESULT STDMETHODCALLTYPE | GetCanonicalFormatEtc (FORMATETC __RPC_FAR *pformatectIn, FORMATETC __RPC_FAR *pformatetcOut)
virtual HRESULT STDMETHODCALLTYPE | SetData (FORMATETC __RPC_FAR *pformatetc, STGMEDIUM __RPC_FAR *pmedium, BOOL fRelease)
virtual HRESULT STDMETHODCALLTYPE | EnumFormatEtc (DWORD dwDirection, IEnumFORMATETC __RPC_FAR *__RPC_FAR *ppenumFormatEtc)
virtual HRESULT STDMETHODCALLTYPE | DAdvise (FORMATETC __RPC_FAR *pformatetc, DWORD advf, IAdviseSink __RPC_FAR *pAdvSink, DWORD __RPC_FAR *pdwConnection)
virtual HRESULT STDMETHODCALLTYPE | DUnadvise (DWORD dwConnection)
virtual HRESULT STDMETHODCALLTYPE | EnumDAdvise (IEnumSTATDATA __RPC_FAR *__RPC_FAR *ppenumAdvise)

Detailed Description

implementation of IDataObject interface

Definition at line 79 of file dragdropimpl.h.

Constructor & Destructor Documentation

IDataObjectImpl::IDataObjectImpl ( IDropSourceImpl * pDropSource )

Definition at line 24 of file dragdropimpl.cpp.

00025  :      super(IID_IDataObject),
00026         m_pDropSource(pDropSource),
00027         m_cRefCount(0)
00028 {
00029 }

IDataObjectImpl::~IDataObjectImpl ( ) [virtual]

Definition at line 31 of file dragdropimpl.cpp.

00032 {
00033         for(StorageArray::iterator it=_storage.begin(); it!=_storage.end(); ++it)
00034                 ReleaseStgMedium(it->_medium);
00035 }

Member Function Documentation

void IDataObjectImpl::CopyMedium | ( | STGMEDIUM * | pMedDest,
 |  | STGMEDIUM * | pMedSrc,
 |  | FORMATETC * | pFmtSrc
 | ) |

Definition at line 140 of file dragdropimpl.cpp.

Referenced by GetData(), and SetData().

00141 {
00142         switch(pMedSrc->tymed)
00143         {
00144         case TYMED_HGLOBAL:
00145                 pMedDest->hGlobal = (HGLOBAL)OleDuplicateData(pMedSrc->hGlobal, pFmtSrc->cfFormat, 0);
00146                 break;
00147         case TYMED_GDI:
00148                 pMedDest->hBitmap = (HBITMAP)OleDuplicateData(pMedSrc->hBitmap, pFmtSrc->cfFormat, 0);
00149                 break;
00150         case TYMED_MFPICT:
00151                 pMedDest->hMetaFilePict = (HMETAFILEPICT)OleDuplicateData(pMedSrc->hMetaFilePict, pFmtSrc->cfFormat, 0);
00152                 break;
00153         case TYMED_ENHMF:
00154                 pMedDest->hEnhMetaFile = (HENHMETAFILE)OleDuplicateData(pMedSrc->hEnhMetaFile, pFmtSrc->cfFormat, 0);
00155                 break;
00156         case TYMED_FILE:
00157                 pMedDest->lpszFileName = (LPOLESTR)OleDuplicateData(pMedSrc->lpszFileName, pFmtSrc->cfFormat, 0);
00158                 break;
00159         case TYMED_ISTREAM:
00160                 pMedDest->pstm = pMedSrc->pstm;
00161                 pMedSrc->pstm->AddRef();
00162                 break;
00163         case TYMED_ISTORAGE:
00164                 pMedDest->pstg = pMedSrc->pstg;
00165                 pMedSrc->pstg->AddRef();
00166                 break;
00167         case TYMED_NULL:
00168         default:
00169                 break;
00170         }
00171         pMedDest->tymed = pMedSrc->tymed;
00172         pMedDest->pUnkForRelease = pMedSrc->pUnkForRelease;
00173 }

STDMETHODIMP IDataObjectImpl::DAdvise | ( | FORMATETC __RPC_FAR * | pformatetc,
 |  | DWORD | advf,
 |  | IAdviseSink __RPC_FAR * | pAdvSink,
 |  | DWORD __RPC_FAR * | pdwConnection
 | ) | [virtual]

Definition at line 203 of file dragdropimpl.cpp.

00208 {
00209         return OLE_E_ADVISENOTSUPPORTED;
00210 }

STDMETHODIMP IDataObjectImpl::DUnadvise ( DWORD dwConnection ) [virtual]

Definition at line 212 of file dragdropimpl.cpp.

00214 {
00215         return E_NOTIMPL;
00216 }

HRESULT STDMETHODCALLTYPE IDataObjectImpl::EnumDAdvise ( IEnumSTATDATA __RPC_FAR *__RPC_FAR * ppenumAdvise ) [virtual]

Definition at line 218 of file dragdropimpl.cpp.

00220 {
00221         return OLE_E_ADVISENOTSUPPORTED;
00222 }

STDMETHODIMP IDataObjectImpl::EnumFormatEtc | ( | DWORD | dwDirection,
 |  | IEnumFORMATETC __RPC_FAR *__RPC_FAR * | ppenumFormatEtc
 | ) | [virtual]

Definition at line 175 of file dragdropimpl.cpp.

00178 {
00179         if (ppenumFormatEtc == NULL)
00180           return E_POINTER;
00181
00182         *ppenumFormatEtc=NULL;
00183         switch (dwDirection)
00184         {
00185           case DATADIR_GET:
00186                  *ppenumFormatEtc = new EnumFormatEtcImpl(_storage);
00187
00188                  if (!*ppenumFormatEtc)
00189                          return E_OUTOFMEMORY;
00190
00191                  (*ppenumFormatEtc)->AddRef();
00192                  break;
00193
00194           case DATADIR_SET:
00195           default:
00196                  return E_NOTIMPL;
00197                  break;
00198         }
00199
00200    return S_OK;
00201 }

STDMETHODIMP IDataObjectImpl::GetCanonicalFormatEtc | ( | FORMATETC __RPC_FAR * | pformatectIn,
 |  | FORMATETC __RPC_FAR * | pformatetcOut
 | ) | [virtual]

Definition at line 95 of file dragdropimpl.cpp.

00098 {
00099         if (pformatetcOut == NULL)
00100                 return E_INVALIDARG;
00101
00102         return DATA_S_SAMEFORMATETC;
00103 }

STDMETHODIMP IDataObjectImpl::GetData | ( | FORMATETC __RPC_FAR * | pformatetcIn,
 |  | STGMEDIUM __RPC_FAR * | pmedium
 | ) | [virtual]

Definition at line 37 of file dragdropimpl.cpp.

References CopyMedium().

00040 {
00041         if (pformatetcIn == NULL || pmedium == NULL)
00042                 return E_INVALIDARG;
00043
00044         pmedium->hGlobal = NULL;
00045
00046         for(StorageArray::iterator it=_storage.begin(); it!=_storage.end(); ++it)
00047         {
00048                 if (pformatetcIn->tymed & it->_format->tymed &&
00049                    pformatetcIn->dwAspect == it->_format->dwAspect &&
00050                    pformatetcIn->cfFormat == it->_format->cfFormat)
00051                 {
00052                         CopyMedium(pmedium, it->_medium, it->_format);
00053                         return S_OK;
00054                 }
00055         }
00056
00057         return DV_E_FORMATETC;
00058 }

Here is the call graph for this function:

STDMETHODIMP IDataObjectImpl::GetDataHere | ( | FORMATETC __RPC_FAR * | pformatetc,
 |  | STGMEDIUM __RPC_FAR * | pmedium
 | ) | [virtual]

Definition at line 60 of file dragdropimpl.cpp.

00063 {
00064         return E_NOTIMPL;
00065 }

STDMETHODIMP IDataObjectImpl::QueryGetData ( FORMATETC __RPC_FAR * pformatetc ) [virtual]

Definition at line 67 of file dragdropimpl.cpp.

00069 {
00070         if (pformatetc == NULL)
00071                 return E_INVALIDARG;
00072
00073         //support others if needed DVASPECT_THUMBNAIL  //DVASPECT_ICON   //DVASPECT_DOCPRINT
00074         if (!(DVASPECT_CONTENT & pformatetc->dwAspect))
00075                 return (DV_E_DVASPECT);
00076
00077         HRESULT  hr = DV_E_TYMED;
00078
00079         for(StorageArray::iterator it=_storage.begin(); it!=_storage.end(); ++it)
00080         {
00081            if (pformatetc->tymed & it->_format->tymed)
00082            {
00083                   if (pformatetc->cfFormat == it->_format->cfFormat)
00084                          return S_OK;
00085                   else
00086                          hr = DV_E_CLIPFORMAT;
00087            }
00088            else
00089                   hr = DV_E_TYMED;
00090         }
00091
00092         return hr;
00093 }

STDMETHODIMP IDataObjectImpl::SetData | ( | FORMATETC __RPC_FAR * | pformatetc,
 |  | STGMEDIUM __RPC_FAR * | pmedium,
 |  | BOOL | fRelease
 | ) | [virtual]

Definition at line 105 of file dragdropimpl.cpp.

References DataStorage::_format, DataStorage::_medium, and CopyMedium().

00109 {
00110         if (pformatetc == NULL || pmedium == NULL)
00111           return E_INVALIDARG;
00112
00113         assert(pformatetc->tymed == pmedium->tymed);
00114         FORMATETC* fetc=new FORMATETC;
00115         STGMEDIUM* pStgMed = new STGMEDIUM;
00116
00117         if (fetc == NULL || pStgMed == NULL)
00118                 return E_OUTOFMEMORY;
00119
00120         ZeroMemory(fetc, sizeof(FORMATETC));
00121         ZeroMemory(pStgMed, sizeof(STGMEDIUM));
00122
00123         *fetc = *pformatetc;
00124
00125         if (fRelease)
00126           *pStgMed = *pmedium;
00127         else
00128                 CopyMedium(pStgMed, pmedium, pformatetc);
00129
00130         DataStorage storage;
00131
00132         storage._format = fetc;
00133         storage._medium = pStgMed;
00134
00135         _storage.push_back(storage);
00136
00137         return S_OK;
00138 }

Here is the call graph for this function:

The documentation for this class was generated from the following files:
  • dragdropimpl.h
  • dragdropimpl.cpp


ROS Explorer: Member List

IDataObjectImpl Member List

This is the complete list of members for IDataObjectImpl, including all inherited members.

_ref | ComSrvObject | [protected]
_uuid_base | IComSrvQI< IDataObject > | [protected]
ComSrvObject() | ComSrvObject | [inline, protected]
CopyMedium(STGMEDIUM *pMedDest, STGMEDIUM *pMedSrc, FORMATETC *pFmtSrc) | IDataObjectImpl |
DAdvise(FORMATETC __RPC_FAR *pformatetc, DWORD advf, IAdviseSink __RPC_FAR *pAdvSink, DWORD __RPC_FAR *pdwConnection) | IDataObjectImpl | [virtual]
DecRef() | SimpleComObject | [inline]
DUnadvise(DWORD dwConnection) | IDataObjectImpl | [virtual]
EnumDAdvise(IEnumSTATDATA __RPC_FAR *__RPC_FAR *ppenumAdvise) | IDataObjectImpl | [virtual]
EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC __RPC_FAR *__RPC_FAR *ppenumFormatEtc) | IDataObjectImpl | [virtual]
GetCanonicalFormatEtc(FORMATETC __RPC_FAR *pformatectIn, FORMATETC __RPC_FAR *pformatetcOut) | IDataObjectImpl | [virtual]
GetData(FORMATETC __RPC_FAR *pformatetcIn, STGMEDIUM __RPC_FAR *pmedium) | IDataObjectImpl | [virtual]
GetDataHere(FORMATETC __RPC_FAR *pformatetc, STGMEDIUM __RPC_FAR *pmedium) | IDataObjectImpl | [virtual]
IComSrvBase(REFIID uuid_base) | IComSrvBase< IDataObject, IDataObjectImpl > | [inline, protected]
IComSrvQI(REFIID uuid_base) | IComSrvQI< IDataObject > | [inline]
IComSrvQI() | IComSrvQI< IDataObject > | [inline, protected]
IDataObjectImpl(IDropSourceImpl *pDropSource) | IDataObjectImpl |
IncRef() | SimpleComObject | [inline]
QueryGetData(FORMATETC __RPC_FAR *pformatetc) | IDataObjectImpl | [virtual]
QueryInterface(REFIID riid, LPVOID *ppv) | IComSrvQI< IDataObject > | [inline]
SetData(FORMATETC __RPC_FAR *pformatetc, STGMEDIUM __RPC_FAR *pmedium, BOOL fRelease) | IDataObjectImpl | [virtual]
STDMETHODIMP_(ULONG) AddRef() | IComSrvBase< IDataObject, IDataObjectImpl > | [inline]
STDMETHODIMP_(ULONG) Release() | IComSrvBase< IDataObject, IDataObjectImpl > | [inline]
~ComSrvObject() | ComSrvObject | [inline, protected, virtual]
~IComSrvQI() | IComSrvQI< IDataObject > | [inline, protected, virtual]
~IDataObjectImpl() | IDataObjectImpl | [virtual]


ROS Explorer: IDropSource Class Reference

IDropSource Class Reference

Inheritance diagram for IDropSource:

[legend]
The documentation for this class was generated from the following file:
  • shellclasses.h


ROS Explorer: IDropSourceImpl Class Reference

IDropSourceImpl Class Reference

implementation of IDropSource interface More...

#include <dragdropimpl.h>

Inheritance diagram for IDropSourceImpl:

[legend]
Collaboration diagram for IDropSourceImpl:

[legend]
List of all members.

Public Member Functions

IDropSourceImpl ()
virtual | ~IDropSourceImpl ()
virtual HRESULT STDMETHODCALLTYPE | QueryContinueDrag (BOOL fEscapePressed, DWORD grfKeyState)
virtual HRESULT STDMETHODCALLTYPE | GiveFeedback (DWORD dwEffect)

Public Attributes

bool | m_bDropped

Detailed Description

implementation of IDropSource interface

Definition at line 50 of file dragdropimpl.h.

Constructor & Destructor Documentation

IDropSourceImpl::IDropSourceImpl ( ) [inline]

Definition at line 60 of file dragdropimpl.h.

00061          :      super(IID_IDropSource),
00062                 m_cRefCount(0),
00063                 m_bDropped(false)
00064         {
00065         }

virtual IDropSourceImpl::~IDropSourceImpl ( ) [inline, virtual]

Definition at line 67 of file dragdropimpl.h.

00067 {}

Member Function Documentation

STDMETHODIMP IDropSourceImpl::GiveFeedback ( DWORD dwEffect ) [virtual]

Definition at line 244 of file dragdropimpl.cpp.

00246 {
00247         return DRAGDROP_S_USEDEFAULTCURSORS;
00248 }

STDMETHODIMP IDropSourceImpl::QueryContinueDrag | ( | BOOL | fEscapePressed,
 |  | DWORD | grfKeyState
 | ) | [virtual]

Definition at line 228 of file dragdropimpl.cpp.

References m_bDropped.

00231 {
00232    if (fEscapePressed)
00233           return DRAGDROP_S_CANCEL;
00234    if (!(grfKeyState & (MK_LBUTTON|MK_RBUTTON)))
00235    {
00236           m_bDropped = true;
00237           return DRAGDROP_S_DROP;
00238    }
00239
00240    return S_OK;
00241
00242 }

Member Data Documentation

bool IDropSourceImpl::m_bDropped

Definition at line 58 of file dragdropimpl.h.

Referenced by QueryContinueDrag().

The documentation for this class was generated from the following files:
  • dragdropimpl.h
  • dragdropimpl.cpp


ROS Explorer: Member List

IDropSourceImpl Member List

This is the complete list of members for IDropSourceImpl, including all inherited members.

_ref | ComSrvObject | [protected]
_uuid_base | IComSrvQI< IDropSource > | [protected]
ComSrvObject() | ComSrvObject | [inline, protected]
DecRef() | SimpleComObject | [inline]
GiveFeedback(DWORD dwEffect) | IDropSourceImpl | [virtual]
IComSrvBase(REFIID uuid_base) | IComSrvBase< IDropSource, IDropSourceImpl > | [inline, protected]
IComSrvQI(REFIID uuid_base) | IComSrvQI< IDropSource > | [inline]
IComSrvQI() | IComSrvQI< IDropSource > | [inline, protected]
IDropSourceImpl() | IDropSourceImpl | [inline]
IncRef() | SimpleComObject | [inline]
m_bDropped | IDropSourceImpl |
QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) | IDropSourceImpl | [virtual]
QueryInterface(REFIID riid, LPVOID *ppv) | IComSrvQI< IDropSource > | [inline]
STDMETHODIMP_(ULONG) AddRef() | IComSrvBase< IDropSource, IDropSourceImpl > | [inline]
STDMETHODIMP_(ULONG) Release() | IComSrvBase< IDropSource, IDropSourceImpl > | [inline]
~ComSrvObject() | ComSrvObject | [inline, protected, virtual]
~IComSrvQI() | IComSrvQI< IDropSource > | [inline, protected, virtual]
~IDropSourceImpl() | IDropSourceImpl | [inline, virtual]


ROS Explorer: IDropTarget Class Reference

IDropTarget Class Reference

Inheritance diagram for IDropTarget:

[legend]
The documentation for this class was generated from the following file:
  • dragdropimpl.h


ROS Explorer: IDropTargetImpl Class Reference

IDropTargetImpl Class Reference

implementation of IDropTarget interface More...

#include <dragdropimpl.h>

Inheritance diagram for IDropTargetImpl:

[legend]
Collaboration diagram for IDropTargetImpl:

[legend]
List of all members.

Public Member Functions

IDropTargetImpl (HWND m_hTargetWnd)
virtual | ~IDropTargetImpl ()
void | AddSuportedFormat (FORMATETC &ftetc)
virtual bool | OnDrop (FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)=0
virtual HRESULT STDMETHODCALLTYPE | QueryInterface (REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject)
virtual ULONG STDMETHODCALLTYPE | AddRef ()
virtual ULONG STDMETHODCALLTYPE | Release ()
bool | QueryDrop (DWORD grfKeyState, LPDWORD pdwEffect)
virtual HRESULT STDMETHODCALLTYPE | DragEnter (IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
virtual HRESULT STDMETHODCALLTYPE | DragOver (DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
virtual HRESULT STDMETHODCALLTYPE | DragLeave ()
virtual HRESULT STDMETHODCALLTYPE | Drop (IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)

Protected Attributes

HWND m_hTargetWnd

Detailed Description

implementation of IDropTarget interface

Definition at line 168 of file dragdropimpl.h.

Constructor & Destructor Documentation

IDropTargetImpl::IDropTargetImpl ( HWND m_hTargetWnd )

Definition at line 331 of file dragdropimpl.cpp.

References m_hTargetWnd.

00332  :      m_cRefCount(0),
00333         m_bAllowDrop(false),
00334         m_pDropTargetHelper(NULL),
00335         m_pSupportedFrmt(NULL),
00336         m_hTargetWnd(hTargetWnd)
00337 {
00338         assert(m_hTargetWnd != NULL);
00339
00340         if (FAILED(CoCreateInstance(CLSID_DragDropHelper, NULL, CLSCTX_INPROC_SERVER,
00341                                          IID_IDropTargetHelper,(LPVOID*)&m_pDropTargetHelper)))
00342                 m_pDropTargetHelper = NULL;
00343 }

IDropTargetImpl::~IDropTargetImpl ( ) [virtual]

Definition at line 345 of file dragdropimpl.cpp.

00346 {
00347         if (m_pDropTargetHelper != NULL)
00348         {
00349                 m_pDropTargetHelper->Release();
00350                 m_pDropTargetHelper = NULL;
00351         }
00352 }

Member Function Documentation

virtual ULONG STDMETHODCALLTYPE IDropTargetImpl::AddRef ( ) [inline, virtual]

Definition at line 192 of file dragdropimpl.h.

Referenced by ShellBrowser::InitDragDrop(), and DesktopShellView::InitDragDrop().

00192 {return ++m_cRefCount;}

void IDropTargetImpl::AddSuportedFormat ( FORMATETC & ftetc ) [inline]

Definition at line 184 of file dragdropimpl.h.

Referenced by ShellBrowser::InitDragDrop(), and DesktopShellView::InitDragDrop().

00184 {m_formatetc.push_back(ftetc);}

HRESULT STDMETHODCALLTYPE IDropTargetImpl::DragEnter | ( | IDataObject __RPC_FAR * | pDataObj,
 |  | DWORD | grfKeyState,
 |  | POINTL | pt,
 |  | DWORD __RPC_FAR * | pdwEffect
 | ) | [virtual]

Definition at line 424 of file dragdropimpl.cpp.

References m_hTargetWnd.

00429 {
00430         if (pDataObj == NULL)
00431                 return E_INVALIDARG;
00432
00433         if (m_pDropTargetHelper)
00434                 m_pDropTargetHelper->DragEnter(m_hTargetWnd, pDataObj, (LPPOINT)&pt, *pdwEffect);
00435
00436         //IEnumFORMATETC* pEnum;
00437         //pDataObj->EnumFormatEtc(DATADIR_GET,&pEnum);
00438         //FORMATETC ftm;
00439         //for()
00440         //pEnum->Next(1,&ftm,0);
00441         //pEnum->Release();
00442         m_pSupportedFrmt = NULL;
00443
00444         for(FormatArray::iterator it=m_formatetc.begin(); it!=m_formatetc.end(); ++it)
00445         {
00446                 m_bAllowDrop = (pDataObj->QueryGetData(&*it) == S_OK)? true: false;
00447
00448                 if (m_bAllowDrop)
00449                 {
00450                         m_pSupportedFrmt = &*it;
00451                         break;
00452                 }
00453         }
00454
00455         QueryDrop(grfKeyState, pdwEffect);
00456
00457         return S_OK;
00458 }

HRESULT STDMETHODCALLTYPE IDropTargetImpl::DragLeave ( ) [virtual]

Reimplemented in DesktopDropTarget, and TreeDropTarget.

Definition at line 473 of file dragdropimpl.cpp.

Referenced by TreeDropTarget::DragLeave().

00474 {
00475         if (m_pDropTargetHelper)
00476                 m_pDropTargetHelper->DragLeave();
00477
00478         m_bAllowDrop = false;
00479         m_pSupportedFrmt = NULL;
00480
00481         return S_OK;
00482 }

HRESULT STDMETHODCALLTYPE IDropTargetImpl::DragOver | ( | DWORD | grfKeyState,
 |  | POINTL | pt,
 |  | DWORD __RPC_FAR * | pdwEffect
 | ) | [virtual]

Reimplemented in DesktopDropTarget, and TreeDropTarget.

Definition at line 460 of file dragdropimpl.cpp.

References QueryDrop().

Referenced by TreeDropTarget::DragOver().

00464 {
00465         if (m_pDropTargetHelper)
00466                 m_pDropTargetHelper->DragOver((LPPOINT)&pt, *pdwEffect);
00467
00468         QueryDrop(grfKeyState, pdwEffect);
00469
00470         return S_OK;
00471 }

Here is the call graph for this function:

HRESULT STDMETHODCALLTYPE IDropTargetImpl::Drop | ( | IDataObject __RPC_FAR * | pDataObj,
 |  | DWORD | grfKeyState,
 |  | POINTL | pt,
 |  | DWORD __RPC_FAR * | pdwEffect
 | ) | [virtual]

Definition at line 484 of file dragdropimpl.cpp.

References OnDrop(), and QueryDrop().

00488 {
00489         if (pDataObj == NULL)
00490                 return E_INVALIDARG;
00491
00492         if (m_pDropTargetHelper)
00493                 m_pDropTargetHelper->Drop(pDataObj, (LPPOINT)&pt, *pdwEffect);
00494
00495         if (QueryDrop(grfKeyState, pdwEffect))
00496         {
00497                 if (m_bAllowDrop && m_pSupportedFrmt != NULL)
00498                 {
00499                         STGMEDIUM medium;
00500
00501                         if (pDataObj->GetData(m_pSupportedFrmt, &medium) == S_OK)
00502                         {
00503                                 if (OnDrop(m_pSupportedFrmt, medium, pdwEffect)) //does derive class wants us to free medium?
00504                                         ReleaseStgMedium(&medium);
00505                         }
00506                 }
00507         }
00508
00509         m_bAllowDrop = false;
00510         *pdwEffect = DROPEFFECT_NONE;
00511         m_pSupportedFrmt = NULL;
00512
00513         return S_OK;
00514 }

Here is the call graph for this function:

virtual bool IDropTargetImpl::OnDrop | ( | FORMATETC * | pFmtEtc,
 |  | STGMEDIUM & | medium,
 |  | DWORD * | pdwEffect
 | ) | [pure virtual]

Implemented in DesktopDropTarget, and TreeDropTarget.

Referenced by Drop().

bool IDropTargetImpl::QueryDrop | ( | DWORD | grfKeyState,
 |  | LPDWORD | pdwEffect
 | ) |

Definition at line 382 of file dragdropimpl.cpp.

Referenced by DragOver(), and Drop().

00383 {
00384         DWORD dwOKEffects = *pdwEffect;
00385
00386         if (!m_bAllowDrop)
00387         {
00388            *pdwEffect = DROPEFFECT_NONE;
00389            return false;
00390         }
00391
00392         //CTRL+SHIFT  -- DROPEFFECT_LINK
00393         //CTRL            -- DROPEFFECT_COPY
00394         //SHIFT           -- DROPEFFECT_MOVE
00395         //no modifier -- DROPEFFECT_MOVE or whatever is allowed by src
00396         *pdwEffect = (grfKeyState & MK_CONTROL) ?
00397                                  ( (grfKeyState & MK_SHIFT) ? DROPEFFECT_LINK : DROPEFFECT_COPY ):
00398                                  ( (grfKeyState & MK_SHIFT) ? DROPEFFECT_MOVE : DROPEFFECT_NONE );
00399         if (*pdwEffect == 0)
00400         {
00401            // No modifier keys used by user while dragging.
00402            if (DROPEFFECT_COPY & dwOKEffects)
00403                   *pdwEffect = DROPEFFECT_COPY;
00404            else if (DROPEFFECT_MOVE & dwOKEffects)
00405                   *pdwEffect = DROPEFFECT_MOVE;
00406            else if (DROPEFFECT_LINK & dwOKEffects)
00407                   *pdwEffect = DROPEFFECT_LINK;
00408            else
00409            {
00410                   *pdwEffect = DROPEFFECT_NONE;
00411            }
00412         }
00413         else
00414         {
00415            // Check if the drag source application allows the drop effect desired by user.
00416            // The drag source specifies this in DoDragDrop
00417            if (!(*pdwEffect & dwOKEffects))
00418                   *pdwEffect = DROPEFFECT_NONE;
00419         }
00420
00421         return (DROPEFFECT_NONE == *pdwEffect)?false:true;
00422 }

HRESULT STDMETHODCALLTYPE IDropTargetImpl::QueryInterface | ( | REFIID | riid,
 |  | void __RPC_FAR *__RPC_FAR * | ppvObject
 | ) | [virtual]

Definition at line 354 of file dragdropimpl.cpp.

00356 {
00357         *ppvObject = NULL;
00358         if (IID_IUnknown==riid || IID_IDropTarget==riid)
00359                 *ppvObject=this;
00360
00361         if (*ppvObject != NULL)
00362         {
00363                 ((LPUNKNOWN)*ppvObject)->AddRef();
00364                 return S_OK;
00365         }
00366
00367         return E_NOINTERFACE;
00368 }

ULONG STDMETHODCALLTYPE IDropTargetImpl::Release ( ) [virtual]

Definition at line 370 of file dragdropimpl.cpp.

Referenced by ShellBrowser::InitDragDrop(), DesktopShellView::InitDragDrop(), and ShellBrowser::~ShellBrowser().

00371 {
00372    long nTemp = --m_cRefCount;
00373
00374    assert(nTemp >= 0);
00375
00376    if (nTemp == 0)
00377           delete this;
00378
00379    return nTemp;
00380 }

Member Data Documentation

HWND IDropTargetImpl::m_hTargetWnd [protected]

Definition at line 178 of file dragdropimpl.h.

Referenced by DragEnter(), and IDropTargetImpl().

The documentation for this class was generated from the following files:
  • dragdropimpl.h
  • dragdropimpl.cpp


ROS Explorer: Member List

IDropTargetImpl Member List

This is the complete list of members for IDropTargetImpl, including all inherited members.

AddRef() | IDropTargetImpl | [inline, virtual]
AddSuportedFormat(FORMATETC &ftetc) | IDropTargetImpl | [inline]
DragEnter(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) | IDropTargetImpl | [virtual]
DragLeave() | IDropTargetImpl | [virtual]
DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) | IDropTargetImpl | [virtual]
Drop(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) | IDropTargetImpl | [virtual]
IDropTargetImpl(HWND m_hTargetWnd) | IDropTargetImpl |
m_hTargetWnd | IDropTargetImpl | [protected]
OnDrop(FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)=0 | IDropTargetImpl | [pure virtual]
QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect) | IDropTargetImpl |
QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject) | IDropTargetImpl | [virtual]
Release() | IDropTargetImpl | [virtual]
~IDropTargetImpl() | IDropTargetImpl | [virtual]


ROS Explorer: IEnumFORMATETC Class Reference

IEnumFORMATETC Class Reference

Inheritance diagram for IEnumFORMATETC:

[legend]
The documentation for this class was generated from the following file:
  • shellclasses.h


ROS Explorer: IOleClientSite Class Reference

IOleClientSite Class Reference

Inheritance diagram for IOleClientSite:

[legend]
The documentation for this class was generated from the following file:
  • webchild.h


ROS Explorer: IOleCommandTarget Class Reference

IOleCommandTarget Class Reference

Inheritance diagram for IOleCommandTarget:

[legend]
The documentation for this class was generated from the following file:
  • shellbrowserimpl.h


ROS Explorer: IOleInPlaceSite Class Reference

IOleInPlaceSite Class Reference

Inheritance diagram for IOleInPlaceSite:

[legend]
The documentation for this class was generated from the following file:
  • webchild.h


ROS Explorer: IPCtrlWindow< BASE, SMARTPTR > Struct Template Reference

IPCtrlWindow< BASE, SMARTPTR > Struct Template Reference

#include <webchild.h>

Inheritance diagram for IPCtrlWindow< BASE, SMARTPTR >:

[legend]
Collaboration diagram for IPCtrlWindow< BASE, SMARTPTR >:

[legend]
List of all members.

Public Types

typedef BASE | super

Public Member Functions

IPCtrlWindow (HWND hwnd)
template<typename T>
IPCtrlWindow (HWND hwnd, T &info)
HRESULT | create_control (HWND hwnd, REFIID clsid, REFIID riid)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Protected Attributes

ComInit _usingCOM
SMARTPTR | _control
OleInPlaceClient _client_side
SIfacePtr< IOleInPlaceObject > | _in_place_object

Detailed Description

template<typename BASE, typename SMARTPTR>
struct IPCtrlWindow< BASE, SMARTPTR >

Definition at line 321 of file webchild.h.

Member Typedef Documentation

template<typename BASE, typename SMARTPTR>
typedef BASE IPCtrlWindow< BASE, SMARTPTR >::super

Reimplemented in WebChildWindow.

Definition at line 323 of file webchild.h.

Constructor & Destructor Documentation

template<typename BASE, typename SMARTPTR>
IPCtrlWindow< BASE, SMARTPTR >::IPCtrlWindow ( HWND hwnd ) [inline]

Definition at line 325 of file webchild.h.

00326          :      super(hwnd)
00327         {
00328         }

template<typename BASE, typename SMARTPTR>
template<typename T>
IPCtrlWindow< BASE, SMARTPTR >::IPCtrlWindow | ( | HWND | hwnd,
 |  | T & | info
 | ) | [inline]

Definition at line 330 of file webchild.h.

00331          :      super(hwnd, info)
00332         {
00333         }

Member Function Documentation

template<typename BASE, typename SMARTPTR>
HRESULT IPCtrlWindow< BASE, SMARTPTR >::create_control | ( | HWND | hwnd,
 |  | REFIID | clsid,
 |  | REFIID | riid
 | ) | [inline]

Definition at line 335 of file webchild.h.

00336         {
00337                  // Erzeugen einer Instanz des Controls
00338                 HRESULT hr = _control.CreateInstance(clsid, riid);
00339                 if (FAILED(hr))
00340                         return hr;
00341
00342                 _client_side.attach(hwnd);
00343
00344                 hr = _client_side.attach_control(SIfacePtr<IOleObject>(_control, IID_IOleObject)/*, OLEIVERB_INPLACEACTIVATE,
00345                                                                                         hwnd, &Rect(10, 10, 500, 500)*/);
00346                 if (FAILED(hr))
00347                         return hr;
00348
00349                  // try to get a IOleInPlaceObject interface for window resizing
00350                 return _control.QueryInterface(IID_IOleInPlaceObject, &_in_place_object);       // _in_place_object = _control
00351         }

template<typename BASE, typename SMARTPTR>
LRESULT IPCtrlWindow< BASE, SMARTPTR >::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [inline, protected]

Reimplemented in WebChildWindow.

Definition at line 354 of file webchild.h.

00355         {
00356                 if (nmsg == WM_SIZE) {
00357                         if (_in_place_object) {
00358                                 RECT rect = {0, 0, LOWORD(lparam), HIWORD(lparam)};
00359
00360                                 _in_place_object->SetObjectRects(&rect, &rect);
00361                         }
00362                 } else if (nmsg == WM_CLOSE) {
00363                         _in_place_object = NULL;
00364
00365                         if (_control) {
00366                                 _client_side.detach(SIfacePtr<IOleObject>(_control, IID_IOleObject), OLECLOSE_NOSAVE);
00367                                 _control = NULL;
00368                         }
00369                 }
00370
00371                 return super::WndProc(nmsg, wparam, lparam);
00372         }

Member Data Documentation

template<typename BASE, typename SMARTPTR>
OleInPlaceClient IPCtrlWindow< BASE, SMARTPTR >::_client_side [protected]

Definition at line 376 of file webchild.h.

template<typename BASE, typename SMARTPTR>
SMARTPTR IPCtrlWindow< BASE, SMARTPTR >::_control [protected]

Definition at line 375 of file webchild.h.

template<typename BASE, typename SMARTPTR>
SIfacePtr<IOleInPlaceObject> IPCtrlWindow< BASE, SMARTPTR >::_in_place_object [protected]

Definition at line 377 of file webchild.h.

template<typename BASE, typename SMARTPTR>
ComInit IPCtrlWindow< BASE, SMARTPTR >::_usingCOM [protected]

Definition at line 374 of file webchild.h.

The documentation for this struct was generated from the following file:
  • webchild.h


ROS Explorer: Member List

IPCtrlWindow< BASE, SMARTPTR > Member List

This is the complete list of members for IPCtrlWindow< BASE, SMARTPTR >, including all inherited members.

_client_side | IPCtrlWindow< BASE, SMARTPTR > | [protected]
_control | IPCtrlWindow< BASE, SMARTPTR > | [protected]
_in_place_object | IPCtrlWindow< BASE, SMARTPTR > | [protected]
_usingCOM | IPCtrlWindow< BASE, SMARTPTR > | [protected]
create_control(HWND hwnd, REFIID clsid, REFIID riid) | IPCtrlWindow< BASE, SMARTPTR > | [inline]
IPCtrlWindow(HWND hwnd) | IPCtrlWindow< BASE, SMARTPTR > | [inline]
IPCtrlWindow(HWND hwnd, T &info) | IPCtrlWindow< BASE, SMARTPTR > | [inline]
super typedef | IPCtrlWindow< BASE, SMARTPTR > |
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | IPCtrlWindow< BASE, SMARTPTR > | [inline, protected]


ROS Explorer: IServiceProvider Class Reference

IServiceProvider Class Reference

Inheritance diagram for IServiceProvider:

[legend]
The documentation for this class was generated from the following file:
  • shellbrowserimpl.h


ROS Explorer: IShellBrowser Class Reference

IShellBrowser Class Reference

Inheritance diagram for IShellBrowser:

[legend]
The documentation for this class was generated from the following file:
  • shellbrowserimpl.h


ROS Explorer: IShellBrowserImpl Struct Reference

IShellBrowserImpl Struct Reference

Implementation of IShellBrowser and ICommDlgBrowser interfaces for explorer child windows (see ShellBrowserChild). More...

#include <shellbrowserimpl.h>

Inheritance diagram for IShellBrowserImpl:

[legend]
Collaboration diagram for IShellBrowserImpl:

[legend]
List of all members.

Public Member Functions

IShellBrowserImpl ()
virtual | ~IShellBrowserImpl ()
virtual HRESULT STDMETHODCALLTYPE | QueryInterface (REFIID iid, void **ppvObject)
virtual ULONG STDMETHODCALLTYPE | AddRef ()
virtual ULONG STDMETHODCALLTYPE | Release ()
virtual HRESULT STDMETHODCALLTYPE | ContextSensitiveHelp (BOOL fEnterMode)
virtual HRESULT STDMETHODCALLTYPE | OnDefaultCommand (IShellView *ppshv)
virtual HRESULT STDMETHODCALLTYPE | OnStateChange (IShellView *ppshv, ULONG uChange)
virtual HRESULT STDMETHODCALLTYPE | IncludeObject (IShellView *ppshv, LPCITEMIDLIST pidl)
virtual HRESULT STDMETHODCALLTYPE | InsertMenusSB (HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)
virtual HRESULT STDMETHODCALLTYPE | SetMenuSB (HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject)
virtual HRESULT STDMETHODCALLTYPE | RemoveMenusSB (HMENU hmenuShared)
virtual HRESULT STDMETHODCALLTYPE | SetStatusTextSB (LPCOLESTR lpszStatusText)
virtual HRESULT STDMETHODCALLTYPE | EnableModelessSB (BOOL fEnable)
virtual HRESULT STDMETHODCALLTYPE | BrowseObject (LPCITEMIDLIST pidl, UINT wFlags)
virtual HRESULT STDMETHODCALLTYPE | GetViewStateStream (DWORD grfMode, LPSTREAM *ppStrm)
virtual HRESULT STDMETHODCALLTYPE | OnViewWindowActive (IShellView *ppshv)
virtual HRESULT STDMETHODCALLTYPE | SetToolbarItems (LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags)
virtual HRESULT STDMETHODCALLTYPE | TranslateAcceleratorSB (LPMSG lpmsg, WORD wID)
virtual HRESULT STDMETHODCALLTYPE | QueryService (REFGUID guidService, REFIID riid, void **ppvObject)
virtual HRESULT STDMETHODCALLTYPE | QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
virtual HRESULT STDMETHODCALLTYPE | Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)

Protected Member Functions

virtual HRESULT | OnDefaultCommand (LPIDA pida)

Protected Attributes

DWORD | _dwRef

Detailed Description

Implementation of IShellBrowser and ICommDlgBrowser interfaces for explorer child windows (see ShellBrowserChild).

Definition at line 37 of file shellbrowserimpl.h.

Constructor & Destructor Documentation

IShellBrowserImpl::IShellBrowserImpl ( ) [inline]

Definition at line 43 of file shellbrowserimpl.h.

00044          :      _dwRef(0)
00045         {
00046         }

virtual IShellBrowserImpl::~IShellBrowserImpl ( ) [inline, virtual]

Definition at line 48 of file shellbrowserimpl.h.

00049         {
00050         }

Member Function Documentation

virtual ULONG STDMETHODCALLTYPE IShellBrowserImpl::AddRef ( ) [inline, virtual]

Definition at line 54 of file shellbrowserimpl.h.

References _dwRef.

00054 {return ++_dwRef;}

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::BrowseObject | ( | LPCITEMIDLIST | pidl,
 |  | UINT | wFlags
 | ) | [inline, virtual]

Definition at line 79 of file shellbrowserimpl.h.

00079 {return E_NOTIMPL;}

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::ContextSensitiveHelp ( BOOL fEnterMode ) [inline, virtual]

Definition at line 58 of file shellbrowserimpl.h.

00058 {return E_NOTIMPL;}

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::EnableModelessSB ( BOOL fEnable ) [inline, virtual]

Definition at line 78 of file shellbrowserimpl.h.

00078 {return E_NOTIMPL;}

HRESULT IShellBrowserImpl::Exec | ( | const GUID * | pguidCmdGroup,
 |  | DWORD | nCmdID,
 |  | DWORD | nCmdexecopt,
 |  | VARIANT * | pvaIn,
 |  | VARIANT * | pvaOut
 | ) | [virtual]

Todo:
implement IOleCommandTarget

Definition at line 89 of file shellbrowserimpl.cpp.

00090 {
00091         return E_FAIL;
00092 }

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::GetViewStateStream | ( | DWORD | grfMode,
 |  | LPSTREAM * | ppStrm
 | ) | [inline, virtual]

Definition at line 80 of file shellbrowserimpl.h.

00080 {return E_NOTIMPL;}

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::IncludeObject | ( | IShellView * | ppshv,
 |  | LPCITEMIDLIST | pidl
 | ) | [inline, virtual]

Definition at line 68 of file shellbrowserimpl.h.

00069         {       //filter files if needed
00070                 return S_OK;
00071         }

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::InsertMenusSB | ( | HMENU | hmenuShared,
 |  | LPOLEMENUGROUPWIDTHS | lpMenuWidths
 | ) | [inline, virtual]

Definition at line 74 of file shellbrowserimpl.h.

00074 {return E_NOTIMPL;}

virtual HRESULT IShellBrowserImpl::OnDefaultCommand ( LPIDA pida ) [inline, protected, virtual]

Reimplemented in DesktopWindow, and ShellBrowser.

Definition at line 95 of file shellbrowserimpl.h.

00095 {return E_NOTIMPL;}

HRESULT IShellBrowserImpl::OnDefaultCommand ( IShellView * ppshv ) [virtual]

Definition at line 96 of file shellbrowserimpl.cpp.

References PIDList::GetData().

00097 {
00098         IDataObject* selection;
00099
00100         HRESULT hr = ppshv->GetItemObject(SVGIO_SELECTION, IID_IDataObject, (void**)&selection);
00101         if (FAILED(hr))
00102                 return hr;
00103
00104         PIDList pidList;
00105
00106         hr = pidList.GetData(selection);
00107         if (FAILED(hr)) {
00108                 selection->Release();
00109                 return hr;
00110         }
00111
00112         hr = OnDefaultCommand(pidList);
00113
00114         selection->Release();
00115
00116         return hr;
00117 }

Here is the call graph for this function:

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::OnStateChange | ( | IShellView * | ppshv,
 |  | ULONG | uChange
 | ) | [inline, virtual]

Definition at line 63 of file shellbrowserimpl.h.

00064         {       //handle selection, rename, focus if needed
00065                 return E_NOTIMPL;
00066         }

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::OnViewWindowActive ( IShellView * ppshv ) [inline, virtual]

Definition at line 81 of file shellbrowserimpl.h.

00081 {return E_NOTIMPL;}

HRESULT IShellBrowserImpl::QueryInterface | ( | REFIID | iid,
 |  | void ** | ppvObject
 | ) | [virtual]

Definition at line 34 of file shellbrowserimpl.cpp.

00035 {
00036         if (!ppvObject)
00037                 return E_POINTER;
00038
00039         if (iid == IID_IUnknown)
00040                 *ppvObject = (IUnknown*)static_cast<IShellBrowser*>(this);
00041         else if (iid == IID_IOleWindow)
00042                 *ppvObject = static_cast<IOleWindow*>(this);
00043         else if (iid == IID_IShellBrowser)
00044                 *ppvObject = static_cast<IShellBrowser*>(this);
00045         else if (iid == IID_ICommDlgBrowser)
00046                 *ppvObject = static_cast<ICommDlgBrowser*>(this);
00047         else if (iid == IID_IServiceProvider)
00048                 *ppvObject = static_cast<IServiceProvider*>(this);
00049         else {
00050                 *ppvObject = NULL;
00051                 return E_NOINTERFACE;
00052         }
00053
00054         return S_OK;
00055 }

HRESULT IShellBrowserImpl::QueryService | ( | REFGUID | guidService,
 |  | REFIID | riid,
 |  | void ** | ppvObject
 | ) | [virtual]

Todo:
use guidService

Definition at line 57 of file shellbrowserimpl.cpp.

00058 {
00059         if (!ppvObject)
00060                 return E_POINTER;
00061
00063
00064         if (riid == IID_IUnknown)
00065                 *ppvObject = (IUnknown*)static_cast<IShellBrowser*>(this);
00066         else if (riid == IID_IOleWindow)
00067                 *ppvObject = static_cast<IOleWindow*>(this);
00068         else if (riid == IID_IShellBrowser)
00069                 *ppvObject = static_cast<IShellBrowser*>(this);
00070         else if (riid == IID_ICommDlgBrowser)
00071                 *ppvObject = static_cast<ICommDlgBrowser*>(this);
00072         else if (riid == IID_IServiceProvider)
00073                 *ppvObject = static_cast<IServiceProvider*>(this);
00074         else if (riid == IID_IOleCommandTarget)
00075                 *ppvObject = static_cast<IOleCommandTarget*>(this);
00076         else {
00077                 *ppvObject = NULL;
00078                 return E_NOINTERFACE;
00079         }
00080
00081         return S_OK;
00082 }

HRESULT IShellBrowserImpl::QueryStatus | ( | const GUID * | pguidCmdGroup,
 |  | ULONG | cCmds,
 |  | OLECMD | prgCmds[],
 |  | OLECMDTEXT * | pCmdText
 | ) | [virtual]

Todo:
implement IOleCommandTarget

Definition at line 84 of file shellbrowserimpl.cpp.

00085 {
00086         return E_FAIL;
00087 }

virtual ULONG STDMETHODCALLTYPE IShellBrowserImpl::Release ( ) [inline, virtual]

Definition at line 55 of file shellbrowserimpl.h.

References _dwRef.

00055 {return --_dwRef;}  //not heap based

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::RemoveMenusSB ( HMENU hmenuShared ) [inline, virtual]

Definition at line 76 of file shellbrowserimpl.h.

00076 {return E_NOTIMPL;}

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::SetMenuSB | ( | HMENU | hmenuShared,
 |  | HOLEMENU | holemenuReserved,
 |  | HWND | hwndActiveObject
 | ) | [inline, virtual]

Definition at line 75 of file shellbrowserimpl.h.

00075 {return E_NOTIMPL;}

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::SetStatusTextSB ( LPCOLESTR lpszStatusText ) [inline, virtual]

Definition at line 77 of file shellbrowserimpl.h.

00077 {return E_NOTIMPL;}

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::SetToolbarItems | ( | LPTBBUTTON | lpButtons,
 |  | UINT | nButtons,
 |  | UINT | uFlags
 | ) | [inline, virtual]

Definition at line 82 of file shellbrowserimpl.h.

00082 {return E_NOTIMPL;}

virtual HRESULT STDMETHODCALLTYPE IShellBrowserImpl::TranslateAcceleratorSB | ( | LPMSG | lpmsg,
 |  | WORD | wID
 | ) | [inline, virtual]

Definition at line 83 of file shellbrowserimpl.h.

00083 {return S_OK;}

Member Data Documentation

DWORD IShellBrowserImpl::_dwRef [protected]

Definition at line 93 of file shellbrowserimpl.h.

Referenced by AddRef(), and Release().

The documentation for this struct was generated from the following files:
  • shellbrowserimpl.h
  • shellbrowserimpl.cpp


ROS Explorer: Member List

IShellBrowserImpl Member List

This is the complete list of members for IShellBrowserImpl, including all inherited members.

_dwRef | IShellBrowserImpl | [protected]
AddRef() | IShellBrowserImpl | [inline, virtual]
BrowseObject(LPCITEMIDLIST pidl, UINT wFlags) | IShellBrowserImpl | [inline, virtual]
ContextSensitiveHelp(BOOL fEnterMode) | IShellBrowserImpl | [inline, virtual]
EnableModelessSB(BOOL fEnable) | IShellBrowserImpl | [inline, virtual]
Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) | IShellBrowserImpl | [virtual]
GetViewStateStream(DWORD grfMode, LPSTREAM *ppStrm) | IShellBrowserImpl | [inline, virtual]
IncludeObject(IShellView *ppshv, LPCITEMIDLIST pidl) | IShellBrowserImpl | [inline, virtual]
InsertMenusSB(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) | IShellBrowserImpl | [inline, virtual]
IShellBrowserImpl() | IShellBrowserImpl | [inline]
OnDefaultCommand(IShellView *ppshv) | IShellBrowserImpl | [virtual]
OnDefaultCommand(LPIDA pida) | IShellBrowserImpl | [inline, protected, virtual]
OnStateChange(IShellView *ppshv, ULONG uChange) | IShellBrowserImpl | [inline, virtual]
OnViewWindowActive(IShellView *ppshv) | IShellBrowserImpl | [inline, virtual]
QueryInterface(REFIID iid, void **ppvObject) | IShellBrowserImpl | [virtual]
QueryService(REFGUID guidService, REFIID riid, void **ppvObject) | IShellBrowserImpl | [virtual]
QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) | IShellBrowserImpl | [virtual]
Release() | IShellBrowserImpl | [inline, virtual]
RemoveMenusSB(HMENU hmenuShared) | IShellBrowserImpl | [inline, virtual]
SetMenuSB(HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject) | IShellBrowserImpl | [inline, virtual]
SetStatusTextSB(LPCOLESTR lpszStatusText) | IShellBrowserImpl | [inline, virtual]
SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) | IShellBrowserImpl | [inline, virtual]
TranslateAcceleratorSB(LPMSG lpmsg, WORD wID) | IShellBrowserImpl | [inline, virtual]
~IShellBrowserImpl() | IShellBrowserImpl | [inline, virtual]


ROS Explorer: IShellFolderViewCB Class Reference

IShellFolderViewCB Class Reference

Inheritance diagram for IShellFolderViewCB:

[legend]
The documentation for this class was generated from the following file:
  • shellclasses.h


ROS Explorer: istream Class Reference

istream Class Reference

Inheritance diagram for istream:

[legend]
The documentation for this class was generated from the following file:
  • xmlstorage.h


ROS Explorer: IUnknown Class Reference

IUnknown Class Reference

Inheritance diagram for IUnknown:

[legend]
The documentation for this class was generated from the following file:
  • shellclasses.h


ROS Explorer: Kette Struct Reference

Kette Struct Reference

#include <fatfs.h>

Collaboration diagram for Kette:

[legend]
List of all members.

Public Attributes

Kette * Vorw
Kette * Rueck
DEntry * Ent

Detailed Description

Definition at line 206 of file fatfs.h.

Member Data Documentation

union DEntry* Kette::Ent

Definition at line 209 of file fatfs.h.

struct Kette* Kette::Rueck

Definition at line 208 of file fatfs.h.

struct Kette* Kette::Vorw

Definition at line 207 of file fatfs.h.

The documentation for this struct was generated from the following file:
  • fatfs.h


ROS Explorer: Member List

Kette Member List

This is the complete list of members for Kette, including all inherited members.

Ent | Kette
Rueck | Kette
Vorw | Kette


ROS Explorer: list Class Reference

list Class Reference

Inheritance diagram for list:

[legend]
The documentation for this class was generated from the following file:
  • favorites.h


ROS Explorer: list Class Reference

list Class Reference

Inheritance diagram for list:

[legend]
The documentation for this class was generated from the following files:
  • xmlstorage.h
  • window.h


ROS Explorer: ListSort Struct Reference

ListSort Struct Reference

sorting of list controls More...

#include <window.h>

Inheritance diagram for ListSort:

[legend]
Collaboration diagram for ListSort:

[legend]
List of all members.

Public Member Functions

ListSort (HWND hwndListview, PFNLVCOMPARE compare_fct)
void | toggle_sort (int idx)
void | sort ()

Public Attributes

int | _sort_crit
bool | _direction

Static Protected Member Functions

static int CALLBACK | CompareFunc (LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort)

Protected Attributes

PFNLVCOMPARE | _compare_fct

Detailed Description

sorting of list controls

Definition at line 950 of file window.h.

Constructor & Destructor Documentation

ListSort::ListSort | ( | HWND | hwndListview,
 |  | PFNLVCOMPARE | compare_fct
 | ) |

Definition at line 1261 of file window.cpp.

References _direction, and _sort_crit.

01262  :      WindowHandle(hwndListview),
01263         _compare_fct(compare_fct)
01264 {
01265         _sort_crit = 0;
01266         _direction = false;
01267 }

Member Function Documentation

static int CALLBACK ListSort::CompareFunc | ( | LPARAM | lparam1,
 |  | LPARAM | lparam2,
 |  | LPARAM | lparamSort
 | ) | [static, protected]

void ListSort::sort ( )

Definition at line 1279 of file window.cpp.

References _compare_fct, WindowHandle::_hwnd, ListView_FindItemPara(), and ListView_GetItemData().

01280 {
01281         int idx = ListView_GetSelectionMark(_hwnd);
01282         LPARAM param = ListView_GetItemData(_hwnd, idx);
01283
01284         ListView_SortItems(_hwnd, _compare_fct, (LPARAM)this);
01285
01286         if (idx >= 0) {
01287                 idx = ListView_FindItemPara(_hwnd, param);
01288                 ListView_EnsureVisible(_hwnd, idx, FALSE);
01289         }
01290 }

Here is the call graph for this function:

void ListSort::toggle_sort ( int idx )

Definition at line 1269 of file window.cpp.

References _direction, and _sort_crit.

01270 {
01271         if (_sort_crit == idx)
01272                 _direction = !_direction;
01273         else {
01274                 _sort_crit = idx;
01275                 _direction = false;
01276         }
01277 }

Member Data Documentation

PFNLVCOMPARE ListSort::_compare_fct [protected]

Definition at line 961 of file window.h.

Referenced by sort().

bool ListSort::_direction

Definition at line 958 of file window.h.

Referenced by FindProgramDlg::CompareFunc(), ListSort(), and toggle_sort().

int ListSort::_sort_crit

Definition at line 957 of file window.h.

Referenced by FindProgramDlg::CompareFunc(), ListSort(), and toggle_sort().

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

ListSort Member List

This is the complete list of members for ListSort, including all inherited members.

_compare_fct | ListSort | [protected]
_direction | ListSort |
_hwnd | WindowHandle | [protected]
_sort_crit | ListSort |
CompareFunc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort) | ListSort | [protected, static]
ListSort(HWND hwndListview, PFNLVCOMPARE compare_fct) | ListSort |
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
sort() | ListSort |
toggle_sort(int idx) | ListSort |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]


ROS Explorer: Lock Struct Reference

Lock Struct Reference

Lock protects a code section utilizing a critical section. More...

#include <utility.h>

Collaboration diagram for Lock:

[legend]
List of all members.

Public Member Functions

Lock (CritSect &crit_sect)
~Lock ()

Protected Attributes

CritSect & _crit_sect

Detailed Description

Lock protects a code section utilizing a critical section.

Definition at line 321 of file utility.h.

Constructor & Destructor Documentation

Lock::Lock ( CritSect & crit_sect ) [inline]

Definition at line 323 of file utility.h.

00324          :      _crit_sect(crit_sect)
00325         {
00326                 EnterCriticalSection(&crit_sect);
00327         }

Lock::~Lock ( ) [inline]

Definition at line 329 of file utility.h.

00330         {
00331                 LeaveCriticalSection(&_crit_sect);
00332         }

Member Data Documentation

CritSect& Lock::_crit_sect [protected]

Definition at line 335 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

Lock Member List

This is the complete list of members for Lock, including all inherited members.

_crit_sect | Lock | [protected]
Lock(CritSect &crit_sect) | Lock | [inline]
~Lock() | Lock | [inline]


ROS Explorer: MainFrameBase Struct Reference

MainFrameBase Struct Reference

Explorer frame window base class. More...

#include <mainframe.h>

Inheritance diagram for MainFrameBase:

[legend]
Collaboration diagram for MainFrameBase:

[legend]
List of all members.

Public Types

typedef PreTranslateWindow | super

Public Member Functions

MainFrameBase (HWND hwnd)
~MainFrameBase ()

Static Public Member Functions

static HWND | Create (const ExplorerCmd &cmd)
static int | OpenShellFolders (LPIDA pida, HWND hFrameWnd)

Public Attributes

WindowHandle _hwndrebar
WindowHandle _htoolbar
WindowHandle _hstatusbar
WindowHandle _haddressedit
WindowHandle _hcommandedit
WindowHandle _hsidebar
HIMAGELIST | _himl
HMENU | _hMenuFrame
HMENU | _hMenuWindow
MenuInfo _menu_info

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
bool | ProcessMessage (UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT *pres)
int | Command (int id, int code)
int | Notify (int id, NMHDR *pnmh)
virtual BOOL | TranslateMsg (MSG *pmsg)
void | toggle_child (HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1)
void | resize_frame_client ()
virtual void | resize_frame (int cx, int cy)
virtual void | frame_get_clientspace (PRECT prect)
BOOL | toggle_fullscreen ()
void | fullscreen_move ()
void | FillBookmarks ()
virtual bool | go_to (LPCTSTR url, bool new_window)
void | ExecuteCommandbar (LPCTSTR dir)

Protected Attributes

FullScreenParameters _fullscreen
HACCEL | _hAccel
HIMAGELIST | _himl_old

Detailed Description

Explorer frame window base class.

Definition at line 41 of file mainframe.h.

Member Typedef Documentation

typedef PreTranslateWindow MainFrameBase::super

Reimplemented from PreTranslateWindow.

Reimplemented in MDIMainFrame, SDIMainFrame, ShellBrowserChildT< MainFrameBase >, and ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >.

Definition at line 43 of file mainframe.h.

Constructor & Destructor Documentation

MainFrameBase::MainFrameBase ( HWND hwnd )

Definition at line 151 of file mainframe.cpp.

References _hAccel, _haddressedit, _hcommandedit, _himl, _himl_old, ExplorerGlobals::_hInstance, _hMenuFrame, MenuInfo::_hMenuView, _hMenuWindow, _hsidebar, _hstatusbar, _htoolbar, WindowHandle::_hwnd, _hwndrebar, _menu_info, g_Globals, ID_GO_BACK, ID_GO_FORWARD, ID_GO_HOME, ID_GO_SEARCH, ID_GO_UP, ID_REFRESH, ID_STOP, ID_VIEW_SIDE_BAR, ID_VIEW_STATUSBAR, ID_VIEW_TOOL_BAR, IDA_EXPLORER, IDB_TOOLBAR, IDW_ADDRESSBAR, IDW_COMMANDBAR, IDW_SIDEBAR, IDW_STATUSBAR, IDW_TOOLBAR, and RBBS_HIDETITLE.

00152  :      super(hwnd)
00153 {
00154         _himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0);
00155
00156         _hMenuFrame = GetMenu(hwnd);
00157         _hMenuWindow = GetSubMenu(_hMenuFrame, GetMenuItemCount(_hMenuFrame)-3);
00158
00159         _menu_info._hMenuView = GetSubMenu(_hMenuFrame, 1);
00160
00161         _hAccel = LoadAccelerators(g_Globals._hInstance, MAKEINTRESOURCE(IDA_EXPLORER));
00162
00163
00164         TBBUTTON toolbarBtns[] = {
00165 #ifdef _NO_REBAR
00166                 {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
00167 #endif
00168                 {7, ID_GO_BACK, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00169                 {8, ID_GO_FORWARD, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00170                 {9, ID_GO_UP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00171                 {10, ID_GO_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00172                 {11, ID_GO_SEARCH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00173                 {12, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00174                 {13, ID_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}
00175         };
00176
00177         _htoolbar = CreateToolbarEx(hwnd,
00178 #ifndef _NO_REBAR
00179                 CCS_NOPARENTALIGN|CCS_NORESIZE|
00180 #endif
00181                 WS_CHILD|WS_VISIBLE, IDW_TOOLBAR, 2, g_Globals._hInstance, IDB_TOOLBAR,
00182                 toolbarBtns, sizeof(toolbarBtns)/sizeof(TBBUTTON),
00183                 16, 15, 16, 15, sizeof(TBBUTTON));
00184
00185         CheckMenuItem(_menu_info._hMenuView, ID_VIEW_TOOL_BAR, MF_BYCOMMAND|MF_CHECKED);
00186
00187
00188          // address & command bar
00189         WindowCanvas canvas(hwnd);
00190         RECT rect = {0, 0, 0, 0};
00191         DrawText(canvas, TEXT("My"), -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
00192         HFONT hfont = GetStockFont(DEFAULT_GUI_FONT);
00193
00194         _haddressedit = CreateWindow(TEXT("EDIT"), NULL, WS_CHILD|WS_VISIBLE, 0, 0, 0, rect.bottom,
00195                                                         hwnd, (HMENU)IDW_ADDRESSBAR, g_Globals._hInstance, 0);
00196         SetWindowFont(_haddressedit, hfont, FALSE);
00197         new EditController(_haddressedit);
00198
00199         _hcommandedit = CreateWindow(TEXT("EDIT"), TEXT("> "), WS_CHILD|WS_VISIBLE, 0, 0, 0, rect.bottom,
00200                                                         hwnd, (HMENU)IDW_COMMANDBAR, g_Globals._hInstance, 0);
00201         SetWindowFont(_hcommandedit, hfont, FALSE);
00202         new EditController(_hcommandedit);
00203
00204         /* CreateStatusWindow does not accept WS_BORDER
00205                 _hstatusbar = CreateWindowEx(WS_EX_NOPARENTNOTIFY, STATUSCLASSNAME, 0,
00206                                                 WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_BORDER|CCS_NODIVIDER, 0,0,0,0,
00207                                                 hwnd, (HMENU)IDW_STATUSBAR, g_Globals._hInstance, 0);*/
00208
00209         _hstatusbar = CreateStatusWindow(WS_CHILD|WS_VISIBLE, 0, hwnd, IDW_STATUSBAR);
00210         CheckMenuItem(_menu_info._hMenuView, ID_VIEW_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
00211
00212         _hsidebar = CreateWindowEx(WS_EX_STATICEDGE, WC_TREEVIEW, TEXT("Sidebar"),
00213                                         WS_CHILD|WS_TABSTOP|WS_BORDER|/*WS_VISIBLE|*/WS_CHILD|TVS_HASLINES|TVS_HASBUTTONS|TVS_SHOWSELALWAYS|TVS_INFOTIP,
00214                                         -1, -1, 200, 0, _hwnd, (HMENU)IDW_SIDEBAR, g_Globals._hInstance, 0);
00215
00216         _himl_old = TreeView_SetImageList(_hsidebar, _himl, TVSIL_NORMAL);
00217
00218         CheckMenuItem(_menu_info._hMenuView, ID_VIEW_SIDE_BAR, MF_BYCOMMAND|MF_UNCHECKED/*MF_CHECKED*/);
00219
00220
00221          // create rebar window to manage toolbar and drivebar
00222 #ifndef _NO_REBAR
00223         _hwndrebar = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL,
00224                                         WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
00225                                         RBS_VARHEIGHT|RBS_AUTOSIZE|RBS_DBLCLKTOGGLE|
00226                                         CCS_NODIVIDER|CCS_NOPARENTALIGN,
00227                                         0, 0, 0, 0, _hwnd, 0, g_Globals._hInstance, 0);
00228
00229         int btn_hgt = HIWORD(SendMessage(_htoolbar, TB_GETBUTTONSIZE, 0, 0));
00230
00231         REBARBANDINFO rbBand;
00232
00233         rbBand.cbSize = sizeof(REBARBANDINFO);
00234         rbBand.fMask  = RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE;
00235 #ifndef RBBS_HIDETITLE // missing in MinGW headers as of 25.02.2004
00236 #define RBBS_HIDETITLE  0x400
00237 #endif
00238         rbBand.fStyle = RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE;
00239
00240         rbBand.cxMinChild = 0;
00241         rbBand.cyMinChild = 0;
00242         rbBand.cyChild = 0;
00243         rbBand.cyMaxChild = 0;
00244         rbBand.cyIntegral = btn_hgt;
00245
00246         rbBand.lpText = NULL;//TEXT("Toolbar");
00247         rbBand.hwndChild = _htoolbar;
00248         rbBand.cxMinChild = 0;
00249         rbBand.cyMinChild = btn_hgt + 4;
00250         rbBand.cx = 284;
00251         SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
00252 #endif
00253 }

MainFrameBase::~MainFrameBase ( )

Definition at line 256 of file mainframe.cpp.

References ExplorerGlobals::_desktop_mode, _himl, _himl_old, ExplorerGlobals::_hMainWnd, _hsidebar, WindowHandle::_hwnd, and g_Globals.

00257 {
00258         (void)TreeView_SetImageList(_hsidebar, _himl_old, TVSIL_NORMAL);
00259         ImageList_Destroy(_himl);
00260
00261          // don't exit desktop when closing file manager window
00262         if (!g_Globals._desktop_mode)
00263                 if (g_Globals._hMainWnd == _hwnd)       // don't quit when switching between MDI and SDI mode
00264                         PostQuitMessage(0);
00265 }

Member Function Documentation

int MainFrameBase::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Window.

Reimplemented in MDIMainFrame, and SDIMainFrame.

Definition at line 350 of file mainframe.cpp.

References _haddressedit, ExplorerGlobals::_hInstance, MenuInfo::_hMenuView, _hsidebar, _hstatusbar, _htoolbar, WindowHandle::_hwnd, _menu_info, BUFFER_LEN, CONTEXT, display_error(), Dialog::DoModal(), ExecuteCommandbar(), explorer_about(), FillBookmarks(), g_Globals, go_to(), ID_ABOUT_EXPLORER, ID_ABOUT_WINDOWS, ID_EXECUTE, ID_EXPLORER_FAQ, ID_HELP, ID_TOOLS_OPTIONS, ID_VIEW_FULLSCREEN, ID_VIEW_SIDE_BAR, ID_VIEW_STATUSBAR, ID_VIEW_TOOL_BAR, IDD_EXECUTE, IDD_MDI_SDI, IDS_TITLE, IDW_ADDRESSBAR, IDW_COMMANDBAR, launch_file(), toggle_child(), toggle_fullscreen(), WINDOW_CREATOR, and ExecuteDialog::WndProc().

Referenced by SDIMainFrame::Command().

00351 {
00352         CONTEXT("MainFrameBase::Command()");
00353
00354         switch(id) {
00355           case ID_FILE_EXIT:
00356                 SendMessage(_hwnd, WM_CLOSE, 0, 0);
00357                 break;
00358
00359           case ID_VIEW_TOOL_BAR:
00360                 toggle_child(_hwnd, id, _htoolbar, 0);
00361                 break;
00362
00363           case ID_VIEW_STATUSBAR:
00364                 toggle_child(_hwnd, id, _hstatusbar);
00365                 break;
00366
00367           case ID_VIEW_SIDE_BAR:
00368                  // lazy initialization
00369                 if (!TreeView_GetCount(_hsidebar))
00370                         FillBookmarks();
00371
00372                 toggle_child(_hwnd, id, _hsidebar);
00373                 break;
00374
00375           case ID_EXECUTE: {
00376                 ExecuteDialog dlg = {{0}, 0};
00377
00378                 if (DialogBoxParam(g_Globals._hInstance, MAKEINTRESOURCE(IDD_EXECUTE), _hwnd, ExecuteDialog::WndProc, (LPARAM)&dlg) == IDOK) {
00379                         CONTEXT("ID_EXECUTE - ShellExecute()");
00380
00381                         HINSTANCE hinst = ShellExecute(_hwnd, NULL/*operation*/, dlg.cmd/*file*/, NULL/*parameters*/, NULL/*dir*/, dlg.cmdshow);
00382
00383                         if ((int)hinst <= 32)
00384                                 display_error(_hwnd, GetLastError());
00385                 }
00386                 break;}
00387
00388           case ID_HELP:
00389                 WinHelp(_hwnd, TEXT("explorer")/*file explorer.hlp*/, HELP_INDEX, 0);
00390                 break;
00391
00392           case ID_VIEW_FULLSCREEN:
00393                 CheckMenuItem(_menu_info._hMenuView, id, toggle_fullscreen()?MF_CHECKED:0);
00394                 break;
00395
00396           case ID_TOOLS_OPTIONS:
00397                 Dialog::DoModal(IDD_MDI_SDI, WINDOW_CREATOR(MdiSdiDlg), _hwnd);
00398                 break;
00399
00400           case ID_ABOUT_WINDOWS:
00401                 ShellAbout(_hwnd, ResString(IDS_TITLE), NULL, 0);
00402                 break;
00403
00404           case ID_ABOUT_EXPLORER:
00405                 explorer_about(_hwnd);
00406                 break;
00407
00408           case ID_EXPLORER_FAQ:
00409                 launch_file(_hwnd, TEXT("http://www.sky.franken.de/explorer/"), SW_SHOW);
00410                 break;
00411
00412           case IDW_ADDRESSBAR:
00413                 if (code == 1) {
00414                         TCHAR url[BUFFER_LEN];
00415
00416                         if (GetWindowText(_haddressedit, url, BUFFER_LEN))
00417                                 go_to(url, false);
00418                 }
00419                 break;
00420
00421           case IDW_COMMANDBAR:
00422                 if (code == 1)
00423                         ExecuteCommandbar(NULL);
00424                 break;
00425
00426           default:
00427                 return 1;       // no command handlers in Window::Command()
00428         }
00429
00430         return 0;
00431 }

Here is the call graph for this function:

HWND MainFrameBase::Create ( const ExplorerCmd & cmd ) [static]

Definition at line 41 of file mainframe.cpp.

References ExplorerCmd::_cmdShow, ExplorerCmd::_flags, ExplorerGlobals::_hMainWnd, ExplorerCmd::_mdi, ExplorerCmd::_path, SDIMainFrame::Create(), MDIMainFrame::Create(), g_Globals, HWND, ExplorerCmd::IsValidPath(), OWM_DETAILS, OWM_EXPLORE, and PM_OPEN_WINDOW.

Referenced by SDIMainFrame::Command(), explorer_show_frame(), and MDIShellBrowserChild::WndProc().

00042 {
00043         HWND hFrame;
00044
00045 #ifndef _NO_MDI
00046         if (cmd._mdi)
00047                 hFrame = MDIMainFrame::Create();
00048         else
00049 #endif
00050                 hFrame = SDIMainFrame::Create();
00051
00052         if (hFrame) {
00053                 HWND hwndOld = g_Globals._hMainWnd;
00054
00055                 g_Globals._hMainWnd = hFrame;
00056
00057                 if (hwndOld)
00058                         DestroyWindow(hwndOld);
00059
00060                 ShowWindow(hFrame, cmd._cmdShow);
00061                 UpdateWindow(hFrame);
00062
00063                  // Open the first child window after initializing the application
00064                 if (cmd.IsValidPath()) {
00065                          // We use the static s_path variable to store the path string in order
00066                          // to avoid accessing prematurely freed memory in the PostMessage handlers.
00067                         static String s_path = cmd._path;
00068
00069                         PostMessage(hFrame, PM_OPEN_WINDOW, cmd._flags, (LPARAM)(LPCTSTR)s_path);
00070                 } else
00071                         PostMessage(hFrame, PM_OPEN_WINDOW, OWM_EXPLORE|OWM_DETAILS, 0);
00072         }
00073
00074         return hFrame;
00075 }

Here is the call graph for this function:

void MainFrameBase::ExecuteCommandbar ( LPCTSTR dir ) [protected]

Todo:
use SHGetFileInfo() with SHGFI_EXETYPE flag to determine EXE type and open console window

Definition at line 434 of file mainframe.cpp.

References _hcommandedit, WindowHandle::_hwnd, BUFFER_LEN, CONTEXT, and display_error().

Referenced by SDIMainFrame::Command(), and Command().

00435 {
00436         TCHAR cmd[BUFFER_LEN];
00437
00438         if (GetWindowText(_hcommandedit, cmd, BUFFER_LEN)) {
00439                 CONTEXT("ExecuteCommandbar - ShellExecute()");
00440
00441                  // remove command prompt from 'cmd' string
00442                 LPCTSTR p = cmd;
00443
00444                 if (*p == '>')
00445                         ++p;
00446
00447                 while(*p == ' ')
00448                         ++p;
00449
00450                 if (dir) {
00451                          // remove "file://" from directory URL
00452                         if (!_tcsnicmp(dir, TEXT("file://"), 7))
00453                                 dir += 7;
00454                 }
00455
00457
00458                 HINSTANCE hinst = ShellExecute(_hwnd, NULL, p, NULL, dir, SW_SHOWNORMAL);
00459
00460                 if ((int)hinst <= 32)
00461                         display_error(_hwnd, GetLastError());
00462         }
00463 }

Here is the call graph for this function:

void MainFrameBase::FillBookmarks ( ) [protected]

Definition at line 666 of file mainframe.cpp.

References ExplorerGlobals::_favorites, _himl, _hsidebar, WindowHandle::_hwnd, ExplorerGlobals::_icon_cache, Icon::add_to_imagelist(), BookmarkList::fill_tree(), g_Globals, IconCache::get_icon(), ICID_BOOKMARK, ICID_FAVORITES, ICID_FOLDER, IDI_DOT, IDS_FAVORITES, ImageList_AddAlphaIcon(), and String::str().

Referenced by Command().

00667 {
00668         HiddenWindow hide(_hsidebar);
00669         WindowCanvas canvas(_hwnd);
00670
00671         TreeView_DeleteAllItems(_hsidebar);
00672
00673         g_Globals._icon_cache.get_icon(ICID_FAVORITES).add_to_imagelist(_himl, canvas);
00674         g_Globals._icon_cache.get_icon(ICID_BOOKMARK).add_to_imagelist(_himl, canvas);
00675         ImageList_AddAlphaIcon(_himl, SmallIcon(IDI_DOT), GetStockBrush(WHITE_BRUSH), canvas);
00676         g_Globals._icon_cache.get_icon(ICID_FOLDER).add_to_imagelist(_himl, canvas);
00677         g_Globals._icon_cache.get_icon(ICID_FOLDER).add_to_imagelist(_himl, canvas);
00678
00679         TV_INSERTSTRUCT tvi;
00680
00681         tvi.hParent = TVI_ROOT;
00682         tvi.hInsertAfter = TVI_LAST;
00683         tvi.item.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
00684         ResString sFavorites(IDS_FAVORITES);
00685         tvi.item.pszText = sFavorites.str();
00686         tvi.item.iSelectedImage = tvi.item.iImage = 0;
00687
00688         HTREEITEM hitem_bookmarks = TreeView_InsertItem(_hsidebar, &tvi);
00689
00690         g_Globals._favorites.fill_tree(_hsidebar, hitem_bookmarks, _himl, canvas);
00691
00692         TreeView_Expand(_hsidebar, hitem_bookmarks, TVE_EXPAND);
00693 }

Here is the call graph for this function:

void MainFrameBase::frame_get_clientspace ( PRECT prect ) [protected, virtual]

Reimplemented in MDIMainFrame.

Definition at line 573 of file mainframe.cpp.

References _hstatusbar, _htoolbar, and WindowHandle::_hwnd.

Referenced by MDIMainFrame::frame_get_clientspace(), and ProcessMessage().

00574 {
00575         if (!IsIconic(_hwnd))
00576                 GetClientRect(_hwnd, prect);
00577         else {
00578                 WINDOWPLACEMENT wp;
00579
00580                 GetWindowPlacement(_hwnd, &wp);
00581
00582                 prect->left = prect->top = 0;
00583                 prect->right = wp.rcNormalPosition.right-wp.rcNormalPosition.left-
00584                                                 2*(GetSystemMetrics(SM_CXSIZEFRAME)+GetSystemMetrics(SM_CXEDGE));
00585                 prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top-
00586                                                 2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))-
00587                                                 GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE);
00588         }
00589
00590         if (IsWindowVisible(_htoolbar)) {
00591                 ClientRect rt(_htoolbar);
00592                 prect->top += rt.bottom+2;
00593         }
00594
00595         if (IsWindowVisible(_hstatusbar)) {
00596                 ClientRect rt(_hstatusbar);
00597                 prect->bottom -= rt.bottom;
00598         }
00599 }

void MainFrameBase::fullscreen_move ( ) [protected]

Definition at line 631 of file mainframe.cpp.

References WindowHandle::_hwnd, ClientToScreen(), and Frame_CalcFrameClient.

Referenced by toggle_child().

00632 {
00633         RECT rt, pos;
00634         GetWindowRect(_hwnd, &pos);
00635
00636         Frame_CalcFrameClient(_hwnd, &rt);
00637         ClientToScreen(_hwnd, (LPPOINT)&rt.left);
00638         ClientToScreen(_hwnd, (LPPOINT)&rt.right);
00639
00640         rt.left = pos.left-rt.left;
00641         rt.top = pos.top-rt.top;
00642         rt.right = GetSystemMetrics(SM_CXSCREEN)+pos.right-rt.right;
00643         rt.bottom = GetSystemMetrics(SM_CYSCREEN)+pos.bottom-rt.bottom;
00644
00645         MoveWindow(_hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
00646 }

Here is the call graph for this function:

bool MainFrameBase::go_to | ( | LPCTSTR | url,
 |  | bool | new_window
 | ) | [protected, virtual]

Todo:
SDI implementation

Reimplemented in MDIMainFrame.

Definition at line 696 of file mainframe.cpp.

Referenced by Command(), MDIMainFrame::go_to(), and Notify().

00697 {
00699
00700         return false;
00701 }

int MainFrameBase::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from Window.

Reimplemented in ShellBrowserChildT< MainFrameBase >.

Definition at line 466 of file mainframe.cpp.

References Bookmark::_description, BookmarkFolder::_description, _hsidebar, BookmarkNode::_pbookmark, BookmarkNode::_pfolder, BookmarkNode::_type, Bookmark::_url, BookmarkNode::BMNT_BOOKMARK, BookmarkNode::BMNT_FOLDER, go_to(), resize_frame_client(), and TreeView_GetItemData().

00467 {
00468         switch(pnmh->code) {
00469                  // resize children windows when the rebar size changes
00470           case RBN_AUTOSIZE:
00471                 resize_frame_client();
00472                 break;
00473
00474           case TVN_GETINFOTIP: {
00475                 NMTVGETINFOTIP* pnmgit = (NMTVGETINFOTIP*)pnmh;
00476
00477                 if (pnmgit->lParam) {
00478                         const BookmarkNode& node = *(BookmarkNode*)pnmgit->lParam;
00479
00480                         if (node._type == BookmarkNode::BMNT_FOLDER) {
00481                                  // display tooltips for bookmark folders
00482                                 if (!node._pfolder->_description.empty())
00483                                         lstrcpyn(pnmgit->pszText, node._pfolder->_description.c_str(), pnmgit->cchTextMax);
00484                         } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
00485                                  // display tooltips for bookmark folders
00486                                 String txt = node._pbookmark->_description;
00487
00488                                 if (!node._pbookmark->_url.empty()) {
00489                                         if (!txt.empty())
00490                                                 txt += TEXT("  -  ");
00491
00492                                         txt += node._pbookmark->_url;
00493                                 }
00494
00495                                 lstrcpyn(pnmgit->pszText, txt.c_str(), pnmgit->cchTextMax);
00496                         }
00497                 }
00498                 break;}
00499
00500           case NM_DBLCLK: {
00501                 HTREEITEM hitem = TreeView_GetSelection(_hsidebar);
00502                 LPARAM lparam = TreeView_GetItemData(_hsidebar, hitem);
00503
00504                 if (lparam) {
00505                         const BookmarkNode& node = *(BookmarkNode*)lparam;
00506
00507                         if (node._type == BookmarkNode::BMNT_BOOKMARK) {
00508                                 bool new_window = GetAsyncKeyState(VK_SHIFT)<0;
00509
00510                                 go_to(node._pbookmark->_url, new_window);
00511                         }
00512                 }
00513                 break;}
00514         }
00515
00516         return 0;
00517 }

Here is the call graph for this function:

int MainFrameBase::OpenShellFolders | ( | LPIDA | pida,
 |  | HWND | hFrameWnd
 | ) | [static]

Definition at line 78 of file mainframe.cpp.

References ExplorerGlobals::_hMainWnd, SDIMainFrame::Create(), MDIMainFrame::Create(), g_Globals, ExplorerGlobals::get_cfg(), HandleException(), HWND, LOG, OWM_PIDL, OWM_SEPARATE, and PM_OPEN_WINDOW.

Referenced by ShellBrowser::OnDefaultCommand(), and DesktopWindow::OnDefaultCommand().

00079 {
00080         int cnt = 0;
00081
00082         LPCITEMIDLIST parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
00083         ShellFolder folder(parent_pidl);
00084         LOG(FmtString(TEXT("MainFrameBase::OpenShellFolders(): parent_pidl=%s"), (LPCTSTR)FileSysShellPath(parent_pidl)));
00085
00086         for(int i=pida->cidl; i>0; --i) {
00087                 LPCITEMIDLIST pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i]);
00088
00089                 SFGAOF attribs = SFGAO_FOLDER;
00090                 HRESULT hr = folder->GetAttributesOf(1, &pidl, &attribs);
00091
00092                 if (SUCCEEDED(hr))
00093                         if (attribs & SFGAO_FOLDER) {
00094                                 try {
00095                                         XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
00096
00097                                         bool mdi = XMLBool(explorer_options, "mdi", true);
00098                                         bool separateFolders = XMLBool(explorer_options, "separate-folders", true);
00099
00100                                         ShellPath pidl_abs = ShellPath(pidl).create_absolute_pidl(parent_pidl);
00101                                         LOG(FmtString(TEXT("MainFrameBase::OpenShellFolders(): pidl_abs=%s"), (LPCTSTR)FileSysShellPath(pidl_abs)));
00102
00103                                         if (hFrameWnd && (mdi || !separateFolders)) {
00104                                                 int flags = OWM_PIDL;
00105
00106                                                 if (separateFolders)
00107                                                         flags |= OWM_SEPARATE;
00108
00109                                                 if (SendMessage(hFrameWnd, PM_OPEN_WINDOW, flags, (LPARAM)(LPCITEMIDLIST)pidl_abs))
00110                                                         ++cnt;
00111                                         } else {
00112                                                 HWND hwnd;
00113 #ifndef _NO_MDI
00114                                                 if (mdi)
00115                                                         hwnd = MDIMainFrame::Create(pidl_abs, 0);
00116                                                 else
00117 #endif
00118                                                         hwnd = SDIMainFrame::Create(pidl_abs, 0);
00119
00120                                                 if (hwnd)
00121                                                         ++cnt;
00122                                         }
00123                                 } catch(COMException& e) {
00124                                         HandleException(e, g_Globals._hMainWnd);
00125                                 }
00126                         }/*TEST
00127                         else { // !(attribs & SFGAO_FOLDER))
00128                                 SHELLEXECUTEINFOA shexinfo;
00129
00130                                 shexinfo.cbSize = sizeof(SHELLEXECUTEINFOA);
00131                                 shexinfo.fMask = SEE_MASK_INVOKEIDLIST;
00132                                 shexinfo.hwnd = NULL;
00133                                 shexinfo.lpVerb = NULL;
00134                                 shexinfo.lpFile = NULL;
00135                                 shexinfo.lpParameters = NULL;
00136                                 shexinfo.lpDirectory = NULL;
00137                                 shexinfo.nShow = SW_NORMAL;
00138                                 shexinfo.lpIDList = ILCombine(parent_pidl, pidl);
00139
00140                                 if (ShellExecuteExA(&shexinfo))
00141                                         ++cnt;
00142
00143                                 ILFree((LPITEMIDLIST)shexinfo.lpIDList);
00144                         }*/
00145         }
00146
00147         return cnt;
00148 }

Here is the call graph for this function:

bool MainFrameBase::ProcessMessage | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam,
 |  | LRESULT * | pres
 | ) | [protected]

Definition at line 278 of file mainframe.cpp.

References _haddressedit, ExplorerGlobals::_hMainWnd, _hstatusbar, WindowHandle::_hwnd, _menu_info, frame_get_clientspace(), g_Globals, HWND, PM_FRM_CALC_CLIENT, PM_FRM_GET_MENUINFO, PM_SETSTATUSTEXT, PM_URL_CHANGED, resize_frame(), resize_frame_client(), and TranslateMsg().

Referenced by MDIMainFrame::WndProc(), and WndProc().

00279 {
00280         switch(nmsg) {
00281           case PM_TRANSLATE_MSG:
00282                 *pres = TranslateMsg((MSG*)lparam);
00283                 return true;
00284
00285           case WM_SHOWWINDOW:
00286                 if (wparam)     // trigger child resizing after window creation - now we can succesfully call IsWindowVisible()
00287                         resize_frame_client();
00288                 return false; // goto def;
00289
00290           case WM_CLOSE:
00291                 DestroyWindow(_hwnd);
00292                 g_Globals._hMainWnd = 0;
00293                 break;
00294
00295           case WM_DESTROY:
00296                 break;
00297
00298           case WM_SIZE:
00299                 resize_frame(LOWORD(lparam), HIWORD(lparam));
00300                 break;  // do not pass message to DefFrameProc
00301
00302           case WM_GETMINMAXINFO: {
00303                 LPMINMAXINFO lpmmi = (LPMINMAXINFO)lparam;
00304
00305                 lpmmi->ptMaxTrackSize.x <<= 1;/*2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN */
00306                 lpmmi->ptMaxTrackSize.y <<= 1;/*2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN */
00307                 break;}
00308
00309           case PM_FRM_CALC_CLIENT:
00310                 frame_get_clientspace((PRECT)lparam);
00311                 *pres = TRUE;
00312                 return true;
00313
00314           case PM_FRM_GET_MENUINFO:
00315                 *pres = (LPARAM)&_menu_info;
00316                 return true;
00317
00318           case PM_GET_CONTROLWINDOW:
00319                 if (wparam == FCW_STATUS) {
00320                         *pres = (LRESULT)(HWND)_hstatusbar;
00321                         return true;
00322                 }
00323                 break;
00324
00325           case PM_SETSTATUSTEXT:
00326                 SendMessage(_hstatusbar, SB_SETTEXT, 0, lparam);
00327                 break;
00328
00329           case PM_URL_CHANGED:
00330                 SetWindowText(_haddressedit, (LPCTSTR)lparam);
00331                 break;
00332
00333           default:
00334                 return false;
00335         }
00336
00337         *pres = 0;
00338         return true;
00339 }

Here is the call graph for this function:

void MainFrameBase::resize_frame | ( | int | cx,
 |  | int | cy
 | ) | [protected, virtual]

Todo:
use split bar

Reimplemented in MDIMainFrame, and SDIMainFrame.

Definition at line 520 of file mainframe.cpp.

References _haddressedit, _hcommandedit, _hsidebar, _hstatusbar, _htoolbar, and _hwndrebar.

Referenced by ProcessMessage(), and resize_frame_client().

00521 {
00522         if (cy <= 0)
00523                 return; // avoid resizing children when receiving RBN_AUTOSIZE while getting minimized
00524
00525         RECT rect = {0, 0, cx, cy};
00526
00527         if (_hwndrebar) {
00528                 int height = ClientRect(_hwndrebar).bottom;
00529                 MoveWindow(_hwndrebar, rect.left, rect.top, rect.right-rect.left, height, TRUE);
00530                 rect.top += height;
00531         } else {
00532                 if (IsWindowVisible(_htoolbar)) {
00533                         SendMessage(_htoolbar, WM_SIZE, 0, 0);
00534                         WindowRect rt(_htoolbar);
00535                         rect.top = rt.bottom;
00536                 //      rect.bottom -= rt.bottom;
00537                 }
00538         }
00539
00540         if (IsWindowVisible(_hstatusbar)) {
00541                 int parts[] = {300, 500};
00542
00543                 SendMessage(_hstatusbar, WM_SIZE, 0, 0);
00544                 SendMessage(_hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
00545                 ClientRect rt(_hstatusbar);
00546                 rect.bottom -= rt.bottom;
00547         }
00548
00549         if (IsWindowVisible(_haddressedit) || IsWindowVisible(_hcommandedit)) {
00550                 ClientRect rt(_haddressedit);
00551                 rect.bottom -= rt.bottom;
00552
00553                 int mid = (rect.right-rect.left) / 2;
00554                 SetWindowPos(_haddressedit, 0, 0, rect.bottom, mid, rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
00555                 SetWindowPos(_hcommandedit, 0, mid+1, rect.bottom, rect.right-(mid+1), rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
00556         }
00557
00558         if (IsWindowVisible(_hsidebar)) {
00559                 WindowRect rt(_hsidebar);
00560                 rect.left += rt.right-rt.left;
00561
00562                 SetWindowPos(_hsidebar, 0, -1, rect.top-1, rt.right-rt.left, rect.bottom-rect.top+1, SWP_NOACTIVATE|SWP_NOZORDER);
00563         }
00564 }

void MainFrameBase::resize_frame_client ( ) [protected]

Definition at line 566 of file mainframe.cpp.

References WindowHandle::_hwnd, and resize_frame().

Referenced by Notify(), ProcessMessage(), and toggle_child().

00567 {
00568         ClientRect rect(_hwnd);
00569
00570         resize_frame(rect.right, rect.bottom);
00571 }

Here is the call graph for this function:

void MainFrameBase::toggle_child | ( | HWND | hwnd,
 |  | UINT | cmd,
 |  | HWND | hchild,
 |  | int | band_idx = -1
 | ) | [protected]

Definition at line 649 of file mainframe.cpp.

References _fullscreen, MenuInfo::_hMenuView, _hwndrebar, _menu_info, FullScreenParameters::_mode, fullscreen_move(), and resize_frame_client().

Referenced by Command().

00650 {
00651         BOOL vis = IsWindowVisible(hchild);
00652
00653         CheckMenuItem(_menu_info._hMenuView, cmd, vis?MF_BYCOMMAND:MF_BYCOMMAND|MF_CHECKED);
00654
00655         if (band_idx != -1)
00656                 SendMessage(_hwndrebar, RB_SHOWBAND, band_idx, !vis);
00657         else
00658                 ShowWindow(hchild, vis? SW_HIDE: SW_SHOW);
00659
00660         if (_fullscreen._mode)
00661                 fullscreen_move();
00662
00663         resize_frame_client();
00664 }

Here is the call graph for this function:

BOOL MainFrameBase::toggle_fullscreen ( ) [protected]

Definition at line 601 of file mainframe.cpp.

References _fullscreen, WindowHandle::_hwnd, FullScreenParameters::_mode, FullScreenParameters::_orgPos, FullScreenParameters::_wasZoomed, ClientToScreen(), and Frame_CalcFrameClient.

Referenced by Command().

00602 {
00603         RECT rt;
00604
00605         if ((_fullscreen._mode=!_fullscreen._mode)) {
00606                 GetWindowRect(_hwnd, &_fullscreen._orgPos);
00607                 _fullscreen._wasZoomed = IsZoomed(_hwnd);
00608
00609                 Frame_CalcFrameClient(_hwnd, &rt);
00610                 ClientToScreen(_hwnd, (LPPOINT)&rt.left);
00611                 ClientToScreen(_hwnd, (LPPOINT)&rt.right);
00612
00613                 rt.left = _fullscreen._orgPos.left-rt.left;
00614                 rt.top = _fullscreen._orgPos.top-rt.top;
00615                 rt.right = GetSystemMetrics(SM_CXSCREEN)+_fullscreen._orgPos.right-rt.right;
00616                 rt.bottom = GetSystemMetrics(SM_CYSCREEN)+_fullscreen._orgPos.bottom-rt.bottom;
00617
00618                 MoveWindow(_hwnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
00619         } else {
00620                 MoveWindow(_hwnd, _fullscreen._orgPos.left, _fullscreen._orgPos.top,
00621                                                         _fullscreen._orgPos.right-_fullscreen._orgPos.left,
00622                                                         _fullscreen._orgPos.bottom-_fullscreen._orgPos.top, TRUE);
00623
00624                 if (_fullscreen._wasZoomed)
00625                         ShowWindow(_hwnd, WS_MAXIMIZE);
00626         }
00627
00628         return _fullscreen._mode;
00629 }

Here is the call graph for this function:

BOOL MainFrameBase::TranslateMsg ( MSG * pmsg ) [protected, virtual]

Reimplemented in MDIMainFrame.

Definition at line 341 of file mainframe.cpp.

References _hAccel, and WindowHandle::_hwnd.

Referenced by ProcessMessage(), and MDIMainFrame::TranslateMsg().

00342 {
00343         if (TranslateAccelerator(_hwnd, _hAccel, pmsg))
00344                 return TRUE;
00345
00346         return FALSE;
00347 }

LRESULT MainFrameBase::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from Window.

Reimplemented in MDIMainFrame, SDIMainFrame, ShellBrowserChildT< MainFrameBase >, and ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >.

Definition at line 268 of file mainframe.cpp.

References ProcessMessage(), and Window::WndProc().

00269 {
00270         LRESULT res;
00271
00272         if (ProcessMessage(nmsg, wparam, lparam, &res))
00273                 return res;
00274         else
00275                 return super::WndProc(nmsg, wparam, lparam);
00276 }

Here is the call graph for this function:

Member Data Documentation

FullScreenParameters MainFrameBase::_fullscreen [protected]

Definition at line 68 of file mainframe.h.

Referenced by toggle_child(), and toggle_fullscreen().

HACCEL MainFrameBase::_hAccel [protected]

Definition at line 70 of file mainframe.h.

Referenced by MainFrameBase(), and TranslateMsg().

WindowHandle MainFrameBase::_haddressedit

Definition at line 56 of file mainframe.h.

Referenced by Command(), MainFrameBase(), ProcessMessage(), SDIMainFrame::resize_frame(), MDIMainFrame::resize_frame(), resize_frame(), and SDIMainFrame::set_url().

WindowHandle MainFrameBase::_hcommandedit

Definition at line 57 of file mainframe.h.

Referenced by ExecuteCommandbar(), MainFrameBase(), SDIMainFrame::resize_frame(), MDIMainFrame::resize_frame(), and resize_frame().

HIMAGELIST MainFrameBase::_himl

Definition at line 60 of file mainframe.h.

Referenced by FillBookmarks(), MainFrameBase(), and ~MainFrameBase().

HIMAGELIST MainFrameBase::_himl_old [protected]

Definition at line 71 of file mainframe.h.

Referenced by MainFrameBase(), and ~MainFrameBase().

HMENU MainFrameBase::_hMenuFrame

Definition at line 62 of file mainframe.h.

Referenced by MainFrameBase().

HMENU MainFrameBase::_hMenuWindow

Definition at line 63 of file mainframe.h.

Referenced by MainFrameBase(), and MDIMainFrame::MDIMainFrame().

WindowHandle MainFrameBase::_hsidebar

Definition at line 59 of file mainframe.h.

Referenced by Command(), FillBookmarks(), MainFrameBase(), Notify(), SDIMainFrame::resize_frame(), MDIMainFrame::resize_frame(), resize_frame(), and ~MainFrameBase().

WindowHandle MainFrameBase::_hstatusbar

Definition at line 54 of file mainframe.h.

Referenced by Command(), frame_get_clientspace(), MainFrameBase(), ProcessMessage(), SDIMainFrame::resize_frame(), MDIMainFrame::resize_frame(), and resize_frame().

WindowHandle MainFrameBase::_htoolbar

Definition at line 53 of file mainframe.h.

Referenced by Command(), frame_get_clientspace(), MainFrameBase(), MDIMainFrame::MDIMainFrame(), SDIMainFrame::resize_frame(), MDIMainFrame::resize_frame(), and resize_frame().

WindowHandle MainFrameBase::_hwndrebar

Definition at line 51 of file mainframe.h.

Referenced by MainFrameBase(), MDIMainFrame::MDIMainFrame(), SDIMainFrame::resize_frame(), MDIMainFrame::resize_frame(), resize_frame(), and toggle_child().

MenuInfo MainFrameBase::_menu_info

Definition at line 65 of file mainframe.h.

Referenced by Command(), MainFrameBase(), MDIMainFrame::MDIMainFrame(), ProcessMessage(), and toggle_child().

The documentation for this struct was generated from the following files:
  • mainframe.h
  • mainframe.cpp


ROS Explorer: Member List

MainFrameBase Member List

This is the complete list of members for MainFrameBase, including all inherited members.

_fullscreen | MainFrameBase | [protected]
_hAccel | MainFrameBase | [protected]
_haddressedit | MainFrameBase |
_hcommandedit | MainFrameBase |
_himl | MainFrameBase |
_himl_old | MainFrameBase | [protected]
_hMenuFrame | MainFrameBase |
_hMenuWindow | MainFrameBase |
_hsidebar | MainFrameBase |
_hstatusbar | MainFrameBase |
_htoolbar | MainFrameBase |
_hwnd | WindowHandle | [protected]
_hwndrebar | MainFrameBase |
_menu_info | MainFrameBase |
CancelModes() | Window | [static]
Command(int id, int code) | MainFrameBase | [protected, virtual]
Create(const ExplorerCmd &cmd) | MainFrameBase | [static]
PreTranslateWindow::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
PreTranslateWindow::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
ExecuteCommandbar(LPCTSTR dir) | MainFrameBase | [protected]
FillBookmarks() | MainFrameBase | [protected]
frame_get_clientspace(PRECT prect) | MainFrameBase | [protected, virtual]
fullscreen_move() | MainFrameBase | [protected]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
go_to(LPCTSTR url, bool new_window) | MainFrameBase | [protected, virtual]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MainFrameBase(HWND hwnd) | MainFrameBase |
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | MainFrameBase | [protected, virtual]
OpenShellFolders(LPIDA pida, HWND hFrameWnd) | MainFrameBase | [static]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PreTranslateWindow(HWND) | PreTranslateWindow |
ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT *pres) | MainFrameBase | [protected]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
resize_frame(int cx, int cy) | MainFrameBase | [protected, virtual]
resize_frame_client() | MainFrameBase | [protected]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | MainFrameBase |
toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1) | MainFrameBase | [protected]
toggle_fullscreen() | MainFrameBase | [protected]
TranslateMsg(MSG *pmsg) | MainFrameBase | [protected, virtual]
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | MainFrameBase | [protected, virtual]
~MainFrameBase() | MainFrameBase |
~PreTranslateWindow() | PreTranslateWindow |
~Window() | Window | [virtual]


ROS Explorer: map Class Reference

map Class Reference

Inheritance diagram for map:

[legend]
The documentation for this class was generated from the following file:
  • globals.h


ROS Explorer: MDIMainFrame Struct Reference

MDIMainFrame Struct Reference

#include <mainframe.h>

Inheritance diagram for MDIMainFrame:

[legend]
Collaboration diagram for MDIMainFrame:

[legend]
List of all members.

Public Types

typedef MainFrameBase | super

Public Member Functions

MDIMainFrame (HWND hwnd)
ChildWindow * | CreateChild (LPCTSTR path=NULL, int mode=OWM_EXPLORE|OWM_DETAILS)
ChildWindow * | CreateChild (LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL)

Static Public Member Functions

static HWND | Create ()
static HWND | Create (LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS)
static HWND | Create (LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Command (int id, int code)
virtual BOOL | TranslateMsg (MSG *pmsg)
bool | activate_drive_window (LPCTSTR path)
bool | activate_child_window (LPCTSTR filesys)
virtual void | resize_frame (int cx, int cy)
virtual void | frame_get_clientspace (PRECT prect)
virtual bool | go_to (LPCTSTR url, bool new_window)

Protected Attributes

HWND _hmdiclient
WindowHandle _hextrabar
WindowHandle _hdrivebar
TCHAR | _drives [BUFFER_LEN]

Detailed Description

Definition at line 98 of file mainframe.h.

Member Typedef Documentation

typedef MainFrameBase MDIMainFrame::super

Reimplemented from MainFrameBase.

Definition at line 100 of file mainframe.h.

Constructor & Destructor Documentation

MDIMainFrame::MDIMainFrame ( HWND hwnd )

Definition at line 706 of file mainframe.cpp.

References _drives, _hdrivebar, _hextrabar, ExplorerGlobals::_hInstance, _hmdiclient, MenuInfo::_hMenuView, MainFrameBase::_hMenuWindow, MainFrameBase::_htoolbar, MainFrameBase::_hwndrebar, MainFrameBase::_menu_info, BUFFER_LEN, g_Globals, ID_DRIVE_DESKTOP, ID_DRIVE_FAT, ID_DRIVE_FIRST, ID_DRIVE_NTOBJ_NS, ID_DRIVE_REGISTRY, ID_DRIVE_SHELL_NS, ID_DRIVE_UNIX_FS, ID_VIEW_DRIVE_BAR, ID_VIEW_EXTRA_BAR, ID_WEB_WINDOW, ID_WINDOW_CASCADE, ID_WINDOW_NEW, ID_WINDOW_TILE_HORZ, ID_WINDOW_TILE_VERT, IDB_DRIVEBAR, IDW_DRIVEBAR, IDW_EXTRABAR, IDW_FIRST_CHILD, RBBS_HIDETITLE, and W_VER_NT.

00707  :      super(hwnd)
00708 {
00709         TBBUTTON mdiBtns[] = {
00710                 {0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
00711                 {0, ID_WINDOW_NEW, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00712                 {1, ID_WINDOW_CASCADE, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00713                 {2, ID_WINDOW_TILE_HORZ, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
00714                 {3, ID_WINDOW_TILE_VERT, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}
00715         };
00716
00717         SendMessage(_htoolbar, TB_ADDBUTTONS, sizeof(mdiBtns)/sizeof(TBBUTTON), (LPARAM)&mdiBtns);
00718
00719         CLIENTCREATESTRUCT ccs;
00720
00721         ccs.hWindowMenu = _hMenuWindow;
00722         ccs.idFirstChild = IDW_FIRST_CHILD;
00723
00724         _hmdiclient = CreateWindowEx(0, TEXT("MDICLIENT"), NULL,
00725                                         WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|WS_HSCROLL|WS_VISIBLE|WS_BORDER,
00726                                         0, 0, 0, 0,
00727                                         hwnd, 0, g_Globals._hInstance, &ccs);
00728
00729         TBBUTTON extraBtns = {0, 0, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
00730
00731 #ifndef _NO_REBAR
00732         _hextrabar = CreateToolbarEx(hwnd,
00733                                 CCS_NOPARENTALIGN|CCS_NORESIZE|
00734                                 WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
00735                                 IDW_EXTRABAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, NULL, 0,
00736                                 16, 13, 16, 13, sizeof(TBBUTTON));
00737 #else
00738         _hextrabar = CreateToolbarEx(hwnd,
00739                                 WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
00740                                 IDW_EXTRABAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, &extraBtns, 1,
00741                                 16, 13, 16, 13, sizeof(TBBUTTON));
00742 #endif
00743
00744         CheckMenuItem(_menu_info._hMenuView, ID_VIEW_EXTRA_BAR, MF_BYCOMMAND|MF_CHECKED);
00745
00746
00747         extraBtns.fsStyle = BTNS_BUTTON;
00748
00749 #ifdef __WINE__
00750          // insert unix file system button
00751         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("/\0"));
00752         extraBtns.idCommand = ID_DRIVE_UNIX_FS;
00753         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00754 #endif
00755
00756          // insert explorer window button
00757         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Explore\0"));
00758         extraBtns.idCommand = ID_DRIVE_DESKTOP;
00759         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00760
00761          // insert shell namespace button
00762         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Shell\0"));
00763         extraBtns.idCommand = ID_DRIVE_SHELL_NS;
00764         extraBtns.iBitmap = 6;
00765         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00766
00767          // insert web control button
00768         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Web\0"));
00769         extraBtns.idCommand = ID_WEB_WINDOW;
00770         extraBtns.iBitmap = 7;
00771         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00772
00773         if ((HIWORD(GetVersion())>>14) == W_VER_NT) {
00774                  // insert NT object namespace button
00775                 extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("NT Obj\0"));
00776                 extraBtns.idCommand = ID_DRIVE_NTOBJ_NS;
00777                 extraBtns.iBitmap = 8;
00778                 SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00779         }
00780
00781          // insert Registry button
00782         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("Reg.\0"));
00783         extraBtns.idCommand = ID_DRIVE_REGISTRY;
00784         extraBtns.iBitmap = 9;
00785         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00786
00787 #ifdef _DEBUG
00788          // insert FAT direct file system access button
00789         extraBtns.iString = SendMessage(_hextrabar, TB_ADDSTRING, 0, (LPARAM)TEXT("FAT\0"));
00790         extraBtns.idCommand = ID_DRIVE_FAT;
00791         extraBtns.iBitmap = 10;
00792         SendMessage(_hextrabar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&extraBtns);
00793 #endif
00794
00795
00796         TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
00797         PTSTR p;
00798
00799 #ifndef _NO_REBAR
00800         _hdrivebar = CreateToolbarEx(hwnd,
00801                                 CCS_NOPARENTALIGN|CCS_NORESIZE|
00802                                 WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
00803                                 IDW_DRIVEBAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, NULL, 0,
00804                                 16, 13, 16, 13, sizeof(TBBUTTON));
00805 #else
00806         _hdrivebar = CreateToolbarEx(hwnd,
00807                                 WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
00808                                 IDW_DRIVEBAR, 2, g_Globals._hInstance, IDB_DRIVEBAR, &drivebarBtn, 1,
00809                                 16, 13, 16, 13, sizeof(TBBUTTON));
00810 #endif
00811
00812         CheckMenuItem(_menu_info._hMenuView, ID_VIEW_DRIVE_BAR, MF_BYCOMMAND|MF_CHECKED);
00813
00814
00815         GetLogicalDriveStrings(BUFFER_LEN, _drives);
00816
00817          // register windows drive root strings
00818         SendMessage(_hdrivebar, TB_ADDSTRING, 0, (LPARAM)_drives);
00819
00820         drivebarBtn.fsStyle = BTNS_BUTTON;
00821         drivebarBtn.idCommand = ID_DRIVE_FIRST;
00822
00823         for(p=_drives; *p; ) {
00824                 switch(GetDriveType(p)) {
00825                         case DRIVE_REMOVABLE:   drivebarBtn.iBitmap = 1;        break;
00826                         case DRIVE_CDROM:               drivebarBtn.iBitmap = 3;        break;
00827                         case DRIVE_REMOTE:              drivebarBtn.iBitmap = 4;        break;
00828                         case DRIVE_RAMDISK:     drivebarBtn.iBitmap = 5;        break;
00829                         default:/*DRIVE_FIXED*/ drivebarBtn.iBitmap = 2;
00830                 }
00831
00832                 SendMessage(_hdrivebar, TB_INSERTBUTTON, INT_MAX, (LPARAM)&drivebarBtn);
00833                 ++drivebarBtn.idCommand;
00834                 ++drivebarBtn.iString;
00835
00836                 while(*p++);
00837         }
00838
00839
00840 #ifndef _NO_REBAR
00841         int btn_hgt = HIWORD(SendMessage(_htoolbar, TB_GETBUTTONSIZE, 0, 0));
00842
00843         REBARBANDINFO rbBand;
00844
00845         rbBand.cbSize = sizeof(REBARBANDINFO);
00846         rbBand.fMask  = RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE;
00847 #ifndef RBBS_HIDETITLE // missing in MinGW headers as of 25.02.2004
00848 #define RBBS_HIDETITLE  0x400
00849 #endif
00850         rbBand.fStyle = RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE;
00851
00852         rbBand.lpText = TEXT("Extras");
00853         rbBand.hwndChild = _hextrabar;
00854         rbBand.cxMinChild = 0;
00855         rbBand.cyMinChild = btn_hgt + 4;
00856         rbBand.cx = 284;
00857         SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
00858
00859         rbBand.fStyle |= RBBS_BREAK;
00860         rbBand.lpText = TEXT("Drives");
00861         rbBand.hwndChild = _hdrivebar;
00862         rbBand.cxMinChild = 0;
00863         rbBand.cyMinChild = btn_hgt + 4;
00864         rbBand.cx = 400;
00865         SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);
00866 #endif
00867 }

Member Function Documentation

bool MDIMainFrame::activate_child_window ( LPCTSTR filesys ) [protected]

Definition at line 1277 of file mainframe.cpp.

References Root::_fs, _hmdiclient, ShellBrowser::get_root(), FileChildWindow::get_root(), HWND, PM_GET_FILEWND_PTR, and PM_GET_SHELLBROWSER_PTR.

01278 {
01279         HWND child_wnd;
01280
01281          // search for a already open window of the given file system name
01282         for(child_wnd=::GetNextWindow(_hmdiclient,GW_CHILD); child_wnd; child_wnd=::GetNextWindow(child_wnd, GW_HWNDNEXT)) {
01283                 FileChildWindow* child = (FileChildWindow*) SendMessage(child_wnd, PM_GET_FILEWND_PTR, 0, 0);
01284
01285                 if (child) {
01286                         if (!lstrcmpi(child->get_root()._fs, filesys)) {
01287                                 SendMessage(_hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
01288
01289                                 if (IsMinimized(child_wnd))
01290                                         ShowWindow(child_wnd, SW_SHOWNORMAL);
01291
01292                                 return true;
01293                         }
01294                 } else {
01295                         ShellBrowser* shell_child = (ShellBrowser*) SendMessage(child_wnd, PM_GET_SHELLBROWSER_PTR, 0, 0);
01296
01297                         if (shell_child) {
01298                                 if (!lstrcmpi(shell_child->get_root()._fs, filesys)) {
01299                                         SendMessage(_hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
01300
01301                                         if (IsMinimized(child_wnd))
01302                                                 ShowWindow(child_wnd, SW_SHOWNORMAL);
01303
01304                                         return true;
01305                                 }
01306                         }
01307                 }
01308         }
01309
01310         return false;
01311 }

Here is the call graph for this function:

bool MDIMainFrame::activate_drive_window ( LPCTSTR path ) [protected]

Definition at line 1249 of file mainframe.cpp.

References _hmdiclient, _MAX_DRIVE, Root::_path, _tsplitpath_s, COUNTOF, FileChildWindow::get_root(), HWND, and PM_GET_FILEWND_PTR.

Referenced by Command().

01250 {
01251         TCHAR drv1[_MAX_DRIVE], drv2[_MAX_DRIVE];
01252         HWND child_wnd;
01253
01254         _tsplitpath_s(path, drv1, COUNTOF(drv1), NULL, 0, NULL, 0, NULL, 0);
01255
01256          // search for a already open window for the same drive
01257         for(child_wnd=::GetNextWindow(_hmdiclient,GW_CHILD); child_wnd; child_wnd=::GetNextWindow(child_wnd, GW_HWNDNEXT)) {
01258                 FileChildWindow* child = (FileChildWindow*) SendMessage(child_wnd, PM_GET_FILEWND_PTR, 0, 0);
01259
01260                 if (child) {
01261                         _tsplitpath_s(child->get_root()._path, drv2, COUNTOF(drv2), NULL, 0, NULL, 0, NULL, 0);
01262
01263                         if (!lstrcmpi(drv2, drv1)) {
01264                                 SendMessage(_hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
01265
01266                                 if (IsMinimized(child_wnd))
01267                                         ShowWindow(child_wnd, SW_SHOWNORMAL);
01268
01269                                 return true;
01270                         }
01271                 }
01272         }
01273
01274         return false;
01275 }

Here is the call graph for this function:

int MDIMainFrame::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Todo:
store last directory per drive
Todo:
prompt for image file
Todo:
There are even more menu items!

Reimplemented from MainFrameBase.

Definition at line 1003 of file mainframe.cpp.

References _drives, _hmdiclient, _MAX_DRIVE, _tsplitpath_s, activate_drive_window(), CONTEXT, COUNTOF, FileChildWindow::create(), display_error(), HWND, ID_DRIVE_FIRST, and PM_DISPATCH_COMMAND.

01004 {
01005         CONTEXT("MDIMainFrame::Command()");
01006
01007         HWND hwndClient = (HWND) SendMessage(_hmdiclient, WM_MDIGETACTIVE, 0, 0);
01008
01009         if (hwndClient)
01010                 if (SendMessage(hwndClient, PM_DISPATCH_COMMAND, MAKELONG(id,code), 0))
01011                         return 0;
01012
01013         if (id>=ID_DRIVE_FIRST && id<=ID_DRIVE_FIRST+0xFF) {
01014                 TCHAR drv[_MAX_DRIVE], path[MAX_PATH];
01015                 LPCTSTR root = _drives;
01016
01017                 for(int i=id-ID_DRIVE_FIRST; i--; root++)
01018                         while(*root)
01019                                 ++root;
01020
01021                 if (activate_drive_window(root))
01022                         return 0;
01023
01024                 _tsplitpath_s(root, drv, COUNTOF(drv), NULL, 0, NULL, 0, NULL, 0);
01025
01026                 if (!SetCurrentDirectory(drv)) {
01027                         display_error(_hwnd, GetLastError());
01028                         return 0;
01029                 }
01030
01031                 GetCurrentDirectory(MAX_PATH, path);
01032
01033                 FileChildWindow::create(FileChildWndInfo(_hmdiclient, path));
01034
01035                 return 1;
01036         }
01037
01038         switch(id) {
01039           case ID_WINDOW_NEW: {
01040                 TCHAR path[MAX_PATH];
01041
01042                 GetCurrentDirectory(MAX_PATH, path);
01043
01044                 FileChildWindow::create(FileChildWndInfo(_hmdiclient, path));
01045                 break;}
01046
01047           case ID_WINDOW_CASCADE:
01048                 SendMessage(_hmdiclient, WM_MDICASCADE, 0, 0);
01049                 break;
01050
01051           case ID_WINDOW_TILE_HORZ:
01052                 SendMessage(_hmdiclient, WM_MDITILE, MDITILE_HORIZONTAL, 0);
01053                 break;
01054
01055           case ID_WINDOW_TILE_VERT:
01056                 SendMessage(_hmdiclient, WM_MDITILE, MDITILE_VERTICAL, 0);
01057                 break;
01058
01059           case ID_WINDOW_ARRANGE:
01060                 SendMessage(_hmdiclient, WM_MDIICONARRANGE, 0, 0);
01061                 break;
01062
01063           case ID_VIEW_EXTRA_BAR:
01064                 toggle_child(_hwnd, id, _hextrabar, 1);
01065                 break;
01066
01067           case ID_VIEW_DRIVE_BAR:
01068                 toggle_child(_hwnd, id, _hdrivebar, 2);
01069                 break;
01070
01071 #ifdef __WINE__
01072           case ID_DRIVE_UNIX_FS: {
01073                 TCHAR path[MAX_PATH];
01074                 FileChildWindow* child;
01075
01076                 getcwd(path, COUNTOF(path));
01077
01078                 if (activate_child_window(TEXT("unixfs")))
01079                         break;
01080
01081                 FileChildWindow::create(_hmdiclient, FileChildWndInfo(path));
01082                 break;}
01083 #endif
01084
01085           case ID_DRIVE_DESKTOP: {
01086                 TCHAR path[MAX_PATH];
01087
01088                 if (activate_child_window(TEXT("Desktop")))
01089                         break;
01090
01091                 GetCurrentDirectory(MAX_PATH, path);
01092
01093                 MDIShellBrowserChild::create(ShellChildWndInfo(_hmdiclient, path, DesktopFolderPath()));
01094                 break;}
01095
01096           case ID_DRIVE_SHELL_NS: {
01097                 TCHAR path[MAX_PATH];
01098                 GetCurrentDirectory(MAX_PATH, path);
01099
01100                 if (activate_child_window(TEXT("Shell")))
01101                         break;
01102
01103                 FileChildWindow::create(ShellChildWndInfo(_hmdiclient, path, DesktopFolderPath()));
01104                 break;}
01105
01106           case ID_DRIVE_NTOBJ_NS: {
01107                 if (activate_child_window(TEXT("NTOBJ")))
01108                         break;
01109
01110                 FileChildWindow::create(NtObjChildWndInfo(_hmdiclient, TEXT("\\")));
01111           break;}
01112
01113           case ID_DRIVE_REGISTRY: {
01114                 if (activate_child_window(TEXT("Registry")))
01115                         break;
01116
01117                 FileChildWindow::create(RegistryChildWndInfo(_hmdiclient, TEXT("\\")));
01118           break;}
01119
01120           case ID_DRIVE_FAT: {
01121
01123
01124                 if (activate_child_window(TEXT("FAT")))
01125                         break;
01126
01127                 FileChildWindow::create(FATChildWndInfo(_hmdiclient, TEXT("FAT Image")));       //@@
01128           break;}
01129
01130           case ID_WEB_WINDOW:
01131 #ifdef _DEBUG
01132                 create_webchildwindow(WebChildWndInfo(_hmdiclient, TEXT("http://localhost")));
01133 #else
01134                 create_webchildwindow(WebChildWndInfo(_hmdiclient, TEXT("http://www.reactos.org")));
01135 #endif
01136                 break;
01137
01138           case ID_EXPLORER_FAQ:
01139                 create_webchildwindow(WebChildWndInfo(_hmdiclient, TEXT("http://www.sky.franken.de/explorer/")));
01140                 break;
01141
01142           case ID_VIEW_SDI:
01143                 MainFrameBase::Create(ExplorerCmd());
01144                 break;
01145
01146           case IDW_COMMANDBAR:
01147                 if (code == 1) {
01148                         TCHAR url[BUFFER_LEN];
01149                         LPCTSTR dir;
01150
01151                         if (GetWindowText(_haddressedit, url, BUFFER_LEN))
01152                                 dir = url;
01153                         else
01154                                 dir = NULL;
01155
01156                         ExecuteCommandbar(dir);
01157                 }
01158                 break;
01159
01161
01162           default:
01163                 if (super::Command(id, code) == 0)
01164                         return 0;
01165                 else
01166                         return DefFrameProc(_hwnd, _hmdiclient, WM_COMMAND, MAKELONG(id,code), 0);
01167         }
01168
01169         return 0;
01170 }

Here is the call graph for this function:

HWND MDIMainFrame::Create | ( | LPCITEMIDLIST | pidl,
 |  | int | mode = OWM_EXPLORE|OWM_DETAILS|OWM_PIDL
 | ) | [static]

Definition at line 896 of file mainframe.cpp.

References Create(), CreateChild(), GET_WINDOW, and HWND.

00897 {
00898         HWND hFrame = Create();
00899         if (!hFrame)
00900                 return 0;
00901
00902         ShowWindow(hFrame, SW_SHOW);
00903
00904         MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame);
00905
00906         if (pMainFrame)
00907                 pMainFrame->CreateChild(pidl, mode);
00908
00909         return hFrame;
00910 }

Here is the call graph for this function:

HWND MDIMainFrame::Create | ( | LPCTSTR | path,
 |  | int | mode = OWM_EXPLORE|OWM_DETAILS
 | ) | [static]

Definition at line 880 of file mainframe.cpp.

References Create(), CreateChild(), GET_WINDOW, and HWND.

00881 {
00882         HWND hFrame = Create();
00883         if (!hFrame)
00884                 return 0;
00885
00886         ShowWindow(hFrame, SW_SHOW);
00887
00888         MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame);
00889
00890         if (pMainFrame)
00891                 pMainFrame->CreateChild(path, mode);
00892
00893         return hFrame;
00894 }

Here is the call graph for this function:

HWND MDIMainFrame::Create ( ) [static]

Definition at line 870 of file mainframe.cpp.

References ExplorerGlobals::_hframeClass, ExplorerGlobals::_hInstance, Window::Create(), g_Globals, IDM_MDIFRAME, IDS_TITLE, and WINDOW_CREATOR.

Referenced by StartMenuHandler::Command(), Create(), MainFrameBase::Create(), and MainFrameBase::OpenShellFolders().

00871 {
00872         HMENU hMenuFrame = LoadMenu(g_Globals._hInstance, MAKEINTRESOURCE(IDM_MDIFRAME));
00873
00874         return Window::Create(WINDOW_CREATOR(MDIMainFrame), 0,
00875                                 (LPCTSTR)(int)g_Globals._hframeClass, ResString(IDS_TITLE), WS_OVERLAPPEDWINDOW,
00876                                 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
00877                                 0/*hwndDesktop*/, hMenuFrame);
00878 }

Here is the call graph for this function:

ChildWindow * MDIMainFrame::CreateChild | ( | LPCITEMIDLIST | pidl,
 |  | int | mode = OWM_EXPLORE|OWM_DETAILS|OWM_PIDL
 | ) |

Definition at line 918 of file mainframe.cpp.

References WindowHandle::_hwnd, OWM_PIDL, and PM_OPEN_WINDOW.

00919 {
00920         return reinterpret_cast<ChildWindow*>(SendMessage(_hwnd, PM_OPEN_WINDOW, mode|OWM_PIDL, (LPARAM)pidl));
00921 }

ChildWindow * MDIMainFrame::CreateChild | ( | LPCTSTR | path = NULL,
 |  | int | mode = OWM_EXPLORE|OWM_DETAILS
 | ) |

Definition at line 913 of file mainframe.cpp.

References WindowHandle::_hwnd, and PM_OPEN_WINDOW.

Referenced by SDIMainFrame::Create(), Create(), and go_to().

00914 {
00915         return reinterpret_cast<ChildWindow*>(SendMessage(_hwnd, PM_OPEN_WINDOW, mode, (LPARAM)path));
00916 }

void MDIMainFrame::frame_get_clientspace ( PRECT prect ) [protected, virtual]

Reimplemented from MainFrameBase.

Definition at line 1173 of file mainframe.cpp.

References _hdrivebar, and MainFrameBase::frame_get_clientspace().

01174 {
01175         super::frame_get_clientspace(prect);
01176
01177         if (IsWindowVisible(_hdrivebar)) {
01178                 ClientRect rt(_hdrivebar);
01179                 prect->top += rt.bottom+2;
01180         }
01181 }

Here is the call graph for this function:

bool MDIMainFrame::go_to | ( | LPCTSTR | url,
 |  | bool | new_window
 | ) | [protected, virtual]

Todo:
SDI implementation

Reimplemented from MainFrameBase.

Definition at line 1313 of file mainframe.cpp.

References _hmdiclient, CreateChild(), MainFrameBase::go_to(), HWND, and PM_JUMP_TO_URL.

01314 {
01315         if (!new_window) {
01316                 HWND hwndClient = (HWND) SendMessage(_hmdiclient, WM_MDIGETACTIVE, 0, 0);
01317
01318                 if (hwndClient)
01319                         if (SendMessage(hwndClient, PM_JUMP_TO_URL, 0, (LPARAM)url))
01320                                 return true;
01321         }
01322
01323         if (CreateChild(url))
01324                 return true;
01325
01326         return super::go_to(url, new_window);
01327 }

Here is the call graph for this function:

void MDIMainFrame::resize_frame | ( | int | cx,
 |  | int | cy
 | ) | [protected, virtual]

Todo:
use split bar

Reimplemented from MainFrameBase.

Definition at line 1183 of file mainframe.cpp.

References MainFrameBase::_haddressedit, MainFrameBase::_hcommandedit, _hdrivebar, _hextrabar, _hmdiclient, MainFrameBase::_hsidebar, MainFrameBase::_hstatusbar, MainFrameBase::_htoolbar, and MainFrameBase::_hwndrebar.

01184 {
01185         if (cy <= 0)
01186                 return; // avoid resizing children when receiving RBN_AUTOSIZE while getting minimized
01187
01188         RECT rect = {0, 0, cx, cy};
01189
01190         if (_hwndrebar) {
01191                 int height = ClientRect(_hwndrebar).bottom;
01192                 MoveWindow(_hwndrebar, rect.left, rect.top, rect.right-rect.left, height, TRUE);
01193                 rect.top += height;
01194         } else {
01195                 if (IsWindowVisible(_htoolbar)) {
01196                         SendMessage(_htoolbar, WM_SIZE, 0, 0);
01197                         WindowRect rt(_htoolbar);
01198                         rect.top = rt.bottom;
01199                 //      rect.bottom -= rt.bottom;
01200                 }
01201
01202                 if (IsWindowVisible(_hextrabar)) {
01203                         SendMessage(_hextrabar, WM_SIZE, 0, 0);
01204                         WindowRect rt(_hextrabar);
01205                         int new_top = --rect.top + rt.bottom;
01206                         MoveWindow(_hextrabar, 0, rect.top, rt.right, new_top, TRUE);
01207                         rect.top = new_top;
01208                 //      rect.bottom -= rt.bottom;
01209                 }
01210
01211                 if (IsWindowVisible(_hdrivebar)) {
01212                         SendMessage(_hdrivebar, WM_SIZE, 0, 0);
01213                         WindowRect rt(_hdrivebar);
01214                         int new_top = --rect.top + rt.bottom;
01215                         MoveWindow(_hdrivebar, 0, rect.top, rt.right, new_top, TRUE);
01216                         rect.top = new_top;
01217                 //      rect.bottom -= rt.bottom;
01218                 }
01219         }
01220
01221         if (IsWindowVisible(_hstatusbar)) {
01222                 int parts[] = {300, 500};
01223
01224                 SendMessage(_hstatusbar, WM_SIZE, 0, 0);
01225                 SendMessage(_hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
01226                 ClientRect rt(_hstatusbar);
01227                 rect.bottom -= rt.bottom;
01228         }
01229
01230         if (IsWindowVisible(_haddressedit) || IsWindowVisible(_hcommandedit)) {
01231                 ClientRect rt(_haddressedit);
01232                 rect.bottom -= rt.bottom;
01233
01234                 int mid = (rect.right-rect.left) / 2;
01235                 SetWindowPos(_haddressedit, 0, 0, rect.bottom, mid, rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
01236                 SetWindowPos(_hcommandedit, 0, mid+1, rect.bottom, rect.right-(mid+1), rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
01237         }
01238
01239         if (IsWindowVisible(_hsidebar)) {
01240                 WindowRect rt(_hsidebar);
01241                 rect.left += rt.right-rt.left;
01242
01243                 SetWindowPos(_hsidebar, 0, -1, rect.top-1, rt.right-rt.left, rect.bottom-rect.top+1, SWP_NOACTIVATE|SWP_NOZORDER);
01244         }
01245
01246         MoveWindow(_hmdiclient, rect.left-1, rect.top-1, rect.right-rect.left+2, rect.bottom-rect.top+1, TRUE);
01247 }

BOOL MDIMainFrame::TranslateMsg ( MSG * pmsg ) [protected, virtual]

Reimplemented from MainFrameBase.

Definition at line 924 of file mainframe.cpp.

References _hmdiclient, and MainFrameBase::TranslateMsg().

00925 {
00926         if (_hmdiclient && TranslateMDISysAccel(_hmdiclient, pmsg))
00927                 return TRUE;
00928
00929         return super::TranslateMsg(pmsg);
00930 }

Here is the call graph for this function:

LRESULT MDIMainFrame::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:
read paths and window placements from registry

Reimplemented from MainFrameBase.

Definition at line 932 of file mainframe.cpp.

References _hmdiclient, FileChildWndInfo::_open_mode, FileChildWndInfo::_pos, ShellPath::assign(), CONTEXT, MDIShellBrowserChild::create(), create_webchildwindow(), GET_WINDOW, LOG, OBJ_CONTEXT, OWM_PIDL, OWM_SEPARATE, and MainFrameBase::ProcessMessage().

00933 {
00934         switch(nmsg) {
00935           case PM_OPEN_WINDOW: {
00936                 CONTEXT("MDIMainFrame PM_OPEN_WINDOW");
00937
00938                 TCHAR buffer[MAX_PATH];
00939                 LPCTSTR path;
00940                 ShellPath root_path = DesktopFolderPath();
00941
00942                 if (lparam) {
00943                         if (wparam & OWM_PIDL) {
00944                                  // take over PIDL from lparam
00945                                 root_path.assign((LPCITEMIDLIST)lparam);        // create as "rooted" window
00946                                 FileSysShellPath fsp(root_path);
00947                                 path = fsp;
00948
00949                                 if (path) {
00950                                         LOG(FmtString(TEXT("MDIMainFrame PM_OPEN_WINDOW: path=%s"), path));
00951                                         lstrcpy(buffer, path);
00952                                         path = buffer;
00953                                 }
00954                         } else {
00955                                  // take over path from lparam
00956                                 path = (LPCTSTR)lparam;
00957                                 root_path = path;       // create as "rooted" window
00958                         }
00959                 } else {
00961                         if (!GetCurrentDirectory(MAX_PATH, buffer))
00962                                 *buffer = '\0';
00963
00964                         path = buffer;
00965                 }
00966
00967                 if (path && _tcsstr(path, TEXT("://"))) {       // "http://...", "ftp://", ...
00968                         OBJ_CONTEXT("create WebChild window", path);
00969
00970                         return (LRESULT)GET_WINDOW(ChildWindow, create_webchildwindow(WebChildWndInfo(_hmdiclient, path)));
00971                 } else {
00972                         OBJ_CONTEXT("create ShellChildWndInfo", path);
00973
00974                          // Shell Namespace as default view
00975                         ShellChildWndInfo create_info(_hmdiclient, path, root_path);
00976
00977                         create_info._pos.showCmd = wparam&OWM_SEPARATE? SW_SHOWNORMAL: SW_SHOWMAXIMIZED;
00978                         create_info._pos.rcNormalPosition.left = CW_USEDEFAULT;
00979                         create_info._pos.rcNormalPosition.top = CW_USEDEFAULT;
00980                         create_info._pos.rcNormalPosition.right = CW_USEDEFAULT;
00981                         create_info._pos.rcNormalPosition.bottom = CW_USEDEFAULT;
00982
00983                         create_info._open_mode = wparam;
00984
00985                 //      FileChildWindow::create(_hmdiclient, create_info);
00986                         return (LRESULT)MDIShellBrowserChild::create(create_info);
00987                 }
00988                 return TRUE;}   // success
00989
00990           default: {
00991                 LRESULT res;
00992
00993                 if (super::ProcessMessage(nmsg, wparam, lparam, &res))
00994                         return res;
00995                 else
00996                         return DefFrameProc(_hwnd, _hmdiclient, nmsg, wparam, lparam);
00997           }
00998         }
00999
01000         return 0;
01001 }

Here is the call graph for this function:

Member Data Documentation

TCHAR MDIMainFrame::_drives[BUFFER_LEN] [protected]

Definition at line 131 of file mainframe.h.

Referenced by Command(), and MDIMainFrame().

WindowHandle MDIMainFrame::_hdrivebar [protected]

Definition at line 115 of file mainframe.h.

Referenced by frame_get_clientspace(), MDIMainFrame(), and resize_frame().

WindowHandle MDIMainFrame::_hextrabar [protected]

Definition at line 114 of file mainframe.h.

Referenced by MDIMainFrame(), and resize_frame().

HWND MDIMainFrame::_hmdiclient [protected]

Definition at line 112 of file mainframe.h.

Referenced by activate_child_window(), activate_drive_window(), Command(), go_to(), MDIMainFrame(), resize_frame(), TranslateMsg(), and WndProc().

The documentation for this struct was generated from the following files:
  • mainframe.h
  • mainframe.cpp


ROS Explorer: Member List

MDIMainFrame Member List

This is the complete list of members for MDIMainFrame, including all inherited members.

_drives | MDIMainFrame | [protected]
_fullscreen | MainFrameBase | [protected]
_hAccel | MainFrameBase | [protected]
_haddressedit | MainFrameBase |
_hcommandedit | MainFrameBase |
_hdrivebar | MDIMainFrame | [protected]
_hextrabar | MDIMainFrame | [protected]
_himl | MainFrameBase |
_himl_old | MainFrameBase | [protected]
_hmdiclient | MDIMainFrame | [protected]
_hMenuFrame | MainFrameBase |
_hMenuWindow | MainFrameBase |
_hsidebar | MainFrameBase |
_hstatusbar | MainFrameBase |
_htoolbar | MainFrameBase |
_hwnd | WindowHandle | [protected]
_hwndrebar | MainFrameBase |
_menu_info | MainFrameBase |
activate_child_window(LPCTSTR filesys) | MDIMainFrame | [protected]
activate_drive_window(LPCTSTR path) | MDIMainFrame | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | MDIMainFrame | [protected, virtual]
Create() | MDIMainFrame | [static]
Create(LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS) | MDIMainFrame | [static]
Create(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL) | MDIMainFrame | [static]
MainFrameBase::Create(const ExplorerCmd &cmd) | MainFrameBase | [static]
PreTranslateWindow::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
PreTranslateWindow::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CreateChild(LPCTSTR path=NULL, int mode=OWM_EXPLORE|OWM_DETAILS) | MDIMainFrame |
CreateChild(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL) | MDIMainFrame |
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
ExecuteCommandbar(LPCTSTR dir) | MainFrameBase | [protected]
FillBookmarks() | MainFrameBase | [protected]
frame_get_clientspace(PRECT prect) | MDIMainFrame | [protected, virtual]
fullscreen_move() | MainFrameBase | [protected]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
go_to(LPCTSTR url, bool new_window) | MDIMainFrame | [protected, virtual]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MainFrameBase(HWND hwnd) | MainFrameBase |
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MDIMainFrame(HWND hwnd) | MDIMainFrame |
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | MainFrameBase | [protected, virtual]
OpenShellFolders(LPIDA pida, HWND hFrameWnd) | MainFrameBase | [static]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PreTranslateWindow(HWND) | PreTranslateWindow |
ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT *pres) | MainFrameBase | [protected]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
resize_frame(int cx, int cy) | MDIMainFrame | [protected, virtual]
resize_frame_client() | MainFrameBase | [protected]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | MDIMainFrame |
toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1) | MainFrameBase | [protected]
toggle_fullscreen() | MainFrameBase | [protected]
TranslateMsg(MSG *pmsg) | MDIMainFrame | [protected, virtual]
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | MDIMainFrame | [protected, virtual]
~MainFrameBase() | MainFrameBase |
~PreTranslateWindow() | PreTranslateWindow |
~Window() | Window | [virtual]


ROS Explorer: MdiSdiDlg Struct Reference

MdiSdiDlg Struct Reference

configuration dialog to choose between MDI and SDI mode More...

#include <settings.h>

Inheritance diagram for MdiSdiDlg:

[legend]
Collaboration diagram for MdiSdiDlg:

[legend]
List of all members.

Public Types

typedef ResizeController<
Dialog > 		super

Public Member Functions

MdiSdiDlg (HWND hwnd)

Protected Member Functions

virtual int Command (int id, int code)

Detailed Description

configuration dialog to choose between MDI and SDI mode

Definition at line 91 of file settings.h.

Member Typedef Documentation

typedef ResizeController<Dialog> MdiSdiDlg::super

Reimplemented from ResizeController< Dialog >.

Definition at line 93 of file settings.h.

Constructor & Destructor Documentation

MdiSdiDlg::MdiSdiDlg ( HWND hwnd )

Definition at line 234 of file settings.cpp.

References CenterWindow(), g_Globals, ExplorerGlobals::get_cfg(), IDC_MDI, IDC_SDI, and IDC_SEPARATE_SUBFOLDERS.

00235  :      super(hwnd)
00236 {
00237         CenterWindow(hwnd);
00238
00239         XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
00240         bool mdi = XMLBool(explorer_options, "mdi", true);
00241         bool separateFolders = XMLBool(explorer_options, "separate-folders", true);
00242
00243         int id = mdi? IDC_MDI: IDC_SDI;
00244         CheckDlgButton(hwnd, id, BST_CHECKED);
00245         SetFocus(GetDlgItem(hwnd, id));
00246
00247         CheckDlgButton(hwnd, IDC_SEPARATE_SUBFOLDERS, separateFolders?BST_CHECKED:BST_UNCHECKED);
00248 }

Here is the call graph for this function:

Member Function Documentation

int MdiSdiDlg::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Dialog.

Definition at line 250 of file settings.cpp.

References WindowHandle::_hwnd, g_Globals, ExplorerGlobals::get_cfg(), IDC_MDI, and IDC_SEPARATE_SUBFOLDERS.

00251 {
00252         if (code == BN_CLICKED) {
00253                 switch(id) {
00254                   case IDOK: {
00255                         bool mdi = IsDlgButtonChecked(_hwnd, IDC_MDI)==BST_CHECKED;
00256                         bool separateFolders = IsDlgButtonChecked(_hwnd, IDC_SEPARATE_SUBFOLDERS)==BST_CHECKED;
00257
00258                         XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
00259
00260                         XMLBoolRef(explorer_options, "mdi") = mdi;
00261                         XMLBoolRef(explorer_options, "separate-folders") = separateFolders;
00262                   } // fall through
00263
00264                   case IDCANCEL:
00265                         EndDialog(_hwnd, id);
00266                         break;
00267                 }
00268
00269                 return 0;
00270         }
00271
00272         return 1;
00273 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • settings.h
  • settings.cpp


ROS Explorer: Member List

MdiSdiDlg Member List

This is the complete list of members for MdiSdiDlg, including all inherited members.

_hwnd | WindowHandle | [protected]
_resize_mgr | ResizeController< Dialog > | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | MdiSdiDlg | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
Dialog(HWND) | Dialog |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0) | Dialog | [static]
DoModal(UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0) | Dialog | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetClientSpace(PRECT prect) | ResizeController< Dialog > | [inline, virtual]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MdiSdiDlg(HWND hwnd) | MdiSdiDlg |
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeController(HWND hwnd) | ResizeController< Dialog > | [inline]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | MdiSdiDlg |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | ResizeController< Dialog > | [inline, virtual]
~Dialog() | Dialog |
~Window() | Window | [virtual]


ROS Explorer: MDIShellBrowserChild Struct Reference

MDIShellBrowserChild Struct Reference

#include <shellbrowser.h>

Inheritance diagram for MDIShellBrowserChild:

[legend]
Collaboration diagram for MDIShellBrowserChild:

[legend]
List of all members.

Public Types

typedef ExtContextMenuHandlerT<
ShellBrowserChildT< ChildWindow > > 		super

Public Member Functions

MDIShellBrowserChild (HWND hwnd, const ShellChildWndInfo &info)
LRESULT | Init (LPCREATESTRUCT)
virtual String | jump_to_int (LPCTSTR url)

Static Public Member Functions

static MDIShellBrowserChild * | create (const ShellChildWndInfo &info)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
void | update_shell_browser ()
virtual void | entry_selected (Entry *entry)

Protected Attributes

ShellChildWndInfo _create_info
ShellPathInfo _shellpath_info

Detailed Description

Definition at line 250 of file shellbrowser.h.

Member Typedef Documentation

typedef ExtContextMenuHandlerT< ShellBrowserChildT<ChildWindow> > MDIShellBrowserChild::super

Reimplemented from ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >.

Definition at line 256 of file shellbrowser.h.

Constructor & Destructor Documentation

MDIShellBrowserChild::MDIShellBrowserChild | ( | HWND | hwnd,
 |  | const ShellChildWndInfo & | info
 | ) |

todo Conversion of shell path into path string -> store into URL history const String& path = GetDesktopFolder().get_name(info._shell_path, SHGDN_FORADDRESSBAR); const String& parsingpath = GetDesktopFolder().get_name(info._shell_path, SHGDN_FORPARSING);

store path into history if (info._path && *info._path) _url_history.push(info._path);

Definition at line 543 of file shellbrowser.cpp.

00544  :      super(hwnd, info),
00545         _create_info(info),
00546         _shellpath_info(info)   //@@ copies info -> no referenz to _create_info !
00547 {
00556 }

Member Function Documentation

MDIShellBrowserChild * MDIShellBrowserChild::create ( const ShellChildWndInfo & info ) [static]

Definition at line 559 of file shellbrowser.cpp.

References FileChildWndInfo::_pos, CLASSNAME_CHILDWND, ChildWindow::create(), and WINDOW_CREATOR_INFO.

Referenced by WndProc(), and MDIMainFrame::WndProc().

00560 {
00561         ChildWindow* child = ChildWindow::create(info, info._pos.rcNormalPosition,
00562                 WINDOW_CREATOR_INFO(MDIShellBrowserChild,ShellChildWndInfo), CLASSNAME_CHILDWND, NULL, info._pos.showCmd==SW_SHOWMAXIMIZED? WS_MAXIMIZE: 0);
00563
00564         return static_cast<MDIShellBrowserChild*>(child);
00565 }

Here is the call graph for this function:

void MDIShellBrowserChild::entry_selected ( Entry * entry ) [protected, virtual]

Implements BrowserCallback.

Definition at line 673 of file shellbrowser.cpp.

References Entry::_data, Entry::_etype, WindowHandle::_hwnd, ShellBrowserChildT< ChildWindow >::_shellBrowser, COUNTOF, ET_SHELL, ShellEntry::get_parent_folder(), ShellEntry::get_path(), ChildWindow::resize_children(), and ChildWindow::set_url().

00674 {
00675         if (entry->_etype == ET_SHELL) {
00676                 ShellEntry* shell_entry = static_cast<ShellEntry*>(entry);
00677                 IShellFolder* folder;
00678
00679                 if (shell_entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00680                         folder = static_cast<ShellDirectory*>(shell_entry)->_folder;
00681                 else
00682                         folder = shell_entry->get_parent_folder();
00683
00684                 if (!folder) {
00685                         assert(folder);
00686                         return;
00687                 }
00688
00689                 TCHAR path[MAX_PATH];
00690
00691                 if (shell_entry->get_path(path, COUNTOF(path))) {
00692                         String url;
00693
00694                         if (path[0] == ':')
00695                                 url.printf(TEXT("shell://%s"), path);
00696                         else
00697                                 url.printf(TEXT("file://%s"), path);
00698
00699                         set_url(url);
00700                 }
00701
00702                 _shellBrowser->UpdateFolderView(folder);
00703
00704                  // set size of new created shell view windows
00705                 ClientRect rt(_hwnd);
00706                 resize_children(rt.right, rt.bottom);
00707         }
00708 }

Here is the call graph for this function:

LRESULT MDIShellBrowserChild::Init ( LPCREATESTRUCT ) [virtual]

Reimplemented from Window.

Definition at line 568 of file shellbrowser.cpp.

References _create_info, ShellChildWndInfo::_shell_path, ShellBrowserChildT< ChildWindow >::_shellBrowser, CONTEXT, ShellPath::get_folder(), Window::Init(), and update_shell_browser().

00569 {
00570         CONTEXT("MDIShellBrowserChild::Init()");
00571
00572         if (super::Init(pcs))
00573                 return 1;
00574
00575         update_shell_browser();
00576
00577         if (_shellBrowser.get())
00578                 if (_left_hwnd)
00579                         _shellBrowser->Init();
00580                 else
00581                         _shellBrowser->UpdateFolderView(_create_info._shell_path.get_folder());
00582
00583         return 0;
00584 }

Here is the call graph for this function:

String MDIShellBrowserChild::jump_to_int ( LPCTSTR url ) [virtual]

Todo:
use fname

Implements ChildWindow.

Definition at line 652 of file shellbrowser.cpp.

References ShellBrowserChildT< ChildWindow >::_shellBrowser, and SplitFileSysURL().

00653 {
00654         String dir, fname;
00655
00656         if (!_tcsnicmp(url, TEXT("shell://"), 8)) {
00657                 if (_shellBrowser->jump_to_pidl(ShellPath(url+8)))
00658                         return url;
00659         }
00660
00661         if (SplitFileSysURL(url, dir, fname)) {
00662
00664
00665                 if (_shellBrowser->jump_to_pidl(ShellPath(dir)))
00666                         return FmtString(TEXT("file://%s"), (LPCTSTR)dir);
00667         }
00668
00669         return String();
00670 }

Here is the call graph for this function:

void MDIShellBrowserChild::update_shell_browser ( ) [protected]

Todo:
use OWM_ROOTED flag

Definition at line 617 of file shellbrowser.cpp.

References ShellBrowserChildT< ChildWindow >::_shellBrowser, ChildWindow::_split_pos, and DEFAULT_SPLIT_POS.

Referenced by Init().

00618 {
00619         int split_pos = DEFAULT_SPLIT_POS;
00620
00621         if (_shellBrowser.get()) {
00622                 split_pos = _split_pos;
00623                 delete _shellBrowser.release();
00624         }
00625
00627
00628          // create explorer treeview
00629         if (_create_info._open_mode & OWM_EXPLORE) {
00630                 if (!_left_hwnd) {
00631                         ClientRect rect(_hwnd);
00632
00633                         _left_hwnd = CreateWindowEx(0, WC_TREEVIEW, NULL,
00634                                                         WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS,//|TVS_NOTOOLTIPS
00635                                                         0, rect.top, split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top,
00636                                                         _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0);
00637                 }
00638         } else {
00639                 if (_left_hwnd) {
00640                         DestroyWindow(_left_hwnd);
00641                         _left_hwnd = 0;
00642                 }
00643         }
00644
00645         _shellBrowser = auto_ptr<ShellBrowser>(new ShellBrowser(_hwnd, _left_hwnd, _right_hwnd,
00646                                                                                                 _shellpath_info, this, _cm_ifs));
00647
00648         _shellBrowser->Init(_hwndFrame);
00649 }

LRESULT MDIShellBrowserChild::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:

Reimplemented from ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >.

Definition at line 587 of file shellbrowser.cpp.

References _create_info, ShellBrowserChildT< ChildWindow >::_shellBrowser, ChildWindow::_url, CONTEXT, MainFrameBase::Create(), create(), ID_REFRESH, ID_VIEW_SDI, ID_WINDOW_NEW, and ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >::WndProc().

00588 {
00589         switch(nmsg) {
00590           case PM_DISPATCH_COMMAND: {
00591                 switch(LOWORD(wparam)) {
00592                   case ID_WINDOW_NEW: {CONTEXT("MDIShellBrowserChild PM_DISPATCH_COMMAND ID_WINDOW_NEW");
00593                         MDIShellBrowserChild::create(_create_info);
00594                         break;}
00595
00596                   case ID_REFRESH:
00597                         //@todo refresh shell child
00598                         _shellBrowser->invalidate_cache();
00599                         break;
00600
00601                   case ID_VIEW_SDI:
00602                         MainFrameBase::Create(ExplorerCmd(_url, false));
00603                         break;
00604
00605                   default:
00606                         return super::WndProc(nmsg, wparam, lparam);
00607                 }
00608                 return TRUE;}
00609
00610           default:
00611                 return super::WndProc(nmsg, wparam, lparam);
00612         }
00613
00614         return 0;
00615 }

Here is the call graph for this function:

Member Data Documentation

ShellChildWndInfo MDIShellBrowserChild::_create_info [protected]

Definition at line 267 of file shellbrowser.h.

Referenced by Init(), and WndProc().

ShellPathInfo MDIShellBrowserChild::_shellpath_info [protected]

Definition at line 268 of file shellbrowser.h.

The documentation for this struct was generated from the following files:
  • shellbrowser.h
  • shellbrowser.cpp


ROS Explorer: Member List

MDIShellBrowserChild Member List

This is the complete list of members for MDIShellBrowserChild, including all inherited members.

_cm_ifs | ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > > | [protected]
_create_info | MDIShellBrowserChild | [protected]
_focus_pane | ChildWindow | [protected]
_hwnd | WindowHandle | [protected]
_hwndFrame | ChildWindow | [protected]
_last_split | ChildWindow | [protected]
_left_hwnd | ChildWindow | [protected]
_menu_info | ChildWindow | [protected]
_right_hwnd | ChildWindow | [protected]
_shellBrowser | ShellBrowserChildT< ChildWindow > | [protected]
_shellpath_info | MDIShellBrowserChild | [protected]
_split_pos | ChildWindow | [protected]
_statusText | ChildWindow | [protected]
_url | ChildWindow | [protected]
_url_history | ChildWindow | [protected]
CancelModes() | Window | [static]
ChildWindow(HWND hwnd, const ChildWndInfo &info) | ChildWindow |
Command(int id, int code) | Window | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create(const ShellChildWndInfo &info) | MDIShellBrowserChild | [static]
ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >::create(const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0) | ChildWindow | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
entry_selected(Entry *entry) | MDIShellBrowserChild | [protected, virtual]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > > | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
go_to(LPCTSTR url) | ChildWindow |
Init(LPCREATESTRUCT) | MDIShellBrowserChild | [virtual]
jump_to_int(LPCTSTR url) | MDIShellBrowserChild | [virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MDIShellBrowserChild(HWND hwnd, const ShellChildWndInfo &info) | MDIShellBrowserChild |
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | ShellBrowserChildT< ChildWindow > | [inline, protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
resize_children(int cx, int cy) | ChildWindow | [protected, virtual]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
set_url(LPCTSTR url) | ChildWindow | [protected]
ShellBrowserChildT(HWND hwnd) | ShellBrowserChildT< ChildWindow > | [inline]
ShellBrowserChildT(HWND hwnd, const ShellChildWndInfo &info) | ShellBrowserChildT< ChildWindow > | [inline]
super typedef | MDIShellBrowserChild |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
update_shell_browser() | MDIShellBrowserChild | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | MDIShellBrowserChild | [protected, virtual]
~BrowserCallback() | BrowserCallback | [inline, virtual]
~Window() | Window | [virtual]


ROS Explorer: MemCanvas Struct Reference

MemCanvas Struct Reference

Memory Canvas creates and destroys memory devoce contexts. More...

#include <utility.h>

Inheritance diagram for MemCanvas:

[legend]
Collaboration diagram for MemCanvas:

[legend]
List of all members.

Public Member Functions

MemCanvas (HDC hdc=0)
~MemCanvas ()

Detailed Description

Memory Canvas creates and destroys memory devoce contexts.

Definition at line 521 of file utility.h.

Constructor & Destructor Documentation

MemCanvas::MemCanvas ( HDC hdc = 0 ) [inline]

Definition at line 523 of file utility.h.

00524          :      Canvas(CreateCompatibleDC(hdc)) {assert(_hdc);}

MemCanvas::~MemCanvas ( ) [inline]

Definition at line 526 of file utility.h.

00526 {DeleteDC(_hdc);}

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

MemCanvas Member List

This is the complete list of members for MemCanvas, including all inherited members.

_hdc | Canvas | [protected]
Canvas(HDC hdc) | Canvas | [inline]
MemCanvas(HDC hdc=0) | MemCanvas | [inline]
operator HDC() | Canvas | [inline]
~MemCanvas() | MemCanvas | [inline]


ROS Explorer: MenuInfo Struct Reference

MenuInfo Struct Reference

menu info structure More...

#include <window.h>

Collaboration diagram for MenuInfo:

[legend]
List of all members.

Public Attributes

HMENU _hMenuView

Detailed Description

menu info structure

Definition at line 275 of file window.h.

Member Data Documentation

HMENU MenuInfo::_hMenuView

Definition at line 277 of file window.h.

Referenced by Pane::command(), MainFrameBase::Command(), MainFrameBase::MainFrameBase(), MDIMainFrame::MDIMainFrame(), and MainFrameBase::toggle_child().

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

MenuInfo Member List

This is the complete list of members for MenuInfo, including all inherited members.

_hMenuView MenuInfo


ROS Explorer: NotifyArea Struct Reference

NotifyArea Struct Reference

tray notification area aka "tray" More...

#include <traynotify.h>

Inheritance diagram for NotifyArea:

[legend]
Collaboration diagram for NotifyArea:

[legend]
List of all members.

Public Types

typedef Window | super

Public Member Functions

NotifyArea (HWND hwnd)
~NotifyArea ()
LRESULT | ProcessTrayNotification (int notify_code, NOTIFYICONDATA *pnid)

Static Public Member Functions

static HWND | Create (HWND hwndParent)

Protected Member Functions

LRESULT | Init (LPCREATESTRUCT pcs)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Command (int id, int code)
int | Notify (int id, NMHDR *pnmh)
void | UpdateIcons ()
void | Paint ()
void | Refresh (bool do_refresh=false)
void | CancelModes ()
NotifyIconSet::iterator | IconHitTest (const POINT &pos)
search for a icon at a given client coordinate position
bool | DetermineHideState (NotifyInfo &entry)
void | read_config ()
void | write_config ()
void | show_clock (bool flag)

Protected Attributes

WindowHandle _hwndClock
int | _clock_width
ToolTip _tooltip
NotifyHook _hook
bool | _show_hidden
bool | _hide_inactive
bool | _show_button
NotifyIconCfgList _cfg
map< HWND, String > _window_modules
NotifyIconMap _icon_map
NotifyIconSet _sorted_icons
int | _next_idx
size_t | _last_icon_count

Friends

struct | TrayNotifyDlg

Detailed Description

tray notification area aka "tray"

Definition at line 130 of file traynotify.h.

Member Typedef Documentation

typedef Window NotifyArea::super

Definition at line 132 of file traynotify.h.

Constructor & Destructor Documentation

NotifyArea::NotifyArea ( HWND hwnd )

Definition at line 209 of file traynotify.cpp.

References _clock_width, _hide_inactive, _last_icon_count, _next_idx, _show_button, and _show_hidden.

00210  :      super(hwnd),
00211         _tooltip(hwnd)
00212 {
00213         _next_idx = 0;
00214         _clock_width = 0;
00215         _last_icon_count = 0;
00216         _show_hidden = false;
00217         _hide_inactive = true;
00218         _show_button = true;
00219 }

NotifyArea::~NotifyArea ( )

Definition at line 221 of file traynotify.cpp.

References WindowHandle::_hwnd, and write_config().

00222 {
00223         KillTimer(_hwnd, 0);
00224
00225         write_config();
00226 }

Here is the call graph for this function:

Member Function Documentation

void NotifyArea::CancelModes ( ) [protected]

Reimplemented from Window.

Definition at line 576 of file traynotify.cpp.

References _sorted_icons.

00577 {
00578         PostMessage(HWND_BROADCAST, WM_CANCELMODE, 0, 0);
00579
00580         for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it)
00581                 PostMessage(it->_hWnd, WM_CANCELMODE, 0, 0);
00582 }

int NotifyArea::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 515 of file traynotify.cpp.

References Dialog::DoModal(), ID_CONFIG_NOTIFYAREA, ID_CONFIG_TIME, ID_SHOW_ICON_BUTTON, IDD_NOTIFYAREA, launch_cpanel(), and WINDOW_CREATOR.

00516 {
00517         switch(id) {
00518           case ID_SHOW_HIDDEN_ICONS:
00519                 _show_hidden = !_show_hidden;
00520                 UpdateIcons();
00521                 break;
00522
00523           case ID_SHOW_ICON_BUTTON:
00524                 _show_button = !_show_button;
00525                 UpdateIcons();
00526                 break;
00527
00528           case ID_CONFIG_NOTIFYAREA:
00529                 Dialog::DoModal(IDD_NOTIFYAREA, WINDOW_CREATOR(TrayNotifyDlg), GetParent(_hwnd));
00530                 break;
00531
00532           case ID_CONFIG_TIME:
00533                 launch_cpanel(_hwnd, TEXT("timedate.cpl"));
00534                 break;
00535
00536           default:
00537                 SendParent(WM_COMMAND, MAKELONG(id,code), 0);
00538         }
00539
00540         return 0;
00541 }

Here is the call graph for this function:

HWND NotifyArea::Create ( HWND hwndParent ) [static]

Definition at line 374 of file traynotify.cpp.

References CLASSNAME_TRAYNOTIFY, Window::Create(), NOTIFYAREA_WIDTH_DEF, TITLE_TRAYNOTIFY, and WINDOW_CREATOR.

Referenced by DesktopBar::Init().

00375 {
00376         static BtnWindowClass wcTrayNotify(CLASSNAME_TRAYNOTIFY, CS_DBLCLKS);
00377
00378         ClientRect clnt(hwndParent);
00379
00380         return Window::Create(WINDOW_CREATOR(NotifyArea), WS_EX_STATICEDGE,
00381                                                         wcTrayNotify, TITLE_TRAYNOTIFY, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN,
00382                                                         clnt.right-(NOTIFYAREA_WIDTH_DEF+1), 1, NOTIFYAREA_WIDTH_DEF, clnt.bottom-2, hwndParent);
00383 }

Here is the call graph for this function:

bool NotifyArea::DetermineHideState ( NotifyInfo & entry ) [protected]

Referenced by NotifyIconConfig::create_name(), ProcessTrayNotification(), and Refresh().

NotifyIconSet::iterator NotifyArea::IconHitTest ( const POINT & pos ) [protected]

search for a icon at a given client coordinate position

Definition at line 799 of file traynotify.cpp.

References _show_button, _sorted_icons, NOTIFYICON_DIST, NOTIFYICON_SIZE, NOTIFYICON_X, and NOTIFYICON_Y.

Referenced by Notify(), and WndProc().

00800 {
00801         if (pos.y<NOTIFYICON_Y || pos.y>=NOTIFYICON_Y+NOTIFYICON_SIZE)
00802                 return _sorted_icons.end();
00803
00804         NotifyIconSet::iterator it = _sorted_icons.begin();
00805
00806         int x = NOTIFYICON_X;
00807
00808         if (_show_button)
00809                 x += NOTIFYICON_DIST;
00810
00811         for(; it!=_sorted_icons.end(); ++it) {
00812                 //NotifyInfo& entry = const_cast<NotifyInfo&>(*it);     // Why does GCC 3.3 need this additional const_cast ?!
00813
00814                 if (pos.x>=x && pos.x<x+NOTIFYICON_SIZE)
00815                         break;
00816
00817                 x += NOTIFYICON_DIST;
00818         }
00819
00820         return it;
00821 }

LRESULT NotifyArea::Init ( LPCREATESTRUCT pcs ) [protected, virtual]

Reimplemented from Window.

Definition at line 362 of file traynotify.cpp.

References WindowHandle::_hwnd, Window::Init(), and read_config().

00363 {
00364         if (super::Init(pcs))
00365                 return 1;
00366
00367         read_config();
00368
00369         SetTimer(_hwnd, 0, 1000, NULL);
00370
00371         return 0;
00372 }

Here is the call graph for this function:

int NotifyArea::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 543 of file traynotify.cpp.

References WindowHandle::_hwnd, _show_button, _show_hidden, _sorted_icons, IconHitTest(), IDS_HIDE_ICONS, IDS_SHOW_HIDDEN_ICONS, NOTIFYICON_SIZE, NOTIFYICON_X, NOTIFYICON_Y, and ScreenToClient().

00544 {
00545         if (pnmh->code == TTN_GETDISPINFO) {
00546                 LPNMTTDISPINFO pdi = (LPNMTTDISPINFO)pnmh;
00547
00548                 Point pt(GetMessagePos());
00549                 ScreenToClient(_hwnd, &pt);
00550
00551                 if (_show_button &&
00552                         pt.x>=NOTIFYICON_X && pt.x<NOTIFYICON_X+NOTIFYICON_SIZE &&
00553                         pt.y>=NOTIFYICON_Y && pt.y<NOTIFYICON_Y+NOTIFYICON_SIZE)
00554                 {
00555                         static ResString sShowIcons(IDS_SHOW_HIDDEN_ICONS);
00556                         static ResString sHideIcons(IDS_HIDE_ICONS);
00557
00558                         pdi->lpszText = (_show_hidden? sHideIcons: sShowIcons).str();
00559                 } else {
00560                         NotifyIconSet::iterator found = IconHitTest(pt);
00561
00562                         if (found != _sorted_icons.end()) {
00563                                 NotifyInfo& entry = const_cast<NotifyInfo&>(*found);    // Why does GCC 3.3 need this additional const_cast ?!
00564
00565                                  // enable multiline tooltips (break at CR/LF and for very long one-line strings)
00566                                 SendMessage(pnmh->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 400);
00567
00568                                 pdi->lpszText = entry._tipText.str();
00569                         }
00570                 }
00571         }
00572
00573         return 0;
00574 }

Here is the call graph for this function:

void NotifyArea::Paint ( ) [protected]

Definition at line 707 of file traynotify.cpp.

References WindowHandle::_hwnd, _show_hidden, _sorted_icons, IDI_NOTIFY_L, IDI_NOTIFY_R, NOTIFYICON_DIST, NOTIFYICON_SIZE, NOTIFYICON_X, and NOTIFYICON_Y.

Referenced by WndProc().

00708 {
00709         BufferedPaintCanvas canvas(_hwnd);
00710
00711          // first fill with the background color
00712         FillRect(canvas, &canvas.rcPaint, GetSysColorBrush(COLOR_BTNFACE));
00713
00714          // draw icons
00715         int x = NOTIFYICON_X;
00716         int y = NOTIFYICON_Y;
00717
00718         if (_show_button) {
00719                 static SmallIcon leftArrowIcon(IDI_NOTIFY_L);
00720                 static SmallIcon rightArrowIcon(IDI_NOTIFY_R);
00721
00722                 DrawIconEx(canvas, x, y, _show_hidden?rightArrowIcon:leftArrowIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL);
00723                 x += NOTIFYICON_DIST;
00724         }
00725
00726 #ifndef _NO_ALPHABLEND
00727         MemCanvas mem_dc;
00728         SelectedBitmap bmp(mem_dc, CreateCompatibleBitmap(canvas, NOTIFYICON_SIZE, NOTIFYICON_SIZE));
00729         RECT rect = {0, 0, NOTIFYICON_SIZE, NOTIFYICON_SIZE};
00730         BLENDFUNCTION blend = {AC_SRC_OVER, 0, 128, 0}; // 50 % visible
00731 #endif
00732
00733         for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it) {
00734 #ifndef _NO_ALPHABLEND
00735                 if (it->_dwState & NIS_HIDDEN) {
00736                         FillRect(mem_dc, &rect, GetSysColorBrush(COLOR_BTNFACE));
00737                         DrawIconEx(mem_dc, 0, 0, it->_hIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL);
00738                         AlphaBlend(canvas, x, y, NOTIFYICON_SIZE, NOTIFYICON_SIZE, mem_dc, 0, 0, NOTIFYICON_SIZE, NOTIFYICON_SIZE, blend);
00739                 } else
00740 #endif
00741                         DrawIconEx(canvas, x, y, it->_hIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL);
00742
00743                 x += NOTIFYICON_DIST;
00744         }
00745 }

LRESULT NotifyArea::ProcessTrayNotification | ( | int | notify_code,
 |  | NOTIFYICONDATA * | pnid
 | ) |

Todo:
This is a fix for Windows Task Manager.
Todo:
call only if really changes occurred

Definition at line 584 of file traynotify.cpp.

References NotifyInfo::_dwState, _icon_map, NotifyInfo::_idx, NotifyIconConfig::_mode, _next_idx, DetermineHideState(), NotifyInfo::modify(), NIM_HIDE, and UpdateIcons().

00585 {
00586         switch(notify_code) {
00587           case NIM_ADD:
00588           case NIM_MODIFY:
00589                 if ((int)pnid->uID >= 0) {
00590                         NotifyInfo& entry = _icon_map[pnid];
00591
00592                          // a new entry?
00593                         if (entry._idx == -1)
00594                                 entry._idx = ++_next_idx;
00595                 /* equivalent code using iterator::find();
00596                         NotifyIconMap::iterator found = _icon_map.find(pnid);
00597                         NotifyInfo* pentry;
00598                          // a new entry?
00599                         if (found == _icon_map.end()) {
00600                                 pentry = &_icon_map[pnid];
00601                                 pentry->_idx = ++_next_idx;
00602                         } else {
00603                                 pentry = &found->second;
00604                         }
00605                         NotifyInfo& entry = *pentry;
00606                 */
00607                         bool changes = entry.modify(pnid);
00608
00609 #if NOTIFYICON_VERSION>=3       // as of 21.08.2003 missing in MinGW headers
00610                         if (DetermineHideState(entry) && entry._mode==NIM_HIDE) {
00611                                 entry._dwState |= NIS_HIDDEN;
00612                                 changes = true;
00613                         }
00614 #endif
00615
00616                         if (changes)
00617                                 UpdateIcons();
00618
00619                         return TRUE;
00620                 }
00621                 break;
00622
00623           case NIM_DELETE: {
00624                 NotifyIconMap::iterator found = _icon_map.find(pnid);
00625
00626                 if (found != _icon_map.end()) {
00627                         if (found->second._hIcon)
00628                                 DestroyIcon(found->second._hIcon);
00629                         _icon_map.erase(found);
00630                         UpdateIcons();
00631                         return TRUE;
00632                 }
00633                 break;}
00634
00635 #if NOTIFYICON_VERSION>=3       // as of 21.08.2003 missing in MinGW headers
00636           case NIM_SETFOCUS:
00637                 SetForegroundWindow(_hwnd);
00638                 return TRUE;
00639
00640           case NIM_SETVERSION:
00641                 NotifyIconMap::iterator found = _icon_map.find(pnid);
00642
00643                 if (found != _icon_map.end()) {
00644                         found->second._version = pnid->UNION_MEMBER(uVersion);
00645                         return TRUE;
00646                 } else
00647                         return FALSE;
00648 #endif
00649         }
00650
00651         return FALSE;
00652 }

Here is the call graph for this function:

void NotifyArea::read_config ( ) [protected]

Todo:
read default setting from registry
Todo:
read default setting from registry

Definition at line 248 of file traynotify.cpp.

References XMLStorage::XMLPos::back(), g_Globals, ExplorerGlobals::get_cfg(), and XMLStorage::XMLPos::go_down().

Referenced by Init(), and WndProc().

00249 {
00250         bool clock_visible = true;
00251
00252          // read notification icon settings from XML configuration
00253         XMLPos cfg_pos = g_Globals.get_cfg();
00254
00255 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
00256         if (!g_Globals._SHRestricted || !SHRestricted(REST_HIDECLOCK))
00257 #endif
00258         {
00259                 if (cfg_pos.go_down("desktopbar")) {
00260                         clock_visible = XMLBoolRef(XMLPos(cfg_pos,"options"), "show-clock", !get_hide_clock_from_registry());
00261                         cfg_pos.back();
00262                 }
00263         }
00264
00265         if (cfg_pos.go_down("notify-icons")) {
00266                 XMLPos options(cfg_pos, "options");
00267
00268                 _hide_inactive = XMLBool(options, "hide-inactive", true);
00269                 _show_hidden = XMLBool(options, "show-hidden", false);
00270                 _show_button = XMLBool(options, "show-button", true);
00271
00272                 XMLChildrenFilter icons(cfg_pos, "icon");
00273
00274                 for(XMLChildrenFilter::iterator it=icons.begin(); it!=icons.end(); ++it) {
00275                         const XMLNode& node = **it;
00276
00277                         NotifyIconConfig cfg;
00278
00279                         cfg._name = node.get("name").c_str();
00280                         cfg._tipText = node.get("text").c_str();
00281                         cfg._windowTitle = node.get("window").c_str();
00282                         cfg._modulePath = node.get("module").c_str();
00283                         const string& mode = node.get("show");
00284
00285                         if (mode == "show")
00286                                 cfg._mode = NIM_SHOW;
00287                         else if (mode == "hide")
00288                                 cfg._mode = NIM_HIDE;
00289                         else //if (mode == "auto")
00290                                 cfg._mode = NIM_HIDE;
00291
00292                         _cfg.push_back(cfg);
00293                 }
00294
00295                 cfg_pos.back();
00296         }
00297
00298         show_clock(clock_visible);
00299 }

Here is the call graph for this function:

void NotifyArea::Refresh ( bool do_refresh = false ) [protected]

Definition at line 747 of file traynotify.cpp.

References _hide_inactive, _icon_map, _sorted_icons, DetermineHideState(), ICON_AUTOHIDE_SECONDS, NIM_AUTO, and NIM_SHOW.

Referenced by WndProc().

00748 {
00749          // Look for task icons without valid owner window.
00750          // This is an extended feature missing in MS Windows.
00751         for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it) {
00752                 const NotifyInfo& entry = *it;
00753
00754                 if (!IsWindow(entry._hWnd))
00755                         if (_icon_map.erase(entry))     // delete icons without valid owner window
00756                                 ++update;
00757         }
00758
00759         DWORD now = GetTickCount();
00760
00761          // handle icon hiding
00762         for(NotifyIconMap::iterator it=_icon_map.begin(); it!=_icon_map.end(); ++it) {
00763                 NotifyInfo& entry = it->second;
00764
00765                 DetermineHideState(entry);
00766
00767                 switch(entry._mode) {
00768                   case NIM_HIDE:
00769                         if (!(entry._dwState & NIS_HIDDEN)) {
00770                                 entry._dwState |= NIS_HIDDEN;
00771                                 ++update;
00772                         }
00773                         break;
00774
00775                   case NIM_SHOW:
00776                         if (entry._dwState&NIS_HIDDEN) {
00777                                 entry._dwState &= ~NIS_HIDDEN;
00778                                 ++update;
00779                         }
00780                         break;
00781
00782                   case NIM_AUTO:
00783                          // automatically hide icons after long periods of inactivity
00784                         if (_hide_inactive)
00785                                 if (!(entry._dwState & NIS_HIDDEN))
00786                                         if (now-entry._lastChange > ICON_AUTOHIDE_SECONDS*1000) {
00787                                                 entry._dwState |= NIS_HIDDEN;
00788                                                 ++update;
00789                                         }
00790                         break;
00791                 }
00792         }
00793
00794         if (update)
00795                 UpdateIcons();
00796 }

Here is the call graph for this function:

void NotifyArea::show_clock ( bool flag ) [protected]

Definition at line 339 of file traynotify.cpp.

References _clock_width, WindowHandle::_hwnd, _hwndClock, ClockWindow::Create(), and PM_RESIZE_CHILDREN.

00340 {
00341         bool vis = _hwndClock!=0;
00342
00343         if (vis != flag) {
00344                 if (flag) {
00345                          // create clock window
00346                         _hwndClock = ClockWindow::Create(_hwnd);
00347
00348                         if (_hwndClock) {
00349                                 ClientRect clock_size(_hwndClock);
00350                                 _clock_width = clock_size.right;
00351                         }
00352                 } else {
00353                         DestroyWindow(_hwndClock);
00354                         _hwndClock = 0;
00355                         _clock_width = 0;
00356                 }
00357
00358                 SendMessage(GetParent(_hwnd), PM_RESIZE_CHILDREN, 0, 0);
00359         }
00360 }

Here is the call graph for this function:

void NotifyArea::UpdateIcons ( ) [protected]

Definition at line 654 of file traynotify.cpp.

References _icon_map, _show_hidden, and _sorted_icons.

Referenced by ProcessTrayNotification().

00655 {
00656         _sorted_icons.clear();
00657
00658          // sort icon infos by display index
00659         for(NotifyIconMap::const_iterator it=_icon_map.begin(); it!=_icon_map.end(); ++it) {
00660                 const NotifyInfo& entry = it->second;
00661
00662 #ifdef NIF_STATE        // as of 21.08.2003 missing in MinGW headers
00663                 if (_show_hidden || !(entry._dwState & NIS_HIDDEN))
00664 #endif
00665                         _sorted_icons.insert(entry);
00666         }
00667
00668          // sync tooltip areas to current icon number
00669         if (_sorted_icons.size() != _last_icon_count) {
00670                 RECT rect = {NOTIFYICON_X, NOTIFYICON_Y, NOTIFYICON_X+NOTIFYICON_SIZE, NOTIFYICON_Y+NOTIFYICON_SIZE};
00671
00672                 size_t tt_idx = 0;
00673
00674                 if (_show_button) {
00675                         _tooltip.add(_hwnd, tt_idx++, rect);
00676
00677                         rect.left += NOTIFYICON_DIST;
00678                         rect.right += NOTIFYICON_DIST;
00679                 }
00680
00681                 size_t icon_cnt = _sorted_icons.size();
00682                 while(tt_idx < icon_cnt) {
00683                         _tooltip.add(_hwnd, tt_idx++, rect);
00684
00685                         rect.left += NOTIFYICON_DIST;
00686                         rect.right += NOTIFYICON_DIST;
00687                 }
00688
00689                 while(tt_idx < _last_icon_count)
00690                         _tooltip.remove(_hwnd, tt_idx++);
00691
00692                 _last_icon_count = _sorted_icons.size();
00693         }
00694
00695         SendMessage(GetParent(_hwnd), PM_RESIZE_CHILDREN, 0, 0);
00696
00697         InvalidateRect(_hwnd, NULL, FALSE);     // refresh icon display
00698         UpdateWindow(_hwnd);
00699 }

LRESULT NotifyArea::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 385 of file traynotify.cpp.

References _clock_width, WindowHandle::_hwnd, _hwndClock, _show_button, _show_hidden, _sorted_icons, GET_WINDOW, IconHitTest(), ID_SHOW_HIDDEN_ICONS, ID_SHOW_ICON_BUTTON, IDM_NOTIFYAREA, NOTIFYAREA_SPACE, NOTIFYICON_DIST, Paint(), PM_GET_WIDTH, PM_REFRESH, PM_REFRESH_CONFIG, read_config(), Refresh(), ScreenToClient(), and ClockWindow::TimerTick().

00386 {
00387         switch(nmsg) {
00388           case WM_PAINT:
00389                 Paint();
00390                 break;
00391
00392           case WM_TIMER: {
00393                 Refresh();
00394
00395                 ClockWindow* clock_window = GET_WINDOW(ClockWindow, _hwndClock);
00396
00397                 if (clock_window)
00398                         clock_window->TimerTick();
00399                 break;}
00400
00401           case PM_REFRESH:
00402                 Refresh(true);
00403                 break;
00404
00405           case WM_SIZE: {
00406                 int cx = LOWORD(lparam);
00407                 SetWindowPos(_hwndClock, 0, cx-_clock_width, 0, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
00408                 break;}
00409
00410           case PM_GET_WIDTH: {
00411                 int w = _sorted_icons.size()*NOTIFYICON_DIST + NOTIFYAREA_SPACE + _clock_width;
00412                 if (_show_button)
00413                         w += NOTIFYICON_DIST;
00414                 return w;}
00415
00416           case PM_REFRESH_CONFIG:
00417                 read_config();
00418                 break;
00419
00420           case WM_CONTEXTMENU: {
00421                 Point pt(lparam);
00422                 ScreenToClient(_hwnd, &pt);
00423
00424                 if (IconHitTest(pt) == _sorted_icons.end()) { // display menu only when no icon clicked
00425                         PopupMenu menu(IDM_NOTIFYAREA);
00426                         SetMenuDefaultItem(menu, 0, MF_BYPOSITION);
00427                         CheckMenuItem(menu, ID_SHOW_HIDDEN_ICONS, MF_BYCOMMAND|(_show_hidden?MF_CHECKED:MF_UNCHECKED));
00428                         CheckMenuItem(menu, ID_SHOW_ICON_BUTTON, MF_BYCOMMAND|(_show_button?MF_CHECKED:MF_UNCHECKED));
00429                         menu.TrackPopupMenu(_hwnd, MAKEPOINTS(lparam));
00430                 }
00431                 break;}
00432
00433           case WM_COPYDATA: {   // receive NotifyHook answers
00434                 String path;
00435                 HWND hwnd;
00436
00437                 if (_hook.ModulePathCopyData(lparam, &hwnd, path))
00438                         _window_modules[hwnd] = path;
00439                 break;}
00440
00441           default:
00442                 if (nmsg>=WM_MOUSEFIRST && nmsg<=WM_MOUSELAST) {
00443                          // close startup menu and other popup menus
00444                          // This functionality is missing in MS Windows.
00445                         if (nmsg==WM_LBUTTONDOWN || nmsg==WM_MBUTTONDOWN || nmsg==WM_RBUTTONDOWN
00446 #ifdef WM_XBUTTONDOWN
00447                                 || nmsg==WM_XBUTTONDOWN
00448 #endif
00449                                 )
00450
00451                                 CancelModes();
00452
00453                         Point pt(lparam);
00454                         NotifyIconSet::const_iterator found = IconHitTest(pt);
00455
00456                         if (found != _sorted_icons.end()) {
00457                                 const NotifyInfo& entry = const_cast<NotifyInfo&>(*found);      // Why does GCC 3.3 need this additional const_cast ?!
00458
00459                                  // set activation time stamp
00460                                 if (nmsg == WM_LBUTTONDOWN ||   // Some programs need PostMessage() instead of SendMessage().
00461                                         nmsg == WM_MBUTTONDOWN ||       // So call SendMessage() only for BUTTONUP and BLCLK messages
00462 #ifdef WM_XBUTTONDOWN
00463                                         nmsg == WM_XBUTTONDOWN ||
00464 #endif
00465                                         nmsg == WM_RBUTTONDOWN) {
00466                                         _icon_map[entry]._lastChange = GetTickCount();
00467                                 }
00468
00469                                  // Notify the message if the owner is still alive
00470                                 if (IsWindow(entry._hWnd)) {
00471                                         if (nmsg == WM_MOUSEMOVE ||             // avoid to call blocking SendMessage() for merely moving the mouse over icons
00472                                                 nmsg == WM_LBUTTONDOWN ||       // Some programs need PostMessage() instead of SendMessage().
00473                                                 nmsg == WM_MBUTTONDOWN ||       // So call SendMessage() only for BUTTONUP and BLCLK messages
00474 #ifdef WM_XBUTTONDOWN
00475                                                 nmsg == WM_XBUTTONDOWN ||
00476 #endif
00477                                                 nmsg == WM_RBUTTONDOWN)
00478                                                 PostMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg);
00479                                         else {
00480                                                  // allow SetForegroundWindow() in client process
00481                                                 DWORD pid;
00482
00483                                                 if (GetWindowThreadProcessId(entry._hWnd, &pid)) {
00484                                                          // bind dynamically to AllowSetForegroundWindow() to be compatible to WIN98
00485                                                         static DynamicFct<BOOL(WINAPI*)(DWORD)> AllowSetForegroundWindow(TEXT("USER32"), "AllowSetForegroundWindow");
00486
00487                                                         if (AllowSetForegroundWindow)
00488                                                                 (*AllowSetForegroundWindow)(pid);
00489                                                 }
00490
00491                                                  // use PostMessage() for notifcation icons of Shell Service Objects in the own process
00492                                                 if (pid == GetCurrentProcessId())
00493                                                         PostMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg);
00494                                                 else
00495                                                         SendMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg);
00496                                         }
00497                                 }
00498                                 else if (_icon_map.erase(entry))        // delete icons without valid owner window
00499                                         UpdateIcons();
00500                         } else
00501                                  // handle clicks on notification area button "show hidden icons"
00502                                 if (_show_button)
00503                                         if (nmsg == WM_LBUTTONDOWN)
00504                                                 if (pt.x>=NOTIFYICON_X && pt.x<NOTIFYICON_X+NOTIFYICON_SIZE &&
00505                                                         pt.y>=NOTIFYICON_Y && pt.y<NOTIFYICON_Y+NOTIFYICON_SIZE)
00506                                                         PostMessage(_hwnd, WM_COMMAND, MAKEWPARAM(ID_SHOW_HIDDEN_ICONS,0), 0);
00507                 }
00508
00509                 return super::WndProc(nmsg, wparam, lparam);
00510         }
00511
00512         return 0;
00513 }

Here is the call graph for this function:

void NotifyArea::write_config ( ) [protected]

Definition at line 301 of file traynotify.cpp.

References _cfg, _hide_inactive, _hwndClock, _show_button, _show_hidden, XMLStorage::XMLPos::back(), g_Globals, ExplorerGlobals::get_cfg(), XMLStorage::XMLPos::smart_create(), and string_from_mode().

Referenced by ~NotifyArea().

00302 {
00303          // write notification icon settings to XML configuration file
00304         XMLPos cfg_pos = g_Globals.get_cfg();
00305
00306         cfg_pos.smart_create("desktopbar");
00307         XMLBoolRef boolRef(XMLPos(cfg_pos,"options"), "show-clock");
00308     boolRef = _hwndClock!=0;
00309         cfg_pos.back();
00310
00311         cfg_pos.smart_create("notify-icons");
00312
00313         XMLPos options(cfg_pos, "options");
00314         XMLBoolRef(options, "hide-inactive") = _hide_inactive;
00315         XMLBoolRef(options, "show-hidden") = _show_hidden;
00316         XMLBoolRef(options, "show-button") = _show_button;
00317
00318         for(NotifyIconCfgList::iterator it=_cfg.begin(); it!=_cfg.end(); ++it) {
00319                 NotifyIconConfig& cfg = *it;
00320
00321                  // search for the corresponding node using the original name
00322                 cfg_pos.smart_create("icon", "name", cfg._name);
00323
00324                  // refresh unique name
00325                 cfg.create_name();
00326
00327                 cfg_pos["name"] = cfg._name.c_str();
00328                 cfg_pos["text"] = cfg._tipText.c_str();
00329                 cfg_pos["window"] = cfg._windowTitle.c_str();
00330                 cfg_pos["module"] = cfg._modulePath.c_str();
00331                 cfg_pos["show"] = string_from_mode(cfg._mode).c_str();
00332
00333                 cfg_pos.back();
00334         }
00335
00336         cfg_pos.back(); // smart_create
00337 }

Here is the call graph for this function:

Friends And Related Function Documentation

friend struct TrayNotifyDlg [friend]

Definition at line 168 of file traynotify.h.

Member Data Documentation

NotifyIconCfgList NotifyArea::_cfg [protected]

Definition at line 170 of file traynotify.h.

Referenced by TrayNotifyDlg::Refresh(), TrayNotifyDlg::SetIconMode(), TrayNotifyDlg::TrayNotifyDlg(), and write_config().

int NotifyArea::_clock_width [protected]

Definition at line 143 of file traynotify.h.

Referenced by NotifyArea(), show_clock(), and WndProc().

bool NotifyArea::_hide_inactive [protected]

Definition at line 149 of file traynotify.h.

Referenced by NotifyArea(), Refresh(), and write_config().

NotifyHook NotifyArea::_hook [protected]

Definition at line 146 of file traynotify.h.

Referenced by NotifyIconConfig::create_name().

WindowHandle NotifyArea::_hwndClock [protected]

Definition at line 142 of file traynotify.h.

Referenced by show_clock(), WndProc(), and write_config().

NotifyIconMap NotifyArea::_icon_map [protected]

Definition at line 174 of file traynotify.h.

Referenced by ProcessTrayNotification(), TrayNotifyDlg::Refresh(), Refresh(), TrayNotifyDlg::TrayNotifyDlg(), and UpdateIcons().

size_t NotifyArea::_last_icon_count [protected]

Definition at line 177 of file traynotify.h.

Referenced by NotifyArea().

int NotifyArea::_next_idx [protected]

Definition at line 176 of file traynotify.h.

Referenced by NotifyArea(), and ProcessTrayNotification().

bool NotifyArea::_show_button [protected]

Definition at line 150 of file traynotify.h.

Referenced by IconHitTest(), Notify(), NotifyArea(), WndProc(), and write_config().

bool NotifyArea::_show_hidden [protected]

Definition at line 148 of file traynotify.h.

Referenced by Notify(), NotifyArea(), Paint(), TrayNotifyDlg::TrayNotifyDlg(), UpdateIcons(), WndProc(), and write_config().

NotifyIconSet NotifyArea::_sorted_icons [protected]

Definition at line 175 of file traynotify.h.

Referenced by CancelModes(), IconHitTest(), Notify(), Paint(), Refresh(), UpdateIcons(), and WndProc().

ToolTip NotifyArea::_tooltip [protected]

Definition at line 145 of file traynotify.h.

map<HWND, String> NotifyArea::_window_modules [protected]

Definition at line 172 of file traynotify.h.

Referenced by NotifyIconConfig::create_name().

The documentation for this struct was generated from the following files:
  • traynotify.h
  • traynotify.cpp


ROS Explorer: Member List

NotifyArea Member List

This is the complete list of members for NotifyArea, including all inherited members.

_cfg | NotifyArea | [protected]
_clock_width | NotifyArea | [protected]
_hide_inactive | NotifyArea | [protected]
_hook | NotifyArea | [protected]
_hwnd | WindowHandle | [protected]
_hwndClock | NotifyArea | [protected]
_icon_map | NotifyArea | [protected]
_last_icon_count | NotifyArea | [protected]
_next_idx | NotifyArea | [protected]
_show_button | NotifyArea | [protected]
_show_hidden | NotifyArea | [protected]
_sorted_icons | NotifyArea | [protected]
_tooltip | NotifyArea | [protected]
_window_modules | NotifyArea | [protected]
CancelModes() | NotifyArea | [protected]
Command(int id, int code) | NotifyArea | [protected, virtual]
Create(HWND hwndParent) | NotifyArea | [static]
Window::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Window::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DetermineHideState(NotifyInfo &entry) | NotifyArea | [protected]
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
IconHitTest(const POINT &pos) | NotifyArea | [protected]
Init(LPCREATESTRUCT pcs) | NotifyArea | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | NotifyArea | [protected, virtual]
NotifyArea(HWND hwnd) | NotifyArea |
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
Paint() | NotifyArea | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
ProcessTrayNotification(int notify_code, NOTIFYICONDATA *pnid) | NotifyArea |
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
read_config() | NotifyArea | [protected]
Refresh(bool do_refresh=false) | NotifyArea | [protected]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
show_clock(bool flag) | NotifyArea | [protected]
super typedef | NotifyArea |
TrayNotifyDlg | NotifyArea | [friend]
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
UpdateIcons() | NotifyArea | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | NotifyArea | [protected, virtual]
write_config() | NotifyArea | [protected]
~NotifyArea() | NotifyArea |
~Window() | Window | [virtual]


ROS Explorer: NotifyHook Struct Reference

NotifyHook Struct Reference

#include <traynotify.h>

Collaboration diagram for NotifyHook:

[legend]
List of all members.

Public Member Functions

NotifyHook ()
~NotifyHook ()
void | GetModulePath (HWND hwnd, HWND hwndCallback)
bool | ModulePathCopyData (LPARAM lparam, HWND *phwnd, String &path)

Protected Attributes

const UINT | WM_GETMODULEPATH

Detailed Description

Definition at line 116 of file traynotify.h.

Constructor & Destructor Documentation

NotifyHook::NotifyHook ( )

Definition at line 38 of file traynotify.cpp.

00039  :      WM_GETMODULEPATH(InstallNotifyHook())
00040 {
00041 }

NotifyHook::~NotifyHook ( )

Definition at line 43 of file traynotify.cpp.

00044 {
00045         DeinstallNotifyHook();
00046 }

Member Function Documentation

void NotifyHook::GetModulePath | ( | HWND | hwnd,
 |  | HWND | hwndCallback
 | ) |

Definition at line 48 of file traynotify.cpp.

References WM_GETMODULEPATH.

Referenced by NotifyIconConfig::create_name().

00049 {
00050         PostMessage(hwnd, WM_GETMODULEPATH, (WPARAM)hwndCallback, 0);
00051 }

bool NotifyHook::ModulePathCopyData | ( | LPARAM | lparam,
 |  | HWND * | phwnd,
 |  | String & | path
 | ) |

Definition at line 53 of file traynotify.cpp.

References String::assign(), and COUNTOF.

00054 {
00055         char buffer[MAX_PATH];
00056
00057         int l = GetWindowModulePathCopyData(lparam, phwnd, buffer, COUNTOF(buffer));
00058
00059         if (l) {
00060                 path.assign(buffer, l);
00061                 return true;
00062         } else
00063                 return false;
00064 }

Here is the call graph for this function:

Member Data Documentation

const UINT NotifyHook::WM_GETMODULEPATH [protected]

Definition at line 125 of file traynotify.h.

Referenced by GetModulePath().

The documentation for this struct was generated from the following files:
  • traynotify.h
  • traynotify.cpp


ROS Explorer: Member List

NotifyHook Member List

This is the complete list of members for NotifyHook, including all inherited members.

GetModulePath(HWND hwnd, HWND hwndCallback) | NotifyHook |
ModulePathCopyData(LPARAM lparam, HWND *phwnd, String &path) | NotifyHook |
NotifyHook() | NotifyHook |
WM_GETMODULEPATH | NotifyHook | [protected]
~NotifyHook() | NotifyHook |


ROS Explorer: NotifyIconConfig Struct Reference

NotifyIconConfig Struct Reference

configuration for the display mode of a notification icon More...

#include <traynotify.h>

Inheritance diagram for NotifyIconConfig:

[legend]
Collaboration diagram for NotifyIconConfig:

[legend]
List of all members.

Public Member Functions

NotifyIconConfig ()
void | create_name ()
bool | match (const NotifyIconConfig &props) const

Public Attributes

String _tipText
String _windowTitle
String _modulePath
NOTIFYICONMODE _mode
String _name

Detailed Description

configuration for the display mode of a notification icon

Definition at line 71 of file traynotify.h.

Constructor & Destructor Documentation

NotifyIconConfig::NotifyIconConfig ( ) [inline]

Definition at line 73 of file traynotify.h.

00073 : _mode(NIM_AUTO) {}

Member Function Documentation

void NotifyIconConfig::create_name ( )

Definition at line 824 of file traynotify.cpp.

References NotifyArea::_hook, WindowHandle::_hwnd, NotifyIconIndex::_hWnd, _modulePath, _name, _tipText, NotifyArea::_window_modules, _windowTitle, NotifyArea::DetermineHideState(), NotifyHook::GetModulePath(), and match().

Referenced by NotifyInfo::modify().

00825 {
00826         _name = FmtString(TEXT("'%s' - '%s' - '%s'"), _tipText.c_str(), _windowTitle.c_str(), _modulePath.c_str());
00827 }

Here is the call graph for this function:

bool NotifyIconConfig::match ( const NotifyIconConfig & props ) const

Referenced by create_name().

Member Data Documentation

NOTIFYICONMODE NotifyIconConfig::_mode

Definition at line 83 of file traynotify.h.

Referenced by TrayNotifyDlg::InsertItem(), NotifyInfo::NotifyInfo(), NotifyArea::ProcessTrayNotification(), TrayNotifyDlg::RefreshProperties(), and TrayNotifyDlg::SetIconMode().

String NotifyIconConfig::_modulePath

Definition at line 81 of file traynotify.h.

Referenced by create_name(), and TrayNotifyDlg::RefreshProperties().

String NotifyIconConfig::_name

Definition at line 85 of file traynotify.h.

Referenced by create_name().

String NotifyIconConfig::_tipText

Definition at line 79 of file traynotify.h.

Referenced by create_name(), NotifyInfo::modify(), and TrayNotifyDlg::RefreshProperties().

String NotifyIconConfig::_windowTitle

Definition at line 80 of file traynotify.h.

Referenced by create_name(), NotifyInfo::modify(), and TrayNotifyDlg::RefreshProperties().

The documentation for this struct was generated from the following files:
  • traynotify.h
  • traynotify.cpp


ROS Explorer: Member List

NotifyIconConfig Member List

This is the complete list of members for NotifyIconConfig, including all inherited members.

_mode | NotifyIconConfig |
_modulePath | NotifyIconConfig |
_name | NotifyIconConfig |
_tipText | NotifyIconConfig |
_windowTitle | NotifyIconConfig |
create_name() | NotifyIconConfig |
match(const NotifyIconConfig &props) const | NotifyIconConfig |
NotifyIconConfig() | NotifyIconConfig | [inline]


ROS Explorer: NotifyIconDlgInfo Struct Reference

NotifyIconDlgInfo Struct Reference

#include <traynotify.h>

Inheritance diagram for NotifyIconDlgInfo:

[legend]
Collaboration diagram for NotifyIconDlgInfo:

[legend]
List of all members.

Public Types

typedef NotifyIconConfig | super

Public Member Functions

NotifyIconDlgInfo (const NotifyInfo &info)
NotifyIconDlgInfo (const NotifyIconConfig &cfg)
NotifyIconDlgInfo ()

Public Attributes

DWORD | _lastChange

Detailed Description

Definition at line 183 of file traynotify.h.

Member Typedef Documentation

typedef NotifyIconConfig NotifyIconDlgInfo::super

Definition at line 185 of file traynotify.h.

Constructor & Destructor Documentation

NotifyIconDlgInfo::NotifyIconDlgInfo ( const NotifyInfo & info ) [inline]

Definition at line 187 of file traynotify.h.

00187 : super(info), _lastChange(info._lastChange) {}

NotifyIconDlgInfo::NotifyIconDlgInfo ( const NotifyIconConfig & cfg ) [inline]

Definition at line 188 of file traynotify.h.

00188 : super(cfg), _lastChange(0) {}

NotifyIconDlgInfo::NotifyIconDlgInfo ( ) [inline]

Definition at line 189 of file traynotify.h.

00189 : _lastChange(0) {}

Member Data Documentation

DWORD NotifyIconDlgInfo::_lastChange

Definition at line 191 of file traynotify.h.

Referenced by TrayNotifyDlg::RefreshProperties().

The documentation for this struct was generated from the following file:
  • traynotify.h


ROS Explorer: Member List

NotifyIconDlgInfo Member List

This is the complete list of members for NotifyIconDlgInfo, including all inherited members.

_lastChange | NotifyIconDlgInfo |
_mode | NotifyIconConfig |
_modulePath | NotifyIconConfig |
_name | NotifyIconConfig |
_tipText | NotifyIconConfig |
_windowTitle | NotifyIconConfig |
create_name() | NotifyIconConfig |
match(const NotifyIconConfig &props) const | NotifyIconConfig |
NotifyIconConfig() | NotifyIconConfig | [inline]
NotifyIconDlgInfo(const NotifyInfo &info) | NotifyIconDlgInfo | [inline]
NotifyIconDlgInfo(const NotifyIconConfig &cfg) | NotifyIconDlgInfo | [inline]
NotifyIconDlgInfo() | NotifyIconDlgInfo | [inline]
super typedef | NotifyIconDlgInfo |


ROS Explorer: NotifyIconIndex Struct Reference

NotifyIconIndex Struct Reference

NotifyIconIndex is used for maintaining the order of notification icons. More...

#include <traynotify.h>

Inheritance diagram for NotifyIconIndex:

[legend]
Collaboration diagram for NotifyIconIndex:

[legend]
List of all members.

Public Member Functions

NotifyIconIndex (NOTIFYICONDATA *pnid)

Public Attributes

HWND _hWnd
UINT | _uID

Protected Member Functions

NotifyIconIndex ()

Friends

bool | operator< (const NotifyIconIndex &a, const NotifyIconIndex &b)

Detailed Description

NotifyIconIndex is used for maintaining the order of notification icons.

Definition at line 48 of file traynotify.h.

Constructor & Destructor Documentation

NotifyIconIndex::NotifyIconIndex ( NOTIFYICONDATA * pnid )

Definition at line 67 of file traynotify.cpp.

References _hWnd, and _uID.

00068 {
00069         _hWnd = pnid->hWnd;
00070         _uID = pnid->uID;
00071
00072          // special handling for windows task manager
00073         if ((int)_uID < 0)
00074                 _uID = 0;
00075 }

NotifyIconIndex::NotifyIconIndex ( ) [protected]

Definition at line 77 of file traynotify.cpp.

References _hWnd, and _uID.

00078 {
00079         _hWnd = 0;
00080         _uID = 0;
00081 }

Friends And Related Function Documentation

bool operator< | ( | const NotifyIconIndex & | a,
 |  | const NotifyIconIndex & | b
 | ) | [friend]

Definition at line 53 of file traynotify.h.

00054                 {return a._hWnd<b._hWnd || (a._hWnd==b._hWnd && a._uID<b._uID);}

Member Data Documentation

HWND NotifyIconIndex::_hWnd

Definition at line 56 of file traynotify.h.

Referenced by NotifyIconConfig::create_name(), NotifyInfo::modify(), and NotifyIconIndex().

UINT NotifyIconIndex::_uID

Definition at line 57 of file traynotify.h.

Referenced by NotifyInfo::modify(), and NotifyIconIndex().

The documentation for this struct was generated from the following files:
  • traynotify.h
  • traynotify.cpp


ROS Explorer: Member List

NotifyIconIndex Member List

This is the complete list of members for NotifyIconIndex, including all inherited members.

_hWnd | NotifyIconIndex |
_uID | NotifyIconIndex |
NotifyIconIndex(NOTIFYICONDATA *pnid) | NotifyIconIndex |
NotifyIconIndex() | NotifyIconIndex | [protected]
operator<(const NotifyIconIndex &a, const NotifyIconIndex &b) | NotifyIconIndex | [friend]


ROS Explorer: NotifyInfo Struct Reference

NotifyInfo Struct Reference

structure for maintaining informations about one notification icon More...

#include <traynotify.h>

Inheritance diagram for NotifyInfo:

[legend]
Collaboration diagram for NotifyInfo:

[legend]
List of all members.

Public Member Functions

NotifyInfo ()
bool | modify (NOTIFYICONDATA *pnid)

Public Attributes

int | _idx
HICON | _hIcon
DWORD | _dwState
UINT | _uCallbackMessage
UINT | _version
DWORD | _lastChange

Friends

bool | operator< (const NotifyInfo &a, const NotifyInfo &b)

Detailed Description

structure for maintaining informations about one notification icon

Definition at line 93 of file traynotify.h.

Constructor & Destructor Documentation

NotifyInfo::NotifyInfo ( )

Definition at line 84 of file traynotify.cpp.

References _dwState, _hIcon, _idx, _lastChange, NotifyIconConfig::_mode, _uCallbackMessage, _version, and NIM_AUTO.

00085 {
00086         _idx = -1;
00087         _hIcon = 0;
00088         _dwState = 0;
00089         _uCallbackMessage = 0;
00090         _version = 0;
00091
00092         _mode = NIM_AUTO;
00093         _lastChange = GetTickCount();
00094 }

Member Function Documentation

bool NotifyInfo::modify ( NOTIFYICONDATA * pnid )

Todo:
compare icon

Definition at line 107 of file traynotify.cpp.

References _dwState, _hIcon, NotifyIconIndex::_hWnd, _lastChange, NotifyIconConfig::_tipText, _uCallbackMessage, NotifyIconIndex::_uID, NotifyIconConfig::_windowTitle, String::assign(), COUNTOF, NotifyIconConfig::create_name(), NID_SIZE_A3, NID_SIZE_A5, NID_SIZE_A6, NID_SIZE_W3, NID_SIZE_W5, NID_SIZE_W6, and NOTIFYICON_SIZE.

Referenced by NotifyArea::ProcessTrayNotification().

00108 {
00109         bool changes = false;
00110
00111         if (_hWnd!=pnid->hWnd || _uID!=pnid->uID) {
00112                 _hWnd = pnid->hWnd;
00113                 _uID = pnid->uID;
00114
00115                 changes = true;
00116         }
00117
00118         if (pnid->uFlags & NIF_MESSAGE) {
00119                 if (_uCallbackMessage != pnid->uCallbackMessage) {
00120                         _uCallbackMessage = pnid->uCallbackMessage;
00121                         changes = true;
00122                 }
00123         }
00124
00125         if (pnid->uFlags & NIF_ICON) {
00126                  // Some applications destroy the icon immediatelly after completing the
00127                  // NIM_ADD/MODIFY message, so we have to make a copy of it.
00128                 if (_hIcon)
00129                         DestroyIcon(_hIcon);
00130
00131                 _hIcon = (HICON) CopyImage(pnid->hIcon, IMAGE_ICON, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0);
00132
00133                 changes = true;
00134         }
00135
00136 #ifdef NIF_STATE        // as of 21.08.2003 missing in MinGW headers
00137         if (pnid->uFlags & NIF_STATE) {
00138                 DWORD new_state = (_dwState&~pnid->dwStateMask) | (pnid->dwState&pnid->dwStateMask);
00139
00140                 if (_dwState != new_state) {
00141                         _dwState = new_state;
00142                         changes = true;
00143                 }
00144         }
00145 #endif
00146
00147          // store tool tip text
00148         if (pnid->uFlags & NIF_TIP) {
00149                 String new_text;
00150
00151                 if (pnid->cbSize==NID_SIZE_W6 || pnid->cbSize==NID_SIZE_W5 || pnid->cbSize==NID_SIZE_W3) {
00152                          // UNICODE version of NOTIFYICONDATA structure
00153                         LPCWSTR txt = (LPCWSTR)pnid->szTip;
00154                         int max_len = pnid->cbSize==NID_SIZE_W3? 64: 128;
00155
00156                          // get tooltip string length
00157                         int l = 0;
00158                         for(; l<max_len; ++l)
00159                                 if (!txt[l])
00160                                         break;
00161
00162                         new_text.assign(txt, l);
00163
00164                         if (new_text != _tipText) {
00165                                 _tipText = new_text;
00166                                 changes = true;
00167                         }
00168                 } else if (pnid->cbSize==NID_SIZE_A6 || pnid->cbSize==NID_SIZE_A5 || pnid->cbSize==NID_SIZE_A3) {
00169                         LPCSTR txt = (LPCSTR)pnid->szTip;
00170                         int max_len = pnid->cbSize==NID_SIZE_A3? 64: 128;
00171
00172                         int l = 0;
00173                         for(int l=0; l<max_len; ++l)
00174                                 if (!txt[l])
00175                                         break;
00176
00177                         new_text.assign(txt, l);
00178
00179                         if (new_text != _tipText) {
00180                                 _tipText = new_text;
00181                                 changes = true;
00182                         }
00183                 }
00184         }
00185
00186         TCHAR title[MAX_PATH];
00187
00188         DWORD pid;
00189         GetWindowThreadProcessId(_hWnd, &pid);
00190
00191          // avoid to send WM_GETTEXT messages to the own process
00192         if (pid != GetCurrentProcessId())
00193                 if (GetWindowText(_hWnd, title, COUNTOF(title))) {
00194                         if (_windowTitle != title) {
00195                                 _windowTitle = title;
00196                                 changes = true;
00197                         }
00198                 }
00199
00200         if (changes) {
00201                 create_name();
00202                 _lastChange = GetTickCount();
00203         }
00204
00205         return changes;
00206 }

Here is the call graph for this function:

Friends And Related Function Documentation

bool operator< | ( | const NotifyInfo & | a,
 |  | const NotifyInfo & | b
 | ) | [friend]

Definition at line 98 of file traynotify.h.

00099                 {return a._idx < b._idx;}

Member Data Documentation

DWORD NotifyInfo::_dwState

Definition at line 105 of file traynotify.h.

Referenced by modify(), NotifyInfo(), and NotifyArea::ProcessTrayNotification().

HICON NotifyInfo::_hIcon

Definition at line 104 of file traynotify.h.

Referenced by TrayNotifyDlg::InsertItem(), modify(), and NotifyInfo().

int NotifyInfo::_idx

Definition at line 103 of file traynotify.h.

Referenced by NotifyInfo(), and NotifyArea::ProcessTrayNotification().

DWORD NotifyInfo::_lastChange

Definition at line 109 of file traynotify.h.

Referenced by modify(), and NotifyInfo().

UINT NotifyInfo::_uCallbackMessage

Definition at line 106 of file traynotify.h.

Referenced by modify(), and NotifyInfo().

UINT NotifyInfo::_version

Definition at line 107 of file traynotify.h.

Referenced by NotifyInfo().

The documentation for this struct was generated from the following files:
  • traynotify.h
  • traynotify.cpp


ROS Explorer: Member List

NotifyInfo Member List

This is the complete list of members for NotifyInfo, including all inherited members.

_dwState | NotifyInfo |
_hIcon | NotifyInfo |
_hWnd | NotifyIconIndex |
_idx | NotifyInfo |
_lastChange | NotifyInfo |
_mode | NotifyIconConfig |
_modulePath | NotifyIconConfig |
_name | NotifyIconConfig |
_tipText | NotifyIconConfig |
_uCallbackMessage | NotifyInfo |
_uID | NotifyIconIndex |
_version | NotifyInfo |
_windowTitle | NotifyIconConfig |
create_name() | NotifyIconConfig |
match(const NotifyIconConfig &props) const | NotifyIconConfig |
modify(NOTIFYICONDATA *pnid) | NotifyInfo |
NotifyIconConfig() | NotifyIconConfig | [inline]
NotifyIconIndex(NOTIFYICONDATA *pnid) | NotifyIconIndex |
NotifyIconIndex() | NotifyIconIndex | [protected]
NotifyInfo() | NotifyInfo |
operator<(const NotifyInfo &a, const NotifyInfo &b) | NotifyInfo | [friend]
NotifyIconIndex::operator<(const NotifyIconIndex &a, const NotifyIconIndex &b) | NotifyIconIndex | [friend]


ROS Explorer: NTDLL Struct Reference

NTDLL Struct Reference

Collaboration diagram for NTDLL:

[legend]
List of all members.

Public Member Functions

NTDLL ()

Public Attributes

NTOBJECTOPENFUNCTIONS | _ObjectOpenFunctions [23]
DynamicFct< void(__stdcall
*)(RtlAnsiString *, LPCSTR)> 		RtlInitAnsiString
DynamicFct< void(__stdcall
*)(RtlUnicodeString *, LPCWSTR)> 		RtlInitUnicodeString
DynamicFct< DWORD(__stdcall
*)(RtlAnsiString *)> 		RtlFreeAnsiString
DynamicFct< DWORD(__stdcall
*)(RtlUnicodeString *)> 		RtlFreeUnicodeString
DynamicFct< DWORD(__stdcall
*)(RtlUnicodeString *, const
RtlAnsiString *, BOOL)> 		RtlAnsiStringToUnicodeString
DynamicFct< DWORD(__stdcall
*)(RtlAnsiString *, const
RtlUnicodeString *, BOOL)> 		RtlUnicodeStringToAnsiString
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenDirectoryObject
DynamicFct< DWORD(__stdcall
*)(HANDLE, NtObjectInfo *,
DWORD size, BOOL, BOOL, void *,
void *)> 		NtQueryDirectoryObject
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, void *,
DWORD *, DWORD, OpenStruct *)> 		NtOpenFile
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenSymbolicLinkObject
DynamicFct< DWORD(__stdcall
*)(HANDLE, RtlUnicodeString *,
DWORD *)> 		NtQuerySymbolicLinkObject
DynamicFct< DWORD(__stdcall
*)(HANDLE, DWORD, NtObject *,
DWORD size, DWORD *read)> 		NtQueryObject
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenMutant
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenSection
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenEvent
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenEventPair
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenIoCompletion
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenSemaphore
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenTimer
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenKey
DynamicFct< DWORD(__stdcall
*)(HANDLE)> 		NtClose
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenProcess
DynamicFct< DWORD(__stdcall
*)(HANDLE *, DWORD, OpenStruct *)> 		NtOpenThread

Static Public Attributes

static const LPCWSTR | s_ObjectTypes []

Detailed Description

Definition at line 40 of file ntobjfs.cpp.

Constructor & Destructor Documentation

NTDLL::NTDLL ( ) [inline]

Definition at line 41 of file ntobjfs.cpp.

00042          :      CONSTRUCT_NTDLLFCT(RtlInitAnsiString),
00043                 CONSTRUCT_NTDLLFCT(RtlInitUnicodeString),
00044                 CONSTRUCT_NTDLLFCT(RtlFreeAnsiString),
00045                 CONSTRUCT_NTDLLFCT(RtlFreeUnicodeString),
00046                 CONSTRUCT_NTDLLFCT(RtlAnsiStringToUnicodeString),
00047                 CONSTRUCT_NTDLLFCT(RtlUnicodeStringToAnsiString),
00048                 CONSTRUCT_NTDLLFCT(NtOpenDirectoryObject),
00049                 CONSTRUCT_NTDLLFCT(NtQueryDirectoryObject),
00050                 CONSTRUCT_NTDLLFCT(NtOpenFile),
00051                 CONSTRUCT_NTDLLFCT(NtOpenSymbolicLinkObject),
00052                 CONSTRUCT_NTDLLFCT(NtQuerySymbolicLinkObject),
00053                 CONSTRUCT_NTDLLFCT(NtQueryObject),
00054                 CONSTRUCT_NTDLLFCT(NtOpenMutant),
00055                 CONSTRUCT_NTDLLFCT(NtOpenSection),
00056                 CONSTRUCT_NTDLLFCT(NtOpenEvent),
00057                 CONSTRUCT_NTDLLFCT(NtOpenEventPair),
00058                 CONSTRUCT_NTDLLFCT(NtOpenIoCompletion),
00059                 CONSTRUCT_NTDLLFCT(NtOpenSemaphore),
00060                 CONSTRUCT_NTDLLFCT(NtOpenTimer),
00061                 CONSTRUCT_NTDLLFCT(NtOpenKey),
00062                 CONSTRUCT_NTDLLFCT(NtClose),
00063                 CONSTRUCT_NTDLLFCT(NtOpenProcess),
00064                 CONSTRUCT_NTDLLFCT(NtOpenThread)
00065         {
00066                 NTOBJECTOPENFUNCTIONS* p = _ObjectOpenFunctions;
00067
00068                 *p++ = *NtOpenDirectoryObject;
00069                 *p++ = *NtOpenSymbolicLinkObject;
00070                 *p++ = *NtOpenMutant;
00071                 *p++ = *NtOpenSection;
00072                 *p++ = *NtOpenEvent;
00073                 *p++ = *NtOpenSemaphore;
00074                 *p++ = *NtOpenTimer;
00075                 *p++ = *NtOpenKey;
00076                 *p++ = *NtOpenEventPair;
00077                 *p++ = *NtOpenIoCompletion;
00078                 *p++ = 0/*Device Object*/;
00079                 *p++ = 0/*NtOpenFile*/;
00080                 *p++ = 0/*CONTROLLER_OBJECT*/;
00081                 *p++ = 0/*PROFILE_OBJECT*/;
00082                 *p++ = 0/*TYPE_OBJECT*/;
00083                 *p++ = 0/*DESKTOP_OBJECT*/;
00084                 *p++ = 0/*WINDOWSTATION_OBJECT*/;
00085                 *p++ = 0/*DRIVER_OBJECT*/;
00086                 *p++ = 0/*TOKEN_OBJECT*/;
00087                 *p++ = 0/*PROCESS_OBJECT*/;
00088                 *p++ = 0/*THREAD_OBJECT*/;
00089                 *p++ = 0/*ADAPTER_OBJECT*/;
00090                 *p++ = 0/*PORT_OBJECT*/;
00091         }

Member Data Documentation

NTOBJECTOPENFUNCTIONS NTDLL::_ObjectOpenFunctions[23]

Definition at line 93 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE)> NTDLL::NtClose

Definition at line 117 of file ntobjfs.cpp.

Referenced by NtObjDirectory::read_directory().

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenDirectoryObject

Definition at line 103 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenEvent

Definition at line 111 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenEventPair

Definition at line 112 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, void*, DWORD*, DWORD, OpenStruct*)> NTDLL::NtOpenFile

Definition at line 105 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenIoCompletion

Definition at line 113 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenKey

Definition at line 116 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenMutant

Definition at line 109 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenProcess

Definition at line 118 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenSection

Definition at line 110 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenSemaphore

Definition at line 114 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenSymbolicLinkObject

Definition at line 106 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenThread

Definition at line 119 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE*, DWORD, OpenStruct*)> NTDLL::NtOpenTimer

Definition at line 115 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(HANDLE, NtObjectInfo*, DWORD size, BOOL, BOOL, void*, void*)> NTDLL::NtQueryDirectoryObject

Definition at line 104 of file ntobjfs.cpp.

Referenced by NtObjDirectory::read_directory().

DynamicFct<DWORD (__stdcall*)(HANDLE, DWORD, NtObject*, DWORD size, DWORD* read)> NTDLL::NtQueryObject

Definition at line 108 of file ntobjfs.cpp.

Referenced by NtObjDirectory::read_directory().

DynamicFct<DWORD (__stdcall*)(HANDLE, RtlUnicodeString*, DWORD*)> NTDLL::NtQuerySymbolicLinkObject

Definition at line 107 of file ntobjfs.cpp.

Referenced by NtObjDirectory::read_directory().

DynamicFct<DWORD (__stdcall*)(RtlUnicodeString*, const RtlAnsiString*, BOOL)> NTDLL::RtlAnsiStringToUnicodeString

Definition at line 100 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(RtlAnsiString*)> NTDLL::RtlFreeAnsiString

Definition at line 98 of file ntobjfs.cpp.

DynamicFct<DWORD (__stdcall*)(RtlUnicodeString*)> NTDLL::RtlFreeUnicodeString

Definition at line 99 of file ntobjfs.cpp.

DynamicFct<void (__stdcall*)(RtlAnsiString*, LPCSTR)> NTDLL::RtlInitAnsiString

Definition at line 96 of file ntobjfs.cpp.

DynamicFct<void (__stdcall*)(RtlUnicodeString*, LPCWSTR)> NTDLL::RtlInitUnicodeString

Definition at line 97 of file ntobjfs.cpp.

Referenced by UnicodeString::UnicodeString().

DynamicFct<DWORD (__stdcall*)(RtlAnsiString*, const RtlUnicodeString*, BOOL)> NTDLL::RtlUnicodeStringToAnsiString

Definition at line 101 of file ntobjfs.cpp.

const LPCWSTR NTDLL::s_ObjectTypes [static]

Initial value:

 {
        L"Directory", L"SymbolicLink",
        L"Mutant", L"Section", L"Event", L"Semaphore",
        L"Timer", L"Key", L"EventPair", L"IoCompletion",
        L"Device", L"File", L"Controller", L"Profile",
        L"Type", L"Desktop", L"WindowStatiom", L"Driver",
        L"Token", L"Process", L"Thread", L"Adapter", L"Port",
        0
}

Definition at line 94 of file ntobjfs.cpp.

Referenced by NtObjDirectory::read_directory().

The documentation for this struct was generated from the following file:
  • ntobjfs.cpp


ROS Explorer: Member List

NTDLL Member List

This is the complete list of members for NTDLL, including all inherited members.

_ObjectOpenFunctions | NTDLL |
NtClose | NTDLL |
NTDLL() | NTDLL | [inline]
NtOpenDirectoryObject | NTDLL |
NtOpenEvent | NTDLL |
NtOpenEventPair | NTDLL |
NtOpenFile | NTDLL |
NtOpenIoCompletion | NTDLL |
NtOpenKey | NTDLL |
NtOpenMutant | NTDLL |
NtOpenProcess | NTDLL |
NtOpenSection | NTDLL |
NtOpenSemaphore | NTDLL |
NtOpenSymbolicLinkObject | NTDLL |
NtOpenThread | NTDLL |
NtOpenTimer | NTDLL |
NtQueryDirectoryObject | NTDLL |
NtQueryObject | NTDLL |
NtQuerySymbolicLinkObject | NTDLL |
RtlAnsiStringToUnicodeString | NTDLL |
RtlFreeAnsiString | NTDLL |
RtlFreeUnicodeString | NTDLL |
RtlInitAnsiString | NTDLL |
RtlInitUnicodeString | NTDLL |
RtlUnicodeStringToAnsiString | NTDLL |
s_ObjectTypes | NTDLL | [static]


ROS Explorer: NtObjChildWndInfo Struct Reference

NtObjChildWndInfo Struct Reference

information structure for creation of FileChildWindow for NT object namespace More...

#include <filechild.h>

Inheritance diagram for NtObjChildWndInfo:

[legend]
Collaboration diagram for NtObjChildWndInfo:

[legend]
List of all members.

Public Types

typedef FileChildWndInfo super

Public Member Functions

NtObjChildWndInfo (HWND hmdiclient, LPCTSTR path)

Detailed Description

information structure for creation of FileChildWindow for NT object namespace

Definition at line 55 of file filechild.h.

Member Typedef Documentation

typedef FileChildWndInfo NtObjChildWndInfo::super

Reimplemented from FileChildWndInfo.

Definition at line 57 of file filechild.h.

Constructor & Destructor Documentation

NtObjChildWndInfo::NtObjChildWndInfo | ( | HWND | hmdiclient,
 |  | LPCTSTR | path
 | ) |

Definition at line 72 of file filechild.cpp.

00073  :      FileChildWndInfo(hmdiclient, path, ET_NTOBJS)
00074 {
00075 }

The documentation for this struct was generated from the following files:
  • filechild.h
  • filechild.cpp


ROS Explorer: Member List

NtObjChildWndInfo Member List

This is the complete list of members for NtObjChildWndInfo, including all inherited members.

_etype | FileChildWndInfo |
_hmdiclient | ChildWndInfo |
_open_mode | FileChildWndInfo |
_path | FileChildWndInfo |
_pos | FileChildWndInfo |
ChildWndInfo(HWND hmdiclient) | ChildWndInfo | [inline]
FileChildWndInfo(HWND hmdiclient, LPCTSTR path, ENTRY_TYPE etype=ET_UNKNOWN) | FileChildWndInfo |
NtObjChildWndInfo(HWND hmdiclient, LPCTSTR path) | NtObjChildWndInfo |
super typedef | NtObjChildWndInfo |


ROS Explorer: NtObjDirectory Struct Reference

NtObjDirectory Struct Reference

NtObj file system directory-entry. More...

#include <ntobjfs.h>

Inheritance diagram for NtObjDirectory:

[legend]
Collaboration diagram for NtObjDirectory:

[legend]
List of all members.

Public Member Functions

NtObjDirectory (LPCTSTR root_path)
NtObjDirectory (Entry *parent, LPCTSTR path)
~NtObjDirectory ()
virtual void | read_directory (int scan_flags=SCAN_ALL)
virtual Entry * | find_entry (const void *)

Detailed Description

NtObj file system directory-entry.

Definition at line 100 of file ntobjfs.h.

Constructor & Destructor Documentation

NtObjDirectory::NtObjDirectory ( LPCTSTR root_path ) [inline]

Definition at line 102 of file ntobjfs.h.

References Directory::_path.

00103          :      NtObjEntry(DIRECTORY_OBJECT)
00104         {
00105                 _path = _tcsdup(root_path);
00106         }

NtObjDirectory::NtObjDirectory | ( | Entry * | parent,
 |  | LPCTSTR | path
 | ) | [inline]

Definition at line 108 of file ntobjfs.h.

References Directory::_path.

00109          :      NtObjEntry(parent, DIRECTORY_OBJECT)
00110         {
00111                 _path = _tcsdup(path);
00112         }

NtObjDirectory::~NtObjDirectory ( ) [inline]

Definition at line 114 of file ntobjfs.h.

References Directory::_path.

00115         {
00116                 free(_path);
00117                 _path = NULL;
00118         }

Member Function Documentation

Entry * NtObjDirectory::find_entry ( const void * ) [virtual]

Reimplemented from Entry.

Definition at line 355 of file ntobjfs.cpp.

References Entry::_data, Entry::_down, and Entry::_next.

00356 {
00357         LPCTSTR name = (LPCTSTR)p;
00358
00359         for(Entry*entry=_down; entry; entry=entry->_next) {
00360                 LPCTSTR p = name;
00361                 LPCTSTR q = entry->_data.cFileName;
00362
00363                 do {
00364                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00365                                 return entry;
00366                 } while(tolower(*p++) == tolower(*q++));
00367
00368                 p = name;
00369                 q = entry->_data.cAlternateFileName;
00370
00371                 do {
00372                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00373                                 return entry;
00374                 } while(tolower(*p++) == tolower(*q++));
00375         }
00376
00377         return NULL;
00378 }

void NtObjDirectory::read_directory ( int scan_flags = SCAN_ALL ) [virtual]

Reimplemented from Entry.

Definition at line 173 of file ntobjfs.cpp.

References Entry::_bhfi, Entry::_bhfi_valid, Entry::_content, Entry::_data, Entry::_level, _MAX_PATH, Entry::_next, Entry::_type_name, ATTRIBUTE_SYMBOLIC_LINK, CONTEXT, COUNTOF, NtObject::creation_time, DIRECTORY_OBJECT, KEY_OBJECT, NtObjectInfo::name, NTDLL::NtClose, NTDLL::NtQueryDirectoryObject, NTDLL::NtQueryObject, NTDLL::NtQuerySymbolicLinkObject, NtObject::reference_count, NTDLL::s_ObjectTypes, RtlUnicodeString::string_len, RtlUnicodeString::string_ptr, SYMBOLICLINK_OBJECT, NtObjectInfo::type, U2nA, UNKNOWN_OBJECT_TYPE, and wcsncpy_s.

00174 {
00175         CONTEXT("NtObjDirectory::read_directory()");
00176
00177         if (!g_NTDLL)
00178                 g_NTDLL = new NTDLL();
00179
00180         Entry* first_entry = NULL;
00181         int level = _level + 1;
00182
00183         LPCTSTR path = (LPCTSTR)_path;
00184
00185         TCHAR buffer[MAX_PATH], *p=buffer;
00186 #ifndef UNICODE
00187         WCHAR wbuffer[MAX_PATH], *w=wbuffer;
00188 #endif
00189
00190         do {
00191                 *p++ = *path;
00192 #ifndef UNICODE
00193                 *w++ = *path;
00194 #endif
00195         } while(*path++);
00196         --p;
00197 #ifndef UNICODE
00198         --w;
00199 #endif
00200
00201         DWORD idx;
00202         HANDLE dir_handle;
00203
00204 #ifdef UNICODE
00205         if (NtOpenObject(_type, &dir_handle, 0, buffer))
00206 #else
00207         if (NtOpenObject(_type, &dir_handle, 0, wbuffer))
00208 #endif
00209                 return;
00210
00211 #ifdef UNICODE
00212         if (p[-1] != '\\')
00213                 *p++ = '\\';
00214 #else
00215         if (w[-1] != '\\')
00216                 *w++ = '\\';
00217 #endif
00218
00219         NtObjectInfo* info = (NtObjectInfo*)alloca(2048);
00220
00221         if (!(*g_NTDLL->NtQueryDirectoryObject)(dir_handle, info, 2048, TRUE, TRUE, &idx, NULL)) {
00222                 WIN32_FIND_DATA w32fd;
00223                 Entry* last = NULL;
00224                 Entry* entry;
00225
00226                 do {
00227                         memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00228
00229 #ifdef UNICODE
00230                         if (info->name.string_ptr) {
00231                                 info->name.string_ptr[info->name.string_len / sizeof(WCHAR)] = 0;
00232                         } else {
00233                                 info->name.string_ptr = TEXT("");
00234                         }
00235                         if (info->type.string_ptr) {
00236                                 info->type.string_ptr[info->type.string_len / sizeof(WCHAR)] = 0;
00237                         } else {
00238                                 info->type.string_ptr = TEXT("");
00239                         }
00240                         lstrcpynW(p, info->name.string_ptr, COUNTOF(buffer));
00241 #else
00242                         WideCharToMultiByte(CP_ACP, 0, info->name.string_ptr, info->name.string_len, p, COUNTOF(buffer), 0, 0);
00243 #endif
00244
00245                         lstrcpyn(w32fd.cFileName, p, sizeof(w32fd.cFileName) / sizeof(0[w32fd.cFileName]));
00246
00247                         const LPCWSTR* tname = NTDLL::s_ObjectTypes;
00248                         OBJECT_TYPE type = UNKNOWN_OBJECT_TYPE;
00249
00250                         for(; *tname; tname++)
00251                                 if (!wcsncmp(info->type.string_ptr, *tname, 32))
00252                                         {type=OBJECT_TYPE(tname-NTDLL::s_ObjectTypes); break;}
00253
00254                         if (type == DIRECTORY_OBJECT) {
00255                                 w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00256
00257                                 entry = new NtObjDirectory(this, buffer);
00258                         }
00259
00260                         else if (type == SYMBOLICLINK_OBJECT) {
00261                                 w32fd.dwFileAttributes |= ATTRIBUTE_SYMBOLIC_LINK;
00262
00263                                 entry = NULL;
00264
00265                                 if (*w32fd.cFileName>='A' &&*w32fd.cFileName<='Z' && w32fd.cFileName[1]==':')
00266                                         if (!_tcsncmp(buffer,TEXT("\\??\\"),4) ||               // NT4
00267                                                 !_tcsncmp(buffer,TEXT("\\GLOBAL??"),9)) {       // XP
00268                                                 w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00269                                                 entry = new WinDirectory(this, w32fd.cFileName);
00270                                         }
00271
00272                                 if (!entry)
00273                                         entry = new NtObjDirectory(this, buffer);
00274                         }
00275
00276                         else if (type == KEY_OBJECT) {
00277                                 w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00278
00279                                 entry = new RegistryRoot(this, buffer);
00280                         }
00281                         else
00282                                 entry = new NtObjEntry(this, type);
00283
00284                         HANDLE handle;
00285
00286 #ifdef UNICODE
00287                         lstrcpyW(p, info->name.string_ptr);
00288                         if (!NtOpenObject(type, &handle, 0, buffer))
00289 #else
00290                         lstrcpyW(w, info->name.string_ptr);
00291                         if (!NtOpenObject(type, &handle, 0, wbuffer))
00292 #endif
00293                         {
00294                                 NtObject object;
00295                                 DWORD read;
00296
00297                                 if (!(*g_NTDLL->NtQueryObject)(handle, 0/*ObjectBasicInformation*/, &object, sizeof(NtObject), &read)) {
00298                                         memcpy(&w32fd.ftCreationTime, &object.creation_time, sizeof(FILETIME));
00299
00300                                         memset(&entry->_bhfi, 0, sizeof(BY_HANDLE_FILE_INFORMATION));
00301                                         entry->_bhfi.nNumberOfLinks = object.reference_count - 1;
00302                                         entry->_bhfi_valid = true;
00303                                 }
00304
00305                                 if (type == SYMBOLICLINK_OBJECT) {
00306                                         WCHAR wbuffer[_MAX_PATH];
00307                                         UnicodeString link(_MAX_PATH, wbuffer);
00308
00309                                         if (!(*g_NTDLL->NtQuerySymbolicLinkObject)(handle, &link, NULL)) {
00310                                                 int len = link.string_len/sizeof(WCHAR);
00311                                                 entry->_content = (LPTSTR) malloc((len+1)*sizeof(TCHAR));
00312 #ifdef UNICODE
00313                                                 wcsncpy_s(entry->_content, len+1, link, len);
00314 #else
00315                                                 U2nA(link, entry->_content, len);
00316 #endif
00317                                                 entry->_content[len] = '\0';
00318                                         }
00319                                 }
00320
00321                                 (*g_NTDLL->NtClose)(handle);
00322                         }
00323
00324                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00325
00326 #ifdef UNICODE
00327                         entry->_type_name = _wcsdup(info->type.string_ptr);
00328 #else
00329                         char type_name[32];
00330                         WideCharToMultiByte(CP_ACP, 0, info->type.string_ptr, info->type.string_len, type_name, 32, 0, 0);
00331                         entry->_type_name = _strdup(type_name);
00332 #endif
00333
00334                         if (!first_entry)
00335                                 first_entry = entry;
00336
00337                         if (last)
00338                                 last->_next = entry;
00339
00340                         entry->_level = level;
00341
00342                         last = entry;
00343                 } while(!(*g_NTDLL->NtQueryDirectoryObject)(dir_handle, info, 2048, TRUE, FALSE, &idx, NULL));
00344
00345                 last->_next = NULL;
00346         }
00347
00348         (*g_NTDLL->NtClose)(dir_handle);
00349
00350         _down = first_entry;
00351         _scanned = true;
00352 }

The documentation for this struct was generated from the following files:
  • ntobjfs.h
  • ntobjfs.cpp


ROS Explorer: Member List

NtObjDirectory Member List

This is the complete list of members for NtObjDirectory, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_path | Directory | [protected]
_scanned | Entry |
_shell_attribs | Entry |
_type | NtObjEntry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | Entry | [inline, virtual]
Directory() | Directory | [inline, protected]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
find_entry(const void *) | NtObjDirectory | [virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | Entry | [inline, virtual]
get_path(PTSTR path, size_t path_count) const | NtObjEntry | [protected, virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow) | NtObjEntry | [protected, virtual]
NtObjDirectory(LPCTSTR root_path) | NtObjDirectory | [inline]
NtObjDirectory(Entry *parent, LPCTSTR path) | NtObjDirectory | [inline]
NtObjEntry(Entry *parent, OBJECT_TYPE type) | NtObjEntry | [inline]
NtObjEntry(OBJECT_TYPE type) | NtObjEntry | [inline, protected]
read_directory(int scan_flags=SCAN_ALL) | NtObjDirectory | [virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Directory() | Directory | [inline, protected, virtual]
~Entry() | Entry | [virtual]
~NtObjDirectory() | NtObjDirectory | [inline]


ROS Explorer: NtObject Struct Reference

NtObject Struct Reference

#include <ntobjfs.h>

Collaboration diagram for NtObject:

[legend]
List of all members.

Public Attributes

DWORD | _0
DWORD | _1
DWORD | handle_count
DWORD | reference_count
DWORD | _4
DWORD | _5
DWORD | _6
DWORD | _7
DWORD | _8
DWORD | _9
DWORD | _A
DWORD | _B
FILETIME | creation_time

Detailed Description

Definition at line 67 of file ntobjfs.h.

Member Data Documentation

DWORD NtObject::_0

Definition at line 68 of file ntobjfs.h.

DWORD NtObject::_1

Definition at line 69 of file ntobjfs.h.

DWORD NtObject::_4

Definition at line 72 of file ntobjfs.h.

DWORD NtObject::_5

Definition at line 73 of file ntobjfs.h.

DWORD NtObject::_6

Definition at line 74 of file ntobjfs.h.

DWORD NtObject::_7

Definition at line 75 of file ntobjfs.h.

DWORD NtObject::_8

Definition at line 76 of file ntobjfs.h.

DWORD NtObject::_9

Definition at line 77 of file ntobjfs.h.

DWORD NtObject::_A

Definition at line 78 of file ntobjfs.h.

DWORD NtObject::_B

Definition at line 79 of file ntobjfs.h.

FILETIME NtObject::creation_time

Definition at line 80 of file ntobjfs.h.

Referenced by NtObjDirectory::read_directory().

DWORD NtObject::handle_count

Definition at line 70 of file ntobjfs.h.

DWORD NtObject::reference_count

Definition at line 71 of file ntobjfs.h.

Referenced by NtObjDirectory::read_directory().

The documentation for this struct was generated from the following file:
  • ntobjfs.h


ROS Explorer: Member List

NtObject Member List

This is the complete list of members for NtObject, including all inherited members.

_0 | NtObject
_1 | NtObject
_4 | NtObject
_5 | NtObject
_6 | NtObject
_7 | NtObject
_8 | NtObject
_9 | NtObject
_A | NtObject
_B | NtObject
creation_time | NtObject
handle_count | NtObject
reference_count | NtObject


ROS Explorer: NtObjectInfo Struct Reference

NtObjectInfo Struct Reference

#include <ntobjfs.h>

Collaboration diagram for NtObjectInfo:

[legend]
List of all members.

Public Attributes

RtlUnicodeString name
RtlUnicodeString type
BYTE padding [16]

Detailed Description

Definition at line 52 of file ntobjfs.h.

Member Data Documentation

RtlUnicodeString NtObjectInfo::name

Definition at line 53 of file ntobjfs.h.

Referenced by NtObjDirectory::read_directory().

BYTE NtObjectInfo::padding[16]

Definition at line 55 of file ntobjfs.h.

RtlUnicodeString NtObjectInfo::type

Definition at line 54 of file ntobjfs.h.

Referenced by NtObjDirectory::read_directory().

The documentation for this struct was generated from the following file:
  • ntobjfs.h


ROS Explorer: Member List

NtObjectInfo Member List

This is the complete list of members for NtObjectInfo, including all inherited members.

name | NtObjectInfo
padding | NtObjectInfo
type | NtObjectInfo


ROS Explorer: NtObjEntry Struct Reference

NtObjEntry Struct Reference

NtObj file system file-entry. More...

#include <ntobjfs.h>

Inheritance diagram for NtObjEntry:

[legend]
Collaboration diagram for NtObjEntry:

[legend]
List of all members.

Public Member Functions

NtObjEntry (Entry *parent, OBJECT_TYPE type)

Public Attributes

OBJECT_TYPE _type

Protected Member Functions

NtObjEntry (OBJECT_TYPE type)
virtual bool | get_path (PTSTR path, size_t path_count) const
virtual BOOL | launch_entry (HWND hwnd, UINT nCmdShow)

Detailed Description

NtObj file system file-entry.

Definition at line 85 of file ntobjfs.h.

Constructor & Destructor Documentation

NtObjEntry::NtObjEntry | ( | Entry * | parent,
 |  | OBJECT_TYPE | type
 | ) | [inline]

Definition at line 87 of file ntobjfs.h.

00087 : Entry(parent, ET_NTOBJS), _type(type) {}

NtObjEntry::NtObjEntry ( OBJECT_TYPE type ) [inline, protected]

Definition at line 92 of file ntobjfs.h.

00092 : Entry(ET_NTOBJS), _type(type) {}

Member Function Documentation

bool NtObjEntry::get_path | ( | PTSTR | path,
 |  | size_t | path_count
 | ) | const [protected, virtual]

Implements Entry.

Definition at line 382 of file ntobjfs.cpp.

References ET_NTOBJS, and Entry::get_path_base().

00383 {
00384         return get_path_base ( path, path_count, ET_NTOBJS );
00385 }

Here is the call graph for this function:

BOOL NtObjEntry::launch_entry | ( | HWND | hwnd,
 |  | UINT | nCmdShow
 | ) | [protected, virtual]

Reimplemented from Entry.

Definition at line 387 of file ntobjfs.cpp.

00388 {
00389         return FALSE;
00390 }

Member Data Documentation

OBJECT_TYPE NtObjEntry::_type

Definition at line 89 of file ntobjfs.h.

The documentation for this struct was generated from the following files:
  • ntobjfs.h
  • ntobjfs.cpp


ROS Explorer: Member List

NtObjEntry Member List

This is the complete list of members for NtObjEntry, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_scanned | Entry |
_shell_attribs | Entry |
_type | NtObjEntry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | Entry | [inline, virtual]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
find_entry(const void *) | Entry | [inline, virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | Entry | [inline, virtual]
get_path(PTSTR path, size_t path_count) const | NtObjEntry | [protected, virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow) | NtObjEntry | [protected, virtual]
NtObjEntry(Entry *parent, OBJECT_TYPE type) | NtObjEntry | [inline]
NtObjEntry(OBJECT_TYPE type) | NtObjEntry | [inline, protected]
read_directory(int scan_flags=SCAN_ALL) | Entry | [inline, virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Entry() | Entry | [virtual]


ROS Explorer: OleInit Struct Reference

OleInit Struct Reference

OLE initialisation for drag drop support. More...

#include <shellclasses.h>

List of all members.

Public Member Functions

OleInit ()
~OleInit ()

Detailed Description

OLE initialisation for drag drop support.

Definition at line 201 of file shellclasses.h.

Constructor & Destructor Documentation

OleInit::OleInit ( ) [inline]

Definition at line 203 of file shellclasses.h.

References CHECKERROR.

00204         {
00205                 CHECKERROR(OleInitialize(0));
00206         }

OleInit::~OleInit ( ) [inline]

Definition at line 208 of file shellclasses.h.

00209         {
00210                 OleUninitialize();
00211         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

OleInit Member List

This is the complete list of members for OleInit, including all inherited members.

OleInit() | OleInit | [inline]
~OleInit() | OleInit | [inline]


ROS Explorer: OleInPlaceClient Struct Reference

OleInPlaceClient Struct Reference

#include <webchild.h>

Inheritance diagram for OleInPlaceClient:

[legend]
Collaboration diagram for OleInPlaceClient:

[legend]
List of all members.

Public Member Functions

OleInPlaceClient (HWND hwnd=0)
void | attach (HWND hwnd)
HRESULT | attach_control (IOleObject *ole_obj, LONG iVerb=OLEIVERB_INPLACEACTIVATE, HWND hwndParent=0, LPCRECT pRect=NULL)
HRESULT | detach (IOleObject *ole_obj, DWORD dwSaveOption=OLECLOSE_SAVEIFDIRTY)
STDMETHODIMP | QueryInterface (REFIID riid, LPVOID *ppv)
STDMETHODIMP_ (ULONG) AddRef()
STDMETHODIMP_ (ULONG) Release()
virtual HRESULT STDMETHODCALLTYPE | GetWindow (HWND __RPC_FAR *phwnd)
virtual HRESULT STDMETHODCALLTYPE | ContextSensitiveHelp (BOOL fEnterMode)
virtual HRESULT STDMETHODCALLTYPE | SaveObject ()
virtual HRESULT STDMETHODCALLTYPE | GetMoniker (DWORD dwAssign, DWORD dwWhichMoniker, IMoniker __RPC_FAR *__RPC_FAR *ppmk)
virtual HRESULT STDMETHODCALLTYPE | GetContainer (IOleContainer __RPC_FAR *__RPC_FAR *ppContainer)
virtual HRESULT STDMETHODCALLTYPE | ShowObject ()
virtual HRESULT STDMETHODCALLTYPE | OnShowWindow (BOOL fShow)
virtual HRESULT STDMETHODCALLTYPE | RequestNewObjectLayout ()
virtual HRESULT STDMETHODCALLTYPE | CanInPlaceActivate ()
virtual HRESULT STDMETHODCALLTYPE | OnInPlaceActivate ()
virtual HRESULT STDMETHODCALLTYPE | OnUIActivate ()
virtual HRESULT STDMETHODCALLTYPE | GetWindowContext (IOleInPlaceFrame __RPC_FAR *__RPC_FAR *ppFrame, IOleInPlaceUIWindow __RPC_FAR *__RPC_FAR *ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
virtual HRESULT STDMETHODCALLTYPE | Scroll (SIZE scrollExtant)
virtual HRESULT STDMETHODCALLTYPE | OnUIDeactivate (BOOL fUndoable)
virtual HRESULT STDMETHODCALLTYPE | OnInPlaceDeactivate ()
virtual HRESULT STDMETHODCALLTYPE | DiscardUndoState ()
virtual HRESULT STDMETHODCALLTYPE | DeactivateAndUndo ()
virtual HRESULT STDMETHODCALLTYPE | OnPosRectChange (LPCRECT lprcPosRect)

Protected Attributes

HWND _hwnd

Detailed Description

Definition at line 141 of file webchild.h.

Constructor & Destructor Documentation

OleInPlaceClient::OleInPlaceClient ( HWND hwnd = 0 ) [inline]

Definition at line 149 of file webchild.h.

00150          :      _hwnd(hwnd)
00151         {
00152         }

Member Function Documentation

void OleInPlaceClient::attach ( HWND hwnd ) [inline]

Definition at line 154 of file webchild.h.

00155         {
00156                 _hwnd = hwnd;
00157         }

HRESULT OleInPlaceClient::attach_control | ( | IOleObject * | ole_obj,
 |  | LONG | iVerb = OLEIVERB_INPLACEACTIVATE,
 |  | HWND | hwndParent = 0,
 |  | LPCRECT | pRect = NULL
 | ) | [inline]

Definition at line 159 of file webchild.h.

00160         {
00161                 HRESULT hr = ole_obj->SetClientSite(this);
00162                 if (FAILED(hr))
00163                         return hr;
00164
00165 //              hr = ole_obj->SetHostNames(app, doc));
00166
00167                 hr = ole_obj->DoVerb(iVerb, NULL, this, 0, 0/*hwnd*/, NULL/*&rcPos*/);
00168
00169                 return hr;
00170         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::CanInPlaceActivate ( ) [inline, virtual]

Definition at line 249 of file webchild.h.

00250         {
00251                 return S_OK;
00252         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::ContextSensitiveHelp ( BOOL fEnterMode ) [inline, virtual]

Definition at line 207 of file webchild.h.

00208         {
00209                 return E_NOTIMPL;
00210         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::DeactivateAndUndo ( ) [inline, virtual]

Definition at line 307 of file webchild.h.

00308         {
00309                 return S_OK;
00310         }

HRESULT OleInPlaceClient::detach | ( | IOleObject * | ole_obj,
 |  | DWORD | dwSaveOption = OLECLOSE_SAVEIFDIRTY
 | ) | [inline]

Definition at line 172 of file webchild.h.

00173         {
00174                 HRESULT hr = ole_obj->Close(dwSaveOption);
00175
00176                 _hwnd = 0;
00177
00178                 return hr;
00179         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::DiscardUndoState ( ) [inline, virtual]

Definition at line 302 of file webchild.h.

00303         {
00304                 return S_OK;
00305         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::GetContainer ( IOleContainer __RPC_FAR *__RPC_FAR * ppContainer ) [inline, virtual]

Definition at line 225 of file webchild.h.

00226         {
00227                 ppContainer = 0;
00228                 return E_NOINTERFACE;
00229         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::GetMoniker | ( | DWORD | dwAssign,
 |  | DWORD | dwWhichMoniker,
 |  | IMoniker __RPC_FAR *__RPC_FAR * | ppmk
 | ) | [inline, virtual]

Definition at line 220 of file webchild.h.

00221         {
00222                 return E_NOTIMPL;
00223         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::GetWindow ( HWND __RPC_FAR * phwnd ) [inline, virtual]

Definition at line 201 of file webchild.h.

00202         {
00203                 *phwnd = _hwnd;
00204                 return S_OK;
00205         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::GetWindowContext | ( | IOleInPlaceFrame __RPC_FAR *__RPC_FAR * | ppFrame,
 |  | IOleInPlaceUIWindow __RPC_FAR *__RPC_FAR * | ppDoc,
 |  | LPRECT | lprcPosRect,
 |  | LPRECT | lprcClipRect,
 |  | LPOLEINPLACEFRAMEINFO | lpFrameInfo
 | ) | [inline, virtual]

Definition at line 264 of file webchild.h.

00270         {
00271                 ClientRect rect(_hwnd);
00272
00273                 ppFrame = 0;
00274                 ppDoc = 0;
00275                 *lprcPosRect = rect;
00276                 *lprcClipRect = rect;
00277
00278                 assert(lpFrameInfo->cb>=sizeof(OLEINPLACEFRAMEINFO));
00279                 lpFrameInfo->fMDIApp = FALSE;   //@@
00280                 lpFrameInfo->hwndFrame = 0;
00281                 lpFrameInfo->haccel = 0;
00282                 lpFrameInfo->cAccelEntries = 0;
00283
00284                 return S_OK;
00285         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::OnInPlaceActivate ( ) [inline, virtual]

Definition at line 254 of file webchild.h.

00255         {
00256                 return S_OK;
00257         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::OnInPlaceDeactivate ( ) [inline, virtual]

Definition at line 297 of file webchild.h.

00298         {
00299                 return S_OK;
00300         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::OnPosRectChange ( LPCRECT lprcPosRect ) [inline, virtual]

Definition at line 312 of file webchild.h.

00313         {
00314                 return S_OK;
00315         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::OnShowWindow ( BOOL fShow ) [inline, virtual]

Definition at line 236 of file webchild.h.

00237         {
00238                 return S_OK;
00239         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::OnUIActivate ( ) [inline, virtual]

Definition at line 259 of file webchild.h.

00260         {
00261                 return S_OK;
00262         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::OnUIDeactivate ( BOOL fUndoable ) [inline, virtual]

Definition at line 292 of file webchild.h.

00293         {
00294                 return S_OK;
00295         }

STDMETHODIMP OleInPlaceClient::QueryInterface | ( | REFIID | riid,
 |  | LPVOID * | ppv
 | ) | [inline]

Definition at line 181 of file webchild.h.

00182         {
00183                 if (IsEqualIID(riid, IID_IOleClientSite))
00184                         {*ppv=static_cast<IOleClientSite*>(this); IncRef(); return S_OK;}
00185
00186                 if (IsEqualIID(riid, IID_IOleInPlaceSite))
00187                         {*ppv=static_cast<IOleInPlaceSite*>(this); IncRef(); return S_OK;}
00188
00189                 if (IsEqualIID(riid, IID_IUnknown))
00190                         {*ppv=static_cast<IOleClientSite/*oder auch IOleInPlaceSite*/*>(this); IncRef(); return S_OK;}
00191
00192                 return E_NOINTERFACE;
00193         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::RequestNewObjectLayout ( ) [inline, virtual]

Definition at line 241 of file webchild.h.

00242         {
00243                 return S_OK;
00244         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::SaveObject ( ) [inline, virtual]

Definition at line 215 of file webchild.h.

00216         {
00217                 return E_NOTIMPL;
00218         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::Scroll ( SIZE scrollExtant ) [inline, virtual]

Definition at line 287 of file webchild.h.

00288         {
00289                 return S_OK;
00290         }

virtual HRESULT STDMETHODCALLTYPE OleInPlaceClient::ShowObject ( ) [inline, virtual]

Definition at line 231 of file webchild.h.

00232         {
00233                 return S_OK;
00234         }

OleInPlaceClient::STDMETHODIMP_ ( ULONG ) [inline]

Definition at line 196 of file webchild.h.

00196 {return DecRef();}

OleInPlaceClient::STDMETHODIMP_ ( ULONG ) [inline]

Definition at line 195 of file webchild.h.

00195 {return IncRef();}

Member Data Documentation

HWND OleInPlaceClient::_hwnd [protected]

Definition at line 146 of file webchild.h.

The documentation for this struct was generated from the following file:
  • webchild.h


ROS Explorer: Member List

OleInPlaceClient Member List

This is the complete list of members for OleInPlaceClient, including all inherited members.

_hwnd | OleInPlaceClient | [protected]
_ref | ComSrvObject | [protected]
attach(HWND hwnd) | OleInPlaceClient | [inline]
attach_control(IOleObject *ole_obj, LONG iVerb=OLEIVERB_INPLACEACTIVATE, HWND hwndParent=0, LPCRECT pRect=NULL) | OleInPlaceClient | [inline]
CanInPlaceActivate() | OleInPlaceClient | [inline, virtual]
ComSrvObject() | ComSrvObject | [inline, protected]
ContextSensitiveHelp(BOOL fEnterMode) | OleInPlaceClient | [inline, virtual]
DeactivateAndUndo() | OleInPlaceClient | [inline, virtual]
DecRef() | SimpleComObject | [inline]
detach(IOleObject *ole_obj, DWORD dwSaveOption=OLECLOSE_SAVEIFDIRTY) | OleInPlaceClient | [inline]
DiscardUndoState() | OleInPlaceClient | [inline, virtual]
GetContainer(IOleContainer __RPC_FAR *__RPC_FAR *ppContainer) | OleInPlaceClient | [inline, virtual]
GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker __RPC_FAR *__RPC_FAR *ppmk) | OleInPlaceClient | [inline, virtual]
GetWindow(HWND __RPC_FAR *phwnd) | OleInPlaceClient | [inline, virtual]
GetWindowContext(IOleInPlaceFrame __RPC_FAR *__RPC_FAR *ppFrame, IOleInPlaceUIWindow __RPC_FAR *__RPC_FAR *ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo) | OleInPlaceClient | [inline, virtual]
IncRef() | SimpleComObject | [inline]
OleInPlaceClient(HWND hwnd=0) | OleInPlaceClient | [inline]
OnInPlaceActivate() | OleInPlaceClient | [inline, virtual]
OnInPlaceDeactivate() | OleInPlaceClient | [inline, virtual]
OnPosRectChange(LPCRECT lprcPosRect) | OleInPlaceClient | [inline, virtual]
OnShowWindow(BOOL fShow) | OleInPlaceClient | [inline, virtual]
OnUIActivate() | OleInPlaceClient | [inline, virtual]
OnUIDeactivate(BOOL fUndoable) | OleInPlaceClient | [inline, virtual]
QueryInterface(REFIID riid, LPVOID *ppv) | OleInPlaceClient | [inline]
RequestNewObjectLayout() | OleInPlaceClient | [inline, virtual]
SaveObject() | OleInPlaceClient | [inline, virtual]
Scroll(SIZE scrollExtant) | OleInPlaceClient | [inline, virtual]
ShowObject() | OleInPlaceClient | [inline, virtual]
STDMETHODIMP_(ULONG) AddRef() | OleInPlaceClient | [inline]
STDMETHODIMP_(ULONG) Release() | OleInPlaceClient | [inline]
~ComSrvObject() | ComSrvObject | [inline, protected, virtual]


ROS Explorer: OpenStruct Struct Reference

OpenStruct Struct Reference

#include <ntobjfs.h>

Collaboration diagram for OpenStruct:

[legend]
List of all members.

Public Attributes

DWORD | size
DWORD | _1
RtlUnicodeString * string
DWORD | _3
DWORD | _4
DWORD | _5

Detailed Description

Definition at line 58 of file ntobjfs.h.

Member Data Documentation

DWORD OpenStruct::_1

Definition at line 60 of file ntobjfs.h.

DWORD OpenStruct::_3

Definition at line 62 of file ntobjfs.h.

DWORD OpenStruct::_4

Definition at line 63 of file ntobjfs.h.

DWORD OpenStruct::_5

Definition at line 64 of file ntobjfs.h.

DWORD OpenStruct::size

Definition at line 59 of file ntobjfs.h.

RtlUnicodeString* OpenStruct::string

Definition at line 61 of file ntobjfs.h.

The documentation for this struct was generated from the following file:
  • ntobjfs.h


ROS Explorer: Member List

OpenStruct Member List

This is the complete list of members for OpenStruct, including all inherited members.

_1 | OpenStruct
_3 | OpenStruct
_4 | OpenStruct
_5 | OpenStruct
size | OpenStruct
string | OpenStruct


ROS Explorer: ostream Class Reference

ostream Class Reference

Inheritance diagram for ostream:

[legend]
The documentation for this class was generated from the following file:
  • xmlstorage.h


ROS Explorer: OutputWorker Struct Reference

OutputWorker Struct Reference

Worker for drawing contents of file lists in child pane. More...

#include <pane.h>

Collaboration diagram for OutputWorker:

[legend]
List of all members.

Public Member Functions

OutputWorker ()
void | init_output (HWND hwnd)
void | output_text (LPDRAWITEMSTRUCT dis, int *positions, int col, LPCTSTR str, DWORD flags)
void | output_tabbed_text (LPDRAWITEMSTRUCT dis, int *positions, int col, LPCTSTR str)
void | output_number (LPDRAWITEMSTRUCT dis, int *positions, int col, LPCTSTR str)

Public Attributes

SIZE | _spaceSize
TCHAR | _num_sep
HFONT | _hfont

Detailed Description

Worker for drawing contents of file lists in child pane.

Definition at line 50 of file pane.h.

Constructor & Destructor Documentation

OutputWorker::OutputWorker ( )

Definition at line 859 of file pane.cpp.

References _hfont.

00860 {
00861         _hfont = CreateFont(-MulDiv(8,GetDeviceCaps(WindowCanvas(0),LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, TEXT("MS Sans Serif"));
00862 }

Member Function Documentation

void OutputWorker::init_output ( HWND hwnd )

Definition at line 864 of file pane.cpp.

References _hfont, _num_sep, and _spaceSize.

Referenced by Pane::init().

00865 {
00866         TCHAR b[16];
00867
00868         WindowCanvas canvas(hwnd);
00869
00870         if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, TEXT("1000"), 0, b, 16) > 4)
00871                 _num_sep = b[1];
00872         else
00873                 _num_sep = TEXT('.');
00874
00875         FontSelection font(canvas, _hfont);
00876         GetTextExtentPoint32(canvas, TEXT(" "), 1, &_spaceSize);
00877 }

void OutputWorker::output_number | ( | LPDRAWITEMSTRUCT | dis,
 |  | int * | positions,
 |  | int | col,
 |  | LPCTSTR | str
 | ) |

Definition at line 909 of file pane.cpp.

References _num_sep, and _spaceSize.

Referenced by Pane::draw_item().

00910 {
00911         int x = dis->rcItem.left;
00912         RECT rt;
00913         LPCTSTR s = str;
00914         TCHAR b[128];
00915         LPTSTR d = b;
00916         int pos;
00917
00918         rt.left   = x+positions[col]+_spaceSize.cx;
00919         rt.top    = dis->rcItem.top;
00920         rt.right  = x+positions[col+1]-_spaceSize.cx;
00921         rt.bottom = dis->rcItem.bottom;
00922
00923         if (*s)
00924                 *d++ = *s++;
00925
00926          // insert number separator characters
00927         pos = lstrlen(s) % 3;
00928
00929         while(*s)
00930                 if (pos--)
00931                         *d++ = *s++;
00932                 else {
00933                         *d++ = _num_sep;
00934                         pos = 3;
00935                 }
00936
00937         DrawText(dis->hDC, b, d-b, &rt, DT_RIGHT|DT_SINGLELINE|DT_NOPREFIX|DT_END_ELLIPSIS);
00938 }

void OutputWorker::output_tabbed_text | ( | LPDRAWITEMSTRUCT | dis,
 |  | int * | positions,
 |  | int | col,
 |  | LPCTSTR | str
 | ) |

Definition at line 893 of file pane.cpp.

References _spaceSize.

Referenced by Pane::draw_item().

00894 {
00895         int x = dis->rcItem.left;
00896         RECT rt;
00897
00898         rt.left   = x+positions[col]+_spaceSize.cx;
00899         rt.top    = dis->rcItem.top;
00900         rt.right  = x+positions[col+1]-_spaceSize.cx;
00901         rt.bottom = dis->rcItem.bottom;
00902
00903 /*      DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
00904         DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
00905
00906         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
00907 }

void OutputWorker::output_text | ( | LPDRAWITEMSTRUCT | dis,
 |  | int * | positions,
 |  | int | col,
 |  | LPCTSTR | str,
 |  | DWORD | flags
 | ) |

Definition at line 880 of file pane.cpp.

References _spaceSize.

Referenced by Pane::draw_item().

00881 {
00882         int x = dis->rcItem.left;
00883         RECT rt;
00884
00885         rt.left   = x+positions[col]+_spaceSize.cx;
00886         rt.top    = dis->rcItem.top;
00887         rt.right  = x+positions[col+1]-_spaceSize.cx;
00888         rt.bottom = dis->rcItem.bottom;
00889
00890         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|flags);
00891 }

Member Data Documentation

HFONT OutputWorker::_hfont

Definition at line 61 of file pane.h.

Referenced by Pane::calc_single_width(), Pane::calc_widths(), Pane::init(), init_output(), and OutputWorker().

TCHAR OutputWorker::_num_sep

Definition at line 60 of file pane.h.

Referenced by init_output(), and output_number().

SIZE OutputWorker::_spaceSize

Definition at line 59 of file pane.h.

Referenced by Pane::calc_widths(), Pane::draw_item(), init_output(), output_number(), output_tabbed_text(), and output_text().

The documentation for this struct was generated from the following files:
  • pane.h
  • pane.cpp


ROS Explorer: Member List

OutputWorker Member List

This is the complete list of members for OutputWorker, including all inherited members.

_hfont | OutputWorker
_num_sep | OutputWorker
_spaceSize | OutputWorker
init_output(HWND hwnd) | OutputWorker
output_number(LPDRAWITEMSTRUCT dis, int *positions, int col, LPCTSTR str) | OutputWorker
output_tabbed_text(LPDRAWITEMSTRUCT dis, int *positions, int col, LPCTSTR str) | OutputWorker
output_text(LPDRAWITEMSTRUCT dis, int *positions, int col, LPCTSTR str, DWORD flags) | OutputWorker
OutputWorker() | OutputWorker


ROS Explorer: OwnerdrawnButton Struct Reference

OwnerdrawnButton Struct Reference

Subclass button controls to draw them by using PM_DISPATCH_DRAWITEM The owning window should use the OwnerDrawParent template to route owner draw messages to the buttons. More...

#include <window.h>

Inheritance diagram for OwnerdrawnButton:

[legend]
Collaboration diagram for OwnerdrawnButton:

[legend]
List of all members.

Public Types

typedef SubclassedWindow | super

Public Member Functions

OwnerdrawnButton (HWND hwnd)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual void | DrawItem (LPDRAWITEMSTRUCT dis)=0

Detailed Description

Subclass button controls to draw them by using PM_DISPATCH_DRAWITEM The owning window should use the OwnerDrawParent template to route owner draw messages to the buttons.

Definition at line 655 of file window.h.

Member Typedef Documentation

typedef SubclassedWindow OwnerdrawnButton::super

Reimplemented from SubclassedWindow.

Reimplemented in StartButton, FlatButton, and PictureButton.

Definition at line 657 of file window.h.

Constructor & Destructor Documentation

OwnerdrawnButton::OwnerdrawnButton ( HWND hwnd ) [inline]

Definition at line 659 of file window.h.

00660          :      super(hwnd) {}

Member Function Documentation

virtual void OwnerdrawnButton::DrawItem ( LPDRAWITEMSTRUCT dis ) [protected, pure virtual]

Implemented in FlatButton, and PictureButton.

Referenced by WndProc().

LRESULT OwnerdrawnButton::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from SubclassedWindow.

Reimplemented in StartButton, and FlatButton.

Definition at line 852 of file window.cpp.

References DrawItem(), PM_DISPATCH_DRAWITEM, and SubclassedWindow::WndProc().

Referenced by FlatButton::WndProc(), and StartButton::WndProc().

00853 {
00854         if (nmsg == PM_DISPATCH_DRAWITEM) {
00855                 DrawItem((LPDRAWITEMSTRUCT)lparam);
00856                 return TRUE;
00857         } else
00858                 return super::WndProc(nmsg, wparam, lparam);
00859 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

OwnerdrawnButton Member List

This is the complete list of members for OwnerdrawnButton, including all inherited members.

_hwnd | WindowHandle | [protected]
_orgWndProc | SubclassedWindow | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | SubclassedWindow | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawItem(LPDRAWITEMSTRUCT dis)=0 | OwnerdrawnButton | [protected, pure virtual]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | SubclassedWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerdrawnButton(HWND hwnd) | OwnerdrawnButton | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | OwnerdrawnButton |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | OwnerdrawnButton | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: OwnerDrawParent< BASE > Struct Template Reference

OwnerDrawParent< BASE > Struct Template Reference

draw message routing for ColorButton and PictureButton More...

#include <window.h>

Inheritance diagram for OwnerDrawParent< BASE >:

[legend]
Collaboration diagram for OwnerDrawParent< BASE >:

[legend]
List of all members.

Public Types

typedef BASE | super

Public Member Functions

OwnerDrawParent (HWND hwnd)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Detailed Description

template<typename BASE>
struct OwnerDrawParent< BASE >

draw message routing for ColorButton and PictureButton

Definition at line 623 of file window.h.

Member Typedef Documentation

template<typename BASE>
typedef BASE OwnerDrawParent< BASE >::super

Reimplemented in ExplorerAboutDlg, DesktopSettingsDlg, DesktopBar, StartMenu, StartMenuHandler, StartMenuRoot, SettingsMenu, BrowseMenu, SearchMenu, RecentStartMenu, FavoritesMenu, ExtContextMenuHandlerT< OwnerDrawParent< Window > >, and CtlColorParent< OwnerDrawParent< Dialog > >.

Definition at line 625 of file window.h.

Constructor & Destructor Documentation

template<typename BASE>
OwnerDrawParent< BASE >::OwnerDrawParent ( HWND hwnd ) [inline]

Definition at line 627 of file window.h.

00628          : super(hwnd) {}

Member Function Documentation

template<typename BASE>
LRESULT OwnerDrawParent< BASE >::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [inline]

Reimplemented in ExplorerAboutDlg, DesktopBar, StartMenu, StartMenuRoot, ExtContextMenuHandlerT< OwnerDrawParent< Window > >, and CtlColorParent< OwnerDrawParent< Dialog > >.

Definition at line 630 of file window.h.

00631         {
00632                 switch(nmsg) {
00633                   case WM_DRAWITEM:
00634                         if (wparam) {   // should there be drawn a control?
00635                                 HWND hctl = GetDlgItem(this->_hwnd, wparam);
00636
00637                                 if (hctl)
00638                                         return SendMessage(hctl, PM_DISPATCH_DRAWITEM, wparam, lparam);
00639                         } /*else                // or is it a menu entry?
00640                                 ; */
00641
00642                         return 0;
00643
00644                   default:
00645                         return super::WndProc(nmsg, wparam, lparam);
00646                 }
00647         }

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

OwnerDrawParent< BASE > Member List

This is the complete list of members for OwnerDrawParent< BASE >, including all inherited members.

OwnerDrawParent(HWND hwnd) | OwnerDrawParent< BASE > | [inline]
super typedef | OwnerDrawParent< BASE > |
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | OwnerDrawParent< BASE > | [inline]


ROS Explorer: PaintCanvas Struct Reference

PaintCanvas Struct Reference

PaintCanvas is a encapsulation of device contexts managed by BeginPaint()/EndPaint(). More...

#include <utility.h>

Inheritance diagram for PaintCanvas:

[legend]
Collaboration diagram for PaintCanvas:

[legend]
List of all members.

Public Member Functions

PaintCanvas (HWND hwnd)
~PaintCanvas ()
operator HDC () const

Protected Attributes

HWND _hwnd

Detailed Description

PaintCanvas is a encapsulation of device contexts managed by BeginPaint()/EndPaint().

Definition at line 475 of file utility.h.

Constructor & Destructor Documentation

PaintCanvas::PaintCanvas ( HWND hwnd ) [inline]

Definition at line 477 of file utility.h.

00478          :      _hwnd(hwnd)
00479         {
00480                 BeginPaint(hwnd, this);
00481         }

PaintCanvas::~PaintCanvas ( ) [inline]

Definition at line 483 of file utility.h.

00484         {
00485                 EndPaint(_hwnd, this);
00486         }

Member Function Documentation

PaintCanvas::operator HDC ( ) const [inline]

Definition at line 488 of file utility.h.

00488 {return hdc;}

Member Data Documentation

HWND PaintCanvas::_hwnd [protected]

Definition at line 491 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

PaintCanvas Member List

This is the complete list of members for PaintCanvas, including all inherited members.

_hwnd | PaintCanvas | [protected]
operator HDC() const | PaintCanvas | [inline]
PaintCanvas(HWND hwnd) | PaintCanvas | [inline]
~PaintCanvas() | PaintCanvas | [inline]


ROS Explorer: PAINTSTRUCT Class Reference

PAINTSTRUCT Class Reference

Inheritance diagram for PAINTSTRUCT:

[legend]
The documentation for this class was generated from the following file:
  • utility.h


ROS Explorer: Pane Struct Reference

Pane Struct Reference

child window pane for displaying file lists More...

#include <pane.h>

Inheritance diagram for Pane:

[legend]
Collaboration diagram for Pane:

[legend]
List of all members.

Public Types

typedef SubclassedWindow | super

Public Member Functions

Pane (HWND hparent, int id, int id_header, Entry *rool, bool treePane, int visible_cols)
~Pane ()
void | init ()
void | set_header ()
bool | create_header (HWND parent, int id)
bool | calc_widths (bool anyway)
void | calc_single_width (int col)
void | draw_item (LPDRAWITEMSTRUCT dis, Entry *entry, int calcWidthCol=-1)
int | insert_entries (Entry *dir, int idx=-1)
BOOL | command (UINT cmd)
int | Notify (int id, NMHDR *pnmh)

Public Attributes

int | _widths [COLUMNS]
int | _positions [COLUMNS+1]
WindowHandle _hwndHeader
Entry * _root
Entry * _cur
COLORREF | _clrCompressed
int | _visible_cols
bool | _treePane

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
void | calc_width (LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
void | calc_tabbed_width (LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
MainFrameBase * get_frame ()

Protected Attributes

HIMAGELIST | _himl
OutputWorker _out_wrkr

Detailed Description

child window pane for displaying file lists

Definition at line 66 of file pane.h.

Member Typedef Documentation

typedef SubclassedWindow Pane::super

Reimplemented from SubclassedWindow.

Definition at line 68 of file pane.h.

Constructor & Destructor Documentation

Pane::Pane | ( | HWND | hparent,
 |  | int | id,
 |  | int | id_header,
 |  | Entry * | rool,
 |  | bool | treePane,
 |  | int | visible_cols
 | ) |

Definition at line 76 of file pane.cpp.

References _root, create_header(), init(), and insert_entries().

00077  :      super(CreateWindow(TEXT("ListBox"), TEXT(""), WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|
00078                         LBS_DISABLENOSCROLL|LBS_NOINTEGRALHEIGHT|LBS_OWNERDRAWFIXED|LBS_NOTIFY,
00079                         0, 0, 0, 0, hparent, (HMENU)id, g_Globals._hInstance, 0)),
00080         _root(root),
00081         _visible_cols(visible_cols),
00082         _treePane(treePane)
00083 {
00084          // insert entries into listbox
00085         Entry* entry = _root;
00086
00087         if (entry)
00088                 insert_entries(entry);
00089
00090         init();
00091
00092         create_header(hparent, id_header);
00093 }

Here is the call graph for this function:

Pane::~Pane ( )

Definition at line 95 of file pane.cpp.

References _himl.

00096 {
00097         ImageList_Destroy(_himl);
00098 }

Member Function Documentation

void Pane::calc_single_width ( int col )

Definition at line 725 of file pane.cpp.

References OutputWorker::_hfont, WindowHandle::_hwnd, _out_wrkr, _widths, and draw_item().

00726 {
00727         HFONT hfontOld;
00728         int x, cx;
00729         int cnt;
00730         HDC hdc;
00731
00732         int entries = ListBox_GetCount(_hwnd);
00733
00734         _widths[col] = 0;
00735
00736         hdc = GetDC(_hwnd);
00737         hfontOld = SelectFont(hdc, _out_wrkr._hfont);
00738
00739         for(cnt=0; cnt<entries; cnt++) {
00740                 Entry* entry = (Entry*) ListBox_GetItemData(_hwnd, cnt);
00741
00742                 DRAWITEMSTRUCT dis;
00743
00744                 dis.CtlType               = 0;
00745                 dis.CtlID                 = 0;
00746                 dis.itemID                = 0;
00747                 dis.itemAction    = 0;
00748                 dis.itemState     = 0;
00749                 dis.hwndItem      = _hwnd;
00750                 dis.hDC                   = hdc;
00751                 dis.rcItem.left   = 0;
00752                 dis.rcItem.top    = 0;
00753                 dis.rcItem.right  = 0;
00754                 dis.rcItem.bottom = 0;
00755                 /*dis.itemData    = 0; */
00756
00757                 draw_item(&dis, entry, col);
00758         }
00759
00760         SelectObject(hdc, hfontOld);
00761         ReleaseDC(_hwnd, hdc);
00762
00763         cx = _widths[col];
00764
00765         if (cx) {
00766                 cx += 3*_out_wrkr._spaceSize.cx;
00767
00768                 if (cx < IMAGE_WIDTH)
00769                         cx = IMAGE_WIDTH;
00770         }
00771
00772         _widths[col] = cx;
00773
00774         x = _positions[col] + cx;
00775
00776         for(; col<COLUMNS; ) {
00777                 _positions[++col] = x;
00778                 x += _widths[col];
00779         }
00780
00781         ListBox_SetHorizontalExtent(_hwnd, x);
00782 }

Here is the call graph for this function:

void Pane::calc_tabbed_width | ( | LPDRAWITEMSTRUCT | dis,
 |  | int | col,
 |  | LPCTSTR | str
 | ) | [protected]

Definition at line 643 of file pane.cpp.

References _widths.

Referenced by draw_item().

00644 {
00645         RECT rt = {0, 0, 0, 0};
00646
00647 /*      DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2};
00648         DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/
00649
00650         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_EXPANDTABS|DT_TABSTOP|(2<<8));
00651         //FIXME rt (0,0) ???
00652
00653         if (rt.right > _widths[col])
00654                 _widths[col] = rt.right;
00655 }

void Pane::calc_width | ( | LPDRAWITEMSTRUCT | dis,
 |  | int | col,
 |  | LPCTSTR | str
 | ) | [protected]

Definition at line 633 of file pane.cpp.

References _widths.

Referenced by draw_item().

00634 {
00635         RECT rt = {0, 0, 0, 0};
00636
00637         DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_CALCRECT|DT_SINGLELINE|DT_NOPREFIX);
00638
00639         if (rt.right > _widths[col])
00640                 _widths[col] = rt.right;
00641 }

bool Pane::calc_widths ( bool anyway )

Definition at line 181 of file pane.cpp.

References OutputWorker::_hfont, WindowHandle::_hwnd, _out_wrkr, _positions, OutputWorker::_spaceSize, _widths, COLUMNS, and draw_item().

Referenced by FileChildWindow::activate_entry(), command(), FileChildWindow::expand_entry(), init(), and FileChildWindow::set_curdir().

00182 {
00183         int col, x, cx, spc=3*_out_wrkr._spaceSize.cx;
00184         int entries = ListBox_GetCount(_hwnd);
00185         int orgWidths[COLUMNS];
00186         int orgPositions[COLUMNS+1];
00187         HFONT hfontOld;
00188         HDC hdc;
00189         int cnt;
00190
00191         if (!anyway) {
00192                 memcpy(orgWidths, _widths, sizeof(orgWidths));
00193                 memcpy(orgPositions, _positions, sizeof(orgPositions));
00194         }
00195
00196         for(col=0; col<COLUMNS; col++)
00197                 _widths[col] = 0;
00198
00199         hdc = GetDC(_hwnd);
00200         hfontOld = SelectFont(hdc, _out_wrkr._hfont);
00201
00202         for(cnt=0; cnt<entries; cnt++) {
00203                 Entry* entry = (Entry*) ListBox_GetItemData(_hwnd, cnt);
00204
00205                 DRAWITEMSTRUCT dis;
00206
00207                 dis.CtlType               = 0;
00208                 dis.CtlID                 = 0;
00209                 dis.itemID                = 0;
00210                 dis.itemAction    = 0;
00211                 dis.itemState     = 0;
00212                 dis.hwndItem      = _hwnd;
00213                 dis.hDC                   = hdc;
00214                 dis.rcItem.left   = 0;
00215                 dis.rcItem.top    = 0;
00216                 dis.rcItem.right  = 0;
00217                 dis.rcItem.bottom = 0;
00218                 /*dis.itemData    = 0; */
00219
00220                 draw_item(&dis, entry, COLUMNS);
00221         }
00222
00223         SelectObject(hdc, hfontOld);
00224         ReleaseDC(_hwnd, hdc);
00225
00226         x = 0;
00227         for(col=0; col<COLUMNS; col++) {
00228                 _positions[col] = x;
00229                 cx = _widths[col];
00230
00231                 if (cx) {
00232                         cx += spc;
00233
00234                         if (cx < IMAGE_WIDTH)
00235                                 cx = IMAGE_WIDTH;
00236
00237                         _widths[col] = cx;
00238                 }
00239
00240                 x += cx;
00241         }
00242
00243         _positions[COLUMNS] = x;
00244
00245         ListBox_SetHorizontalExtent(_hwnd, x);
00246
00247          // no change?
00248         if (!memcmp(orgWidths, _widths, sizeof(orgWidths)))
00249                 return FALSE;
00250
00251          // don't move, if only collapsing an entry
00252         if (!anyway && _widths[0]<orgWidths[0] &&
00253                 !memcmp(orgWidths+1, _widths+1, sizeof(orgWidths)-sizeof(int))) {
00254                 _widths[0] = orgWidths[0];
00255                 memcpy(_positions, orgPositions, sizeof(orgPositions));
00256
00257                 return FALSE;
00258         }
00259
00260         InvalidateRect(_hwnd, 0, TRUE);
00261
00262         return TRUE;
00263 }

Here is the call graph for this function:

BOOL Pane::command ( UINT cmd )

Definition at line 941 of file pane.cpp.

References MenuInfo::_hMenuView, WindowHandle::_hwnd, _visible_cols, calc_widths(), COL_ALL, Frame_GetMenuInfo, ID_PREFERED_SIZES, ID_VIEW_ALL_ATTRIBUTES, ID_VIEW_NAME, ID_VIEW_SELECTED_ATTRIBUTES, and set_header().

00942 {
00943         switch(cmd) {
00944                 case ID_VIEW_NAME:
00945                         if (_visible_cols) {
00946                                 _visible_cols = 0;
00947                                 calc_widths(true);
00948                                 set_header();
00949                                 InvalidateRect(_hwnd, 0, TRUE);
00950                                 MenuInfo* menu_info = Frame_GetMenuInfo(GetParent(_hwnd));
00951                                 if (menu_info) {
00952                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_NAME, MF_BYCOMMAND|MF_CHECKED);
00953                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND);
00954                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
00955                                 }
00956                         }
00957                         break;
00958
00959                 case ID_VIEW_ALL_ATTRIBUTES:
00960                         if (_visible_cols != COL_ALL) {
00961                                 _visible_cols = COL_ALL;
00962                                 calc_widths(true);
00963                                 set_header();
00964                                 InvalidateRect(_hwnd, 0, TRUE);
00965                                 MenuInfo* menu_info = Frame_GetMenuInfo(GetParent(_hwnd));
00966                                 if (menu_info) {
00967                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_NAME, MF_BYCOMMAND);
00968                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND|MF_CHECKED);
00969                                         CheckMenuItem(menu_info->_hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
00970                                 }
00971                         }
00972                         break;
00973
00974                 case ID_PREFERED_SIZES: {
00975                         calc_widths(true);
00976                         set_header();
00977                         InvalidateRect(_hwnd, 0, TRUE);
00978                         break;}
00979
00980                         /*@todo more command ids... */
00981
00982                 default:
00983                         return FALSE;
00984         }
00985
00986         return TRUE;
00987 }

Here is the call graph for this function:

bool Pane::create_header | ( | HWND | parent,
 |  | int | id
 | ) |

Definition at line 130 of file pane.cpp.

References ExplorerGlobals::_hInstance, _widths, COLUMNS, g_Globals, and HWND.

Referenced by Pane().

00131 {
00132         HWND hwnd = CreateWindow(WC_HEADER, 0, WS_CHILD|WS_VISIBLE|HDS_HORZ/*@todo |HDS_BUTTONS + sort orders*/,
00133                                                                 0, 0, 0, 0, hparent, (HMENU)id, g_Globals._hInstance, 0);
00134         if (!hwnd)
00135                 return false;
00136
00137         SetWindowFont(hwnd, GetStockFont(DEFAULT_GUI_FONT), FALSE);
00138
00139         HD_ITEM hdi;
00140
00141         hdi.mask = HDI_TEXT|HDI_WIDTH|HDI_FORMAT;
00142
00143         for(int idx=0; idx<COLUMNS; idx++) {
00144                 hdi.pszText = g_pos_names[idx];
00145                 hdi.fmt = HDF_STRING | g_pos_align[idx];
00146                 hdi.cxy = _widths[idx];
00147                 Header_InsertItem(hwnd, idx, &hdi);
00148         }
00149
00150         _hwndHeader = hwnd;
00151
00152         return true;
00153 }

void Pane::draw_item | ( | LPDRAWITEMSTRUCT | dis,
 |  | Entry * | entry,
 |  | int | calcWidthCol = -1
 | ) |

Todo:
not in every case time enough

Definition at line 301 of file pane.cpp.

References Entry::_bhfi, Entry::_bhfi_valid, _clrCompressed, Entry::_content, Entry::_data, Entry::_display_name, Entry::_down, _himl, ExplorerGlobals::_icon_cache, Entry::_icon_id, Entry::_next, _out_wrkr, _positions, OutputWorker::_spaceSize, _stprintf, _treePane, Entry::_type_name, Entry::_up, _visible_cols, _widths, ATTRIBUTE_EXECUTABLE, ATTRIBUTE_SYMBOLIC_LINK, BUFFER_LEN, calc_tabbed_width(), calc_width(), COL_ATTRIBUTES, COL_CONTENT, COL_INDEX, COL_LINKS, COL_SIZE, COL_TYPE, COLUMNS, Icon::draw(), FILE_ATTRIBUTE_ENCRYPTED, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED, FILE_ATTRIBUTE_REPARSE_POINT, FILE_ATTRIBUTE_SPARSE_FILE, g_Globals, IconCache::get_icon(), ICID_NONE, IMAGE_HEIGHT, IMAGE_WIDTH, IMG_DOCUMENT, IMG_EXECUTABLE, IMG_FILE, IMG_FOLDER, IMG_FOLDER_CUR, IMG_FOLDER_UP, IMG_NONE, IMG_OPEN_FOLDER, LONGLONGARG, OutputWorker::output_number(), OutputWorker::output_tabbed_text(), and OutputWorker::output_text().

Referenced by calc_single_width(), calc_widths(), and FileChildWindow::WndProc().

00302 {
00303         TCHAR buffer[BUFFER_LEN];
00304         DWORD attrs;
00305         int visible_cols = _visible_cols;
00306         COLORREF bkcolor, textcolor;
00307         RECT focusRect = dis->rcItem;
00308         enum IMAGE img;
00309         int img_pos, cx;
00310         int col = 0;
00311
00312         if (entry) {
00313                 attrs = entry->_data.dwFileAttributes;
00314
00315                 if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
00316                         if (entry->_data.cFileName[0]==TEXT('.') && entry->_data.cFileName[1]==TEXT('.')
00317                                         && entry->_data.cFileName[2]==TEXT('\0'))
00318                                 img = IMG_FOLDER_UP;
00319                         else if (entry->_data.cFileName[0]==TEXT('.') && entry->_data.cFileName[1]==TEXT('\0'))
00320                                 img = IMG_FOLDER_CUR;
00321                         else if ((_treePane && (dis->itemState&ODS_FOCUS)))
00322                                 img = IMG_OPEN_FOLDER;
00323                         else
00324                                 img = IMG_FOLDER;
00325                 } else {
00326                         if (attrs & ATTRIBUTE_EXECUTABLE)
00327                                 img = IMG_EXECUTABLE;
00328                         else if (entry->_type_name)
00329                                 img = IMG_DOCUMENT;
00330                         else
00331                                 img = IMG_FILE;
00332                 }
00333         } else {
00334                 attrs = 0;
00335                 img = IMG_NONE;
00336         }
00337
00338         if (_treePane) {
00339                 if (entry) {
00340                         img_pos = dis->rcItem.left + entry->_level*(IMAGE_WIDTH+_out_wrkr._spaceSize.cx);
00341
00342                         if (calcWidthCol == -1) {
00343                                 int x;
00344                                 int y = dis->rcItem.top + IMAGE_HEIGHT/2;
00345                                 Entry* up;
00346                                 RECT rt_clip;
00347                                 HRGN hrgn_org = CreateRectRgn(0, 0, 0, 0);
00348                                 HRGN hrgn;
00349
00350                                 rt_clip.left   = dis->rcItem.left;
00351                                 rt_clip.top    = dis->rcItem.top;
00352                                 rt_clip.right  = dis->rcItem.left+_widths[col];
00353                                 rt_clip.bottom = dis->rcItem.bottom;
00354
00355                                 hrgn = CreateRectRgnIndirect(&rt_clip);
00356
00357                                 if (!GetClipRgn(dis->hDC, hrgn_org)) {
00358                                         DeleteObject(hrgn_org);
00359                                         hrgn_org = 0;
00360                                 }
00361
00362                                 //HGDIOBJ holdPen = SelectObject(dis->hDC, GetStockObject(BLACK_PEN));
00363                                 ExtSelectClipRgn(dis->hDC, hrgn, RGN_AND);
00364                                 DeleteObject(hrgn);
00365
00366                                 if ((up=entry->_up) != NULL) {
00367                                         MoveToEx(dis->hDC, img_pos-IMAGE_WIDTH/2, y, 0);
00368                                         LineTo(dis->hDC, img_pos-2, y);
00369
00370                                         x = img_pos - IMAGE_WIDTH/2;
00371
00372                                         do {
00373                                                 x -= IMAGE_WIDTH+_out_wrkr._spaceSize.cx;
00374
00375                                                 if (up->_next) {
00376 #ifndef _LEFT_FILES
00377                                                         bool following_child = (up->_next->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)!=0; // a directory?
00378
00379                                                         if (!following_child)
00380                                                                 for(Entry*n=up->_next; n; n=n->_next)
00381                                                                         if (n->_down) { // any file with NTFS sub-streams?
00382                                                                                 following_child = true;
00383                                                                                 break;
00384                                                                         }
00385
00386                                                         if (following_child)
00387 #endif
00388                                                         {
00389                                                                 MoveToEx(dis->hDC, x, dis->rcItem.top, 0);
00390                                                                 LineTo(dis->hDC, x, dis->rcItem.bottom);
00391                                                         }
00392                                                 }
00393                                         } while((up=up->_up) != NULL);
00394                                 }
00395
00396                                 x = img_pos - IMAGE_WIDTH/2;
00397
00398                                 MoveToEx(dis->hDC, x, dis->rcItem.top, 0);
00399                                 LineTo(dis->hDC, x, y);
00400
00401                                 if (entry->_next) {
00402 #ifndef _LEFT_FILES
00403                                         bool following_child = (entry->_next->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)!=0;      // a directory?
00404
00405                                         if (!following_child)
00406                                                 for(Entry*n=entry->_next; n; n=n->_next)
00407                                                         if (n->_down) { // any file with NTFS sub-streams?
00408                                                                 following_child = true;
00409                                                                 break;
00410                                                         }
00411
00412                                         if (following_child)
00413 #endif
00414                                                 LineTo(dis->hDC, x, dis->rcItem.bottom);
00415                                 }
00416
00417                                 if (entry->_down && entry->_expanded) {
00418                                         x += IMAGE_WIDTH + _out_wrkr._spaceSize.cx;
00419                                         MoveToEx(dis->hDC, x, dis->rcItem.top+IMAGE_HEIGHT, 0);
00420                                         LineTo(dis->hDC, x, dis->rcItem.bottom);
00421                                 }
00422
00423                                 SelectClipRgn(dis->hDC, hrgn_org);
00424                                 if (hrgn_org) DeleteObject(hrgn_org);
00425                                 //SelectObject(dis->hDC, holdPen);
00426                         } else if (calcWidthCol==col || calcWidthCol==COLUMNS) {
00427                                 int right = img_pos + IMAGE_WIDTH - _out_wrkr._spaceSize.cx;
00428
00429                                 if (right > _widths[col])
00430                                         _widths[col] = right;
00431                         }
00432                 } else  {
00433                         img_pos = dis->rcItem.left;
00434                 }
00435         } else {
00436                 img_pos = dis->rcItem.left;
00437
00438                 if (calcWidthCol==col || calcWidthCol==COLUMNS)
00439                         _widths[col] = IMAGE_WIDTH;
00440         }
00441
00442         if (calcWidthCol == -1) {
00443                 focusRect.left = img_pos -2;
00444
00445                 if (attrs & FILE_ATTRIBUTE_COMPRESSED)
00446                         textcolor = _clrCompressed;
00447                 else
00448                         textcolor = RGB(0,0,0);
00449
00450                 if (dis->itemState & ODS_FOCUS) {
00451                         textcolor = GetSysColor(COLOR_HIGHLIGHTTEXT);
00452                         bkcolor = GetSysColor(COLOR_HIGHLIGHT);
00453                 } else {
00454                         bkcolor = GetSysColor(COLOR_WINDOW);
00455                 }
00456
00457                 HBRUSH hbrush = CreateSolidBrush(bkcolor);
00458                 FillRect(dis->hDC, &focusRect, hbrush);
00459                 DeleteObject(hbrush);
00460
00461                 SetBkMode(dis->hDC, TRANSPARENT);
00462                 SetTextColor(dis->hDC, textcolor);
00463
00464                 cx = _widths[col];
00465
00466                 if (cx && img!=IMG_NONE) {
00467                         if (cx > IMAGE_WIDTH)
00468                                 cx = IMAGE_WIDTH;
00469
00470                         if (entry->_icon_id > ICID_NONE)
00471                                 g_Globals._icon_cache.get_icon(entry->_icon_id).draw(dis->hDC, img_pos, dis->rcItem.top, cx, GetSystemMetrics(SM_CYSMICON), bkcolor, 0);
00472                         else
00473                                 ImageList_DrawEx(_himl, img, dis->hDC,
00474                                                                  img_pos, dis->rcItem.top, cx,
00475                                                                  IMAGE_HEIGHT, bkcolor, CLR_DEFAULT, ILD_NORMAL);
00476                 }
00477         }
00478
00479         if (!entry)
00480                 return;
00481
00482         ++col;
00483
00484          // output file name
00485         if (calcWidthCol == -1)
00486                 _out_wrkr.output_text(dis, _positions, col, entry->_display_name, 0);
00487         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00488                 calc_width(dis, col, entry->_display_name);
00489         ++col;
00490
00491          // output type/class name
00492         if (visible_cols & COL_TYPE) {
00493                 if (calcWidthCol == -1)
00494                         _out_wrkr.output_text(dis, _positions, col, entry->_type_name? entry->_type_name: TEXT(""), 0);
00495                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00496                         calc_width(dis, col, entry->_type_name? entry->_type_name: TEXT(""));
00497         }
00498         ++col;
00499
00500          // display file size
00501         if (visible_cols & COL_SIZE) {
00502                 ULONGLONG size = ((ULONGLONG)entry->_data.nFileSizeHigh << 32) | entry->_data.nFileSizeLow;
00503
00504                 _stprintf(buffer, TEXT("%") LONGLONGARG TEXT("d"), size);
00505
00506                 if (calcWidthCol == -1)
00507                         _out_wrkr.output_number(dis, _positions, col, buffer);
00508                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00509                         calc_width(dis, col, buffer);
00510         }
00511         ++col;
00512
00513          // display file date
00514         if (visible_cols & (COL_DATE|COL_TIME)) {
00515                 format_date(&entry->_data.ftCreationTime, buffer, visible_cols);
00516                 if (calcWidthCol == -1)
00517                         _out_wrkr.output_text(dis, _positions, col, buffer, 0);
00518                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00519                         calc_width(dis, col, buffer);
00520                 ++col;
00521
00522                 format_date(&entry->_data.ftLastAccessTime, buffer, visible_cols);
00523                 if (calcWidthCol == -1)
00524                         _out_wrkr.output_text(dis,_positions,  col, buffer, 0);
00525                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00526                         calc_width(dis, col, buffer);
00527                 ++col;
00528
00529                 format_date(&entry->_data.ftLastWriteTime, buffer, visible_cols);
00530                 if (calcWidthCol == -1)
00531                         _out_wrkr.output_text(dis, _positions, col, buffer, 0);
00532                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00533                         calc_width(dis, col, buffer);
00534                 ++col;
00535         } else
00536                 col += 3;
00537
00538         if (entry->_bhfi_valid) {
00539                 ULONGLONG index = ((ULONGLONG)entry->_bhfi.nFileIndexHigh << 32) | entry->_bhfi.nFileIndexLow;
00540
00541                 if (visible_cols & COL_INDEX) {
00542                         _stprintf(buffer, TEXT("%") LONGLONGARG TEXT("X"), index);
00543
00544                         if (calcWidthCol == -1)
00545                                 _out_wrkr.output_text(dis, _positions, col, buffer, DT_RIGHT);
00546                         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00547                                 calc_width(dis, col, buffer);
00548
00549                         ++col;
00550                 }
00551
00552                 if (visible_cols & COL_LINKS) {
00553                         wsprintf(buffer, TEXT("%d"), entry->_bhfi.nNumberOfLinks);
00554
00555                         if (calcWidthCol == -1)
00556                                 _out_wrkr.output_text(dis, _positions, col, buffer, DT_RIGHT);
00557                         else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00558                                 calc_width(dis, col, buffer);
00559
00560                         ++col;
00561                 }
00562         } else
00563                 col += 2;
00564
00565          // show file attributes
00566         if (visible_cols & COL_ATTRIBUTES) {
00567                 lstrcpy(buffer, TEXT(" \t \t \t \t \t \t \t \t \t \t \t \t \t \t "));
00568
00569                 if (attrs & FILE_ATTRIBUTE_NORMAL)                                      buffer[ 0] = 'N';
00570                 else {
00571                         if (attrs & FILE_ATTRIBUTE_READONLY)                    buffer[ 2] = 'R';
00572                         if (attrs & FILE_ATTRIBUTE_HIDDEN)                              buffer[ 4] = 'H';
00573                         if (attrs & FILE_ATTRIBUTE_SYSTEM)                              buffer[ 6] = 'S';
00574                         if (attrs & FILE_ATTRIBUTE_ARCHIVE)                     buffer[ 8] = 'A';
00575                         if (attrs & FILE_ATTRIBUTE_COMPRESSED)                  buffer[10] = 'C';
00576                         if (attrs & FILE_ATTRIBUTE_DIRECTORY)                   buffer[12] = 'D';
00577                         if (attrs & FILE_ATTRIBUTE_ENCRYPTED)                   buffer[14] = 'E';
00578                         if (attrs & FILE_ATTRIBUTE_TEMPORARY)                   buffer[16] = 'T';
00579                         if (attrs & FILE_ATTRIBUTE_SPARSE_FILE)                 buffer[18] = 'P';
00580                         if (attrs & FILE_ATTRIBUTE_REPARSE_POINT)               buffer[20] = 'Q';
00581                         if (attrs & FILE_ATTRIBUTE_OFFLINE)                     buffer[22] = 'O';
00582                         if (attrs & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) buffer[24] = 'X';
00583                         if (attrs & ATTRIBUTE_EXECUTABLE)                               buffer[26] = 'x';
00584                         if (attrs & ATTRIBUTE_SYMBOLIC_LINK)                    buffer[28] = 'L';
00585                 }
00586
00587                 if (calcWidthCol == -1)
00588                         _out_wrkr.output_tabbed_text(dis, _positions, col, buffer);
00589                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00590                         calc_tabbed_width(dis, col, buffer);
00591         }
00592         ++col;
00593
00594 /*TODO
00595         if (flags.security) {
00596                 DWORD rights = get_access_mask();
00597
00598                 tcscpy(buffer, TEXT(" \t \t \t  \t  \t \t \t  \t  \t \t \t "));
00599
00600                 if (rights & FILE_READ_DATA)                    buffer[ 0] = 'R';
00601                 if (rights & FILE_WRITE_DATA)                   buffer[ 2] = 'W';
00602                 if (rights & FILE_APPEND_DATA)                  buffer[ 4] = 'A';
00603                 if (rights & FILE_READ_EA)                              {buffer[6] = 'entry'; buffer[ 7] = 'R';}
00604                 if (rights & FILE_WRITE_EA)                     {buffer[9] = 'entry'; buffer[10] = 'W';}
00605                 if (rights & FILE_EXECUTE)                              buffer[12] = 'X';
00606                 if (rights & FILE_DELETE_CHILD)                 buffer[14] = 'D';
00607                 if (rights & FILE_READ_ATTRIBUTES)              {buffer[16] = 'a'; buffer[17] = 'R';}
00608                 if (rights & FILE_WRITE_ATTRIBUTES)     {buffer[19] = 'a'; buffer[20] = 'W';}
00609                 if (rights & WRITE_DAC)                                 buffer[22] = 'C';
00610                 if (rights & WRITE_OWNER)                               buffer[24] = 'O';
00611                 if (rights & SYNCHRONIZE)                               buffer[26] = 'S';
00612
00613                 output_text(dis, col++, buffer, DT_LEFT, 3, psize);
00614         }
00615
00616         if (flags.description) {
00617                 get_description(buffer);
00618                 output_text(dis, col++, buffer, 0, psize);
00619         }
00620 */
00621         ++col;
00622
00623          // output content / symbolic link target / comment
00624         if (visible_cols & COL_CONTENT) {
00625                 if (calcWidthCol == -1)
00626                         _out_wrkr.output_text(dis, _positions, col, entry->_content? entry->_content: TEXT(""), 0);
00627                 else if (calcWidthCol==col || calcWidthCol==COLUMNS)
00628                         calc_width(dis, col, entry->_content? entry->_content: TEXT(""));
00629         }
00630 }

Here is the call graph for this function:

MainFrameBase * Pane::get_frame ( ) [protected]

Definition at line 989 of file pane.cpp.

References WindowHandle::_hwnd, and HWND.

00990 {
00991         HWND owner = GetParent(_hwnd);
00992
00993         return (MainFrameBase*)owner;
00994 }

void Pane::init ( )

Definition at line 156 of file pane.cpp.

References _clrCompressed, OutputWorker::_hfont, _himl, ExplorerGlobals::_hInstance, WindowHandle::_hwnd, _out_wrkr, calc_widths(), g_Globals, IDB_IMAGES, and OutputWorker::init_output().

Referenced by Pane().

00157 {
00158         _himl = ImageList_LoadBitmap(g_Globals._hInstance, MAKEINTRESOURCE(IDB_IMAGES), 16, 0, RGB(0,255,0));
00159
00160         SetWindowFont(_hwnd, _out_wrkr._hfont, FALSE);
00161
00162          // read the color for compressed files from registry
00163         HKEY hkeyExplorer = 0;
00164         DWORD len = sizeof(_clrCompressed);
00165
00166         if (RegOpenKey(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer"), &hkeyExplorer) ||
00167                 RegQueryValueEx(hkeyExplorer, TEXT("AltColor"), 0, NULL, (LPBYTE)&_clrCompressed, &len) || len!=sizeof(_clrCompressed))
00168                 _clrCompressed = RGB(0,0,255);
00169
00170         if (hkeyExplorer)
00171                 RegCloseKey(hkeyExplorer);
00172
00173          // calculate column widths
00174         _out_wrkr.init_output(_hwnd);
00175         calc_widths(true);
00176 }

Here is the call graph for this function:

int Pane::insert_entries | ( | Entry * | dir,
 |  | int | idx = -1
 | ) |

Definition at line 660 of file pane.cpp.

References Entry::_data, Entry::_down, Entry::_expanded, WindowHandle::_hwnd, Entry::_next, and _treePane.

Referenced by FileChildWindow::expand_entry(), Pane(), and FileChildWindow::set_curdir().

00661 {
00662         Entry* entry = dir;
00663
00664         if (!entry)
00665                 return idx;
00666
00667         for(; entry; entry=entry->_next) {
00668 #ifndef _LEFT_FILES
00669                 if (_treePane &&
00670                         !(entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) &&    // not a directory?
00671                         !entry->_down)  // not a file with NTFS sub-streams?
00672                         continue;
00673 #endif
00674
00675                  // don't display entries "." and ".." in the left pane
00676                 if (_treePane && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
00677                                 && entry->_data.cFileName[0]==TEXT('.'))
00678                         if (entry->_data.cFileName[1]==TEXT('\0') ||
00679                                 (entry->_data.cFileName[1]==TEXT('.') && entry->_data.cFileName[2]==TEXT('\0')))
00680                                 continue;
00681
00682                 if (idx != -1)
00683                         ++idx;
00684
00685                 ListBox_InsertItemData(_hwnd, idx, entry);
00686
00687                 if (_treePane && entry->_expanded)
00688                         idx = insert_entries(entry->_down, idx);
00689         }
00690
00691         return idx;
00692 }

int Pane::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [virtual]

Reimplemented from SubclassedWindow.

Definition at line 785 of file pane.cpp.

References WindowHandle::_hwnd, _hwndHeader, _positions, _widths, and set_header().

00786 {
00787         switch(pnmh->code) {
00788                 case HDN_TRACK:
00789                 case HDN_ENDTRACK: {
00790                         HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
00791                         int idx = phdn->iItem;
00792                         int dx = phdn->pitem->cxy - _widths[idx];
00793                         int i;
00794
00795                         ClientRect clnt(_hwnd);
00796
00797                          // move immediate to simulate HDS_FULLDRAG (for now [04/2000] not realy needed with WINELIB)
00798                         Header_SetItem(_hwndHeader, idx, phdn->pitem);
00799
00800                         _widths[idx] += dx;
00801
00802                         for(i=idx; ++i<=COLUMNS; )
00803                                 _positions[i] += dx;
00804
00805                         {
00806                                 int scroll_pos = GetScrollPos(_hwnd, SB_HORZ);
00807                                 RECT rt_scr;
00808                                 RECT rt_clip;
00809
00810                                 rt_scr.left   = _positions[idx+1]-scroll_pos;
00811                                 rt_scr.top    = 0;
00812                                 rt_scr.right  = clnt.right;
00813                                 rt_scr.bottom = clnt.bottom;
00814
00815                                 rt_clip.left   = _positions[idx]-scroll_pos;
00816                                 rt_clip.top    = 0;
00817                                 rt_clip.right  = clnt.right;
00818                                 rt_clip.bottom = clnt.bottom;
00819
00820                                 if (rt_scr.left < 0) rt_scr.left = 0;
00821                                 if (rt_clip.left < 0) rt_clip.left = 0;
00822
00823                                 ScrollWindowEx(_hwnd, dx, 0, &rt_scr, &rt_clip, 0, 0, SW_INVALIDATE);
00824
00825                                 rt_clip.right = _positions[idx+1];
00826                                 RedrawWindow(_hwnd, &rt_clip, 0, RDW_INVALIDATE|RDW_UPDATENOW);
00827
00828                                 if (pnmh->code == HDN_ENDTRACK) {
00829                                         ListBox_SetHorizontalExtent(_hwnd, _positions[COLUMNS]);
00830
00831                                         if (GetScrollPos(_hwnd, SB_HORZ) != scroll_pos)
00832                                                 set_header();
00833                                 }
00834                         }
00835
00836                         return 0;
00837                 }
00838
00839                 case HDN_DIVIDERDBLCLICK: {
00840                         HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
00841                         HD_ITEM item;
00842
00843                         calc_single_width(phdn->iItem);
00844                         item.mask = HDI_WIDTH;
00845                         item.cxy = _widths[phdn->iItem];
00846
00847                         Header_SetItem(_hwndHeader, phdn->iItem, &item);
00848                         InvalidateRect(_hwnd, 0, TRUE);
00849                         break;}
00850
00851                 default:
00852                         return super::Notify(id, pnmh);
00853         }
00854
00855         return 0;
00856 }

Here is the call graph for this function:

void Pane::set_header ( )

Definition at line 695 of file pane.cpp.

References WindowHandle::_hwnd, _hwndHeader, _widths, and COLUMNS.

Referenced by FileChildWindow::activate_entry(), command(), FileChildWindow::expand_entry(), Notify(), FileChildWindow::set_curdir(), and WndProc().

00696 {
00697         HD_ITEM item;
00698         int scroll_pos = GetScrollPos(_hwnd, SB_HORZ);
00699         int i=0, x=0;
00700
00701         item.mask = HDI_WIDTH;
00702         item.cxy = 0;
00703
00704         for(; x+_widths[i]<scroll_pos && i<COLUMNS; i++) {
00705                 x += _widths[i];
00706                 Header_SetItem(_hwndHeader, i, &item);
00707         }
00708
00709         if (i < COLUMNS) {
00710                 x += _widths[i];
00711                 item.cxy = x - scroll_pos;
00712                 Header_SetItem(_hwndHeader, i++, &item);
00713
00714                 for(; i<COLUMNS; i++) {
00715                         item.cxy = _widths[i];
00716                         x += _widths[i];
00717                         Header_SetItem(_hwndHeader, i, &item);
00718                 }
00719         }
00720 }

LRESULT Pane::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from SubclassedWindow.

Definition at line 101 of file pane.cpp.

References WindowHandle::_hwnd, PM_GET_FILEWND_PTR, FileChildWindow::set_focus_pane(), set_header(), and FileChildWindow::switch_focus_pane().

00102 {
00103         switch(nmsg) {
00104           case WM_HSCROLL:
00105                 set_header();
00106                 break;
00107
00108           case WM_SETFOCUS: {
00109                 FileChildWindow* child = (FileChildWindow*) SendMessage(GetParent(_hwnd), PM_GET_FILEWND_PTR, 0, 0);
00110
00111                 child->set_focus_pane(this);
00112                 ListBox_SetSel(_hwnd, TRUE, 1);
00113                 /*@todo check menu items */
00114                 break;}
00115
00116           case WM_KEYDOWN: {
00117                 FileChildWindow* child = (FileChildWindow*) SendMessage(GetParent(_hwnd), PM_GET_FILEWND_PTR, 0, 0);
00118
00119                 if (wparam == VK_TAB) {
00120                         /*@todo SetFocus(g_Globals.hdrivebar) */
00121                         child->switch_focus_pane();
00122                 }
00123                 break;}
00124         }
00125
00126         return super::WndProc(nmsg, wparam, lparam);
00127 }

Here is the call graph for this function:

Member Data Documentation

COLORREF Pane::_clrCompressed

Definition at line 82 of file pane.h.

Referenced by draw_item(), and init().

Entry* Pane::_cur

Definition at line 80 of file pane.h.

Referenced by FileChildWindow::activate_entry(), FileChildWindow::Command(), and FileChildWindow::set_curdir().

HIMAGELIST Pane::_himl [protected]

Definition at line 107 of file pane.h.

Referenced by draw_item(), init(), and ~Pane().

WindowHandle Pane::_hwndHeader

Definition at line 77 of file pane.h.

Referenced by Notify(), FileChildWindow::resize_children(), and set_header().

OutputWorker Pane::_out_wrkr [protected]

Definition at line 108 of file pane.h.

Referenced by calc_single_width(), calc_widths(), draw_item(), and init().

int Pane::_positions[COLUMNS+1]

Definition at line 75 of file pane.h.

Referenced by calc_widths(), draw_item(), and Notify().

Entry* Pane::_root

Definition at line 79 of file pane.h.

Referenced by Pane(), and FileChildWindow::set_curdir().

bool Pane::_treePane

Definition at line 85 of file pane.h.

Referenced by FileChildWindow::activate_entry(), draw_item(), and insert_entries().

int Pane::_visible_cols

Definition at line 84 of file pane.h.

Referenced by command(), and draw_item().

int Pane::_widths[COLUMNS]

Definition at line 74 of file pane.h.

Referenced by calc_single_width(), calc_tabbed_width(), calc_width(), calc_widths(), create_header(), draw_item(), Notify(), and set_header().

The documentation for this struct was generated from the following files:
  • pane.h
  • pane.cpp


ROS Explorer: Member List

Pane Member List

This is the complete list of members for Pane, including all inherited members.

_clrCompressed | Pane |
_cur | Pane |
_himl | Pane | [protected]
_hwnd | WindowHandle | [protected]
_hwndHeader | Pane |
_orgWndProc | SubclassedWindow | [protected]
_out_wrkr | Pane | [protected]
_positions | Pane |
_root | Pane |
_treePane | Pane |
_visible_cols | Pane |
_widths | Pane |
calc_single_width(int col) | Pane |
calc_tabbed_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str) | Pane | [protected]
calc_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str) | Pane | [protected]
calc_widths(bool anyway) | Pane |
CancelModes() | Window | [static]
command(UINT cmd) | Pane |
Command(int id, int code) | SubclassedWindow | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_header(HWND parent, int id) | Pane |
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
draw_item(LPDRAWITEMSTRUCT dis, Entry *entry, int calcWidthCol=-1) | Pane |
get_frame() | Pane | [protected]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
init() | Pane |
insert_entries(Entry *dir, int idx=-1) | Pane |
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Pane | [virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
Pane(HWND hparent, int id, int id_header, Entry *rool, bool treePane, int visible_cols) | Pane |
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
set_header() | Pane |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | Pane |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | Pane | [protected, virtual]
~Pane() | Pane |
~Window() | Window | [virtual]


ROS Explorer: PictureButton Struct Reference

PictureButton Struct Reference

Subclass button controls to paint pictures left to the labels. More...

#include <window.h>

Inheritance diagram for PictureButton:

[legend]
Collaboration diagram for PictureButton:

[legend]
List of all members.

Public Types

typedef OwnerdrawnButton | super

Public Member Functions

PictureButton (HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
PictureButton (HWND hparent, int id, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
PictureButton (HWND hwnd, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
PictureButton (HWND hparent, int id, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)

Protected Member Functions

virtual void | DrawItem (LPDRAWITEMSTRUCT dis)

Protected Attributes

HICON | _hIcon
HBITMAP | _hBmp
HBRUSH | _hBrush
int | _cx
int | _cy
bool | _flat

Detailed Description

Subclass button controls to paint pictures left to the labels.

The buttons should have set the style bit BS_OWNERDRAW. The owning window should use the OwnerDrawParent template to route owner draw messages to the buttons.

Definition at line 716 of file window.h.

Member Typedef Documentation

typedef OwnerdrawnButton PictureButton::super

Reimplemented from OwnerdrawnButton.

Reimplemented in StartButton.

Definition at line 718 of file window.h.

Constructor & Destructor Documentation

PictureButton::PictureButton | ( | HWND | hwnd,
 |  | HICON | hIcon,
 |  | HBRUSH | hbrush = GetSysColorBrush(COLOR_BTNFACE),
 |  | bool | flat = false
 | ) | [inline]

Definition at line 720 of file window.h.

00721          :      super(hwnd), _hIcon(hIcon), _hBmp(0), _hBrush(hbrush), _flat(flat)
00722         {
00723                 _cx = 16;
00724                 _cy = 16;
00725         }

PictureButton::PictureButton | ( | HWND | hparent,
 |  | int | id,
 |  | HICON | hIcon,
 |  | HBRUSH | hbrush = GetSysColorBrush(COLOR_BTNFACE),
 |  | bool | flat = false
 | ) | [inline]

Definition at line 727 of file window.h.

00728          :      super(GetDlgItem(hparent, id)), _hIcon(hIcon), _hBmp(0), _hBrush(hbrush), _flat(flat)
00729         {
00730                 _cx = 16;
00731                 _cy = 16;
00732         }

PictureButton::PictureButton | ( | HWND | hwnd,
 |  | HBITMAP | hBmp,
 |  | HBRUSH | hbrush = GetSysColorBrush(COLOR_BTNFACE),
 |  | bool | flat = false
 | ) | [inline]

Definition at line 734 of file window.h.

00735          :      super(hwnd), _hIcon(0), _hBmp(hBmp), _hBrush(hbrush), _flat(flat)
00736         {
00737                 BITMAP bmp;
00738                 GetObject(hBmp, sizeof(bmp), &bmp);
00739                 _cx = bmp.bmWidth;
00740                 _cy = bmp.bmHeight;
00741         }

PictureButton::PictureButton | ( | HWND | hparent,
 |  | int | id,
 |  | HBITMAP | hBmp,
 |  | HBRUSH | hbrush = GetSysColorBrush(COLOR_BTNFACE),
 |  | bool | flat = false
 | ) | [inline]

Definition at line 743 of file window.h.

00744          :      super(GetDlgItem(hparent, id)), _hIcon(0), _hBmp(hBmp), _hBrush(hbrush), _flat(flat)
00745         {
00746                 BITMAP bmp;
00747                 GetObject(hBmp, sizeof(bmp), &bmp);
00748                 _cx = bmp.bmWidth;
00749                 _cy = bmp.bmHeight;
00750         }

Member Function Documentation

void PictureButton::DrawItem ( LPDRAWITEMSTRUCT dis ) [protected, virtual]

Implements OwnerdrawnButton.

Definition at line 952 of file window.cpp.

References _cx, _cy, _flat, _hBmp, _hBrush, _hIcon, WindowHandle::_hwnd, BUFFER_LEN, and DrawGrayText().

00953 {
00954         UINT state = DFCS_BUTTONPUSH;
00955         int style = GetWindowStyle(_hwnd);
00956
00957         if (dis->itemState & ODS_DISABLED)
00958                 state |= DFCS_INACTIVE;
00959
00960         POINT imagePos;
00961         RECT textRect;
00962         int dt_flags;
00963
00964         if (style & BS_BOTTOM) {
00965                  // align horizontal centered, vertical floating
00966                 imagePos.x = (dis->rcItem.left + dis->rcItem.right - _cx) / 2;
00967                 imagePos.y = dis->rcItem.top + 3;
00968
00969                 textRect.left = dis->rcItem.left + 2;
00970                 textRect.top = dis->rcItem.top + _cy + 4;
00971                 textRect.right = dis->rcItem.right - 4;
00972                 textRect.bottom = dis->rcItem.bottom - 4;
00973
00974                 dt_flags = DT_SINGLELINE|DT_CENTER|DT_VCENTER;
00975         } else {
00976                  // horizontal floating, vertical centered
00977                 imagePos.x = dis->rcItem.left + 3;
00978                 imagePos.y = (dis->rcItem.top + dis->rcItem.bottom - _cy)/2;
00979
00980                 textRect.left = dis->rcItem.left + _cx + 4;
00981                 textRect.top = dis->rcItem.top + 2;
00982                 textRect.right = dis->rcItem.right - 4;
00983                 textRect.bottom = dis->rcItem.bottom - 4;
00984
00985                 dt_flags = DT_SINGLELINE|DT_VCENTER/*|DT_CENTER*/;
00986         }
00987
00988         if (dis->itemState & ODS_SELECTED) {
00989                 state |= DFCS_PUSHED;
00990                 ++imagePos.x;           ++imagePos.y;
00991                 ++textRect.left;        ++textRect.top;
00992                 ++textRect.right;       ++textRect.bottom;
00993         }
00994
00995         if (_flat) {
00996                 FillRect(dis->hDC, &dis->rcItem, _hBrush);
00997
00998                 if (style & BS_FLAT)    // Only with BS_FLAT set, there will be drawn a frame without highlight.
00999                         DrawEdge(dis->hDC, &dis->rcItem, EDGE_RAISED, BF_RECT|BF_FLAT);
01000         } else
01001                 DrawFrameControl(dis->hDC, &dis->rcItem, DFC_BUTTON, state);
01002
01003         if (_hIcon)
01004                 DrawIconEx(dis->hDC, imagePos.x, imagePos.y, _hIcon, _cx, _cy, 0, _hBrush, DI_NORMAL);
01005         else {
01006                 MemCanvas mem_dc;
01007                 BitmapSelection sel(mem_dc, _hBmp);
01008                 BitBlt(dis->hDC, imagePos.x, imagePos.y, _cx, _cy, mem_dc, 0, 0, SRCCOPY);
01009         }
01010
01011         TCHAR title[BUFFER_LEN];
01012         GetWindowText(_hwnd, title, BUFFER_LEN);
01013
01014         BkMode bk_mode(dis->hDC, TRANSPARENT);
01015
01016         if (dis->itemState & (ODS_DISABLED|ODS_GRAYED))
01017                 DrawGrayText(dis->hDC, &textRect, title, dt_flags);
01018         else {
01019                 TextColor lcColor(dis->hDC, GetSysColor(COLOR_BTNTEXT));
01020                 DrawText(dis->hDC, title, -1, &textRect, dt_flags);
01021         }
01022
01023         if (dis->itemState & ODS_FOCUS) {
01024                 RECT rect = {
01025                         dis->rcItem.left+3, dis->rcItem.top+3,
01026                         dis->rcItem.right-dis->rcItem.left-4, dis->rcItem.bottom-dis->rcItem.top-4
01027                 };
01028                 if (dis->itemState & ODS_SELECTED) {
01029                         ++rect.left;    ++rect.top;
01030                         ++rect.right;   ++rect.bottom;
01031                 }
01032                 DrawFocusRect(dis->hDC, &rect);
01033         }
01034 }

Here is the call graph for this function:

Member Data Documentation

int PictureButton::_cx [protected]

Definition at line 759 of file window.h.

Referenced by DrawItem().

int PictureButton::_cy [protected]

Definition at line 760 of file window.h.

Referenced by DrawItem().

bool PictureButton::_flat [protected]

Definition at line 762 of file window.h.

Referenced by DrawItem().

HBITMAP PictureButton::_hBmp [protected]

Definition at line 756 of file window.h.

Referenced by DrawItem().

HBRUSH PictureButton::_hBrush [protected]

Definition at line 757 of file window.h.

Referenced by DrawItem().

HICON PictureButton::_hIcon [protected]

Definition at line 755 of file window.h.

Referenced by DrawItem().

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

PictureButton Member List

This is the complete list of members for PictureButton, including all inherited members.

_cx | PictureButton | [protected]
_cy | PictureButton | [protected]
_flat | PictureButton | [protected]
_hBmp | PictureButton | [protected]
_hBrush | PictureButton | [protected]
_hIcon | PictureButton | [protected]
_hwnd | WindowHandle | [protected]
_orgWndProc | SubclassedWindow | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | SubclassedWindow | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawItem(LPDRAWITEMSTRUCT dis) | PictureButton | [protected, virtual]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | SubclassedWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerdrawnButton(HWND hwnd) | OwnerdrawnButton | [inline]
PictureButton(HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) | PictureButton | [inline]
PictureButton(HWND hparent, int id, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) | PictureButton | [inline]
PictureButton(HWND hwnd, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) | PictureButton | [inline]
PictureButton(HWND hparent, int id, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) | PictureButton | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | PictureButton |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | OwnerdrawnButton | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: PIDList Struct Reference

PIDList Struct Reference

list of PIDLs More...

#include <shellclasses.h>

Collaboration diagram for PIDList:

[legend]
List of all members.

Public Member Functions

PIDList ()
~PIDList ()
HRESULT | GetData (IDataObject *selection)
operator LPIDA ()

Protected Attributes

STGMEDIUM | _stgm
LPIDA | _pIDList

Detailed Description

list of PIDLs

Definition at line 1045 of file shellclasses.h.

Constructor & Destructor Documentation

PIDList::PIDList ( ) [inline]

Definition at line 1047 of file shellclasses.h.

01048         {
01049                 memset(&_stgm, 0, sizeof(STGMEDIUM));
01050         }

PIDList::~PIDList ( ) [inline]

Definition at line 1052 of file shellclasses.h.

01053         {
01054                 if (_stgm.hGlobal) {
01055                         GlobalUnlock(_stgm.hGlobal);
01056                         ReleaseStgMedium(&_stgm);
01057                 }
01058         }

Member Function Documentation

HRESULT PIDList::GetData ( IDataObject * selection ) [inline]

Definition at line 1060 of file shellclasses.h.

Referenced by DesktopShellView::DoContextMenu(), and IShellBrowserImpl::OnDefaultCommand().

01061         {
01062                 static UINT CF_IDLIST = RegisterClipboardFormat(CFSTR_SHELLIDLIST);
01063
01064                 FORMATETC fetc;
01065                 fetc.cfFormat = CF_IDLIST;
01066                 fetc.ptd = NULL;
01067                 fetc.dwAspect = DVASPECT_CONTENT;
01068                 fetc.lindex = -1;
01069                 fetc.tymed = TYMED_HGLOBAL;
01070
01071                 HRESULT hr = selection->QueryGetData(&fetc);
01072                 if (FAILED(hr))
01073                         return hr;
01074
01075                 hr = selection->GetData(&fetc, &_stgm);
01076                 if (FAILED(hr))
01077                         return hr;
01078
01079                 _pIDList = (LPIDA)GlobalLock(_stgm.hGlobal);
01080
01081                 return hr;
01082         }

PIDList::operator LPIDA ( ) [inline]

Definition at line 1084 of file shellclasses.h.

01084 {return _pIDList;}

Member Data Documentation

LPIDA PIDList::_pIDList [protected]

Definition at line 1088 of file shellclasses.h.

STGMEDIUM PIDList::_stgm [protected]

Definition at line 1087 of file shellclasses.h.

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

PIDList Member List

This is the complete list of members for PIDList, including all inherited members.

_pIDList | PIDList | [protected]
_stgm | PIDList | [protected]
GetData(IDataObject *selection) | PIDList | [inline]
operator LPIDA() | PIDList | [inline]
PIDList() | PIDList | [inline]
~PIDList() | PIDList | [inline]


ROS Explorer: Point Struct Reference

Point Struct Reference

PointL encapsulates the POINT structure into a C++ object. More...

#include <utility.h>

Inheritance diagram for Point:

[legend]
Collaboration diagram for Point:

[legend]
List of all members.

Public Member Functions

Point (LONG x_, LONG y_)
Point (LPARAM lparam)
operator LPPOINT ()

Detailed Description

PointL encapsulates the POINT structure into a C++ object.

Definition at line 430 of file utility.h.

Constructor & Destructor Documentation

Point::Point | ( | LONG | x_,
 |  | LONG | y_
 | ) | [inline]

Definition at line 432 of file utility.h.

00433         {
00434                 x = x_;
00435                 y = y_;
00436         }

Point::Point ( LPARAM lparam ) [inline]

Definition at line 439 of file utility.h.

00440         {
00441                 x = GET_X_LPARAM(lparam);
00442                 y = GET_Y_LPARAM(lparam);
00443         }

Member Function Documentation

Point::operator LPPOINT ( ) [inline]

Definition at line 445 of file utility.h.

00445 {return this;}

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

Point Member List

This is the complete list of members for Point, including all inherited members.

operator LPPOINT() | Point | [inline]
Point(LONG x_, LONG y_) | Point | [inline]
Point(LPARAM lparam) | Point | [inline]


ROS Explorer: PopupMenu Struct Reference

PopupMenu Struct Reference

Popup Menus. More...

#include <utility.h>

Collaboration diagram for PopupMenu:

[legend]
List of all members.

Public Member Functions

PopupMenu ()
PopupMenu (UINT nid)
operator HMENU ()
void | Append (UINT id, LPCTSTR str, UINT flags=MF_STRING)
int | TrackPopupMenu (HWND hwnd, const POINT &pt, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON, LPTPMPARAMS tpm=NULL)
int | PopupContextMenu (HWND hwnd, POINTS pos, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON)
int | TrackPopupMenu (HWND hwnd, POINTS pos, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON)
int | TrackPopupMenuAtCursor (HWND hwnd, UINT flags=TPM_LEFTBUTTON)
int | TrackPopupMenuAtPos (HWND hwnd, DWORD pos, UINT flags=TPM_LEFTBUTTON)

Protected Attributes

HMENU | _hmenu

Detailed Description

Popup Menus.

Definition at line 655 of file utility.h.

Constructor & Destructor Documentation

PopupMenu::PopupMenu ( ) [inline]

Definition at line 657 of file utility.h.

00658          :      _hmenu(CreatePopupMenu())
00659         {
00660         }

PopupMenu::PopupMenu ( UINT nid )

Definition at line 746 of file explorer.cpp.

References ExplorerGlobals::_hInstance, and _hmenu.

00747 {
00748         HMENU hMenu = LoadMenu(g_Globals._hInstance, MAKEINTRESOURCE(nid));
00749         _hmenu = GetSubMenu(hMenu, 0);
00750 }

Member Function Documentation

void PopupMenu::Append | ( | UINT | id,
 |  | LPCTSTR | str,
 |  | UINT | flags = MF_STRING
 | ) | [inline]

Definition at line 666 of file utility.h.

00667         {
00668                 AppendMenu(_hmenu, flags, id, str);
00669         }

PopupMenu::operator HMENU ( ) [inline]

Definition at line 664 of file utility.h.

00664 {return _hmenu;}

int PopupMenu::PopupContextMenu | ( | HWND | hwnd,
 |  | POINTS | pos,
 |  | UINT | flags = TPM_LEFTBUTTON|TPM_RIGHTBUTTON
 | ) | [inline]

Definition at line 675 of file utility.h.

00675                                                                                                {
00676          POINT pt; POINTSTOPOINT(pt, pos);
00677          return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL);
00678         }

int PopupMenu::TrackPopupMenu | ( | HWND | hwnd,
 |  | POINTS | pos,
 |  | UINT | flags = TPM_LEFTBUTTON|TPM_RIGHTBUTTON
 | ) | [inline]

Definition at line 680 of file utility.h.

References ClientToScreen().

00680                                                                                              {
00681          POINT pt; POINTSTOPOINT(pt, pos);
00682          ClientToScreen(hwnd, &pt);
00683          return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL);
00684         }

Here is the call graph for this function:

int PopupMenu::TrackPopupMenu | ( | HWND | hwnd,
 |  | const POINT & | pt,
 |  | UINT | flags = TPM_LEFTBUTTON|TPM_RIGHTBUTTON,
 |  | LPTPMPARAMS | tpm = NULL
 | ) | [inline]

Definition at line 671 of file utility.h.

00671                                                                                                                         {
00672          return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, tpm);
00673         }

int PopupMenu::TrackPopupMenuAtCursor | ( | HWND | hwnd,
 |  | UINT | flags = TPM_LEFTBUTTON
 | ) | [inline]

Definition at line 686 of file utility.h.

00686                                                                          {
00687          POINT pt; GetCursorPos(&pt);
00688          return TrackPopupMenuEx(_hmenu, flags, pt.x, pt.y, hwnd, NULL);
00689         }

int PopupMenu::TrackPopupMenuAtPos | ( | HWND | hwnd,
 |  | DWORD | pos,
 |  | UINT | flags = TPM_LEFTBUTTON
 | ) | [inline]

Definition at line 691 of file utility.h.

00691                                                                                  {
00692          return TrackPopupMenuEx(_hmenu, flags, GET_X_LPARAM(pos), GET_Y_LPARAM(pos), hwnd, NULL);
00693         }

Member Data Documentation

HMENU PopupMenu::_hmenu [protected]

Definition at line 696 of file utility.h.

Referenced by PopupMenu().

The documentation for this struct was generated from the following files:
  • utility.h
  • explorer.cpp


ROS Explorer: Member List

PopupMenu Member List

This is the complete list of members for PopupMenu, including all inherited members.

_hmenu | PopupMenu | [protected]
Append(UINT id, LPCTSTR str, UINT flags=MF_STRING) | PopupMenu | [inline]
operator HMENU() | PopupMenu | [inline]
PopupContextMenu(HWND hwnd, POINTS pos, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON) | PopupMenu | [inline]
PopupMenu() | PopupMenu | [inline]
PopupMenu(UINT nid) | PopupMenu |
TrackPopupMenu(HWND hwnd, const POINT &pt, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON, LPTPMPARAMS tpm=NULL) | PopupMenu | [inline]
TrackPopupMenu(HWND hwnd, POINTS pos, UINT flags=TPM_LEFTBUTTON|TPM_RIGHTBUTTON) | PopupMenu | [inline]
TrackPopupMenuAtCursor(HWND hwnd, UINT flags=TPM_LEFTBUTTON) | PopupMenu | [inline]
TrackPopupMenuAtPos(HWND hwnd, DWORD pos, UINT flags=TPM_LEFTBUTTON) | PopupMenu | [inline]


ROS Explorer: PreTranslateWindow Struct Reference

PreTranslateWindow Struct Reference

PreTranslateWindow is used to register windows to be called by Window::pretranslate_msg(). More...

#include <window.h>

Inheritance diagram for PreTranslateWindow:

[legend]
Collaboration diagram for PreTranslateWindow:

[legend]
List of all members.

Public Types

typedef Window super

Public Member Functions

PreTranslateWindow (HWND)
~PreTranslateWindow ()

Detailed Description

PreTranslateWindow is used to register windows to be called by Window::pretranslate_msg().

This way you get PM_TRANSLATE_MSG messages before the message loop dispatches messages. You can then for example use TranslateAccelerator() to implement key shortcuts.

Definition at line 333 of file window.h.

Member Typedef Documentation

typedef Window PreTranslateWindow::super

Reimplemented in MainFrameBase, MDIMainFrame, SDIMainFrame, ShellBrowserChildT< MainFrameBase >, and ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >.

Definition at line 335 of file window.h.

Constructor & Destructor Documentation

PreTranslateWindow::PreTranslateWindow ( HWND )

Definition at line 665 of file window.cpp.

References Window::register_pretranslate().

00666  :      super(hwnd)
00667 {
00668         register_pretranslate(hwnd);
00669 }

Here is the call graph for this function:

PreTranslateWindow::~PreTranslateWindow ( )

Definition at line 671 of file window.cpp.

References WindowHandle::_hwnd, and Window::unregister_pretranslate().

00672 {
00673         unregister_pretranslate(_hwnd);
00674 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

PreTranslateWindow Member List

This is the complete list of members for PreTranslateWindow, including all inherited members.

_hwnd | WindowHandle | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | Window | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PreTranslateWindow(HWND) | PreTranslateWindow |
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | PreTranslateWindow |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [protected, virtual]
~PreTranslateWindow() | PreTranslateWindow |
~Window() | Window | [virtual]


ROS Explorer: PropertySheetDialog Struct Reference

PropertySheetDialog Struct Reference

Property Sheet dialog. More...

#include <window.h>

Inheritance diagram for PropertySheetDialog:

[legend]
Collaboration diagram for PropertySheetDialog:

[legend]
List of all members.

Public Member Functions

PropertySheetDialog (HWND owner)
void | add (PropSheetPage &psp)
int | DoModal (int start_page=0)
HWND GetCurrentPage ()

Protected Types

typedef vector< PROPSHEETPAGE > | Vector

Protected Attributes

Vector _pages
HWND _hwnd

Detailed Description

Property Sheet dialog.

Definition at line 407 of file window.h.

Member Typedef Documentation

typedef vector<PROPSHEETPAGE> PropertySheetDialog::Vector [protected]

Definition at line 417 of file window.h.

Constructor & Destructor Documentation

PropertySheetDialog::PropertySheetDialog ( HWND owner )

Definition at line 1311 of file window.cpp.

References ExplorerGlobals::_hInstance, and g_Globals.

01312  :      _hwnd(0)
01313 {
01314         PROPSHEETHEADER::dwSize = sizeof(PROPSHEETHEADER);
01315         PROPSHEETHEADER::dwFlags = PSH_PROPSHEETPAGE | PSH_MODELESS;
01316         PROPSHEETHEADER::hwndParent = owner;
01317         PROPSHEETHEADER::hInstance = g_Globals._hInstance;
01318 }

Member Function Documentation

void PropertySheetDialog::add ( PropSheetPage & psp )

Definition at line 1320 of file window.cpp.

References _pages.

Referenced by ExplorerPropertySheet().

01321 {
01322         _pages.push_back(psp);
01323 }

int PropertySheetDialog::DoModal ( int start_page = 0 )

Definition at line 1325 of file window.cpp.

References _pages, Window::dispatch_dialog_msg(), HandleException(), HWND, and Window::pretranslate_msg().

Referenced by ExplorerPropertySheet().

01326 {
01327         PROPSHEETHEADER::ppsp = (LPCPROPSHEETPAGE) &_pages[0];
01328         PROPSHEETHEADER::nPages = _pages.size();
01329         PROPSHEETHEADER::nStartPage = start_page;
01330 /*
01331         Window* pwnd = Window::create_property_sheet(this, WINDOW_CREATOR(PropertySheetDlg), NULL);
01332         if (!pwnd)
01333                 return -1;
01334
01335         HWND hwndPropSheet = *pwnd;
01336 */
01337         int ret = PropertySheet(this);
01338         if (ret == -1)
01339                 return -1;
01340
01341         HWND hwndPropSheet = (HWND) ret;
01342         HWND hwndparent = GetParent(hwndPropSheet);
01343
01344         if (hwndparent)
01345                 EnableWindow(hwndparent, FALSE);
01346
01347         ret = 0;
01348         MSG msg;
01349
01350         while(GetMessage(&msg, 0, 0, 0)) {
01351                 try {
01352                         if (Window::pretranslate_msg(&msg))
01353                                 continue;
01354
01355                         if (PropSheet_IsDialogMessage(hwndPropSheet, &msg))
01356                                 continue;
01357
01358                         if (Window::dispatch_dialog_msg(&msg))
01359                                 continue;
01360
01361                         TranslateMessage(&msg);
01362
01363                         try {
01364                                 DispatchMessage(&msg);
01365                         } catch(COMException& e) {
01366                                 HandleException(e, 0);
01367                         }
01368
01369                         if (!PropSheet_GetCurrentPageHwnd(hwndPropSheet)) {
01370                                 ret = PropSheet_GetResult(hwndPropSheet);
01371                                 break;
01372                         }
01373                 } catch(COMException& e) {
01374                         HandleException(e, 0);
01375                 }
01376         }
01377
01378         if (hwndparent)
01379                 EnableWindow(hwndparent, TRUE);
01380
01381         DestroyWindow(hwndPropSheet);
01382
01383         return ret;
01384 }

Here is the call graph for this function:

HWND PropertySheetDialog::GetCurrentPage ( )

Definition at line 1386 of file window.cpp.

References _hwnd, and HWND.

01387 {
01388         HWND hdlg = PropSheet_GetCurrentPageHwnd(_hwnd);
01389         return hdlg;
01390 }

Member Data Documentation

HWND PropertySheetDialog::_hwnd [protected]

Definition at line 419 of file window.h.

Referenced by GetCurrentPage().

Vector PropertySheetDialog::_pages [protected]

Definition at line 418 of file window.h.

Referenced by add(), and DoModal().

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

PropertySheetDialog Member List

This is the complete list of members for PropertySheetDialog, including all inherited members.

_hwnd | PropertySheetDialog | [protected]
_pages | PropertySheetDialog | [protected]
add(PropSheetPage &psp) | PropertySheetDialog |
DoModal(int start_page=0) | PropertySheetDialog |
GetCurrentPage() | PropertySheetDialog |
PropertySheetDialog(HWND owner) | PropertySheetDialog |
Vector typedef | PropertySheetDialog | [protected]


ROS Explorer: PROPSHEETHEADER Class Reference

PROPSHEETHEADER Class Reference

Inheritance diagram for PROPSHEETHEADER:

[legend]
The documentation for this class was generated from the following file:
  • window.h


ROS Explorer: PROPSHEETPAGE Class Reference

PROPSHEETPAGE Class Reference

Inheritance diagram for PROPSHEETPAGE:

[legend]
The documentation for this class was generated from the following file:
  • window.h


ROS Explorer: PropSheetPage Struct Reference

PropSheetPage Struct Reference

#include <window.h>

Inheritance diagram for PropSheetPage:

[legend]
Collaboration diagram for PropSheetPage:

[legend]
List of all members.

Public Member Functions

PropSheetPage (UINT nid, Window::CREATORFUNC dlg_creator)
void | init (struct PropertySheetDialog *)

Protected Attributes

Window::CREATORFUNC _dlg_creator

Friends

struct | PropSheetPageDlg

Detailed Description

Definition at line 393 of file window.h.

Constructor & Destructor Documentation

PropSheetPage::PropSheetPage | ( | UINT | nid,
 |  | Window::CREATORFUNC | dlg_creator
 | ) |

Definition at line 1293 of file window.cpp.

References ExplorerGlobals::_hInstance, PropSheetPageDlg::DialogProc(), g_Globals, and PSM_GETRESULT.

01294  :      _dlg_creator(dlg_creator)
01295 {
01296         PROPSHEETPAGE::dwSize           = sizeof(PROPSHEETPAGE);
01297         PROPSHEETPAGE::dwFlags          = 0;
01298         PROPSHEETPAGE::hInstance        = g_Globals._hInstance;
01299         PROPSHEETPAGE::pszTemplate      = MAKEINTRESOURCE(nid);
01300         PROPSHEETPAGE::pfnDlgProc       = PropSheetPageDlg::DialogProc;
01301         PROPSHEETPAGE::lParam           = (LPARAM) this;
01302 }

Here is the call graph for this function:

Member Function Documentation

void PropSheetPage::init ( struct PropertySheetDialog * )

Friends And Related Function Documentation

friend struct PropSheetPageDlg [friend]

Definition at line 400 of file window.h.

Member Data Documentation

Window::CREATORFUNC PropSheetPage::_dlg_creator [protected]

Definition at line 402 of file window.h.

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

PropSheetPage Member List

This is the complete list of members for PropSheetPage, including all inherited members.

_dlg_creator | PropSheetPage | [protected]
init(struct PropertySheetDialog *) | PropSheetPage |
PropSheetPage(UINT nid, Window::CREATORFUNC dlg_creator) | PropSheetPage |
PropSheetPageDlg | PropSheetPage | [friend]


ROS Explorer: PropSheetPageDlg Struct Reference

PropSheetPageDlg Struct Reference

Property Sheet Page (inner dialog). More...

#include <window.h>

Inheritance diagram for PropSheetPageDlg:

[legend]
Collaboration diagram for PropSheetPageDlg:

[legend]
List of all members.

Public Types

typedef Dialog | super

Public Member Functions

PropSheetPageDlg (HWND)

Protected Member Functions

int | Command (int id, int code)

Static Protected Member Functions

static INT_PTR CALLBACK | DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)

Friends

struct | PropertySheetDialog
struct | PropSheetPage

Detailed Description

Property Sheet Page (inner dialog).

Definition at line 424 of file window.h.

Member Typedef Documentation

typedef Dialog PropSheetPageDlg::super

Reimplemented from Dialog.

Reimplemented in DesktopSettingsDlg, TaskbarSettingsDlg, StartmenuSettingsDlg, and OwnerDrawParent< PropSheetPageDlg >.

Definition at line 426 of file window.h.

Constructor & Destructor Documentation

PropSheetPageDlg::PropSheetPageDlg ( HWND )

Definition at line 1393 of file window.cpp.

01394  :      super(hwnd)
01395 {
01396 }

Member Function Documentation

int PropSheetPageDlg::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Dialog.

Reimplemented in DesktopSettingsDlg, TaskbarSettingsDlg, and StartmenuSettingsDlg.

Definition at line 1438 of file window.cpp.

Referenced by DialogProc().

01439 {
01440         // override call to EndDialog in Dialog::Command();
01441
01442         return FALSE;
01443 }

INT_PTR CALLBACK PropSheetPageDlg::DialogProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static, protected]

Reimplemented from Window.

Definition at line 1398 of file window.cpp.

References Command(), GET_WINDOW, NFR_CURRENT, Window::Notify(), and Dialog::WndProc().

Referenced by PropSheetPage::PropSheetPage().

01399 {
01400         PropSheetPageDlg* pThis = GET_WINDOW(PropSheetPageDlg, hwnd);
01401
01402         if (pThis) {
01403                 switch(nmsg) {
01404                   case WM_COMMAND:
01405                         pThis->Command(LOWORD(wparam), HIWORD(wparam));
01406                         return TRUE;    // message has been processed
01407
01408                   case WM_NOTIFY:
01409                         pThis->Notify(wparam, (NMHDR*)lparam);
01410                         return TRUE;    // message has been processed
01411
01412                   case WM_NOTIFYFORMAT:
01413                         SetWindowLong(hwnd, DWLP_MSGRESULT, NFR_CURRENT);       // set return value NFR_CURRENT
01414                         return TRUE;    // message has been processed
01415
01416                   case WM_NCDESTROY:
01417                         delete pThis;
01418                         return TRUE;    // message has been processed
01419
01420                   default:
01421                         return pThis->WndProc(nmsg, wparam, lparam);
01422                 }
01423         } else if (nmsg == WM_INITDIALOG) {
01424                 PROPSHEETPAGE* psp = (PROPSHEETPAGE*) lparam;
01425                 PropSheetPage* ppsp = (PropSheetPage*) psp->lParam;
01426
01427                 if (ppsp->_dlg_creator) {
01428                         pThis = static_cast<PropSheetPageDlg*>(ppsp->_dlg_creator(hwnd));
01429
01430                         if (pThis)
01431                                 return pThis->Init(NULL);
01432                 }
01433         }
01434
01435         return FALSE;   // message has not been processed
01436 }

Here is the call graph for this function:

Friends And Related Function Documentation

friend struct PropertySheetDialog [friend]

Definition at line 431 of file window.h.

friend struct PropSheetPage [friend]

Definition at line 432 of file window.h.

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

PropSheetPageDlg Member List

This is the complete list of members for PropSheetPageDlg, including all inherited members.

_hwnd | WindowHandle | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | PropSheetPageDlg | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
Dialog(HWND) | Dialog |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | PropSheetPageDlg | [protected, static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0) | Dialog | [static]
DoModal(UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0) | Dialog | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropertySheetDialog | PropSheetPageDlg | [friend]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
PropSheetPage | PropSheetPageDlg | [friend]
PropSheetPageDlg(HWND) | PropSheetPageDlg |
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | PropSheetPageDlg |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | Dialog | [protected, virtual]
~Dialog() | Dialog |
~Window() | Window | [virtual]


ROS Explorer: QuickLaunchBar Struct Reference

QuickLaunchBar Struct Reference

quick launch bar window More...

#include <quicklaunch.h>

Inheritance diagram for QuickLaunchBar:

[legend]
Collaboration diagram for QuickLaunchBar:

[legend]
List of all members.

Public Types

typedef ExtContextMenuHandlerT<
SubclassedWindow > 		super

Public Member Functions

QuickLaunchBar (HWND hwnd)
~QuickLaunchBar ()

Static Public Member Functions

static HWND | Create (HWND hwndParent)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Command (int id, int code)
int | Notify (int id, NMHDR *pnmh)
void | AddShortcuts ()
void | AddButton (int id, HBITMAP hbmp, LPCTSTR name, Entry *entry, int flags=TBSTATE_ENABLED)
void | UpdateDesktopButtons (int desktop_idx)

Protected Attributes

ShellDirectory * _dir
int | _next_id
QuickLaunchMap _entries
int | _btn_dist
int | _size

Detailed Description

quick launch bar window

Definition at line 60 of file quicklaunch.h.

Member Typedef Documentation

typedef ExtContextMenuHandlerT<SubclassedWindow> QuickLaunchBar::super

Reimplemented from ExtContextMenuHandlerT< SubclassedWindow >.

Definition at line 62 of file quicklaunch.h.

Constructor & Destructor Documentation

QuickLaunchBar::QuickLaunchBar ( HWND hwnd )

Definition at line 51 of file quicklaunch.cpp.

References _btn_dist, _dir, _next_id, _size, CONTEXT, HWND, IDC_FIRST_QUICK_ID, PM_REFRESH, and SetWindowStyle.

Referenced by Create().

00052  :      super(hwnd)
00053 {
00054         CONTEXT("QuickLaunchBar::QuickLaunchBar()");
00055
00056         _dir = NULL;
00057         _next_id = IDC_FIRST_QUICK_ID;
00058         _btn_dist = 20;
00059         _size = 0;
00060
00061         HWND hwndToolTip = (HWND) SendMessage(hwnd, TB_GETTOOLTIPS, 0, 0);
00062
00063         SetWindowStyle(hwndToolTip, GetWindowStyle(hwndToolTip)|TTS_ALWAYSTIP);
00064
00065          // delay refresh to some time later
00066         PostMessage(hwnd, PM_REFRESH, 0, 0);
00067 }

QuickLaunchBar::~QuickLaunchBar ( )

Definition at line 69 of file quicklaunch.cpp.

References _dir.

00070 {
00071         delete _dir;
00072 }

Member Function Documentation

void QuickLaunchBar::AddButton | ( | int | id,
 |  | HBITMAP | hbmp,
 |  | LPCTSTR | name,
 |  | Entry * | entry,
 |  | int | flags = TBSTATE_ENABLED
 | ) | [protected]

Definition at line 177 of file quicklaunch.cpp.

References _entries, QuickLaunchEntry::_entry, QuickLaunchEntry::_hbmp, WindowHandle::_hwnd, and QuickLaunchEntry::_title.

Referenced by AddShortcuts().

00178 {
00179         TBADDBITMAP ab = {0, (UINT_PTR)hbmp};
00180         int bmp_idx = SendMessage(_hwnd, TB_ADDBITMAP, 1, (LPARAM)&ab);
00181
00182         QuickLaunchEntry qle;
00183
00184         qle._hbmp = hbmp;
00185         qle._title = name;
00186         qle._entry = entry;
00187
00188         _entries[id] = qle;
00189
00190         TBBUTTON btn = {0, 0, flags, BTNS_BUTTON|BTNS_NOPREFIX, {0, 0}, 0, 0};
00191
00192         btn.idCommand = id;
00193         btn.iBitmap = bmp_idx;
00194
00195         SendMessage(_hwnd, TB_INSERTBUTTON, INT_MAX, (LPARAM)&btn);
00196 }

void QuickLaunchBar::AddShortcuts ( ) [protected]

Todo:
perhaps also look into CSIDL_COMMON_APPDATA ?

Definition at line 92 of file quicklaunch.cpp.

References Desktops::_current_desktop, ExplorerGlobals::_desktops, _dir, Entry::_down, WindowHandle::_hwnd, ExplorerGlobals::_icon_cache, Entry::_icon_id, Entry::_next, _stprintf, AddButton(), CONTEXT, Icon::create_bitmap(), DESKTOP_COUNT, g_Globals, IconCache::get_icon(), GetDesktopFolder(), ICF_NORMAL, ICID_EXPLORER, ICID_LOGOFF, ID_EXPLORE, ID_MINIMIZE_ALL, ID_SWITCH_DESKTOP_1, IDS_DESKTOP_NUM, IDS_MINIMIZE_ALL, IDS_TITLE, QUICKLAUNCH_FOLDER, RecursiveCreateDirectory(), Entry::safe_extract_icon(), SCAN_FILESYSTEM, Entry::smart_scan(), and SORT_NAME.

Referenced by WndProc().

00093 {
00094         CONTEXT("QuickLaunchBar::AddShortcuts()");
00095
00096         WaitCursor wait;
00097
00098         try {
00099                 TCHAR path[MAX_PATH];
00100
00101                 SpecialFolderFSPath app_data(CSIDL_APPDATA, _hwnd);
00102
00103                 _stprintf(path, TEXT("%s\\")QUICKLAUNCH_FOLDER, (LPCTSTR)app_data);
00104
00105                 RecursiveCreateDirectory(path);
00106                 _dir = new ShellDirectory(GetDesktopFolder(), path, _hwnd);
00107
00108                 _dir->smart_scan(SORT_NAME, /*SCAN_EXTRACT_ICONS|*/SCAN_FILESYSTEM);
00109
00110                  // immediatelly extract the shortcut icons
00111                 for(Entry*entry=_dir->_down; entry; entry=entry->_next)
00112                         entry->_icon_id = entry->safe_extract_icon(ICF_NORMAL);
00113         } catch(COMException&) {
00114                 return;
00115         }
00116
00117
00118         ShellFolder desktop_folder;
00119         WindowCanvas canvas(_hwnd);
00120
00121         COLORREF bk_color = GetSysColor(COLOR_BTNFACE);
00122         HBRUSH bk_brush = GetSysColorBrush(COLOR_BTNFACE);
00123
00124         AddButton(ID_MINIMIZE_ALL, g_Globals._icon_cache.get_icon(ICID_LOGOFF/*@@*/).create_bitmap(bk_color, bk_brush, canvas), ResString(IDS_MINIMIZE_ALL), NULL);
00125         AddButton(ID_EXPLORE, g_Globals._icon_cache.get_icon(ICID_EXPLORER).create_bitmap(bk_color, bk_brush, canvas), ResString(IDS_TITLE), NULL);
00126
00127         TBBUTTON sep = {0, -1, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
00128         SendMessage(_hwnd, TB_INSERTBUTTON, INT_MAX, (LPARAM)&sep);
00129
00130         int cur_desktop = g_Globals._desktops._current_desktop;
00131         ResString desktop_fmt(IDS_DESKTOP_NUM);
00132
00133         HDC hdc = CreateCompatibleDC(canvas);
00134         DWORD size = SendMessage(_hwnd, TB_GETBUTTONSIZE, 0, 0);
00135         int cx = LOWORD(size);
00136         int cy = HIWORD(size);
00137         RECT rect = {0, 0, cx, cy};
00138         RECT textRect = {0, 0, cx-7, cy-7};
00139
00140         for(int i=0; i<DESKTOP_COUNT; ++i) {
00141                 HBITMAP hbmp = CreateCompatibleBitmap(canvas, cx, cy);
00142                 HBITMAP hbmp_old = SelectBitmap(hdc, hbmp);
00143
00144                 FmtString num_txt(TEXT("%d"), i+1);
00145                 TextColor color(hdc, RGB(64,64,64));
00146                 BkMode mode(hdc, TRANSPARENT);
00147                 FillRect(hdc, &rect, GetSysColorBrush(COLOR_BTNFACE));
00148                 DrawText(hdc, num_txt, num_txt.length(), &textRect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
00149
00150                 SelectBitmap(hdc, hbmp_old);
00151
00152                 AddButton(ID_SWITCH_DESKTOP_1+i, hbmp, FmtString(desktop_fmt, i+1), NULL, cur_desktop==i?TBSTATE_ENABLED|TBSTATE_CHECKED:TBSTATE_ENABLED);
00153         }
00154         DeleteDC(hdc);
00155
00156         SendMessage(_hwnd, TB_INSERTBUTTON, INT_MAX, (LPARAM)&sep);
00157
00158         for(Entry*entry=_dir->_down; entry; entry=entry->_next) {
00159                  // hide files like "desktop.ini"
00160                 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
00161                         continue;
00162
00163                          // hide subfolders
00164                         if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
00165                                 HBITMAP hbmp = g_Globals._icon_cache.get_icon(entry->_icon_id).create_bitmap(bk_color, bk_brush, canvas);
00166
00167                                 AddButton(_next_id++, hbmp, entry->_display_name, entry);       //entry->_etype==ET_SHELL? desktop_folder.get_name(static_cast<ShellEntry*>(entry)->_pidl): entry->_display_name);
00168                         }
00169         }
00170
00171         _btn_dist = LOWORD(SendMessage(_hwnd, TB_GETBUTTONSIZE, 0, 0));
00172         _size = _entries.size() * _btn_dist;
00173
00174         SendMessage(GetParent(_hwnd), PM_RESIZE_CHILDREN, 0, 0);
00175 }

Here is the call graph for this function:

int QuickLaunchBar::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from SubclassedWindow.

Definition at line 266 of file quicklaunch.cpp.

References _entries, QuickLaunchEntry::_entry, WindowHandle::_hwnd, CONTEXT, IDC_FIRST_QUICK_ID, and Entry::launch_entry().

00267 {
00268         CONTEXT("QuickLaunchBar::Command()");
00269
00270         if ((id&~0xFF) == IDC_FIRST_QUICK_ID) {
00271                 QuickLaunchEntry& qle = _entries[id];
00272
00273                 if (qle._entry) {
00274                         qle._entry->launch_entry(_hwnd);
00275                         return 0;
00276                 }
00277         }
00278
00279         return 0; // Don't return 1 to avoid recursion with DesktopBar::Command()
00280 }

Here is the call graph for this function:

HWND QuickLaunchBar::Create ( HWND hwndParent ) [static]

Definition at line 74 of file quicklaunch.cpp.

References CONTEXT, HWND, IDW_QUICKLAUNCHBAR, and QuickLaunchBar().

Referenced by DesktopBar::Init().

00075 {
00076         CONTEXT("QuickLaunchBar::Create()");
00077
00078         ClientRect clnt(hwndParent);
00079
00080         HWND hwnd = CreateToolbarEx(hwndParent,
00081                                                                 WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
00082                                                                 CCS_TOP|CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_NORESIZE|
00083                                                                 TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE|TBSTYLE_FLAT,
00084                                                                 IDW_QUICKLAUNCHBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
00085
00086         if (hwnd)
00087                 new QuickLaunchBar(hwnd);
00088
00089         return hwnd;
00090 }

Here is the call graph for this function:

int QuickLaunchBar::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from SubclassedWindow.

Definition at line 282 of file quicklaunch.cpp.

References _entries.

00283 {
00284         switch(pnmh->code) {
00285           case TTN_GETDISPINFO: {
00286                 NMTTDISPINFO* ttdi = (NMTTDISPINFO*) pnmh;
00287
00288                 int id = ttdi->hdr.idFrom;
00289                 ttdi->lpszText = _entries[id]._title.str();
00290 #ifdef TTF_DI_SETITEM
00291                 ttdi->uFlags |= TTF_DI_SETITEM;
00292 #endif
00293
00294                  // enable multiline tooltips (break at CR/LF and for very long one-line strings)
00295                 SendMessage(pnmh->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 400);
00296
00297                 break;}
00298
00299                 return super::Notify(id, pnmh);
00300         }
00301
00302         return 0;
00303 }

void QuickLaunchBar::UpdateDesktopButtons ( int desktop_idx ) [protected]

Definition at line 198 of file quicklaunch.cpp.

References DESKTOP_COUNT.

00199 {
00200         for(int i=0; i<DESKTOP_COUNT; ++i) {
00201                 TBBUTTONINFO tbi = {sizeof(TBBUTTONINFO), TBIF_STATE, 0, 0, desktop_idx==i? TBSTATE_ENABLED|TBSTATE_CHECKED: TBSTATE_ENABLED};
00202
00203                 SendMessage(_hwnd, TB_SETBUTTONINFO, ID_SWITCH_DESKTOP_1+i, (LPARAM)&tbi);
00204         }
00205 }

LRESULT QuickLaunchBar::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from ExtContextMenuHandlerT< SubclassedWindow >.

Definition at line 207 of file quicklaunch.cpp.

References _entries, WindowHandle::_hwnd, _size, AddShortcuts(), and PM_GET_WIDTH.

00208 {
00209         switch(nmsg) {
00210           case PM_REFRESH:
00211                 AddShortcuts();
00212                 break;
00213
00214           case PM_GET_WIDTH: {
00215                  // take line wrapping into account
00216                 int btns = SendMessage(_hwnd, TB_BUTTONCOUNT, 0, 0);
00217                 int rows = SendMessage(_hwnd, TB_GETROWS, 0, 0);
00218
00219                 if (rows<2 || rows==btns)
00220                         return _size;
00221
00222                 RECT rect;
00223                 int max_cx = 0;
00224
00225                 for(QuickLaunchMap::const_iterator it=_entries.begin(); it!=_entries.end(); ++it) {
00226                         SendMessage(_hwnd, TB_GETRECT, it->first, (LPARAM)&rect);
00227
00228                         if (rect.right > max_cx)
00229                                 max_cx = rect.right;
00230                 }
00231
00232                 return max_cx;}
00233
00234           case PM_UPDATE_DESKTOP:
00235                 UpdateDesktopButtons(wparam);
00236                 break;
00237
00238           case WM_CONTEXTMENU: {
00239                 TBBUTTON btn;
00240                 QuickLaunchMap::iterator it;
00241                 Point screen_pt(lparam), clnt_pt=screen_pt;
00242                 ScreenToClient(_hwnd, &clnt_pt);
00243
00244                 Entry* entry = NULL;
00245                 int idx = SendMessage(_hwnd, TB_HITTEST, 0, (LPARAM)&clnt_pt);
00246
00247                 if (idx>=0 &&
00248                         SendMessage(_hwnd, TB_GETBUTTON, idx, (LPARAM)&btn)!=-1 &&
00249                         (it=_entries.find(btn.idCommand))!=_entries.end()) {
00250                         entry = it->second._entry;
00251                 }
00252
00253                 if (entry)      // entry is NULL for desktop switch buttons
00254                         CHECKERROR(entry->do_context_menu(_hwnd, screen_pt, _cm_ifs));
00255                 else
00256                         goto def;
00257                 break;}
00258
00259           default: def:
00260                 return super::WndProc(nmsg, wparam, lparam);
00261         }
00262
00263         return 0;
00264 }

Here is the call graph for this function:

Member Data Documentation

int QuickLaunchBar::_btn_dist [protected]

Definition at line 78 of file quicklaunch.h.

Referenced by QuickLaunchBar().

ShellDirectory* QuickLaunchBar::_dir [protected]

Definition at line 74 of file quicklaunch.h.

Referenced by AddShortcuts(), QuickLaunchBar(), and ~QuickLaunchBar().

QuickLaunchMap QuickLaunchBar::_entries [protected]

Definition at line 77 of file quicklaunch.h.

Referenced by AddButton(), Command(), Notify(), and WndProc().

int QuickLaunchBar::_next_id [protected]

Definition at line 76 of file quicklaunch.h.

Referenced by QuickLaunchBar().

int QuickLaunchBar::_size [protected]

Definition at line 79 of file quicklaunch.h.

Referenced by QuickLaunchBar(), and WndProc().

The documentation for this struct was generated from the following files:
  • quicklaunch.h
  • quicklaunch.cpp


ROS Explorer: Member List

QuickLaunchBar Member List

This is the complete list of members for QuickLaunchBar, including all inherited members.

_btn_dist | QuickLaunchBar | [protected]
_cm_ifs | ExtContextMenuHandlerT< SubclassedWindow > | [protected]
_dir | QuickLaunchBar | [protected]
_entries | QuickLaunchBar | [protected]
_hwnd | WindowHandle | [protected]
_next_id | QuickLaunchBar | [protected]
_orgWndProc | SubclassedWindow | [protected]
_size | QuickLaunchBar | [protected]
AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry *entry, int flags=TBSTATE_ENABLED) | QuickLaunchBar | [protected]
AddShortcuts() | QuickLaunchBar | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | QuickLaunchBar | [protected, virtual]
Create(HWND hwndParent) | QuickLaunchBar | [static]
ExtContextMenuHandlerT< SubclassedWindow >::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
ExtContextMenuHandlerT< SubclassedWindow >::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< SubclassedWindow > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< SubclassedWindow > | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | QuickLaunchBar | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
QuickLaunchBar(HWND hwnd) | QuickLaunchBar |
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | QuickLaunchBar |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
UpdateDesktopButtons(int desktop_idx) | QuickLaunchBar | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | QuickLaunchBar | [protected, virtual]
~QuickLaunchBar() | QuickLaunchBar |
~Window() | Window | [virtual]


ROS Explorer: QuickLaunchEntry Struct Reference

QuickLaunchEntry Struct Reference

quick launch bar shortcut More...

#include <quicklaunch.h>

Collaboration diagram for QuickLaunchEntry:

[legend]
List of all members.

Public Member Functions

QuickLaunchEntry ()

Public Attributes

HBITMAP _hbmp
String _title
Entry * _entry

Detailed Description

quick launch bar shortcut

Definition at line 43 of file quicklaunch.h.

Constructor & Destructor Documentation

QuickLaunchEntry::QuickLaunchEntry ( )

Definition at line 36 of file quicklaunch.cpp.

References _hbmp.

00037 {
00038         _hbmp = 0;
00039 }

Member Data Documentation

Entry* QuickLaunchEntry::_entry

Definition at line 49 of file quicklaunch.h.

Referenced by QuickLaunchBar::AddButton(), and QuickLaunchBar::Command().

HBITMAP QuickLaunchEntry::_hbmp

Definition at line 47 of file quicklaunch.h.

Referenced by QuickLaunchBar::AddButton(), and QuickLaunchEntry().

String QuickLaunchEntry::_title

Definition at line 48 of file quicklaunch.h.

Referenced by QuickLaunchBar::AddButton().

The documentation for this struct was generated from the following files:
  • quicklaunch.h
  • quicklaunch.cpp


ROS Explorer: Member List

QuickLaunchEntry Member List

This is the complete list of members for QuickLaunchEntry, including all inherited members.

_entry | QuickLaunchEntry
_hbmp | QuickLaunchEntry
_title | QuickLaunchEntry
QuickLaunchEntry() | QuickLaunchEntry


ROS Explorer: QuickLaunchMap Struct Reference

QuickLaunchMap Struct Reference

map for managing the task bar buttons More...

#include <quicklaunch.h>

Inheritance diagram for QuickLaunchMap:

[legend]
Collaboration diagram for QuickLaunchMap:

[legend]
List of all members.

Public Member Functions

~QuickLaunchMap ()

Detailed Description

map for managing the task bar buttons

Definition at line 53 of file quicklaunch.h.

Constructor & Destructor Documentation

QuickLaunchMap::~QuickLaunchMap ( )

Definition at line 41 of file quicklaunch.cpp.

00042 {
00043         while(!empty()) {
00044                 iterator it = begin();
00045                 DeleteBitmap(it->second._hbmp);
00046                 erase(it);
00047         }
00048 }

The documentation for this struct was generated from the following files:
  • quicklaunch.h
  • quicklaunch.cpp


ROS Explorer: Member List

QuickLaunchMap Member List

This is the complete list of members for QuickLaunchMap, including all inherited members.

~QuickLaunchMap() QuickLaunchMap


ROS Explorer: RecentStartMenu Struct Reference

RecentStartMenu Struct Reference

"Recent Files" sub-start menu More...

#include <startmenu.h>

Inheritance diagram for RecentStartMenu:

[legend]
Collaboration diagram for RecentStartMenu:

[legend]
List of all members.

Public Types

typedef StartMenu | super

Public Member Functions

RecentStartMenu (HWND hwnd, const StartMenuCreateInfo &create_info)

Protected Member Functions

virtual void | AddEntries ()

Detailed Description

"Recent Files" sub-start menu

Definition at line 436 of file startmenu.h.

Member Typedef Documentation

typedef StartMenu RecentStartMenu::super

Reimplemented from StartMenu.

Definition at line 438 of file startmenu.h.

Constructor & Destructor Documentation

RecentStartMenu::RecentStartMenu | ( | HWND | hwnd,
 |  | const StartMenuCreateInfo & | create_info
 | ) | [inline]

Definition at line 440 of file startmenu.h.

00441          :      super(hwnd, create_info)
00442         {
00443         }

Member Function Documentation

void RecentStartMenu::AddEntries ( ) [protected, virtual]

Todo:
read max. count of entries from registry

Reimplemented from StartMenu.

Definition at line 2201 of file startmenu.cpp.

References StartMenu::_dirs, StartMenu::AddShellEntries(), RECENT_DOCS_COUNT, SCAN_FILESYSTEM, SORT_DATE, and SORT_NAME.

02202 {
02203         for(StartMenuShellDirs::iterator it=_dirs.begin(); it!=_dirs.end(); ++it) {
02204                 StartMenuDirectory& smd = *it;
02205                 ShellDirectory& dir = smd._dir;
02206
02207                 if (!dir._scanned) {
02208                         WaitCursor wait;
02209
02210 #ifdef _LAZY_ICONEXTRACT
02211                         dir.smart_scan(SORT_NAME, SCAN_FILESYSTEM);
02212 #else
02213                         dir.smart_scan(SORT_NAME, SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM);
02214 #endif
02215                 }
02216
02217                 dir.sort_directory(SORT_DATE);
02218                 AddShellEntries(dir, RECENT_DOCS_COUNT, smd._ignore);
02219         }
02220 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • startmenu.h
  • startmenu.cpp


ROS Explorer: Member List

RecentStartMenu Member List

This is the complete list of members for RecentStartMenu, including all inherited members.

_arrow_btns | StartMenu | [protected]
_border_left | StartMenu | [protected]
_border_top | StartMenu | [protected]
_bottom_max | StartMenu | [protected]
_buttons | StartMenu | [protected]
_cm_ifs | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [protected]
_create_info | StartMenu | [protected]
_dirs | StartMenu | [protected]
_entries | StartMenu | [protected]
_floating_btn | StartMenu | [protected]
_hwnd | WindowHandle | [protected]
_invisible_lines | StartMenu | [protected]
_large_icons | StartMenu | [protected]
_last_mouse_pos | StartMenu | [protected]
_last_pos | StartMenu | [protected]
_next_id | StartMenu | [protected]
_scroll_mode | StartMenu | [protected]
_scroll_pos | StartMenu | [protected]
_selected_id | StartMenu | [protected]
_submenu | StartMenu | [protected]
_submenu_id | StartMenu | [protected]
ActivateEntry(int id, const ShellEntrySet &entries) | StartMenu | [protected]
AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true) | StartMenu | [protected]
AddEntries() | RecentStartMenu | [protected, virtual]
AddEntry(const String &title, ICON_ID icon_id, Entry *entry) | StartMenu | [protected]
AddEntry(const String &title, ICON_ID icon_id=ICID_NONE, int id=-1) | StartMenu | [protected]
AddEntry(const ShellFolder folder, ShellEntry *entry) | StartMenu | [protected]
AddEntry(const ShellFolder folder, Entry *entry) | StartMenu | [protected]
AddSeparator() | StartMenu | [protected]
AddShellEntries(const ShellDirectory &dir, int max=-1, const String &ignore="") | StartMenu | [protected]
ButtonHitTest(POINT pt) | StartMenu | [protected]
CancelModes() | Window | [static]
CloseOtherSubmenus(int id=0) | StartMenu | [protected]
CloseStartMenu(int id=0) | StartMenu | [protected, virtual]
CloseSubmenus() | StartMenu | [inline, protected]
Command(int id, int code) | StartMenu | [protected, virtual]
Create(int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="") | StartMenu | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawArrows(HDC hdc, bool large_icons) | StartMenu | [protected]
DrawFloatingButton(HDC hdc) | StartMenu | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down, bool large_icons) | StartMenu | [protected]
GetButtonInfo(int id) const | StartMenu | [protected]
GetButtonRect(int id, PRECT prect) const | StartMenu | [protected]
GetFloatingButtonRect(LPRECT prect) | StartMenu | [protected]
GetSelectionIndex() | StartMenu | [protected]
GetStaticWindowData() | Window | [protected, static]
GetWndClasss() | StartMenu | [protected, static]
Init(LPCREATESTRUCT pcs) | StartMenu | [protected, virtual]
InvalidateSelection() | StartMenu | [protected]
JumpToNextShortcut(char c) | StartMenu | [protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Navigate(int step) | StartMenu | [protected]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
OpenSubmenu(bool select_first=false) | StartMenu | [protected]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< Window > | [inline]
Paint(PaintCanvas &canvas) | StartMenu | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
ProcessKey(int vk) | StartMenu | [protected, virtual]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
RecentStartMenu(HWND hwnd, const StartMenuCreateInfo &create_info) | RecentStartMenu | [inline]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeButtons(int cx) | StartMenu | [protected]
ResizeToButtons() | StartMenu | [protected]
s_def_creator | StartMenu | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SCROLL_DOWN enum value | StartMenu | [protected]
SCROLL_MODE enum name | StartMenu | [protected]
SCROLL_NOT enum value | StartMenu | [protected]
SCROLL_UP enum value | StartMenu | [protected]
SelectButton(int id, bool open_sub=true) | StartMenu | [protected]
SelectButtonIndex(int idx, bool open_sub=true) | StartMenu | [protected]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
StartMenu(HWND hwnd, bool large_icons=false) | StartMenu |
StartMenu(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenu |
super typedef | RecentStartMenu |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
UpdateIcons() | StartMenu | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | StartMenu | [protected, virtual]
~StartMenu() | StartMenu |
~Window() | Window | [virtual]


ROS Explorer: RegDirectory Struct Reference

RegDirectory Struct Reference

Registry key entry. More...

#include <regfs.h>

Inheritance diagram for RegDirectory:

[legend]
Collaboration diagram for RegDirectory:

[legend]
List of all members.

Public Member Functions

RegDirectory (Entry *parent, LPCTSTR path, HKEY hKeyRoot)
~RegDirectory ()
virtual void | read_directory (int scan_flags=SCAN_ALL)
virtual const void * | get_next_path_component (const void *) const
virtual Entry * | find_entry (const void *)

Protected Attributes

HKEY | _hKeyRoot

Detailed Description

Registry key entry.

Definition at line 43 of file regfs.h.

Constructor & Destructor Documentation

RegDirectory::RegDirectory | ( | Entry * | parent,
 |  | LPCTSTR | path,
 |  | HKEY | hKeyRoot
 | ) |

Definition at line 238 of file regfs.cpp.

References Entry::_data, and Directory::_path.

Referenced by read_directory().

00239  :      RegEntry(parent),
00240         _hKeyRoot(hKeyRoot)
00241 {
00242         _path = _tcsdup(path);
00243
00244         memset(&_data, 0, sizeof(WIN32_FIND_DATA));
00245         _data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00246 }

RegDirectory::~RegDirectory ( ) [inline]

Definition at line 47 of file regfs.h.

References Directory::_path.

00048         {
00049                 free(_path);
00050                 _path = NULL;
00051         }

Member Function Documentation

Entry * RegDirectory::find_entry ( const void * ) [virtual]

Reimplemented from Entry.

Definition at line 200 of file regfs.cpp.

References Entry::_data, Entry::_down, and Entry::_next.

00201 {
00202         LPCTSTR name = (LPCTSTR)p;
00203
00204         for(Entry*entry=_down; entry; entry=entry->_next) {
00205                 LPCTSTR p = name;
00206                 LPCTSTR q = entry->_data.cFileName;
00207
00208                 do {
00209                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00210                                 return entry;
00211                 } while(tolower(*p++) == tolower(*q++));
00212
00213                 p = name;
00214                 q = entry->_data.cAlternateFileName;
00215
00216                 do {
00217                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00218                                 return entry;
00219                 } while(tolower(*p++) == tolower(*q++));
00220         }
00221
00222         return NULL;
00223 }

const void * RegDirectory::get_next_path_component ( const void * ) const [virtual]

Reimplemented from Entry.

Definition at line 183 of file regfs.cpp.

00184 {
00185         LPCTSTR s = (LPCTSTR) p;
00186
00187         while(*s && *s!=TEXT('\\'))
00188                 ++s;
00189
00190         while(*s==TEXT('\\'))
00191                 ++s;
00192
00193         if (!*s)
00194                 return NULL;
00195
00196         return s;
00197 }

void RegDirectory::read_directory ( int scan_flags = SCAN_ALL ) [virtual]

Todo:
This can also be done in the RegEnumValue() call if we dynamically adjust the return buffer size.

Reimplemented from Entry.

Definition at line 34 of file regfs.cpp.

References Entry::_data, _hKeyRoot, Entry::_level, Entry::_next, Directory::_path, _tcscpy_s, Entry::_type_name, CONTEXT, RegDirectory(), and RegEntry::RegEntry().

00035 {
00036         CONTEXT("RegDirectory::read_directory()");
00037
00038         Entry* first_entry = NULL;
00039         int level = _level + 1;
00040
00041         TCHAR buffer[MAX_PATH];
00042
00043         _tcscpy(buffer, (LPCTSTR)_path);
00044         LPTSTR pname = buffer + _tcslen(buffer);
00045         int plen = MAX_PATH - _tcslen(buffer);
00046
00047         HKEY hkey;
00048
00049         if (!RegOpenKeyEx(_hKeyRoot, *buffer=='\\'?buffer+1:buffer, 0, STANDARD_RIGHTS_READ|KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS, &hkey)) {
00050                 if (pname[-1] != '\\')
00051                         *pname++ = '\\', plen--;
00052
00053                 TCHAR name[MAX_PATH], class_name[MAX_PATH];
00054                 WIN32_FIND_DATA w32fd;
00055                 Entry* last = NULL;
00056                 RegEntry* entry;
00057
00058                 for(int idx=0; ; ++idx) {
00059                         memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00060
00061                         DWORD name_len = MAX_PATH;
00062                         DWORD class_len = MAX_PATH;
00063
00064                         if (RegEnumKeyEx(hkey, idx, name, &name_len, 0, class_name, &class_len, &w32fd.ftLastWriteTime))
00065                                 break;
00066
00067                         w32fd.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00068                         _tcsncpy(w32fd.cFileName, name, name_len);
00069
00070                         _tcscpy_s(pname, plen, name);
00071                         entry = new RegDirectory(this, buffer, _hKeyRoot);
00072
00073                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00074
00075                         if (class_len)
00076                                 entry->_type_name = _tcsdup(String(class_name, class_len));
00077
00078                         if (!first_entry)
00079                                 first_entry = entry;
00080
00081                         if (last)
00082                                 last->_next = entry;
00083
00084                         entry->_level = level;
00085
00086                         last = entry;
00087                 }
00088 /*
00089                 TCHAR value[MAX_PATH];
00090                 LONG value_len = sizeof(value);
00091
00092                 if (!RegQueryValue(hkey, NULL, value, &value_len) && value_len>1) {
00093                         memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00094
00095                         lstrcpy(w32fd.cFileName, TEXT("(Default)"));
00096
00097                         entry = new RegEntry(this);
00098
00099                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00100
00101                         entry->_content = _tcsdup(value);
00102
00103                         if (!first_entry)
00104                                 first_entry = entry;
00105
00106                         if (last)
00107                                 last->_next = entry;
00108
00109                         entry->_level = level;
00110
00111                         last = entry;
00112                 }
00113 */
00114                 DWORD type;
00115                 for(int idx=0; ; ++idx) {
00116                         DWORD name_len = MAX_PATH;
00117
00118                         if (RegEnumValue(hkey, idx, name, &name_len, 0, &type, NULL, NULL))
00119                                 break;
00120
00121                         memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00122
00123                         if (name[0])
00124                                 lstrcpy(w32fd.cFileName, name);
00125                         else
00126                                 lstrcpy(w32fd.cFileName, TEXT("(Default)"));
00127
00128                         entry = new RegEntry(this);
00129
00130                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00131
00132                         switch(type) {
00133                           case REG_NONE:                                                entry->_type_name = _tcsdup(TEXT("REG_NONE"));                                          break;
00134                           case REG_SZ:                                                  entry->_type_name = _tcsdup(TEXT("REG_SZ"));                                            break;
00135                           case REG_EXPAND_SZ:                                   entry->_type_name = _tcsdup(TEXT("REG_EXPAND_SZ"));                                     break;
00136                           case REG_BINARY:                                              entry->_type_name = _tcsdup(TEXT("REG_BINARY"));                                        break;
00137                           case REG_DWORD:                                               entry->_type_name = _tcsdup(TEXT("REG_DWORD"));                                         break;
00138                           case REG_DWORD_BIG_ENDIAN:                    entry->_type_name = _tcsdup(TEXT("REG_DWORD_BIG_ENDIAN"));                      break;
00139                           case REG_LINK:                                                entry->_type_name = _tcsdup(TEXT("REG_LINK"));                                          break;
00140                           case REG_MULTI_SZ:                                    entry->_type_name = _tcsdup(TEXT("REG_MULTI_SZ"));                                      break;
00141                           case REG_RESOURCE_LIST:                               entry->_type_name = _tcsdup(TEXT("REG_RESOURCE_LIST"));                         break;
00142                           case REG_FULL_RESOURCE_DESCRIPTOR:    entry->_type_name = _tcsdup(TEXT("REG_FULL_RESOURCE_DESCRIPTOR"));      break;
00143                           case REG_RESOURCE_REQUIREMENTS_LIST:  entry->_type_name = _tcsdup(TEXT("REG_RESOURCE_REQUIREMENTS_LIST"));break;
00144                           case REG_QWORD:                                               entry->_type_name = _tcsdup(TEXT("REG_QWORD"));                                         break;
00145                         }
00146
00148                         TCHAR value[MAX_PATH];
00149                         DWORD value_len = sizeof(value);
00150
00151                         if (!RegQueryValueEx(hkey, name, NULL, NULL, (LPBYTE)value, &value_len)) {
00152                                 if (type==REG_SZ || type==REG_EXPAND_SZ || type==REG_LINK)
00153                                         entry->_content = _tcsdup(value);
00154                                 else if (type == REG_DWORD) {
00155                                         TCHAR b[32];
00156                                         _stprintf(b, TEXT("%ld"), *(DWORD*)&value);
00157                                         entry->_content = _tcsdup(b);
00158                                 }
00159                         }
00160
00161                         if (!first_entry)
00162                                 first_entry = entry;
00163
00164                         if (last)
00165                                 last->_next = entry;
00166
00167                         entry->_level = level;
00168
00169                         last = entry;
00170                 }
00171
00172                 if (last)
00173                         last->_next = NULL;
00174
00175                 RegCloseKey(hkey);
00176         }
00177
00178         _down = first_entry;
00179         _scanned = true;
00180 }

Here is the call graph for this function:

Member Data Documentation

HKEY RegDirectory::_hKeyRoot [protected]

Definition at line 58 of file regfs.h.

Referenced by read_directory().

The documentation for this struct was generated from the following files:
  • regfs.h
  • regfs.cpp


ROS Explorer: Member List

RegDirectory Member List

This is the complete list of members for RegDirectory, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_hKeyRoot | RegDirectory | [protected]
_icon_id | Entry |
_level | Entry |
_next | Entry |
_path | Directory | [protected]
_scanned | Entry |
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | Entry | [inline, virtual]
Directory() | Directory | [inline, protected]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
find_entry(const void *) | RegDirectory | [virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | RegDirectory | [virtual]
get_path(PTSTR path, size_t path_count) const | RegEntry | [protected, virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow) | RegEntry | [protected, virtual]
read_directory(int scan_flags=SCAN_ALL) | RegDirectory | [virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
RegDirectory(Entry *parent, LPCTSTR path, HKEY hKeyRoot) | RegDirectory |
RegEntry(Entry *parent) | RegEntry | [inline]
RegEntry() | RegEntry | [inline, protected]
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Directory() | Directory | [inline, protected, virtual]
~Entry() | Entry | [virtual]
~RegDirectory() | RegDirectory | [inline]


ROS Explorer: RegEntry Struct Reference

RegEntry Struct Reference

Registry entry. More...

#include <regfs.h>

Inheritance diagram for RegEntry:

[legend]
Collaboration diagram for RegEntry:

[legend]
List of all members.

Public Member Functions

RegEntry (Entry *parent)

Protected Member Functions

RegEntry ()
virtual bool | get_path (PTSTR path, size_t path_count) const
virtual BOOL | launch_entry (HWND hwnd, UINT nCmdShow)

Detailed Description

Registry entry.

Definition at line 30 of file regfs.h.

Constructor & Destructor Documentation

RegEntry::RegEntry ( Entry * parent ) [inline]

Definition at line 32 of file regfs.h.

00032 : Entry(parent, ET_REGISTRY) {}

RegEntry::RegEntry ( ) [inline, protected]

Definition at line 35 of file regfs.h.

Referenced by RegDirectory::read_directory().

00035 : Entry(ET_REGISTRY) {}

Member Function Documentation

bool RegEntry::get_path | ( | PTSTR | path,
 |  | size_t | path_count
 | ) | const [protected, virtual]

Implements Entry.

Definition at line 227 of file regfs.cpp.

References ET_REGISTRY, and Entry::get_path_base().

00228 {
00229         return get_path_base ( path, path_count, ET_REGISTRY );
00230 }

Here is the call graph for this function:

BOOL RegEntry::launch_entry | ( | HWND | hwnd,
 |  | UINT | nCmdShow
 | ) | [protected, virtual]

Reimplemented from Entry.

Definition at line 232 of file regfs.cpp.

00233 {
00234         return FALSE;
00235 }

The documentation for this struct was generated from the following files:
  • regfs.h
  • regfs.cpp


ROS Explorer: Member List

RegEntry Member List

This is the complete list of members for RegEntry, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_scanned | Entry |
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | Entry | [inline, virtual]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
find_entry(const void *) | Entry | [inline, virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | Entry | [inline, virtual]
get_path(PTSTR path, size_t path_count) const | RegEntry | [protected, virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow) | RegEntry | [protected, virtual]
read_directory(int scan_flags=SCAN_ALL) | Entry | [inline, virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
RegEntry(Entry *parent) | RegEntry | [inline]
RegEntry() | RegEntry | [inline, protected]
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Entry() | Entry | [virtual]


ROS Explorer: RegistryChildWndInfo Struct Reference

RegistryChildWndInfo Struct Reference

information structure for creation of FileChildWindow for the Registry More...

#include <filechild.h>

Inheritance diagram for RegistryChildWndInfo:

[legend]
Collaboration diagram for RegistryChildWndInfo:

[legend]
List of all members.

Public Types

typedef FileChildWndInfo super

Public Member Functions

RegistryChildWndInfo (HWND hmdiclient, LPCTSTR path)

Detailed Description

information structure for creation of FileChildWindow for the Registry

Definition at line 63 of file filechild.h.

Member Typedef Documentation

typedef FileChildWndInfo RegistryChildWndInfo::super

Reimplemented from FileChildWndInfo.

Definition at line 65 of file filechild.h.

Constructor & Destructor Documentation

RegistryChildWndInfo::RegistryChildWndInfo | ( | HWND | hmdiclient,
 |  | LPCTSTR | path
 | ) |

Definition at line 78 of file filechild.cpp.

00079  :      FileChildWndInfo(hmdiclient, path, ET_REGISTRY)
00080 {
00081 }

The documentation for this struct was generated from the following files:
  • filechild.h
  • filechild.cpp


ROS Explorer: Member List

RegistryChildWndInfo Member List

This is the complete list of members for RegistryChildWndInfo, including all inherited members.

_etype | FileChildWndInfo |
_hmdiclient | ChildWndInfo |
_open_mode | FileChildWndInfo |
_path | FileChildWndInfo |
_pos | FileChildWndInfo |
ChildWndInfo(HWND hmdiclient) | ChildWndInfo | [inline]
FileChildWndInfo(HWND hmdiclient, LPCTSTR path, ENTRY_TYPE etype=ET_UNKNOWN) | FileChildWndInfo |
RegistryChildWndInfo(HWND hmdiclient, LPCTSTR path) | RegistryChildWndInfo |
super typedef | RegistryChildWndInfo |


ROS Explorer: RegistryRoot Struct Reference

RegistryRoot Struct Reference

Registry key entry. More...

#include <regfs.h>

Inheritance diagram for RegistryRoot:

[legend]
Collaboration diagram for RegistryRoot:

[legend]
List of all members.

Public Member Functions

RegistryRoot ()
RegistryRoot (Entry *parent, LPCTSTR path)
~RegistryRoot ()
virtual void read_directory (int scan_flags=SCAN_ALL)

Detailed Description

Registry key entry.

Definition at line 63 of file regfs.h.

Constructor & Destructor Documentation

RegistryRoot::RegistryRoot ( ) [inline]

Definition at line 65 of file regfs.h.

00066         {
00067         }

RegistryRoot::RegistryRoot | ( | Entry * | parent,
 |  | LPCTSTR | path
 | ) | [inline]

Definition at line 69 of file regfs.h.

References Directory::_path.

00070          :      RegEntry(parent)
00071         {
00072                 _path = _tcsdup(path);
00073         }

RegistryRoot::~RegistryRoot ( ) [inline]

Definition at line 75 of file regfs.h.

References Directory::_path.

00076         {
00077                 free(_path);
00078                 _path = NULL;
00079         }

Member Function Documentation

void RegistryRoot::read_directory ( int scan_flags = SCAN_ALL ) [virtual]

Reimplemented from Entry.

Definition at line 249 of file regfs.cpp.

References Entry::_data, Entry::_down, Entry::_level, Entry::_next, and Entry::_scanned.

00250 {
00251         Entry *entry, *last, *first_entry;
00252         int level = _level + 1;
00253
00254         _data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00255
00256         entry = new RegDirectory(this, TEXT("\\"), HKEY_CURRENT_USER);
00257         _tcscpy(entry->_data.cFileName, TEXT("HKEY_CURRENT_USER"));
00258         entry->_level = level;
00259
00260         first_entry = entry;
00261         last = entry;
00262
00263         entry = new RegDirectory(this, TEXT("\\"), HKEY_LOCAL_MACHINE);
00264         _tcscpy(entry->_data.cFileName, TEXT("HKEY_LOCAL_MACHINE"));
00265         entry->_level = level;
00266
00267         last->_next = entry;
00268         last = entry;
00269
00270         entry = new RegDirectory(this, TEXT("\\"), HKEY_CLASSES_ROOT);
00271         _tcscpy(entry->_data.cFileName, TEXT("HKEY_CLASSES_ROOT"));
00272         entry->_level = level;
00273
00274         last->_next = entry;
00275         last = entry;
00276
00277         entry = new RegDirectory(this, TEXT("\\"), HKEY_USERS);
00278         _tcscpy(entry->_data.cFileName, TEXT("HKEY_USERS"));
00279         entry->_level = level;
00280
00281         last->_next = entry;
00282         last = entry;
00283 /*
00284         entry = new RegDirectory(this, TEXT("\\"), HKEY_PERFORMANCE_DATA);
00285         _tcscpy(entry->_data.cFileName, TEXT("HKEY_PERFORMANCE_DATA"));
00286         entry->_level = level;
00287
00288         last->_next = entry;
00289         last = entry;
00290 */
00291         entry = new RegDirectory(this, TEXT("\\"), HKEY_CURRENT_CONFIG);
00292         _tcscpy(entry->_data.cFileName, TEXT("HKEY_CURRENT_CONFIG"));
00293         entry->_level = level;
00294
00295         last->_next = entry;
00296         last = entry;
00297 /*
00298         entry = new RegDirectory(this, TEXT("\\"), HKEY_DYN_DATA);
00299         _tcscpy(entry->_data.cFileName, TEXT("HKEY_DYN_DATA"));
00300         entry->_level = level;
00301
00302         last->_next = entry;
00303         last = entry;
00304 */
00305         last->_next = NULL;
00306
00307         _down = first_entry;
00308         _scanned = true;
00309 }

The documentation for this struct was generated from the following files:
  • regfs.h
  • regfs.cpp


ROS Explorer: Member List

RegistryRoot Member List

This is the complete list of members for RegistryRoot, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_path | Directory | [protected]
_scanned | Entry |
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | Entry | [inline, virtual]
Directory() | Directory | [inline, protected]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
find_entry(const void *) | Entry | [inline, virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | Entry | [inline, virtual]
get_path(PTSTR path, size_t path_count) const | RegEntry | [protected, virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow) | RegEntry | [protected, virtual]
read_directory(int scan_flags=SCAN_ALL) | RegistryRoot | [virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
RegEntry(Entry *parent) | RegEntry | [inline]
RegEntry() | RegEntry | [inline, protected]
RegistryRoot() | RegistryRoot | [inline]
RegistryRoot(Entry *parent, LPCTSTR path) | RegistryRoot | [inline]
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Directory() | Directory | [inline, protected, virtual]
~Entry() | Entry | [virtual]
~RegistryRoot() | RegistryRoot | [inline]


ROS Explorer: ResBitmap Struct Reference

ResBitmap Struct Reference

convenient loading of bitmap resources More...

#include <globals.h>

Collaboration diagram for ResBitmap:

[legend]
List of all members.

Public Member Functions

ResBitmap (UINT nid)
~ResBitmap ()
operator HBITMAP () const

Protected Attributes

HBITMAP _hBmp

Detailed Description

convenient loading of bitmap resources

Definition at line 325 of file globals.h.

Constructor & Destructor Documentation

ResBitmap::ResBitmap ( UINT nid )

Definition at line 595 of file explorer.cpp.

References _hBmp, and ExplorerGlobals::_hInstance.

00596 {
00597         _hBmp = LoadBitmap(g_Globals._hInstance, MAKEINTRESOURCE(nid));
00598 }

ResBitmap::~ResBitmap ( ) [inline]

Definition at line 328 of file globals.h.

References _hBmp.

00328 {DeleteObject(_hBmp);}

Member Function Documentation

ResBitmap::operator HBITMAP ( ) const [inline]

Definition at line 330 of file globals.h.

References _hBmp.

00330 {return _hBmp;}

Member Data Documentation

HBITMAP ResBitmap::_hBmp [protected]

Definition at line 333 of file globals.h.

Referenced by operator HBITMAP(), ResBitmap(), and ~ResBitmap().

The documentation for this struct was generated from the following files:
  • globals.h
  • explorer.cpp


ROS Explorer: Member List

ResBitmap Member List

This is the complete list of members for ResBitmap, including all inherited members.

_hBmp | ResBitmap | [protected]
operator HBITMAP() const | ResBitmap | [inline]
ResBitmap(UINT nid) | ResBitmap |
~ResBitmap() | ResBitmap | [inline]


ROS Explorer: ResIcon Struct Reference

ResIcon Struct Reference

convenient loading of standard (32x32) icon resources More...

#include <globals.h>

Collaboration diagram for ResIcon:

[legend]
List of all members.

Public Member Functions

ResIcon (UINT nid)
operator HICON () const

Protected Attributes

HICON _hicon

Detailed Description

convenient loading of standard (32x32) icon resources

Definition at line 289 of file globals.h.

Constructor & Destructor Documentation

ResIcon::ResIcon ( UINT nid )

Definition at line 569 of file explorer.cpp.

References _hicon, and ExplorerGlobals::_hInstance.

00570 {
00571         _hicon = LoadIcon(g_Globals._hInstance, MAKEINTRESOURCE(nid));
00572 }

Member Function Documentation

ResIcon::operator HICON ( ) const [inline]

Definition at line 293 of file globals.h.

References _hicon.

00293 {return _hicon;}

Member Data Documentation

HICON ResIcon::_hicon [protected]

Definition at line 296 of file globals.h.

Referenced by operator HICON(), and ResIcon().

The documentation for this struct was generated from the following files:
  • globals.h
  • explorer.cpp


ROS Explorer: Member List

ResIcon Member List

This is the complete list of members for ResIcon, including all inherited members.

_hicon | ResIcon | [protected]
operator HICON() const | ResIcon | [inline]
ResIcon(UINT nid) | ResIcon |


ROS Explorer: ResIconEx Struct Reference

ResIconEx Struct Reference

convenient loading of icon resources with specified sizes More...

#include <globals.h>

Collaboration diagram for ResIconEx:

[legend]
List of all members.

Public Member Functions

ResIconEx (UINT nid, int w, int h)
operator HICON () const

Protected Attributes

HICON _hicon

Detailed Description

convenient loading of icon resources with specified sizes

Definition at line 311 of file globals.h.

Constructor & Destructor Documentation

ResIconEx::ResIconEx | ( | UINT | nid,
 |  | int | w,
 |  | int | h
 | ) |

Definition at line 579 of file explorer.cpp.

References _hicon, and ExplorerGlobals::_hInstance.

00580 {
00581         _hicon = (HICON)LoadImage(g_Globals._hInstance, MAKEINTRESOURCE(nid), IMAGE_ICON, w, h, LR_SHARED);
00582 }

Member Function Documentation

ResIconEx::operator HICON ( ) const [inline]

Definition at line 315 of file globals.h.

References _hicon.

00315 {return _hicon;}

Member Data Documentation

HICON ResIconEx::_hicon [protected]

Definition at line 318 of file globals.h.

Referenced by operator HICON(), and ResIconEx().

The documentation for this struct was generated from the following files:
  • globals.h
  • explorer.cpp


ROS Explorer: Member List

ResIconEx Member List

This is the complete list of members for ResIconEx, including all inherited members.

_hicon | ResIconEx | [protected]
operator HICON() const | ResIconEx | [inline]
ResIconEx(UINT nid, int w, int h) | ResIconEx |


ROS Explorer: ResizeController< BASE > Struct Template Reference

ResizeController< BASE > Struct Template Reference

Controller base template class for resizable dialogs. More...

#include <window.h>

Inheritance diagram for ResizeController< BASE >:

[legend]
Collaboration diagram for ResizeController< BASE >:

[legend]
List of all members.

Public Types

typedef BASE | super

Public Member Functions

ResizeController (HWND hwnd)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual void | GetClientSpace (PRECT prect)

Protected Attributes

ResizeManager _resize_mgr

Detailed Description

template<typename BASE>
struct ResizeController< BASE >

Controller base template class for resizable dialogs.

Definition at line 514 of file window.h.

Member Typedef Documentation

template<typename BASE>
typedef BASE ResizeController< BASE >::super

Reimplemented in FindProgramDlg, MdiSdiDlg, and TrayNotifyDlg.

Definition at line 516 of file window.h.

Constructor & Destructor Documentation

template<typename BASE>
ResizeController< BASE >::ResizeController ( HWND hwnd ) [inline]

Definition at line 518 of file window.h.

00519          :      super(hwnd),
00520                 _resize_mgr(hwnd)
00521         {
00522         }

Member Function Documentation

template<typename BASE>
virtual void ResizeController< BASE >::GetClientSpace ( PRECT prect ) [inline, virtual]

Definition at line 545 of file window.h.

00546         {
00547                  if (!IsIconic(this->_hwnd)) {
00548                         GetClientRect(this->_hwnd, prect);
00549                  } else {
00550                         WINDOWPLACEMENT wp;
00551                         GetWindowPlacement(this->_hwnd, &wp);
00552                         prect->left = prect->top = 0;
00553                         prect->right = wp.rcNormalPosition.right-wp.rcNormalPosition.left-
00554                                 2*(GetSystemMetrics(SM_CXSIZEFRAME)+GetSystemMetrics(SM_CXEDGE));
00555                         prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top-
00556                                 2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))-
00557                                 GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE);
00558                 }
00559         }

template<typename BASE>
LRESULT ResizeController< BASE >::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [inline]

Reimplemented in FindProgramDlg, and TrayNotifyDlg.

Definition at line 524 of file window.h.

00525         {
00526                 switch(nmsg) {
00527                   case PM_FRM_CALC_CLIENT:
00528                         GetClientSpace((PRECT)lparam);
00529                         return TRUE;
00530
00531                   case WM_SIZE:
00532                         if (wparam != SIZE_MINIMIZED)
00533                                 _resize_mgr.HandleSize(LOWORD(lparam), HIWORD(lparam));
00534                         goto def;
00535
00536                   case WM_GETMINMAXINFO:
00537                         _resize_mgr.SetMinMaxInfo((LPMINMAXINFO)lparam);
00538                         goto def;
00539
00540                   default: def:
00541                         return super::WndProc(nmsg, wparam, lparam);
00542                 }
00543         }

Member Data Documentation

template<typename BASE>
ResizeManager ResizeController< BASE >::_resize_mgr [protected]

Definition at line 562 of file window.h.

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

ResizeController< BASE > Member List

This is the complete list of members for ResizeController< BASE >, including all inherited members.

_resize_mgr | ResizeController< BASE > | [protected]
GetClientSpace(PRECT prect) | ResizeController< BASE > | [inline, virtual]
ResizeController(HWND hwnd) | ResizeController< BASE > | [inline]
super typedef | ResizeController< BASE > |
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | ResizeController< BASE > | [inline]


ROS Explorer: ResizeEntry Struct Reference

ResizeEntry Struct Reference

structure to assign RESIZE_FLAGS to dialogs control More...

#include <window.h>

Collaboration diagram for ResizeEntry:

[legend]
List of all members.

Public Member Functions

ResizeEntry (UINT id, int flags)
ResizeEntry (HWND hwnd, int flags)

Public Attributes

UINT | _id
int | _flags

Detailed Description

structure to assign RESIZE_FLAGS to dialogs control

Definition at line 470 of file window.h.

Constructor & Destructor Documentation

ResizeEntry::ResizeEntry | ( | UINT | id,
 |  | int | flags
 | ) | [inline]

Definition at line 472 of file window.h.

00473          : _id(id), _flags(flags) {}

ResizeEntry::ResizeEntry | ( | HWND | hwnd,
 |  | int | flags
 | ) | [inline]

Definition at line 475 of file window.h.

00476          : _id(GetDlgCtrlID(hwnd)), _flags(flags) {}

Member Data Documentation

int ResizeEntry::_flags

Definition at line 479 of file window.h.

UINT ResizeEntry::_id

Definition at line 478 of file window.h.

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

ResizeEntry Member List

This is the complete list of members for ResizeEntry, including all inherited members.

_flags | ResizeEntry |
_id | ResizeEntry |
ResizeEntry(UINT id, int flags) | ResizeEntry | [inline]
ResizeEntry(HWND hwnd, int flags) | ResizeEntry | [inline]


ROS Explorer: ResizeManager Struct Reference

ResizeManager Struct Reference

Management of controls in resizable dialogs. More...

#include <window.h>

Inheritance diagram for ResizeManager:

[legend]
Collaboration diagram for ResizeManager:

[legend]
List of all members.

Public Types

typedef std::list< ResizeEntry > | super

Public Member Functions

ResizeManager (HWND hwnd)
void | Add (UINT id, int flags)
void | Add (HWND hwnd, int flags)
void | HandleSize (int cx, int cy)
void | Resize (int dx, int dy)
void | SetMinMaxInfo (LPMINMAXINFO lpmmi)

Public Attributes

SIZE | _min_wnd_size

Protected Attributes

HWND _hwnd
SIZE | _last_size

Detailed Description

Management of controls in resizable dialogs.

Definition at line 484 of file window.h.

Member Typedef Documentation

typedef std::list<ResizeEntry> ResizeManager::super

Definition at line 486 of file window.h.

Constructor & Destructor Documentation

ResizeManager::ResizeManager ( HWND hwnd )

Definition at line 763 of file window.cpp.

References _last_size, and _min_wnd_size.

00764  :      _hwnd(hwnd)
00765 {
00766         ClientRect clnt(hwnd);
00767         _last_size.cx = clnt.right;
00768         _last_size.cy = clnt.bottom;
00769
00770         WindowRect rect(hwnd);
00771         _min_wnd_size.cx = rect.right - rect.left;
00772         _min_wnd_size.cy = rect.bottom - rect.top;
00773 }

Member Function Documentation

void ResizeManager::Add | ( | HWND | hwnd,
 |  | int | flags
 | ) | [inline]

Definition at line 493 of file window.h.

00494                 {push_back(ResizeEntry(hwnd, flags));}

void ResizeManager::Add | ( | UINT | id,
 |  | int | flags
 | ) | [inline]

Definition at line 490 of file window.h.

Referenced by FindProgramDlg::FindProgramDlg(), and TrayNotifyDlg::TrayNotifyDlg().

00491                 {push_back(ResizeEntry(id, flags));}

void ResizeManager::HandleSize | ( | int | cx,
 |  | int | cy
 | ) |

Definition at line 775 of file window.cpp.

References _hwnd, _last_size, HWND, MOVE_BOTTOM, MOVE_LEFT, MOVE_RIGHT, MOVE_TOP, and ScreenToClient().

Referenced by Resize().

00776 {
00777         ClientRect clnt_rect(_hwnd);
00778         SIZE new_size = {cx, cy};
00779
00780         int dx = new_size.cx - _last_size.cx;
00781         int dy = new_size.cy - _last_size.cy;
00782
00783         if (!dx && !dy)
00784                 return;
00785
00786         _last_size = new_size;
00787
00788         HDWP hDWP = BeginDeferWindowPos(size());
00789
00790         for(ResizeManager::const_iterator it=begin(); it!=end(); ++it) {
00791                 const ResizeEntry& e = *it;
00792                 RECT move = {0};
00793
00794                 if (e._flags & MOVE_LEFT)
00795                         move.left += dx;
00796
00797                 if (e._flags & MOVE_RIGHT)
00798                         move.right += dx;
00799
00800                 if (e._flags & MOVE_TOP)
00801                         move.top += dy;
00802
00803                 if (e._flags & MOVE_BOTTOM)
00804                         move.bottom += dy;
00805
00806                 UINT flags = 0;
00807
00808                 if (!move.left && !move.top)
00809                         flags = SWP_NOMOVE;
00810
00811                 if (move.right==move.left && move.bottom==move.top)
00812                         flags |= SWP_NOSIZE;
00813
00814                 if (flags != (SWP_NOMOVE|SWP_NOSIZE)) {
00815                         HWND hwnd = GetDlgItem(_hwnd, e._id);
00816
00817                         if (hwnd) {
00818                                 WindowRect rect(hwnd);
00819                                 ScreenToClient(_hwnd, rect);
00820
00821                                 rect.left       += move.left;
00822                                 rect.right      += move.right;
00823                                 rect.top        += move.top;
00824                                 rect.bottom     += move.bottom;
00825
00826                                 hDWP = DeferWindowPos(hDWP, hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, flags|SWP_NOACTIVATE|SWP_NOZORDER);
00827                         }
00828                 }
00829         }
00830
00831         EndDeferWindowPos(hDWP);
00832 }

Here is the call graph for this function:

void ResizeManager::Resize | ( | int | dx,
 |  | int | dy
 | ) |

Definition at line 834 of file window.cpp.

References _hwnd, _min_wnd_size, HandleSize(), and MoveVisible().

Referenced by FindProgramDlg::FindProgramDlg(), and TrayNotifyDlg::TrayNotifyDlg().

00835 {
00836         ::SetWindowPos(_hwnd, 0, 0, 0, _min_wnd_size.cx+dx, _min_wnd_size.cy+dy, SWP_NOMOVE|SWP_NOACTIVATE);
00837         MoveVisible(_hwnd);
00838
00839         ClientRect clnt_rect(_hwnd);
00840         HandleSize(clnt_rect.right, clnt_rect.bottom);
00841 }

Here is the call graph for this function:

void ResizeManager::SetMinMaxInfo ( LPMINMAXINFO lpmmi ) [inline]

Definition at line 499 of file window.h.

00500         {
00501                 lpmmi->ptMinTrackSize.x = _min_wnd_size.cx;
00502                 lpmmi->ptMinTrackSize.y = _min_wnd_size.cy;
00503         }

Member Data Documentation

HWND ResizeManager::_hwnd [protected]

Definition at line 508 of file window.h.

Referenced by HandleSize(), and Resize().

SIZE ResizeManager::_last_size [protected]

Definition at line 509 of file window.h.

Referenced by HandleSize(), and ResizeManager().

SIZE ResizeManager::_min_wnd_size

Definition at line 505 of file window.h.

Referenced by Resize(), and ResizeManager().

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

ResizeManager Member List

This is the complete list of members for ResizeManager, including all inherited members.

_hwnd | ResizeManager | [protected]
_last_size | ResizeManager | [protected]
_min_wnd_size | ResizeManager |
Add(UINT id, int flags) | ResizeManager | [inline]
Add(HWND hwnd, int flags) | ResizeManager | [inline]
HandleSize(int cx, int cy) | ResizeManager |
Resize(int dx, int dy) | ResizeManager |
ResizeManager(HWND hwnd) | ResizeManager |
SetMinMaxInfo(LPMINMAXINFO lpmmi) | ResizeManager | [inline]
super typedef | ResizeManager |


ROS Explorer: ResString Struct Reference

ResString Struct Reference

convenient loading of string resources More...

#include <globals.h>

Inheritance diagram for ResString:

[legend]
Collaboration diagram for ResString:

[legend]
List of all members.

Public Member Functions

ResString (UINT nid)

Detailed Description

convenient loading of string resources

Definition at line 283 of file globals.h.

Constructor & Destructor Documentation

ResString::ResString ( UINT nid )

Definition at line 559 of file explorer.cpp.

References ExplorerGlobals::_hInstance, and BUFFER_LEN.

00560 {
00561         TCHAR buffer[BUFFER_LEN];
00562
00563         int len = LoadString(g_Globals._hInstance, nid, buffer, sizeof(buffer)/sizeof(TCHAR));
00564
00565         super::assign(buffer, len);
00566 }

The documentation for this struct was generated from the following files:
  • globals.h
  • explorer.cpp


ROS Explorer: Member List

ResString Member List

This is the complete list of members for ResString, including all inherited members.

appendf(LPCTSTR fmt,...) | String | [inline]
assign(LPCWSTR s) | String | [inline]
assign(LPCWSTR s, int l) | String | [inline]
assign(const BStr &s) | String | [inline]
assign(LPCTSTR s) | String | [inline]
assign(LPCTSTR s, int l) | String | [inline]
operator LPCTSTR() const | String | [inline]
operator wstring() const | String | [inline]
operator=(LPCWSTR s) | String | [inline]
operator=(const BStr &s) | String | [inline]
operator=(LPCTSTR s) | String | [inline]
operator=(const super &s) | String | [inline]
printf(LPCTSTR fmt,...) | String | [inline]
ResString(UINT nid) | ResString |
str() | String | [inline]
String() | String | [inline]
String(LPCTSTR s) | String | [inline]
String(LPCTSTR s, int l) | String | [inline]
String(const super &other) | String | [inline]
String(const String &other) | String | [inline]
String(LPCWSTR s) | String | [inline]
String(LPCWSTR s, int l) | String | [inline]
String(const wstring &other) | String | [inline]
String(const BStr &s) | String | [inline]
super typedef | String |
toLower() | String | [inline]
vappendf(LPCTSTR fmt, va_list l) | String | [inline]
vprintf(LPCTSTR fmt, va_list l) | String | [inline]


ROS Explorer: Root Struct Reference

Root Struct Reference

root entry for file system trees More...

#include <entries.h>

Collaboration diagram for Root:

[legend]
List of all members.

Public Member Functions

Root ()
~Root ()
Entry * | read_tree (LPCTSTR path, int scan_flags=SCAN_ALL)
Entry * | read_tree (LPCITEMIDLIST pidl, int scan_flags=SCAN_ALL)

Public Attributes

Entry * _entry
TCHAR | _path [MAX_PATH]
TCHAR | _volname [_MAX_FNAME]
TCHAR | _fs [_MAX_DIR]
DWORD | _drive_type
DWORD | _fs_flags
SORT_ORDER _sort_order

Detailed Description

root entry for file system trees

Definition at line 147 of file entries.h.

Constructor & Destructor Documentation

Root::Root ( )

Definition at line 158 of file entries.cpp.

00159 {
00160         memset(this, 0, sizeof(Root));
00161 }

Root::~Root ( )

Definition at line 163 of file entries.cpp.

References _entry, and Entry::free_subentries().

00164 {
00165         if (_entry)
00166                 _entry->free_subentries();
00167 }

Here is the call graph for this function:

Member Function Documentation

Entry * Root::read_tree | ( | LPCITEMIDLIST | pidl,
 |  | int | scan_flags = SCAN_ALL
 | ) |

Definition at line 749 of file entries.cpp.

References _entry, _sort_order, and Entry::read_tree().

00750 {
00751         return _entry->read_tree(pidl, _sort_order);
00752 }

Here is the call graph for this function:

Entry * Root::read_tree | ( | LPCTSTR | path,
 |  | int | scan_flags = SCAN_ALL
 | ) |

Definition at line 730 of file entries.cpp.

References Entry::read_tree(), and Entry::smart_scan().

Referenced by FileChildWindow::FileChildWindow(), and FileChildWindow::jump_to_int().

00731 {
00732         Entry* entry;
00733
00734         if (path && *path)
00735                 entry = _entry->read_tree(path, _sort_order);
00736         else {
00737                 entry = _entry->read_tree(NULL, _sort_order);
00738
00739                 _entry->smart_scan();
00740
00741                 if (_entry->_down)
00742                         _entry->_expanded = true;
00743         }
00744
00745         return entry;
00746 }

Here is the call graph for this function:

Member Data Documentation

DWORD Root::_drive_type

Definition at line 155 of file entries.h.

Referenced by FileChildWindow::FileChildWindow(), and ShellBrowser::Init().

Entry* Root::_entry

Definition at line 151 of file entries.h.

Referenced by FileChildWindow::FileChildWindow(), ShellBrowser::Init(), ShellBrowser::InitializeTree(), ShellBrowser::jump_to(), FileChildWindow::jump_to_int(), ShellBrowser::jump_to_pidl(), read_tree(), and ~Root().

TCHAR Root::_fs[_MAX_DIR]

Definition at line 154 of file entries.h.

Referenced by MDIMainFrame::activate_child_window(), FileChildWindow::FileChildWindow(), and ShellBrowser::Init().

DWORD Root::_fs_flags

Definition at line 156 of file entries.h.

Referenced by FileChildWindow::FileChildWindow(), and ShellBrowser::Init().

TCHAR Root::_path[MAX_PATH]

Definition at line 152 of file entries.h.

Referenced by MDIMainFrame::activate_drive_window(), and FileChildWindow::jump_to_int().

SORT_ORDER Root::_sort_order

Definition at line 157 of file entries.h.

Referenced by FileChildWindow::FileChildWindow(), and read_tree().

TCHAR Root::_volname[_MAX_FNAME]

Definition at line 153 of file entries.h.

Referenced by FileChildWindow::FileChildWindow(), ShellBrowser::Init(), and ShellBrowser::InitializeTree().

The documentation for this struct was generated from the following files:
  • entries.h
  • entries.cpp


ROS Explorer: Member List

Root Member List

This is the complete list of members for Root, including all inherited members.

_drive_type | Root
_entry | Root
_fs | Root
_fs_flags | Root
_path | Root
_sort_order | Root
_volname | Root
read_tree(LPCTSTR path, int scan_flags=SCAN_ALL) | Root
read_tree(LPCITEMIDLIST pidl, int scan_flags=SCAN_ALL) | Root
Root() | Root
~Root() | Root


ROS Explorer: RtlAnsiString Struct Reference

RtlAnsiString Struct Reference

#include <ntobjfs.h>

Collaboration diagram for RtlAnsiString:

[legend]
List of all members.

Public Attributes

WORD | string_len
WORD | alloc_len
LPSTR | string_ptr

Detailed Description

Definition at line 40 of file ntobjfs.h.

Member Data Documentation

WORD RtlAnsiString::alloc_len

Definition at line 42 of file ntobjfs.h.

WORD RtlAnsiString::string_len

Definition at line 41 of file ntobjfs.h.

LPSTR RtlAnsiString::string_ptr

Definition at line 43 of file ntobjfs.h.

The documentation for this struct was generated from the following file:
  • ntobjfs.h


ROS Explorer: Member List

RtlAnsiString Member List

This is the complete list of members for RtlAnsiString, including all inherited members.

alloc_len | RtlAnsiString
string_len | RtlAnsiString
string_ptr | RtlAnsiString


ROS Explorer: RtlUnicodeString Struct Reference

RtlUnicodeString Struct Reference

#include <ntobjfs.h>

Inheritance diagram for RtlUnicodeString:

[legend]
Collaboration diagram for RtlUnicodeString:

[legend]
List of all members.

Public Attributes

WORD | string_len
WORD | alloc_len
LPWSTR | string_ptr

Detailed Description

Definition at line 46 of file ntobjfs.h.

Member Data Documentation

WORD RtlUnicodeString::alloc_len

Definition at line 48 of file ntobjfs.h.

Referenced by UnicodeString::UnicodeString().

WORD RtlUnicodeString::string_len

Definition at line 47 of file ntobjfs.h.

Referenced by NtObjDirectory::read_directory().

LPWSTR RtlUnicodeString::string_ptr

Definition at line 49 of file ntobjfs.h.

Referenced by UnicodeString::operator LPCWSTR(), NtObjDirectory::read_directory(), and UnicodeString::UnicodeString().

The documentation for this struct was generated from the following file:
  • ntobjfs.h


ROS Explorer: Member List

RtlUnicodeString Member List

This is the complete list of members for RtlUnicodeString, including all inherited members.

alloc_len | RtlUnicodeString
string_len | RtlUnicodeString
string_ptr | RtlUnicodeString


ROS Explorer: SDIMainFrame Struct Reference

SDIMainFrame Struct Reference

#include <mainframe.h>

Inheritance diagram for SDIMainFrame:

[legend]
Collaboration diagram for SDIMainFrame:

[legend]
List of all members.

Public Types

typedef ExtContextMenuHandlerT<
ShellBrowserChildT< MainFrameBase > > 		super

Public Member Functions

SDIMainFrame (HWND hwnd)

Static Public Member Functions

static HWND | Create ()
static HWND | Create (LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS)
static HWND | Create (LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Command (int id, int code)
void | resize_frame (int cx, int cy)
void | resize_children ()
void | update_clnt_rect ()
void | update_shell_browser ()
void | jump_to (LPCTSTR path, int mode)
void | jump_to (LPCITEMIDLIST path, int mode)
virtual void | entry_selected (Entry *entry)
void | set_url (LPCTSTR url)

Protected Attributes

ShellPathInfo _shellpath_info
WindowHandle _left_hwnd
WindowHandle _right_hwnd
int | _split_pos
int | _last_split
RECT | _clnt_rect
String _url

Detailed Description

Definition at line 137 of file mainframe.h.

Member Typedef Documentation

typedef ExtContextMenuHandlerT< ShellBrowserChildT<MainFrameBase> > SDIMainFrame::super

Reimplemented from ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >.

Definition at line 143 of file mainframe.h.

Constructor & Destructor Documentation

SDIMainFrame::SDIMainFrame ( HWND hwnd )

Definition at line 1332 of file mainframe.cpp.

References _last_split, _split_pos, and DEFAULT_SPLIT_POS.

01333  :      super(hwnd)
01334 {
01335         _split_pos = DEFAULT_SPLIT_POS;
01336         _last_split = DEFAULT_SPLIT_POS;
01337
01338         /* wait for PM_OPEN_WINDOW message before creating a shell view
01339         update_shell_browser();*/
01340 }

Member Function Documentation

int SDIMainFrame::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from MainFrameBase.

Definition at line 1517 of file mainframe.cpp.

References _url, MainFrameBase::Command(), MainFrameBase::Create(), MainFrameBase::ExecuteCommandbar(), and IDW_COMMANDBAR.

01518 {
01519         switch(id) {
01520           case ID_VIEW_MDI:
01521                 MainFrameBase::Create(ExplorerCmd(_url, true));
01522                 break;
01523
01524           case IDW_COMMANDBAR:
01525                 if (code == 1)
01526                         ExecuteCommandbar(_url);
01527                 break;
01528
01529           default:
01530                 return super::Command(id, code);
01531         }
01532
01533         return 0;
01534 }

Here is the call graph for this function:

HWND SDIMainFrame::Create | ( | LPCITEMIDLIST | pidl,
 |  | int | mode = OWM_EXPLORE|OWM_DETAILS|OWM_PIDL
 | ) | [static]

Definition at line 1352 of file mainframe.cpp.

References Create(), GET_WINDOW, HWND, and jump_to().

01353 {
01354         HWND hFrame = Create();
01355         if (!hFrame)
01356                 return 0;
01357
01358         ShowWindow(hFrame, SW_SHOW);
01359
01360         SDIMainFrame* pFrame = GET_WINDOW(SDIMainFrame, hFrame);
01361
01362         if (pFrame)
01363                 pFrame->jump_to(pidl, mode);
01364
01365         return hFrame;
01366 }

Here is the call graph for this function:

HWND SDIMainFrame::Create | ( | LPCTSTR | path,
 |  | int | mode = OWM_EXPLORE|OWM_DETAILS
 | ) | [static]

Definition at line 1368 of file mainframe.cpp.

References Create(), MDIMainFrame::CreateChild(), GET_WINDOW, and HWND.

01369 {
01370         HWND hFrame = Create();
01371         if (!hFrame)
01372                 return 0;
01373
01374         ShowWindow(hFrame, SW_SHOW);
01375
01376         MDIMainFrame* pMainFrame = GET_WINDOW(MDIMainFrame, hFrame);
01377
01378         if (pMainFrame)
01379                 pMainFrame->CreateChild(path, mode);
01380
01381         return hFrame;
01382 }

Here is the call graph for this function:

HWND SDIMainFrame::Create ( ) [static]

Definition at line 1342 of file mainframe.cpp.

References ExplorerGlobals::_hframeClass, ExplorerGlobals::_hInstance, Window::Create(), g_Globals, IDM_SDIFRAME, IDS_TITLE, and WINDOW_CREATOR.

Referenced by StartMenuHandler::Command(), Create(), MainFrameBase::Create(), and MainFrameBase::OpenShellFolders().

01343 {
01344         HMENU hMenuFrame = LoadMenu(g_Globals._hInstance, MAKEINTRESOURCE(IDM_SDIFRAME));
01345
01346         return Window::Create(WINDOW_CREATOR(SDIMainFrame), 0,
01347                                 (LPCTSTR)(int)g_Globals._hframeClass, ResString(IDS_TITLE), WS_OVERLAPPEDWINDOW,
01348                                 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
01349                                 0/*hwndDesktop*/, hMenuFrame);
01350 }

Here is the call graph for this function:

void SDIMainFrame::entry_selected ( Entry * entry ) [protected, virtual]

Implements BrowserCallback.

Definition at line 1658 of file mainframe.cpp.

References Entry::_data, Entry::_etype, ShellBrowserChildT< MainFrameBase >::_shellBrowser, COUNTOF, ET_SHELL, ShellEntry::get_parent_folder(), ShellEntry::get_path(), set_url(), and update_clnt_rect().

01659 {
01660         if (entry->_etype == ET_SHELL) {
01661                 ShellEntry* shell_entry = static_cast<ShellEntry*>(entry);
01662                 IShellFolder* folder;
01663
01664                 if (shell_entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
01665                         folder = static_cast<ShellDirectory*>(shell_entry)->_folder;
01666                 else
01667                         folder = shell_entry->get_parent_folder();
01668
01669                 if (!folder) {
01670                         assert(folder);
01671                         return;
01672                 }
01673
01674                 TCHAR path[MAX_PATH];
01675
01676                 if (shell_entry->get_path(path, COUNTOF(path))) {
01677                         String url;
01678
01679                         if (path[0] == ':')
01680                                 url.printf(TEXT("shell://%s"), path);
01681                         else
01682                                 url.printf(TEXT("file://%s"), path);
01683
01684                         set_url(url);
01685                 }
01686
01687                 _shellBrowser->UpdateFolderView(folder);
01688
01689                  // update _clnt_rect and set size of new created shell view windows
01690                 update_clnt_rect();
01691         }
01692 }

Here is the call graph for this function:

void SDIMainFrame::jump_to | ( | LPCITEMIDLIST | path,
 |  | int | mode
 | ) | [protected]

Definition at line 1718 of file mainframe.cpp.

References ShellPathInfo::_open_mode, ShellPathInfo::_shell_path, ShellBrowserChildT< MainFrameBase >::_shellBrowser, _shellpath_info, and OWM_PIDL.

01719 {
01720         if (_shellBrowser.get() && (_shellpath_info._open_mode&~OWM_PIDL)==(mode&~OWM_PIDL)) {
01721                 ShellPath shell_path = path;
01722
01723                 _shellBrowser->jump_to(shell_path);
01724
01725                 _shellpath_info._shell_path = shell_path;
01726         } else {
01727                 _shellpath_info._open_mode = mode;
01728                 _shellpath_info._shell_path = path;
01729                 _shellpath_info._root_shell_path = path;        //@@ MF 02.10.2005 was: SpecialFolderPath(CSIDL_DRIVES, _hwnd);
01730
01731                 update_shell_browser();
01732         }
01733 }

void SDIMainFrame::jump_to | ( | LPCTSTR | path,
 |  | int | mode
 | ) | [protected]

Definition at line 1703 of file mainframe.cpp.

References ShellPathInfo::_open_mode, ShellPathInfo::_root_shell_path, ShellPathInfo::_shell_path, _shellpath_info, and update_shell_browser().

Referenced by Create(), and WndProc().

01704 {/*@@todo
01705         if (_shellBrowser.get() && (_shellpath_info._open_mode&~OWM_PIDL)==(mode&~OWM_PIDL)) {
01706                 _shellBrowser->jump_to(path);
01707
01708                 _shellpath_info._shell_path = path;
01709         } else */{
01710                 _shellpath_info._open_mode = mode;
01711                 _shellpath_info._shell_path = path;
01712                 _shellpath_info._root_shell_path = SpecialFolderPath(CSIDL_DRIVES, _hwnd);      //@@ path
01713
01714                 update_shell_browser();
01715         }
01716 }

Here is the call graph for this function:

void SDIMainFrame::resize_children ( ) [protected]

Definition at line 1586 of file mainframe.cpp.

References _clnt_rect, _left_hwnd, _right_hwnd, _split_pos, and SPLIT_WIDTH.

Referenced by resize_frame(), and WndProc().

01587 {
01588         HDWP hdwp = BeginDeferWindowPos(2);
01589
01590         int cx = _clnt_rect.left;
01591
01592         if (_left_hwnd) {
01593                 cx = _split_pos + SPLIT_WIDTH/2;
01594
01595                 hdwp = DeferWindowPos(hdwp, _left_hwnd, 0, _clnt_rect.left, _clnt_rect.top, _split_pos-SPLIT_WIDTH/2-_clnt_rect.left, _clnt_rect.bottom-_clnt_rect.top, SWP_NOZORDER|SWP_NOACTIVATE);
01596         } else {
01597                 //_split_pos = -1;
01598                 cx = 0;
01599         }
01600
01601         if (_right_hwnd)
01602                 hdwp = DeferWindowPos(hdwp, _right_hwnd, 0, _clnt_rect.left+cx+1, _clnt_rect.top, _clnt_rect.right-cx, _clnt_rect.bottom-_clnt_rect.top, SWP_NOZORDER|SWP_NOACTIVATE);
01603
01604         EndDeferWindowPos(hdwp);
01605 }

void SDIMainFrame::resize_frame | ( | int | cx,
 |  | int | cy
 | ) | [protected, virtual]

Todo:
use split bar

Reimplemented from MainFrameBase.

Definition at line 1536 of file mainframe.cpp.

References _clnt_rect, MainFrameBase::_haddressedit, MainFrameBase::_hcommandedit, MainFrameBase::_hsidebar, MainFrameBase::_hstatusbar, MainFrameBase::_htoolbar, MainFrameBase::_hwndrebar, and resize_children().

Referenced by update_clnt_rect(), and WndProc().

01537 {
01538         if (cy <= 0)
01539                 return; // avoid resizing children when receiving RBN_AUTOSIZE while getting minimized
01540
01541         RECT rect = {0, 0, cx, cy};
01542
01543         if (_hwndrebar) {
01544                 int height = ClientRect(_hwndrebar).bottom;
01545                 MoveWindow(_hwndrebar, rect.left, rect.top, rect.right-rect.left, height, TRUE);
01546                 rect.top += height;
01547         } else {
01548                 if (IsWindowVisible(_htoolbar)) {
01549                         SendMessage(_htoolbar, WM_SIZE, 0, 0);
01550                         WindowRect rt(_htoolbar);
01551                         rect.top = rt.bottom;
01552                 //      rect.bottom -= rt.bottom;
01553                 }
01554         }
01555
01556         if (IsWindowVisible(_hstatusbar)) {
01557                 int parts[] = {300, 500};
01558
01559                 SendMessage(_hstatusbar, WM_SIZE, 0, 0);
01560                 SendMessage(_hstatusbar, SB_SETPARTS, 2, (LPARAM)&parts);
01561                 ClientRect rt(_hstatusbar);
01562                 rect.bottom -= rt.bottom;
01563         }
01564
01565         if (IsWindowVisible(_haddressedit) || IsWindowVisible(_hcommandedit)) {
01566                 ClientRect rt(_haddressedit);
01567                 rect.bottom -= rt.bottom;
01568
01569                 int mid = (rect.right-rect.left) / 2;
01570                 SetWindowPos(_haddressedit, 0, 0, rect.bottom, mid, rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
01571                 SetWindowPos(_hcommandedit, 0, mid+1, rect.bottom, rect.right-(mid+1), rt.bottom, SWP_NOACTIVATE|SWP_NOZORDER);
01572         }
01573
01574         if (IsWindowVisible(_hsidebar)) {
01575                 WindowRect rt(_hsidebar);
01576                 rect.left += rt.right-rt.left;
01577
01578                 SetWindowPos(_hsidebar, 0, -1, rect.top-1, rt.right-rt.left, rect.bottom-rect.top+1, SWP_NOACTIVATE|SWP_NOZORDER);
01579         }
01580
01581         _clnt_rect = rect;
01582
01583         resize_children();
01584 }

Here is the call graph for this function:

void SDIMainFrame::set_url ( LPCTSTR url ) [protected]

Definition at line 1694 of file mainframe.cpp.

References MainFrameBase::_haddressedit, and _url.

Referenced by entry_selected().

01695 {
01696         if (_url != url) {
01697                 _url = url;
01698
01699                 SetWindowText(_haddressedit, url); //SendMessage(_hwndFrame, PM_URL_CHANGED, 0, (LPARAM)url);
01700         }
01701 }

void SDIMainFrame::update_clnt_rect ( ) [protected]

Definition at line 1607 of file mainframe.cpp.

References resize_frame().

Referenced by entry_selected().

01608 {
01609         ClientRect rect(_hwnd);
01610
01611         resize_frame(rect.right, rect.bottom);
01612 }

Here is the call graph for this function:

void SDIMainFrame::update_shell_browser ( ) [protected]

Todo:
use OWM_ROOTED flag

Definition at line 1614 of file mainframe.cpp.

References ShellBrowserChildT< MainFrameBase >::_shellBrowser, _split_pos, and DEFAULT_SPLIT_POS.

Referenced by jump_to().

01615 {
01616         int split_pos = DEFAULT_SPLIT_POS;
01617
01618         if (_shellBrowser.get()) {
01619                 split_pos = _split_pos;
01620                 delete _shellBrowser.release();
01621         }
01622
01624
01625          // create explorer treeview
01626         if (_shellpath_info._open_mode & OWM_EXPLORE) {
01627                 if (!_left_hwnd) {
01628                         ClientRect rect(_hwnd);
01629
01630                         _left_hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, NULL,
01631                                                         WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_CHILD|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_NOTOOLTIPS|TVS_SHOWSELALWAYS,
01632                                                         0, rect.top, split_pos-SPLIT_WIDTH/2, rect.bottom-rect.top,
01633                                                         _hwnd, (HMENU)IDC_FILETREE, g_Globals._hInstance, 0);
01634
01635                          // display tree window as long as the shell view is not yet visible
01636                         resize_frame(rect.right, rect.bottom);
01637                         MoveWindow(_left_hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, TRUE);
01638                 }
01639         } else {
01640                 if (_left_hwnd) {
01641                         DestroyWindow(_left_hwnd);
01642                         _left_hwnd = 0;
01643                 }
01644         }
01645
01646         _shellBrowser = auto_ptr<ShellBrowser>(new ShellBrowser(_hwnd, _left_hwnd, _right_hwnd,
01647                                                                                                 _shellpath_info, this, _cm_ifs));
01648
01649         _shellBrowser->Init(_hwnd);
01650
01651         if (_left_hwnd)
01652                 _shellBrowser->Init();
01653
01654          // update _clnt_rect and set size of new created shell view windows
01655         update_clnt_rect();
01656 }

LRESULT SDIMainFrame::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:
read paths and window placements from registry

Reimplemented from ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >.

Definition at line 1384 of file mainframe.cpp.

References _last_split, _left_hwnd, _right_hwnd, _split_pos, ShellPath::assign(), COLOR_SPLITBAR, CONTEXT, jump_to(), LOG, OWM_PIDL, PM_OPEN_WINDOW, resize_children(), resize_frame(), ScreenToClient(), SPLIT_WIDTH, and ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >::WndProc().

01385 {
01386         switch(nmsg) {
01387           case WM_SIZE:
01388                 resize_frame(LOWORD(lparam), HIWORD(lparam));
01389                 break;
01390
01391           case WM_PAINT: {
01392                 PaintCanvas canvas(_hwnd);
01393
01394                 if (_left_hwnd) {
01395                         ClientRect rt(_hwnd);
01396                         rt.left = _split_pos-SPLIT_WIDTH/2;
01397                         rt.right = _split_pos+SPLIT_WIDTH/2+1;
01398
01399                         if (_right_hwnd) {
01400                                 WindowRect right_rect(_right_hwnd);
01401                                 ScreenToClient(_hwnd, &right_rect);
01402                                 rt.top = right_rect.top;
01403                                 rt.bottom = right_rect.bottom;
01404                         }
01405
01406                         HBRUSH lastBrush = SelectBrush(canvas, GetStockBrush(COLOR_SPLITBAR));
01407                         Rectangle(canvas, rt.left, rt.top-1, rt.right, rt.bottom+1);
01408                         SelectObject(canvas, lastBrush);
01409                 }
01410                 break;}
01411
01412           case WM_SETCURSOR:
01413                 if (_left_hwnd)
01414                         if (LOWORD(lparam) == HTCLIENT) {
01415                                 POINT pt;
01416                                 GetCursorPos(&pt);
01417                                 ScreenToClient(_hwnd, &pt);
01418
01419                                 if (pt.x>=_split_pos-SPLIT_WIDTH/2 && pt.x<_split_pos+SPLIT_WIDTH/2+1) {
01420                                         SetCursor(LoadCursor(0, IDC_SIZEWE));
01421                                         return TRUE;
01422                                 }
01423                         }
01424                 goto def;
01425
01426           case WM_LBUTTONDOWN:
01427                 if (_left_hwnd) {
01428                         int x = GET_X_LPARAM(lparam);
01429
01430                         ClientRect rt(_hwnd);
01431
01432                         if (x>=_split_pos-SPLIT_WIDTH/2 && x<_split_pos+SPLIT_WIDTH/2+1) {
01433                                 _last_split = _split_pos;
01434                                 SetCapture(_hwnd);
01435                         }
01436                 }
01437                 break;
01438
01439           case WM_LBUTTONUP:
01440                 if (GetCapture() == _hwnd)
01441                         ReleaseCapture();
01442                 break;
01443
01444           case WM_KEYDOWN:
01445                 if (wparam == VK_ESCAPE)
01446                         if (GetCapture() == _hwnd) {
01447                                 _split_pos = _last_split;
01448                                 resize_children();
01449                                 _last_split = -1;
01450                                 ReleaseCapture();
01451                                 SetCursor(LoadCursor(0, IDC_ARROW));
01452                         }
01453                 break;
01454
01455           case WM_MOUSEMOVE:
01456                 if (GetCapture() == _hwnd) {
01457                         int x = GET_X_LPARAM(lparam);
01458
01459                         ClientRect rt(_hwnd);
01460
01461                         if (x>=0 && x<rt.right) {
01462                                 _split_pos = x;
01463                                 resize_children();
01464                                 rt.left = x-SPLIT_WIDTH/2;
01465                                 rt.right = x+SPLIT_WIDTH/2+1;
01466                                 InvalidateRect(_hwnd, &rt, FALSE);
01467                                 UpdateWindow(_left_hwnd);
01468                                 UpdateWindow(_hwnd);
01469                                 UpdateWindow(_right_hwnd);
01470                         }
01471                 }
01472                 break;
01473
01474           case PM_OPEN_WINDOW: {
01475                 CONTEXT("SDIMainFrame PM_OPEN_WINDOW");
01476
01477                 TCHAR buffer[MAX_PATH];
01478                 LPCTSTR path;
01479                 ShellPath root_path = DesktopFolderPath();
01480
01481                 if (lparam) {
01482                         if (wparam & OWM_PIDL) {
01483                                  // take over PIDL from lparam
01484                                 root_path.assign((LPCITEMIDLIST)lparam);        // create as "rooted" window
01485                                 FileSysShellPath fsp(root_path);
01486                                 path = fsp;
01487
01488                                 if (path) {
01489                                         LOG(FmtString(TEXT("SDIMainFrame PM_OPEN_WINDOW: path=%s"), path));
01490                                         lstrcpy(buffer, path);
01491                                         path = buffer;
01492                                 }
01493                         } else {
01494                                  // take over path from lparam
01495                                 path = (LPCTSTR)lparam;
01496                                 root_path = path;       // create as "rooted" window
01497                         }
01498                 } else {
01500                         if (!GetCurrentDirectory(MAX_PATH, buffer))
01501                                 *buffer = '\0';
01502
01503                         path = buffer;
01504                         root_path = path;
01505                 }
01506
01507                 jump_to(root_path, wparam);     //@todo content of 'path' not used any more
01508                 return TRUE;}   // success
01509
01510           default: def:
01511                 return super::WndProc(nmsg, wparam, lparam);
01512         }
01513
01514         return 0;
01515 }

Here is the call graph for this function:

Member Data Documentation

RECT SDIMainFrame::_clnt_rect [protected]

Definition at line 163 of file mainframe.h.

Referenced by resize_children(), and resize_frame().

int SDIMainFrame::_last_split [protected]

Definition at line 162 of file mainframe.h.

Referenced by SDIMainFrame(), and WndProc().

WindowHandle SDIMainFrame::_left_hwnd [protected]

Definition at line 154 of file mainframe.h.

Referenced by resize_children(), and WndProc().

WindowHandle SDIMainFrame::_right_hwnd [protected]

Definition at line 155 of file mainframe.h.

Referenced by resize_children(), and WndProc().

ShellPathInfo SDIMainFrame::_shellpath_info [protected]

Definition at line 152 of file mainframe.h.

Referenced by jump_to().

int SDIMainFrame::_split_pos [protected]

Todo:
focus handling for TAB switching int _focus_pane; // 0: left 1: right

Definition at line 161 of file mainframe.h.

Referenced by resize_children(), SDIMainFrame(), update_shell_browser(), and WndProc().

String SDIMainFrame::_url [protected]

Definition at line 165 of file mainframe.h.

Referenced by Command(), and set_url().

The documentation for this struct was generated from the following files:
  • mainframe.h
  • mainframe.cpp


ROS Explorer: Member List

SDIMainFrame Member List

This is the complete list of members for SDIMainFrame, including all inherited members.

_clnt_rect | SDIMainFrame | [protected]
_cm_ifs | ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > > | [protected]
_fullscreen | MainFrameBase | [protected]
_hAccel | MainFrameBase | [protected]
_haddressedit | MainFrameBase |
_hcommandedit | MainFrameBase |
_himl | MainFrameBase |
_himl_old | MainFrameBase | [protected]
_hMenuFrame | MainFrameBase |
_hMenuWindow | MainFrameBase |
_hsidebar | MainFrameBase |
_hstatusbar | MainFrameBase |
_htoolbar | MainFrameBase |
_hwnd | WindowHandle | [protected]
_hwndrebar | MainFrameBase |
_last_split | SDIMainFrame | [protected]
_left_hwnd | SDIMainFrame | [protected]
_menu_info | MainFrameBase |
_right_hwnd | SDIMainFrame | [protected]
_shellBrowser | ShellBrowserChildT< MainFrameBase > | [protected]
_shellpath_info | SDIMainFrame | [protected]
_split_pos | SDIMainFrame | [protected]
_url | SDIMainFrame | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | SDIMainFrame | [protected, virtual]
Create() | SDIMainFrame | [static]
Create(LPCTSTR path, int mode=OWM_EXPLORE|OWM_DETAILS) | SDIMainFrame | [static]
Create(LPCITEMIDLIST pidl, int mode=OWM_EXPLORE|OWM_DETAILS|OWM_PIDL) | SDIMainFrame | [static]
ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >::Create(const ExplorerCmd &cmd) | MainFrameBase | [static]
PreTranslateWindow::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
PreTranslateWindow::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
entry_selected(Entry *entry) | SDIMainFrame | [protected, virtual]
ExecuteCommandbar(LPCTSTR dir) | MainFrameBase | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > > | [inline]
FillBookmarks() | MainFrameBase | [protected]
frame_get_clientspace(PRECT prect) | MainFrameBase | [protected, virtual]
fullscreen_move() | MainFrameBase | [protected]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
go_to(LPCTSTR url, bool new_window) | MainFrameBase | [protected, virtual]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
jump_to(LPCTSTR path, int mode) | SDIMainFrame | [protected]
jump_to(LPCITEMIDLIST path, int mode) | SDIMainFrame | [protected]
MainFrameBase(HWND hwnd) | MainFrameBase |
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | ShellBrowserChildT< MainFrameBase > | [inline, protected, virtual]
OpenShellFolders(LPIDA pida, HWND hFrameWnd) | MainFrameBase | [static]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PreTranslateWindow(HWND) | PreTranslateWindow |
ProcessMessage(UINT nmsg, WPARAM wparam, LPARAM lparam, LRESULT *pres) | MainFrameBase | [protected]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
resize_children() | SDIMainFrame | [protected]
resize_frame(int cx, int cy) | SDIMainFrame | [protected, virtual]
resize_frame_client() | MainFrameBase | [protected]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SDIMainFrame(HWND hwnd) | SDIMainFrame |
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
set_url(LPCTSTR url) | SDIMainFrame | [protected]
ShellBrowserChildT(HWND hwnd) | ShellBrowserChildT< MainFrameBase > | [inline]
ShellBrowserChildT(HWND hwnd, const ShellChildWndInfo &info) | ShellBrowserChildT< MainFrameBase > | [inline]
super typedef | SDIMainFrame |
toggle_child(HWND hwnd, UINT cmd, HWND hchild, int band_idx=-1) | MainFrameBase | [protected]
toggle_fullscreen() | MainFrameBase | [protected]
TranslateMsg(MSG *pmsg) | MainFrameBase | [protected, virtual]
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
update_clnt_rect() | SDIMainFrame | [protected]
update_shell_browser() | SDIMainFrame | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | SDIMainFrame | [protected, virtual]
~BrowserCallback() | BrowserCallback | [inline, virtual]
~MainFrameBase() | MainFrameBase |
~PreTranslateWindow() | PreTranslateWindow |
~Window() | Window | [virtual]


ROS Explorer: SearchMenu Struct Reference

SearchMenu Struct Reference

Search sub-startmenu. More...

#include <startmenu.h>

Inheritance diagram for SearchMenu:

[legend]
Collaboration diagram for SearchMenu:

[legend]
List of all members.

Public Types

typedef StartMenuHandler | super

Public Member Functions

SearchMenu (HWND hwnd, const StartMenuCreateInfo &create_info)

Protected Member Functions

virtual void | AddEntries ()

Detailed Description

Search sub-startmenu.

Definition at line 419 of file startmenu.h.

Member Typedef Documentation

typedef StartMenuHandler SearchMenu::super

Reimplemented from StartMenuHandler.

Definition at line 421 of file startmenu.h.

Constructor & Destructor Documentation

SearchMenu::SearchMenu | ( | HWND | hwnd,
 |  | const StartMenuCreateInfo & | create_info
 | ) | [inline]

Definition at line 423 of file startmenu.h.

00424          :      super(hwnd, create_info)
00425         {
00426         }

Member Function Documentation

void SearchMenu::AddEntries ( ) [protected, virtual]

Reimplemented from StartMenu.

Definition at line 2186 of file startmenu.cpp.

References StartMenu::AddButton(), StartMenu::AddEntries(), g_Globals, ICID_APPS, ICID_COMPUTER, ICID_SEARCH_DOC, IDC_SEARCH_COMPUTER, IDC_SEARCH_FILES, IDC_SEARCH_PROGRAM, IDS_SEARCH_COMPUTER, IDS_SEARCH_FILES, and IDS_SEARCH_PRG.

02187 {
02188         super::AddEntries();
02189
02190         AddButton(ResString(IDS_SEARCH_FILES),          ICID_SEARCH_DOC, false, IDC_SEARCH_FILES);
02191
02192 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
02193         if (!g_Globals._SHRestricted || !SHRestricted(REST_HASFINDCOMPUTERS))
02194 #endif
02195                 AddButton(ResString(IDS_SEARCH_COMPUTER),ICID_COMPUTER, false, IDC_SEARCH_COMPUTER);
02196
02197         AddButton(ResString(IDS_SEARCH_PRG),            ICID_APPS, false, IDC_SEARCH_PROGRAM);
02198 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • startmenu.h
  • startmenu.cpp


ROS Explorer: Member List

SearchMenu Member List

This is the complete list of members for SearchMenu, including all inherited members.

_arrow_btns | StartMenu | [protected]
_border_left | StartMenu | [protected]
_border_top | StartMenu | [protected]
_bottom_max | StartMenu | [protected]
_buttons | StartMenu | [protected]
_cm_ifs | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [protected]
_create_info | StartMenu | [protected]
_dirs | StartMenu | [protected]
_entries | StartMenu | [protected]
_floating_btn | StartMenu | [protected]
_hwnd | WindowHandle | [protected]
_invisible_lines | StartMenu | [protected]
_large_icons | StartMenu | [protected]
_last_mouse_pos | StartMenu | [protected]
_last_pos | StartMenu | [protected]
_next_id | StartMenu | [protected]
_scroll_mode | StartMenu | [protected]
_scroll_pos | StartMenu | [protected]
_selected_id | StartMenu | [protected]
_submenu | StartMenu | [protected]
_submenu_id | StartMenu | [protected]
ActivateEntry(int id, const ShellEntrySet &entries) | StartMenu | [protected]
AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true) | StartMenu | [protected]
AddEntries() | SearchMenu | [protected, virtual]
AddEntry(const String &title, ICON_ID icon_id, Entry *entry) | StartMenu | [protected]
AddEntry(const String &title, ICON_ID icon_id=ICID_NONE, int id=-1) | StartMenu | [protected]
AddEntry(const ShellFolder folder, ShellEntry *entry) | StartMenu | [protected]
AddEntry(const ShellFolder folder, Entry *entry) | StartMenu | [protected]
AddSeparator() | StartMenu | [protected]
AddShellEntries(const ShellDirectory &dir, int max=-1, const String &ignore="") | StartMenu | [protected]
ButtonHitTest(POINT pt) | StartMenu | [protected]
CancelModes() | Window | [static]
CloseOtherSubmenus(int id=0) | StartMenu | [protected]
CloseStartMenu(int id=0) | StartMenu | [protected, virtual]
CloseSubmenus() | StartMenu | [inline, protected]
Command(int id, int code) | StartMenuHandler | [protected, virtual]
Create(int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="") | StartMenu | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawArrows(HDC hdc, bool large_icons) | StartMenu | [protected]
DrawFloatingButton(HDC hdc) | StartMenu | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down, bool large_icons) | StartMenu | [protected]
GetButtonInfo(int id) const | StartMenu | [protected]
GetButtonRect(int id, PRECT prect) const | StartMenu | [protected]
GetFloatingButtonRect(LPRECT prect) | StartMenu | [protected]
GetSelectionIndex() | StartMenu | [protected]
GetStaticWindowData() | Window | [protected, static]
GetWndClasss() | StartMenu | [protected, static]
Init(LPCREATESTRUCT pcs) | StartMenu | [protected, virtual]
InvalidateSelection() | StartMenu | [protected]
JumpToNextShortcut(char c) | StartMenu | [protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Navigate(int step) | StartMenu | [protected]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
OpenSubmenu(bool select_first=false) | StartMenu | [protected]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< Window > | [inline]
Paint(PaintCanvas &canvas) | StartMenu | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
ProcessKey(int vk) | StartMenu | [protected, virtual]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeButtons(int cx) | StartMenu | [protected]
ResizeToButtons() | StartMenu | [protected]
s_def_creator | StartMenu | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SCROLL_DOWN enum value | StartMenu | [protected]
SCROLL_MODE enum name | StartMenu | [protected]
SCROLL_NOT enum value | StartMenu | [protected]
SCROLL_UP enum value | StartMenu | [protected]
SearchMenu(HWND hwnd, const StartMenuCreateInfo &create_info) | SearchMenu | [inline]
SelectButton(int id, bool open_sub=true) | StartMenu | [protected]
SelectButtonIndex(int idx, bool open_sub=true) | StartMenu | [protected]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
ShowLaunchDialog(HWND hwndOwner) | StartMenuHandler | [protected, static]
ShowLogoffDialog(HWND hwndOwner) | StartMenuHandler | [protected, static]
ShowSearchComputer() | StartMenuHandler | [protected, static]
ShowSearchDialog() | StartMenuHandler | [protected, static]
StartMenu(HWND hwnd, bool large_icons=false) | StartMenu |
StartMenu(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenu |
StartMenuHandler(HWND hwnd, bool large_icons=false) | StartMenuHandler | [inline]
StartMenuHandler(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenuHandler | [inline]
super typedef | SearchMenu |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
UpdateIcons() | StartMenu | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | StartMenu | [protected, virtual]
~StartMenu() | StartMenu |
~Window() | Window | [virtual]


ROS Explorer: SelectedBitmap Struct Reference

SelectedBitmap Struct Reference

SelectedBitmap is used to localy select bitmaps into device contexts. More...

#include <utility.h>

Collaboration diagram for SelectedBitmap:

[legend]
List of all members.

Public Member Functions

SelectedBitmap (HDC hdc, HBITMAP hbmp)
~SelectedBitmap ()

Protected Attributes

HDC | _hdc
HBITMAP | _old_hbmp

Detailed Description

SelectedBitmap is used to localy select bitmaps into device contexts.

Definition at line 530 of file utility.h.

Constructor & Destructor Documentation

SelectedBitmap::SelectedBitmap | ( | HDC | hdc,
 |  | HBITMAP | hbmp
 | ) | [inline]

Definition at line 532 of file utility.h.

00533          :      _hdc(hdc), _old_hbmp(SelectBitmap(hdc, hbmp)) {}

SelectedBitmap::~SelectedBitmap ( ) [inline]

Definition at line 535 of file utility.h.

00535 {DeleteObject(SelectBitmap(_hdc, _old_hbmp));}

Member Data Documentation

HDC SelectedBitmap::_hdc [protected]

Definition at line 538 of file utility.h.

HBITMAP SelectedBitmap::_old_hbmp [protected]

Definition at line 539 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

SelectedBitmap Member List

This is the complete list of members for SelectedBitmap, including all inherited members.

_hdc | SelectedBitmap | [protected]
_old_hbmp | SelectedBitmap | [protected]
SelectedBitmap(HDC hdc, HBITMAP hbmp) | SelectedBitmap | [inline]
~SelectedBitmap() | SelectedBitmap | [inline]


ROS Explorer: SettingsMenu Struct Reference

SettingsMenu Struct Reference

Settings sub-startmenu. More...

#include <startmenu.h>

Inheritance diagram for SettingsMenu:

[legend]
Collaboration diagram for SettingsMenu:

[legend]
List of all members.

Public Types

typedef StartMenuHandler | super

Public Member Functions

SettingsMenu (HWND hwnd, const StartMenuCreateInfo &create_info)

Protected Member Functions

virtual void | AddEntries ()

Detailed Description

Settings sub-startmenu.

Definition at line 389 of file startmenu.h.

Member Typedef Documentation

typedef StartMenuHandler SettingsMenu::super

Reimplemented from StartMenuHandler.

Definition at line 391 of file startmenu.h.

Constructor & Destructor Documentation

SettingsMenu::SettingsMenu | ( | HWND | hwnd,
 |  | const StartMenuCreateInfo & | create_info
 | ) | [inline]

Definition at line 393 of file startmenu.h.

00394          :      super(hwnd, create_info)
00395         {
00396         }

Member Function Documentation

void SettingsMenu::AddEntries ( ) [protected, virtual]

Reimplemented from StartMenu.

Definition at line 2142 of file startmenu.cpp.

References StartMenu::AddButton(), StartMenu::AddEntries(), g_Globals, ICID_CONFIG, ICID_NETWORK, ICID_PRINTER, ID_DESKTOPBAR_SETTINGS, IDC_ADMIN, IDC_CONNECTIONS, IDC_CONTROL_PANEL, IDC_PRINTERS, IDC_SETTINGS_MENU, IDS_ADMIN, IDS_CONNECTIONS, IDS_CONTROL_PANEL, IDS_DESKTOPBAR_SETTINGS, IDS_PRINTERS, and IDS_SETTINGS_MENU.

02143 {
02144         super::AddEntries();
02145
02146 #if defined(ROSSHELL) || defined(_ROS_) // _ROS_ to be removed when printer/network will be implemented
02147 //TODO  AddButton(ResString(IDS_PRINTERS),                      ICID_PRINTER, false, IDC_PRINTERS_MENU);
02148         AddButton(ResString(IDS_CONNECTIONS),           ICID_NETWORK, false, IDC_CONNECTIONS);
02149 #else
02150 //TODO  AddButton(ResString(IDS_PRINTERS),                      ICID_PRINTER, true, IDC_PRINTERS_MENU);
02151         AddButton(ResString(IDS_CONNECTIONS),           ICID_NETWORK, true, IDC_CONNECTIONS);
02152 #endif
02153         AddButton(ResString(IDS_ADMIN),                         ICID_CONFIG, true, IDC_ADMIN);
02154
02155 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
02156         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCONTROLPANEL))
02157 #endif
02158                 AddButton(ResString(IDS_SETTINGS_MENU), ICID_CONFIG, true, IDC_SETTINGS_MENU);
02159
02160         AddButton(ResString(IDS_DESKTOPBAR_SETTINGS), ICID_CONFIG, false, ID_DESKTOPBAR_SETTINGS);
02161
02162         AddButton(ResString(IDS_PRINTERS),                      ICID_PRINTER, false, IDC_PRINTERS);
02163
02164 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
02165         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCONTROLPANEL))
02166 #endif
02167                 AddButton(ResString(IDS_CONTROL_PANEL), ICID_CONFIG, false, IDC_CONTROL_PANEL);
02168 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • startmenu.h
  • startmenu.cpp


ROS Explorer: Member List

SettingsMenu Member List

This is the complete list of members for SettingsMenu, including all inherited members.

_arrow_btns | StartMenu | [protected]
_border_left | StartMenu | [protected]
_border_top | StartMenu | [protected]
_bottom_max | StartMenu | [protected]
_buttons | StartMenu | [protected]
_cm_ifs | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [protected]
_create_info | StartMenu | [protected]
_dirs | StartMenu | [protected]
_entries | StartMenu | [protected]
_floating_btn | StartMenu | [protected]
_hwnd | WindowHandle | [protected]
_invisible_lines | StartMenu | [protected]
_large_icons | StartMenu | [protected]
_last_mouse_pos | StartMenu | [protected]
_last_pos | StartMenu | [protected]
_next_id | StartMenu | [protected]
_scroll_mode | StartMenu | [protected]
_scroll_pos | StartMenu | [protected]
_selected_id | StartMenu | [protected]
_submenu | StartMenu | [protected]
_submenu_id | StartMenu | [protected]
ActivateEntry(int id, const ShellEntrySet &entries) | StartMenu | [protected]
AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true) | StartMenu | [protected]
AddEntries() | SettingsMenu | [protected, virtual]
AddEntry(const String &title, ICON_ID icon_id, Entry *entry) | StartMenu | [protected]
AddEntry(const String &title, ICON_ID icon_id=ICID_NONE, int id=-1) | StartMenu | [protected]
AddEntry(const ShellFolder folder, ShellEntry *entry) | StartMenu | [protected]
AddEntry(const ShellFolder folder, Entry *entry) | StartMenu | [protected]
AddSeparator() | StartMenu | [protected]
AddShellEntries(const ShellDirectory &dir, int max=-1, const String &ignore="") | StartMenu | [protected]
ButtonHitTest(POINT pt) | StartMenu | [protected]
CancelModes() | Window | [static]
CloseOtherSubmenus(int id=0) | StartMenu | [protected]
CloseStartMenu(int id=0) | StartMenu | [protected, virtual]
CloseSubmenus() | StartMenu | [inline, protected]
Command(int id, int code) | StartMenuHandler | [protected, virtual]
Create(int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="") | StartMenu | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawArrows(HDC hdc, bool large_icons) | StartMenu | [protected]
DrawFloatingButton(HDC hdc) | StartMenu | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down, bool large_icons) | StartMenu | [protected]
GetButtonInfo(int id) const | StartMenu | [protected]
GetButtonRect(int id, PRECT prect) const | StartMenu | [protected]
GetFloatingButtonRect(LPRECT prect) | StartMenu | [protected]
GetSelectionIndex() | StartMenu | [protected]
GetStaticWindowData() | Window | [protected, static]
GetWndClasss() | StartMenu | [protected, static]
Init(LPCREATESTRUCT pcs) | StartMenu | [protected, virtual]
InvalidateSelection() | StartMenu | [protected]
JumpToNextShortcut(char c) | StartMenu | [protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Navigate(int step) | StartMenu | [protected]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
OpenSubmenu(bool select_first=false) | StartMenu | [protected]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< Window > | [inline]
Paint(PaintCanvas &canvas) | StartMenu | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
ProcessKey(int vk) | StartMenu | [protected, virtual]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeButtons(int cx) | StartMenu | [protected]
ResizeToButtons() | StartMenu | [protected]
s_def_creator | StartMenu | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SCROLL_DOWN enum value | StartMenu | [protected]
SCROLL_MODE enum name | StartMenu | [protected]
SCROLL_NOT enum value | StartMenu | [protected]
SCROLL_UP enum value | StartMenu | [protected]
SelectButton(int id, bool open_sub=true) | StartMenu | [protected]
SelectButtonIndex(int idx, bool open_sub=true) | StartMenu | [protected]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SettingsMenu(HWND hwnd, const StartMenuCreateInfo &create_info) | SettingsMenu | [inline]
ShowLaunchDialog(HWND hwndOwner) | StartMenuHandler | [protected, static]
ShowLogoffDialog(HWND hwndOwner) | StartMenuHandler | [protected, static]
ShowSearchComputer() | StartMenuHandler | [protected, static]
ShowSearchDialog() | StartMenuHandler | [protected, static]
StartMenu(HWND hwnd, bool large_icons=false) | StartMenu |
StartMenu(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenu |
StartMenuHandler(HWND hwnd, bool large_icons=false) | StartMenuHandler | [inline]
StartMenuHandler(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenuHandler | [inline]
super typedef | SettingsMenu |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
UpdateIcons() | StartMenu | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | StartMenu | [protected, virtual]
~StartMenu() | StartMenu |
~Window() | Window | [virtual]


ROS Explorer: ShellBrowser Struct Reference

ShellBrowser Struct Reference

Implementation of IShellBrowserImpl interface in explorer child windows. More...

#include <shellbrowser.h>

Inheritance diagram for ShellBrowser:

[legend]
Collaboration diagram for ShellBrowser:

[legend]
List of all members.

Public Member Functions

ShellBrowser (HWND hwnd, HWND left_hwnd, WindowHandle &right_hwnd, ShellPathInfo &create_info, BrowserCallback *cb, CtxMenuInterfaces &cm_ifs)
virtual | ~ShellBrowser ()
virtual HRESULT STDMETHODCALLTYPE | GetWindow (HWND *lphwnd)
virtual HRESULT STDMETHODCALLTYPE | QueryActiveShellView (IShellView **ppshv)
virtual HRESULT STDMETHODCALLTYPE | GetControlWindow (UINT id, HWND *lphwnd)
virtual HRESULT STDMETHODCALLTYPE | SendControlMsg (UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret)
const Root & | get_root () const
void | OnTreeGetDispInfo (int idCtrl, LPNMHDR pnmh)
void | OnTreeItemExpanding (int idCtrl, LPNMTREEVIEW pnmtv)
void | OnTreeItemRClick (int idCtrl, LPNMHDR pnmh)
void | OnTreeItemSelected (int idCtrl, LPNMTREEVIEW pnmtv)
LRESULT | Init (HWND hWndFrame)
void | Init ()
int | InsertSubitems (HTREEITEM hParentItem, Entry *entry, IShellFolder *pParentFolder)
bool | jump_to_pidl (LPCITEMIDLIST pidl)
HRESULT | OnDefaultCommand (LPIDA pida)
void | UpdateFolderView (IShellFolder *folder)
HTREEITEM | select_entry (HTREEITEM hitem, Entry *entry, bool expand=true)
void | jump_to (LPCITEMIDLIST pidl)
void | invalidate_cache ()

Protected Types

typedef IComSrvBase< IShellFolderViewCB,
ShellBrowser > 		super

Protected Member Functions

void | InitializeTree ()
bool | InitDragDrop ()
virtual HRESULT STDMETHODCALLTYPE | MessageSFVCB (UINT uMsg, WPARAM wParam, LPARAM lParam)
shell view callback
int | get_image_idx (int icon_id)

Protected Attributes

HWND _hwnd
HWND _left_hwnd
WindowHandle & _right_hwnd
ShellPathInfo & _create_info
HIMAGELIST | _himl
HIMAGELIST | _himl_old
BrowserCallback * _callback
WindowHandle _hWndFrame
ShellFolder _folder
IShellView * | _pShellView
TreeDropTarget * _pDropTarget
HTREEITEM | _last_sel
Root _root
ShellDirectory * _cur_dir
CtxMenuInterfaces & _cm_ifs
map< int, int > | _image_map

Detailed Description

Implementation of IShellBrowserImpl interface in explorer child windows.

Definition at line 59 of file shellbrowser.h.

Member Typedef Documentation

typedef IComSrvBase<IShellFolderViewCB, ShellBrowser> ShellBrowser::super [protected]

Reimplemented from IComSrvBase< IShellFolderViewCB, ShellBrowser >.

Definition at line 173 of file shellbrowser.h.

Constructor & Destructor Documentation

ShellBrowser::ShellBrowser | ( | HWND | hwnd,
 |  | HWND | left_hwnd,
 |  | WindowHandle & | right_hwnd,
 |  | ShellPathInfo & | create_info,
 |  | BrowserCallback * | cb,
 |  | CtxMenuInterfaces & | cm_ifs
 | ) |

Definition at line 40 of file shellbrowser.cpp.

00043  :      super(IID_IShellFolderViewCB),
00044 #else
00045  :
00046 #endif
00047         _hwnd(hwnd),
00048         _left_hwnd(left_hwnd),
00049         _right_hwnd(right_hwnd),
00050         _create_info(create_info),
00051         _callback(cb),
00052         _cm_ifs(cm_ifs)
00053 {
00054         _pShellView = NULL;
00055         _pDropTarget = NULL;
00056         _last_sel = 0;
00057
00058         _cur_dir = NULL;
00059
00060         _himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0);
00061         ImageList_SetBkColor(_himl, GetSysColor(COLOR_WINDOW));
00062 }

ShellBrowser::~ShellBrowser ( ) [virtual]

Definition at line 64 of file shellbrowser.cpp.

References _himl, _himl_old, _left_hwnd, _pDropTarget, _pShellView, _right_hwnd, and IDropTargetImpl::Release().

00065 {
00066         (void)TreeView_SetImageList(_left_hwnd, _himl_old, TVSIL_NORMAL);
00067         ImageList_Destroy(_himl);
00068
00069         if (_pShellView)
00070                 _pShellView->Release();
00071
00072         if (_pDropTarget) {
00073                 _pDropTarget->Release();
00074                 _pDropTarget = NULL;
00075         }
00076
00077         if (_right_hwnd) {
00078                 DestroyWindow(_right_hwnd);
00079                 _right_hwnd = 0;
00080         }
00081 }

Here is the call graph for this function:

Member Function Documentation

int ShellBrowser::get_image_idx ( int icon_id ) [protected]

Definition at line 256 of file shellbrowser.cpp.

References _himl, ExplorerGlobals::_icon_cache, _image_map, g_Globals, Icon::get_hicon(), IconCache::get_icon(), and ICID_NONE.

Referenced by OnTreeGetDispInfo().

00257 {
00258         if (icon_id != ICID_NONE) {
00259                 map<int,int>::const_iterator found = _image_map.find(icon_id);
00260
00261                 if (found != _image_map.end())
00262                         return found->second;
00263
00264                 int idx = ImageList_AddIcon(_himl, g_Globals._icon_cache.get_icon(icon_id).get_hicon());
00265
00266                 _image_map[icon_id] = idx;
00267
00268                 return idx;
00269         } else
00270                 return -1;
00271 }

Here is the call graph for this function:

const Root& ShellBrowser::get_root ( ) const [inline]

Definition at line 118 of file shellbrowser.h.

References _root.

Referenced by MDIMainFrame::activate_child_window().

00118 {return _root;}

virtual HRESULT STDMETHODCALLTYPE ShellBrowser::GetControlWindow | ( | UINT | id,
 |  | HWND * | lphwnd
 | ) | [inline, virtual]

Definition at line 83 of file shellbrowser.h.

References _hWndFrame, _left_hwnd, HWND, and PM_GET_CONTROLWINDOW.

00084         {
00085                 if (!lphwnd)
00086                         return E_POINTER;
00087
00088                 if (id == FCW_TREE) {
00089                         *lphwnd = _left_hwnd;
00090                         return S_OK;
00091                 }
00092
00093                 HWND hwnd = (HWND)SendMessage(_hWndFrame, PM_GET_CONTROLWINDOW, id, 0);
00094
00095                 if (hwnd) {
00096                         *lphwnd = hwnd;
00097                         return S_OK;
00098                 }
00099
00100                 return E_NOTIMPL;
00101         }

virtual HRESULT STDMETHODCALLTYPE ShellBrowser::GetWindow ( HWND * lphwnd ) [inline, virtual]

Definition at line 69 of file shellbrowser.h.

References _hwnd.

00070         {
00071                 *lphwnd = _hwnd;
00072                 return S_OK;
00073         }

void ShellBrowser::Init ( ) [inline]

Definition at line 127 of file shellbrowser.h.

References InitDragDrop(), and InitializeTree().

00128         {
00129                 InitializeTree();
00130                 InitDragDrop();
00131         }

Here is the call graph for this function:

LRESULT ShellBrowser::Init ( HWND hWndFrame )

Definition at line 84 of file shellbrowser.cpp.

References _create_info, Root::_drive_type, Root::_entry, Root::_fs, Root::_fs_flags, _hwnd, _hWndFrame, _root, ShellPathInfo::_root_shell_path, ShellPathInfo::_shell_path, Root::_volname, CONTEXT, ShellFolder::get_name(), GetDesktopFolder(), jump_to(), and Entry::read_directory().

00085 {
00086         CONTEXT("ShellBrowser::Init()");
00087
00088         _hWndFrame = hWndFrame;
00089
00090         const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORADDRESSBAR);
00091
00092         _root._drive_type = DRIVE_UNKNOWN;
00093         lstrcpy(_root._volname, root_name);
00094         _root._fs_flags = 0;
00095         lstrcpy(_root._fs, TEXT("Desktop"));
00096
00097         _root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd);
00098
00099         jump_to(_create_info._shell_path);
00100
00101          // -> set_curdir()
00102         _root._entry->read_directory();
00103
00104         /* already filled by ShellDirectory constructor
00105         lstrcpy(_root._entry->_data.cFileName, TEXT("Desktop")); */
00106
00107         return 0;
00108 }

Here is the call graph for this function:

bool ShellBrowser::InitDragDrop ( ) [protected]

Definition at line 178 of file shellbrowser.cpp.

References _left_hwnd, _pDropTarget, IDropTargetImpl::AddRef(), IDropTargetImpl::AddSuportedFormat(), CONTEXT, and IDropTargetImpl::Release().

Referenced by Init().

00179 {
00180         CONTEXT("ShellBrowser::InitDragDrop()");
00181
00182         _pDropTarget = new TreeDropTarget(_left_hwnd);
00183
00184         if (!_pDropTarget)
00185                 return false;
00186
00187         _pDropTarget->AddRef();
00188
00189         if (FAILED(RegisterDragDrop(_left_hwnd, _pDropTarget))) {//calls addref
00190                 _pDropTarget->Release(); // free TreeDropTarget
00191                 _pDropTarget = NULL;
00192                 return false;
00193         } else
00194                 _pDropTarget->Release();
00195
00196         FORMATETC ftetc;
00197
00198         ftetc.dwAspect = DVASPECT_CONTENT;
00199         ftetc.lindex = -1;
00200         ftetc.tymed = TYMED_HGLOBAL;
00201         ftetc.cfFormat = CF_HDROP;
00202
00203         _pDropTarget->AddSuportedFormat(ftetc);
00204
00205         return true;
00206 }

Here is the call graph for this function:

void ShellBrowser::InitializeTree ( ) [protected]

Definition at line 154 of file shellbrowser.cpp.

References Root::_entry, _himl, _himl_old, _left_hwnd, _root, Root::_volname, and CONTEXT.

Referenced by Init().

00155 {
00156         CONTEXT("ShellBrowserChild::InitializeTree()");
00157
00158         _himl_old = TreeView_SetImageList(_left_hwnd, _himl, TVSIL_NORMAL);
00159         TreeView_SetScrollTime(_left_hwnd, 100);
00160
00161         TV_INSERTSTRUCT tvInsert;
00162         TV_ITEM& tvItem = tvInsert.item;
00163
00164         tvInsert.hParent = 0;
00165         tvInsert.hInsertAfter = TVI_LAST;
00166
00167         tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;
00168         tvItem.lParam = (LPARAM)_root._entry;
00169         tvItem.pszText = _root._volname; //LPSTR_TEXTCALLBACK;
00170         tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;
00171         tvItem.cChildren = 1;
00172
00173         HTREEITEM hItem = TreeView_InsertItem(_left_hwnd, &tvInsert);
00174         TreeView_SelectItem(_left_hwnd, hItem);
00175         TreeView_Expand(_left_hwnd, hItem, TVE_EXPAND);
00176 }

int ShellBrowser::InsertSubitems | ( | HTREEITEM | hParentItem,
 |  | Entry * | entry,
 |  | IShellFolder * | pParentFolder
 | ) |

Definition at line 312 of file shellbrowser.cpp.

References ExplorerGlobals::_hMainWnd, CONTEXT, g_Globals, HandleException(), and Entry::smart_scan().

Referenced by OnTreeItemExpanding().

00313 {
00314         CONTEXT("ShellBrowser::InsertSubitems()");
00315
00316         WaitCursor wait;
00317
00318         int cnt = 0;
00319
00320         SendMessage(_left_hwnd, WM_SETREDRAW, FALSE, 0);
00321
00322         try {
00323                 entry->smart_scan();
00324         } catch(COMException& e) {
00325                 HandleException(e, g_Globals._hMainWnd);
00326         }
00327
00328         TV_ITEM tvItem;
00329         TV_INSERTSTRUCT tvInsert;
00330
00331         for(entry=entry->_down; entry; entry=entry->_next) {
00332 #ifndef _LEFT_FILES
00333                 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00334 #endif
00335                 {
00336                         ZeroMemory(&tvItem, sizeof(tvItem));
00337
00338                         tvItem.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;
00339                         tvItem.pszText = LPSTR_TEXTCALLBACK;
00340                         tvItem.iImage = tvItem.iSelectedImage = I_IMAGECALLBACK;
00341                         tvItem.lParam = (LPARAM)entry;
00342                         tvItem.cChildren = entry->_shell_attribs & SFGAO_HASSUBFOLDER? 1: 0;
00343
00344                         if (entry->_shell_attribs & SFGAO_SHARE) {
00345                                 tvItem.mask |= TVIF_STATE;
00346                                 tvItem.stateMask |= TVIS_OVERLAYMASK;
00347                                 tvItem.state |= INDEXTOOVERLAYMASK(1);
00348                         }
00349
00350                         tvInsert.item = tvItem;
00351                         tvInsert.hInsertAfter = TVI_LAST;
00352                         tvInsert.hParent = hParentItem;
00353
00354                         (void)TreeView_InsertItem(_left_hwnd, &tvInsert);
00355                 }
00356
00357                 ++cnt;
00358         }
00359
00360         SendMessage(_left_hwnd, WM_SETREDRAW, TRUE, 0);
00361
00362         return cnt;
00363 }

Here is the call graph for this function:

void ShellBrowser::invalidate_cache ( )

Definition at line 273 of file shellbrowser.cpp.

References _himl, _himl_old, ExplorerGlobals::_icon_cache, _image_map, IconCache::free_icon(), and g_Globals.

00274 {
00275         (void)TreeView_SetImageList(_left_hwnd, _himl_old, TVSIL_NORMAL);
00276         ImageList_Destroy(_himl);
00277
00278         _himl_old = TreeView_SetImageList(_left_hwnd, _himl, TVSIL_NORMAL);
00279         _himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0);
00280
00281         for(map<int,int>::const_iterator it=_image_map.begin(); it!=_image_map.end(); ++it)
00282                 g_Globals._icon_cache.free_icon(it->first);
00283
00284         _image_map.clear();
00285 }

Here is the call graph for this function:

void ShellBrowser::jump_to ( LPCITEMIDLIST pidl )

Definition at line 110 of file shellbrowser.cpp.

References _callback, _cur_dir, Root::_entry, _root, BrowserCallback::entry_selected(), Entry::find_entry(), and UpdateFolderView().

Referenced by Init().

00111 {
00112         Entry* entry = NULL;
00113
00114          //@@
00115         if (!_cur_dir)
00116                 _cur_dir = static_cast<ShellDirectory*>(_root._entry);
00117
00118         //LOG(FmtString(TEXT("ShellBrowser::jump_to(): pidl=%s"), (LPCTSTR)FileSysShellPath(pidl)));
00119
00120         if (_cur_dir) {
00121                 static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILFindChild(TEXT("SHELL32"), 24);
00122
00123 /*@todo
00124         we should call read_tree() here to iterate through the hierarchy and open all folders from _create_info._root_shell_path (_cur_dir) to _create_info._shell_path (pidl)
00125         _root._entry->read_tree(_create_info._root_shell_path.get_folder(), info._shell_path, SORT_NAME);
00126         -> see FileChildWindow::FileChildWindow()_create_info._shell_path
00127 */
00128
00129                 LPCITEMIDLIST child_pidl;
00130
00131                 if (ILFindChild)
00132                         child_pidl = (*ILFindChild)(_cur_dir->create_absolute_pidl(), pidl);
00133                 else
00134                         child_pidl = pidl;      // This is not correct in the common case, but works on the desktop level.
00135
00136                 if (child_pidl) {
00137                         _cur_dir->smart_scan();
00138
00139                         entry = _cur_dir->find_entry(child_pidl);
00140
00141                         if (entry) {
00142                                 _cur_dir = static_cast<ShellDirectory*>(entry);
00143                                 _callback->entry_selected(entry);
00144                         }
00145                 }
00146         }
00147
00148                 //@@ work around as long as we don't iterate correctly through the ShellEntry tree
00149         if (!entry)
00150                 UpdateFolderView(ShellFolder(pidl));
00151 }

Here is the call graph for this function:

bool ShellBrowser::jump_to_pidl ( LPCITEMIDLIST pidl )

Definition at line 508 of file shellbrowser.cpp.

References Root::_entry, _root, Entry::find_entry(), Entry::get_next_path_component(), select_entry(), Entry::smart_scan(), and SORT_NAME.

00509 {
00510         if (!_root._entry)
00511                 return false;
00512
00513          // iterate through the hierarchy and open all folders to reach pidl
00514         WaitCursor wait;
00515
00516         HTREEITEM hitem = TreeView_GetRoot(_left_hwnd);
00517         Entry* entry = _root._entry;
00518
00519         for(const void*p=pidl;;) {
00520                 if (!p)
00521                         return true;
00522
00523                 if (!entry || !hitem)
00524                         break;
00525
00526                 entry->smart_scan(SORT_NAME);
00527
00528                 Entry* found = entry->find_entry(p);
00529                 p = entry->get_next_path_component(p);
00530
00531                 if (found)
00532                         hitem = select_entry(hitem, found);
00533
00534                 entry = found;
00535         }
00536
00537         return false;
00538 }

Here is the call graph for this function:

HRESULT STDMETHODCALLTYPE ShellBrowser::MessageSFVCB | ( | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected, virtual]

shell view callback

Definition at line 428 of file shellbrowser.cpp.

00429 {
00430         if (uMsg == SFVM_INITMENUPOPUP) {
00431                 //@todo never reached
00432                 InsertMenu((HMENU)lParam, 0, MF_BYPOSITION, 12345, TEXT("TEST ENTRY"));
00433                 return S_OK;
00434         }
00435
00436         return E_NOTIMPL;
00437 }

HRESULT ShellBrowser::OnDefaultCommand ( LPIDA pida ) [virtual]

Reimplemented from IShellBrowserImpl.

Definition at line 442 of file shellbrowser.cpp.

References Entry::_data, Entry::_etype, _hWndFrame, _last_sel, CONTEXT, ET_SHELL, ShellDirectory::find_entry(), MainFrameBase::OpenShellFolders(), select_entry(), Entry::smart_scan(), and TreeView_GetItemData().

00443 {
00444         CONTEXT("ShellBrowser::OnDefaultCommand()");
00445
00446         if (pida->cidl >= 1) {
00447                 if (_left_hwnd) {       // explorer mode
00448                         if (_last_sel) {
00449                                 ShellDirectory* parent = (ShellDirectory*)TreeView_GetItemData(_left_hwnd, _last_sel);
00450
00451                                 if (parent) {
00452                                         try {
00453                                                 parent->smart_scan();
00454                                         } catch(COMException& e) {
00455                                                 return e.Error();
00456                                         }
00457
00458                                         UINT firstOffset = pida->aoffset[1];
00459                                         LPITEMIDLIST pidl = (LPITEMIDLIST)((LPBYTE)pida+firstOffset);
00460
00461                                         Entry* entry = parent->find_entry(pidl);
00462
00463                                         if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
00464                                                 if (entry->_etype == ET_SHELL)
00465                                                         if (_last_sel && select_entry(_last_sel, entry))
00466                                                                 return S_OK;
00467                                 }
00468                         }
00469                 } else { // no tree control
00470                         if (MainFrameBase::OpenShellFolders(pida, _hWndFrame))
00471                                 return S_OK;
00472
00473 /* create new Frame Window
00474                         if (MainFrame::OpenShellFolders(pida, 0))
00475                                 return S_OK;
00476 */
00477                 }
00478         }
00479
00480         return E_NOTIMPL;
00481 }

Here is the call graph for this function:

void ShellBrowser::OnTreeGetDispInfo | ( | int | idCtrl,
 |  | LPNMHDR | pnmh
 | ) |

Definition at line 233 of file shellbrowser.cpp.

References Entry::_display_name, CONTEXT, get_image_idx(), ICF_HICON, ICF_OPEN, ICF_OVERLAYS, and Entry::safe_extract_icon().

00234 {
00235         CONTEXT("ShellBrowser::OnTreeGetDispInfo()");
00236
00237         LPNMTVDISPINFO lpdi = (LPNMTVDISPINFO)pnmh;
00238         ShellEntry* entry = (ShellEntry*)lpdi->item.lParam;
00239
00240         if (entry) {
00241                 if (lpdi->item.mask & TVIF_TEXT)
00242                         lpdi->item.pszText = entry->_display_name;
00243
00244                 if (lpdi->item.mask & (TVIF_IMAGE|TVIF_SELECTEDIMAGE)) {
00245                         if (lpdi->item.mask & TVIF_IMAGE)
00246                                 lpdi->item.iImage = get_image_idx(
00247                                                 entry->safe_extract_icon((ICONCACHE_FLAGS)(ICF_HICON|ICF_OVERLAYS)));
00248
00249                         if (lpdi->item.mask & TVIF_SELECTEDIMAGE)
00250                                 lpdi->item.iSelectedImage = get_image_idx(
00251                                                 entry->safe_extract_icon((ICONCACHE_FLAGS)(ICF_HICON|ICF_OVERLAYS|ICF_OPEN)));
00252                 }
00253         }
00254 }

Here is the call graph for this function:

void ShellBrowser::OnTreeItemExpanding | ( | int | idCtrl,
 |  | LPNMTREEVIEW | pnmtv
 | ) |

Definition at line 287 of file shellbrowser.cpp.

References ShellDirectory::_folder, Entry::_shell_attribs, CONTEXT, InsertSubitems(), and TreeView_GetItemData().

00288 {
00289         CONTEXT("ShellBrowser::OnTreeItemExpanding()");
00290
00291         if (pnmtv->action == TVE_COLLAPSE)
00292         TreeView_Expand(_left_hwnd, pnmtv->itemNew.hItem, TVE_COLLAPSE|TVE_COLLAPSERESET);
00293     else if (pnmtv->action == TVE_EXPAND) {
00294                 ShellDirectory* entry = (ShellDirectory*)TreeView_GetItemData(_left_hwnd, pnmtv->itemNew.hItem);
00295
00296                 if (entry)
00297                         if (!InsertSubitems(pnmtv->itemNew.hItem, entry, entry->_folder)) {
00298                                 entry->_shell_attribs &= ~SFGAO_HASSUBFOLDER;
00299
00300                                  // remove subitem "+"
00301                                 TV_ITEM tvItem;
00302
00303                                 tvItem.mask = TVIF_CHILDREN;
00304                                 tvItem.hItem = pnmtv->itemNew.hItem;
00305                                 tvItem.cChildren = 0;
00306
00307                                 TreeView_SetItem(_left_hwnd, &tvItem);
00308                         }
00309         }
00310 }

Here is the call graph for this function:

void ShellBrowser::OnTreeItemRClick | ( | int | idCtrl,
 |  | LPNMHDR | pnmh
 | ) |

Definition at line 209 of file shellbrowser.cpp.

References _cm_ifs, _hwnd, _left_hwnd, CHECKERROR, ClientToScreen(), CONTEXT, Entry::do_context_menu(), ScreenToClient(), and TreeView_GetItemData().

00210 {
00211         CONTEXT("ShellBrowser::OnTreeItemRClick()");
00212
00213         TVHITTESTINFO tvhti;
00214
00215         GetCursorPos(&tvhti.pt);
00216         ScreenToClient(_left_hwnd, &tvhti.pt);
00217
00218         tvhti.flags = LVHT_NOWHERE;
00219         (void)TreeView_HitTest(_left_hwnd, &tvhti);
00220
00221         if (TVHT_ONITEM & tvhti.flags) {
00222                 LPARAM itemData = TreeView_GetItemData(_left_hwnd, tvhti.hItem);
00223
00224                 if (itemData) {
00225                         Entry* entry = (Entry*)itemData;
00226                         ClientToScreen(_left_hwnd, &tvhti.pt);
00227
00228                         CHECKERROR(entry->do_context_menu(_hwnd, tvhti.pt, _cm_ifs));
00229                 }
00230         }
00231 }

Here is the call graph for this function:

void ShellBrowser::OnTreeItemSelected | ( | int | idCtrl,
 |  | LPNMTREEVIEW | pnmtv
 | ) |

Definition at line 365 of file shellbrowser.cpp.

References _callback, _last_sel, CONTEXT, and BrowserCallback::entry_selected().

00366 {
00367         CONTEXT("ShellBrowser::OnTreeItemSelected()");
00368
00369         ShellEntry* entry = (ShellEntry*)pnmtv->itemNew.lParam;
00370
00371         _last_sel = pnmtv->itemNew.hItem;
00372
00373         if (entry)
00374                 _callback->entry_selected(entry);
00375 }

Here is the call graph for this function:

virtual HRESULT STDMETHODCALLTYPE ShellBrowser::QueryActiveShellView ( IShellView ** ppshv ) [inline, virtual]

Definition at line 76 of file shellbrowser.h.

References _pShellView.

00077         {
00078                 _pShellView->AddRef();
00079                 *ppshv = _pShellView;
00080                 return S_OK;
00081         }

HTREEITEM ShellBrowser::select_entry | ( | HTREEITEM | hitem,
 |  | Entry * | entry,
 |  | bool | expand = true
 | ) |

Definition at line 484 of file shellbrowser.cpp.

References CONTEXT, and TreeView_GetItemData().

Referenced by jump_to_pidl(), and OnDefaultCommand().

00485 {
00486         CONTEXT("ShellBrowser::select_entry()");
00487
00488         if (expand && !TreeView_Expand(_left_hwnd, hitem, TVE_EXPAND))
00489                 return 0;
00490
00491         for(hitem=TreeView_GetChild(_left_hwnd,hitem); hitem; hitem=TreeView_GetNextSibling(_left_hwnd,hitem)) {
00492                 if ((Entry*)TreeView_GetItemData(_left_hwnd,hitem) == entry) {
00493                         if (TreeView_SelectItem(_left_hwnd, hitem)) {
00494                                 if (expand)
00495                                         TreeView_Expand(_left_hwnd, hitem, TVE_EXPAND);
00496
00497                                 return hitem;
00498                         }
00499
00500                         break;
00501                 }
00502         }
00503
00504         return 0;
00505 }

Here is the call graph for this function:

virtual HRESULT STDMETHODCALLTYPE ShellBrowser::SendControlMsg | ( | UINT | id,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam,
 |  | LRESULT * | pret
 | ) | [inline, virtual]

Definition at line 103 of file shellbrowser.h.

References _hWndFrame, HWND, and PM_GET_CONTROLWINDOW.

00104         {
00105                 if (!pret)
00106                         return E_POINTER;
00107
00108                 HWND hstatusbar = (HWND)SendMessage(_hWndFrame, PM_GET_CONTROLWINDOW, id, 0);
00109
00110                 if (hstatusbar) {
00111                         *pret = ::SendMessage(hstatusbar, uMsg, wParam, lParam);
00112                         return S_OK;
00113                 }
00114
00115                 return E_NOTIMPL;
00116         }

void ShellBrowser::UpdateFolderView ( IShellFolder * folder )

Definition at line 377 of file shellbrowser.cpp.

References _create_info, _folder, _hwnd, ShellPathInfo::_open_mode, _pShellView, _right_hwnd, CONTEXT, and OWM_DETAILS.

Referenced by jump_to().

00378 {
00379         CONTEXT("ShellBrowser::UpdateFolderView()");
00380
00381         FOLDERSETTINGS fs;
00382         IShellView* pLastShellView = _pShellView;
00383
00384         _folder = folder;
00385
00386         if (pLastShellView)
00387                 pLastShellView->GetCurrentInfo(&fs);
00388         else {
00389                 fs.ViewMode = _create_info._open_mode&OWM_DETAILS? FVM_DETAILS: FVM_ICON;
00390                 fs.fFlags = FWF_NOCLIENTEDGE|FWF_BESTFITWINDOW;
00391         }
00392
00393 #ifndef __MINGW32__     // IShellFolderViewCB missing in MinGW (as of 25.09.2005)
00394         SFV_CREATE sfv_create;
00395
00396         sfv_create.cbSize = sizeof(SFV_CREATE);
00397         sfv_create.pshf = folder;
00398         sfv_create.psvOuter = NULL;
00399         sfv_create.psfvcb = this;
00400
00401         HRESULT hr = SHCreateShellFolderView(&sfv_create, &_pShellView);
00402 #else
00403         HRESULT hr = folder->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView);
00404 #endif
00405
00406         if (FAILED(hr)) {
00407                 _pShellView = NULL;
00408                 return;
00409         }
00410
00411         RECT rect = {CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT};
00412         hr = _pShellView->CreateViewWindow(pLastShellView, &fs, static_cast<IShellBrowser*>(this), &rect, &_right_hwnd/*&m_hWndListView*/);
00413
00414         if (pLastShellView) {
00415                 pLastShellView->GetCurrentInfo(&fs);
00416                 pLastShellView->UIActivate(SVUIA_DEACTIVATE);
00417                 pLastShellView->DestroyViewWindow();
00418                 pLastShellView->Release();
00419         }
00420
00421         _pShellView->UIActivate(SVUIA_ACTIVATE_NOFOCUS);
00422 }

Member Data Documentation

BrowserCallback* ShellBrowser::_callback [protected]

Definition at line 154 of file shellbrowser.h.

Referenced by jump_to(), and OnTreeItemSelected().

CtxMenuInterfaces& ShellBrowser::_cm_ifs [protected]

Definition at line 167 of file shellbrowser.h.

Referenced by OnTreeItemRClick().

ShellPathInfo& ShellBrowser::_create_info [protected]

Definition at line 151 of file shellbrowser.h.

Referenced by Init(), and UpdateFolderView().

ShellDirectory* ShellBrowser::_cur_dir [protected]

Definition at line 165 of file shellbrowser.h.

Referenced by jump_to().

ShellFolder ShellBrowser::_folder [protected]

Definition at line 157 of file shellbrowser.h.

Referenced by UpdateFolderView().

HIMAGELIST ShellBrowser::_himl [protected]

Definition at line 152 of file shellbrowser.h.

Referenced by get_image_idx(), InitializeTree(), invalidate_cache(), and ~ShellBrowser().

HIMAGELIST ShellBrowser::_himl_old [protected]

Definition at line 153 of file shellbrowser.h.

Referenced by InitializeTree(), invalidate_cache(), and ~ShellBrowser().

HWND ShellBrowser::_hwnd [protected]

Definition at line 148 of file shellbrowser.h.

Referenced by GetWindow(), Init(), OnTreeItemRClick(), and UpdateFolderView().

WindowHandle ShellBrowser::_hWndFrame [protected]

Definition at line 156 of file shellbrowser.h.

Referenced by GetControlWindow(), Init(), OnDefaultCommand(), and SendControlMsg().

map<int, int> ShellBrowser::_image_map [protected]

Definition at line 179 of file shellbrowser.h.

Referenced by get_image_idx(), and invalidate_cache().

HTREEITEM ShellBrowser::_last_sel [protected]

Definition at line 162 of file shellbrowser.h.

Referenced by OnDefaultCommand(), and OnTreeItemSelected().

HWND ShellBrowser::_left_hwnd [protected]

Definition at line 149 of file shellbrowser.h.

Referenced by GetControlWindow(), InitDragDrop(), InitializeTree(), OnTreeItemRClick(), and ~ShellBrowser().

TreeDropTarget* ShellBrowser::_pDropTarget [protected]

Definition at line 160 of file shellbrowser.h.

Referenced by InitDragDrop(), and ~ShellBrowser().

IShellView* ShellBrowser::_pShellView [protected]

Definition at line 159 of file shellbrowser.h.

Referenced by QueryActiveShellView(), UpdateFolderView(), and ~ShellBrowser().

WindowHandle& ShellBrowser::_right_hwnd [protected]

Definition at line 150 of file shellbrowser.h.

Referenced by UpdateFolderView(), and ~ShellBrowser().

Root ShellBrowser::_root [protected]

Definition at line 164 of file shellbrowser.h.

Referenced by get_root(), Init(), InitializeTree(), jump_to(), and jump_to_pidl().

The documentation for this struct was generated from the following files:
  • shellbrowser.h
  • shellbrowser.cpp


ROS Explorer: Member List

ShellBrowser Member List

This is the complete list of members for ShellBrowser, including all inherited members.

_callback | ShellBrowser | [protected]
_cm_ifs | ShellBrowser | [protected]
_create_info | ShellBrowser | [protected]
_cur_dir | ShellBrowser | [protected]
_dwRef | IShellBrowserImpl | [protected]
_folder | ShellBrowser | [protected]
_himl | ShellBrowser | [protected]
_himl_old | ShellBrowser | [protected]
_hwnd | ShellBrowser | [protected]
_hWndFrame | ShellBrowser | [protected]
_image_map | ShellBrowser | [protected]
_last_sel | ShellBrowser | [protected]
_left_hwnd | ShellBrowser | [protected]
_pDropTarget | ShellBrowser | [protected]
_pShellView | ShellBrowser | [protected]
_ref | ComSrvObject | [protected]
_right_hwnd | ShellBrowser | [protected]
_root | ShellBrowser | [protected]
_uuid_base | IComSrvQI< IShellFolderViewCB > | [protected]
AddRef() | IShellBrowserImpl | [inline, virtual]
BrowseObject(LPCITEMIDLIST pidl, UINT wFlags) | IShellBrowserImpl | [inline, virtual]
ComSrvObject() | ComSrvObject | [inline, protected]
ContextSensitiveHelp(BOOL fEnterMode) | IShellBrowserImpl | [inline, virtual]
DecRef() | SimpleComObject | [inline]
EnableModelessSB(BOOL fEnable) | IShellBrowserImpl | [inline, virtual]
Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) | IShellBrowserImpl | [virtual]
get_image_idx(int icon_id) | ShellBrowser | [protected]
get_root() const | ShellBrowser | [inline]
GetControlWindow(UINT id, HWND *lphwnd) | ShellBrowser | [inline, virtual]
GetViewStateStream(DWORD grfMode, LPSTREAM *ppStrm) | IShellBrowserImpl | [inline, virtual]
GetWindow(HWND *lphwnd) | ShellBrowser | [inline, virtual]
IComSrvBase(REFIID uuid_base) | IComSrvBase< IShellFolderViewCB, ShellBrowser > | [inline, protected]
IComSrvQI(REFIID uuid_base) | IComSrvQI< IShellFolderViewCB > | [inline]
IComSrvQI() | IComSrvQI< IShellFolderViewCB > | [inline, protected]
IncludeObject(IShellView *ppshv, LPCITEMIDLIST pidl) | IShellBrowserImpl | [inline, virtual]
IncRef() | SimpleComObject | [inline]
Init(HWND hWndFrame) | ShellBrowser |
Init() | ShellBrowser | [inline]
InitDragDrop() | ShellBrowser | [protected]
InitializeTree() | ShellBrowser | [protected]
InsertMenusSB(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) | IShellBrowserImpl | [inline, virtual]
InsertSubitems(HTREEITEM hParentItem, Entry *entry, IShellFolder *pParentFolder) | ShellBrowser |
invalidate_cache() | ShellBrowser |
IShellBrowserImpl() | IShellBrowserImpl | [inline]
jump_to(LPCITEMIDLIST pidl) | ShellBrowser |
jump_to_pidl(LPCITEMIDLIST pidl) | ShellBrowser |
MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) | ShellBrowser | [protected, virtual]
OnDefaultCommand(LPIDA pida) | ShellBrowser | [virtual]
IShellBrowserImpl::OnDefaultCommand(IShellView *ppshv) | IShellBrowserImpl | [virtual]
OnStateChange(IShellView *ppshv, ULONG uChange) | IShellBrowserImpl | [inline, virtual]
OnTreeGetDispInfo(int idCtrl, LPNMHDR pnmh) | ShellBrowser |
OnTreeItemExpanding(int idCtrl, LPNMTREEVIEW pnmtv) | ShellBrowser |
OnTreeItemRClick(int idCtrl, LPNMHDR pnmh) | ShellBrowser |
OnTreeItemSelected(int idCtrl, LPNMTREEVIEW pnmtv) | ShellBrowser |
OnViewWindowActive(IShellView *ppshv) | IShellBrowserImpl | [inline, virtual]
QueryActiveShellView(IShellView **ppshv) | ShellBrowser | [inline, virtual]
IShellBrowserImpl::QueryInterface(REFIID iid, void **ppvObject) | IShellBrowserImpl | [virtual]
IComSrvBase< IShellFolderViewCB, ShellBrowser >::QueryInterface(REFIID riid, LPVOID *ppv) | IComSrvQI< IShellFolderViewCB > | [inline]
QueryService(REFGUID guidService, REFIID riid, void **ppvObject) | IShellBrowserImpl | [virtual]
QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) | IShellBrowserImpl | [virtual]
Release() | IShellBrowserImpl | [inline, virtual]
RemoveMenusSB(HMENU hmenuShared) | IShellBrowserImpl | [inline, virtual]
select_entry(HTREEITEM hitem, Entry *entry, bool expand=true) | ShellBrowser |
SendControlMsg(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret) | ShellBrowser | [inline, virtual]
SetMenuSB(HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject) | IShellBrowserImpl | [inline, virtual]
SetStatusTextSB(LPCOLESTR lpszStatusText) | IShellBrowserImpl | [inline, virtual]
SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags) | IShellBrowserImpl | [inline, virtual]
ShellBrowser(HWND hwnd, HWND left_hwnd, WindowHandle &right_hwnd, ShellPathInfo &create_info, BrowserCallback *cb, CtxMenuInterfaces &cm_ifs) | ShellBrowser |
STDMETHODIMP_(ULONG) AddRef() | IComSrvBase< IShellFolderViewCB, ShellBrowser > | [inline]
STDMETHODIMP_(ULONG) Release() | IComSrvBase< IShellFolderViewCB, ShellBrowser > | [inline]
super typedef | ShellBrowser | [protected]
TranslateAcceleratorSB(LPMSG lpmsg, WORD wID) | IShellBrowserImpl | [inline, virtual]
UpdateFolderView(IShellFolder *folder) | ShellBrowser |
~ComSrvObject() | ComSrvObject | [inline, protected, virtual]
~IComSrvQI() | IComSrvQI< IShellFolderViewCB > | [inline, protected, virtual]
~IShellBrowserImpl() | IShellBrowserImpl | [inline, virtual]
~ShellBrowser() | ShellBrowser | [virtual]


ROS Explorer: ShellBrowserChildT< BASE > Struct Template Reference

ShellBrowserChildT< BASE > Struct Template Reference

#include <shellbrowser.h>

Inheritance diagram for ShellBrowserChildT< BASE >:

[legend]
Collaboration diagram for ShellBrowserChildT< BASE >:

[legend]
List of all members.

Public Types

typedef BASE | super

Public Member Functions

ShellBrowserChildT (HWND hwnd)
ShellBrowserChildT (HWND hwnd, const ShellChildWndInfo &info)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Notify (int id, NMHDR *pnmh)

Protected Attributes

auto_ptr< ShellBrowser > | _shellBrowser

Detailed Description

template<typename BASE>
struct ShellBrowserChildT< BASE >

Definition at line 194 of file shellbrowser.h.

Member Typedef Documentation

template<typename BASE>
typedef BASE ShellBrowserChildT< BASE >::super

Reimplemented in SDIMainFrame, MDIShellBrowserChild, ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >, and ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >.

Definition at line 197 of file shellbrowser.h.

Constructor & Destructor Documentation

template<typename BASE>
ShellBrowserChildT< BASE >::ShellBrowserChildT ( HWND hwnd ) [inline]

Definition at line 200 of file shellbrowser.h.

00201          :      super(hwnd)
00202         {
00203         }

template<typename BASE>
ShellBrowserChildT< BASE >::ShellBrowserChildT | ( | HWND | hwnd,
 |  | const ShellChildWndInfo & | info
 | ) | [inline]

Definition at line 206 of file shellbrowser.h.

00207          :      super(hwnd, info)
00208         {
00209         }

Member Function Documentation

template<typename BASE>
int ShellBrowserChildT< BASE >::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [inline, protected]

Definition at line 230 of file shellbrowser.h.

00231         {
00232                 if (_shellBrowser.get())
00233                         switch(pnmh->code) {
00234                           case TVN_GETDISPINFO:         _shellBrowser->OnTreeGetDispInfo(id, pnmh);                                     break;
00235                           case TVN_SELCHANGED:          _shellBrowser->OnTreeItemSelected(id, (LPNMTREEVIEW)pnmh);      break;
00236                           case TVN_ITEMEXPANDING:       _shellBrowser->OnTreeItemExpanding(id, (LPNMTREEVIEW)pnmh);     break;
00237                           case NM_RCLICK:                       _shellBrowser->OnTreeItemRClick(id, pnmh);                                      break;
00238                           default:                                      return super::Notify(id, pnmh);
00239                         }
00240                 else
00241                         return super::Notify(id, pnmh);
00242
00243                 return 0;
00244         }

template<typename BASE>
LRESULT ShellBrowserChildT< BASE >::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [inline, protected]

Reimplemented in SDIMainFrame, MDIShellBrowserChild, ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >, and ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >.

Definition at line 214 of file shellbrowser.h.

00215         {
00216                 switch(nmsg) {
00217                   case PM_GET_SHELLBROWSER_PTR:
00218                         return (LRESULT)&*_shellBrowser;
00219
00220                   case WM_GETISHELLBROWSER:     // for Registry Explorer Plugin
00221                         return (LRESULT)static_cast<IShellBrowser*>(&*_shellBrowser);
00222
00223                   default:
00224                         return super::WndProc(nmsg, wparam, lparam);
00225                 }
00226
00227                 return 0;
00228         }

Member Data Documentation

template<typename BASE>
auto_ptr<ShellBrowser> ShellBrowserChildT< BASE >::_shellBrowser [protected]

Definition at line 212 of file shellbrowser.h.

The documentation for this struct was generated from the following file:
  • shellbrowser.h


ROS Explorer: Member List

ShellBrowserChildT< BASE > Member List

This is the complete list of members for ShellBrowserChildT< BASE >, including all inherited members.

_shellBrowser | ShellBrowserChildT< BASE > | [protected]
entry_selected(Entry *entry)=0 | BrowserCallback | [pure virtual]
Notify(int id, NMHDR *pnmh) | ShellBrowserChildT< BASE > | [inline, protected]
ShellBrowserChildT(HWND hwnd) | ShellBrowserChildT< BASE > | [inline]
ShellBrowserChildT(HWND hwnd, const ShellChildWndInfo &info) | ShellBrowserChildT< BASE > | [inline]
super typedef | ShellBrowserChildT< BASE > |
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | ShellBrowserChildT< BASE > | [inline, protected]
~BrowserCallback() | BrowserCallback | [inline, virtual]


ROS Explorer: ShellChildWndInfo Struct Reference

ShellChildWndInfo Struct Reference

information structure for creation of MDIShellBrowserChild More...

#include <filechild.h>

Inheritance diagram for ShellChildWndInfo:

[legend]
Collaboration diagram for ShellChildWndInfo:

[legend]
List of all members.

Public Types

typedef FileChildWndInfo super

Public Member Functions

ShellChildWndInfo (HWND hmdiclient, LPCTSTR path, const ShellPath &root_shell_path)

Public Attributes

ShellPath _shell_path
ShellPath _root_shell_path

Detailed Description

information structure for creation of MDIShellBrowserChild

Definition at line 44 of file filechild.h.

Member Typedef Documentation

typedef FileChildWndInfo ShellChildWndInfo::super

Reimplemented from FileChildWndInfo.

Definition at line 46 of file filechild.h.

Constructor & Destructor Documentation

ShellChildWndInfo::ShellChildWndInfo | ( | HWND | hmdiclient,
 |  | LPCTSTR | path,
 |  | const ShellPath & | root_shell_path
 | ) |

Definition at line 64 of file filechild.cpp.

00065  :      FileChildWndInfo(hmdiclient, path, ET_SHELL),
00066         _shell_path(path&&*path? path: root_shell_path),
00067         _root_shell_path(root_shell_path)
00068 {
00069 }

Member Data Documentation

ShellPath ShellChildWndInfo::_root_shell_path

Definition at line 51 of file filechild.h.

ShellPath ShellChildWndInfo::_shell_path

Definition at line 50 of file filechild.h.

Referenced by FileChildWindow::FileChildWindow(), and MDIShellBrowserChild::Init().

The documentation for this struct was generated from the following files:
  • filechild.h
  • filechild.cpp


ROS Explorer: Member List

ShellChildWndInfo Member List

This is the complete list of members for ShellChildWndInfo, including all inherited members.

_etype | FileChildWndInfo |
_hmdiclient | ChildWndInfo |
_open_mode | FileChildWndInfo |
_path | FileChildWndInfo |
_pos | FileChildWndInfo |
_root_shell_path | ShellChildWndInfo |
_shell_path | ShellChildWndInfo |
ChildWndInfo(HWND hmdiclient) | ChildWndInfo | [inline]
FileChildWndInfo(HWND hmdiclient, LPCTSTR path, ENTRY_TYPE etype=ET_UNKNOWN) | FileChildWndInfo |
ShellChildWndInfo(HWND hmdiclient, LPCTSTR path, const ShellPath &root_shell_path) | ShellChildWndInfo |
super typedef | ShellChildWndInfo |


ROS Explorer: ShellDirectory Struct Reference

ShellDirectory Struct Reference

shell folder entry More...

#include <shellfs.h>

Inheritance diagram for ShellDirectory:

[legend]
Collaboration diagram for ShellDirectory:

[legend]
List of all members.

Public Member Functions

ShellDirectory (ShellFolder &root_folder, const ShellPath &shell_path, HWND hwnd)
ShellDirectory (ShellDirectory *parent, LPITEMIDLIST shell_path, HWND hwnd)
ShellDirectory (const ShellDirectory &other)
~ShellDirectory ()
virtual void | read_directory (int scan_flags=SCAN_ALL)
virtual const void * | get_next_path_component (const void *) const
virtual Entry * | find_entry (const void *)
virtual bool | get_path (PTSTR path, size_t path_count) const
int | extract_icons (ICONCACHE_FLAGS flags)

Public Attributes

ShellFolder _folder
HWND _hwnd

Protected Member Functions

bool | fill_w32fdata_shell (LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA *, BY_HANDLE_FILE_INFORMATION *, bool do_access=true)

Detailed Description

shell folder entry

Definition at line 52 of file shellfs.h.

Constructor & Destructor Documentation

ShellDirectory::ShellDirectory | ( | ShellFolder & | root_folder,
 |  | const ShellPath & | shell_path,
 |  | HWND | hwnd
 | ) | [inline]

Definition at line 54 of file shellfs.h.

References Entry::_data, Directory::_path, Entry::_shell_attribs, CONTEXT, and ShellFolder::get_name().

Referenced by read_directory().

00055          :      ShellEntry(shell_path),
00056                 _folder(root_folder, shell_path),
00057                 _hwnd(hwnd)
00058         {
00059                 CONTEXT("ShellDirectory::ShellDirectory()");
00060
00061                 lstrcpy(_data.cFileName, root_folder.get_name(shell_path, SHGDN_FORADDRESSBAR));
00062                 _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
00063                 _shell_attribs = SFGAO_FOLDER;
00064
00065                 ShellFolder subfolder(root_folder, shell_path);
00066                 IShellFolder* pFolder = subfolder;
00067                 pFolder->AddRef();
00068                 _path = pFolder;
00069         }

Here is the call graph for this function:

ShellDirectory::ShellDirectory | ( | ShellDirectory * | parent,
 |  | LPITEMIDLIST | shell_path,
 |  | HWND | hwnd
 | ) | [inline, explicit]

Definition at line 71 of file shellfs.h.

References _folder, and Directory::_path.

00072          :      ShellEntry(parent, shell_path),
00073                 _folder(parent->_folder, shell_path),
00074                 _hwnd(hwnd)
00075         {
00076                 /* not neccessary - the caller will fill the info
00077                 lstrcpy(_data.cFileName, _folder.get_name(shell_path));
00078                 _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
00079                 _shell_attribs = SFGAO_FOLDER; */
00080
00081                 _folder->AddRef();
00082                 _path = _folder;
00083         }

ShellDirectory::ShellDirectory ( const ShellDirectory & other ) [inline]

Definition at line 85 of file shellfs.h.

References Directory::_path.

00086          :      ShellEntry(other),
00087                 Directory(other),
00088                 _folder(other._folder),
00089                 _hwnd(other._hwnd)
00090         {
00091                 IShellFolder* pFolder = (IShellFolder*)_path;
00092                 pFolder->AddRef();
00093         }

ShellDirectory::~ShellDirectory ( ) [inline]

Definition at line 95 of file shellfs.h.

References Directory::_path.

00096         {
00097                 IShellFolder* pFolder = (IShellFolder*)_path;
00098                 _path = NULL;
00099                 pFolder->Release();
00100         }

Member Function Documentation

int ShellDirectory::extract_icons ( ICONCACHE_FLAGS flags )

Definition at line 483 of file shellfs.cpp.

References Entry::_down, Entry::_icon_id, Entry::_next, Entry::extract_icon(), ICID_NONE, and ICID_UNKNOWN.

00484 {
00485         int cnt = 0;
00486
00487         for(Entry*entry=_down; entry; entry=entry->_next)
00488                 if (entry->_icon_id == ICID_UNKNOWN) {
00489                         entry->_icon_id = entry->extract_icon(flags);
00490
00491                         if (entry->_icon_id != ICID_NONE)
00492                                 ++cnt;
00493                 }
00494
00495         return cnt;
00496 }

Here is the call graph for this function:

bool ShellDirectory::fill_w32fdata_shell | ( | LPCITEMIDLIST | pidl,
 |  | SFGAOF | attribs,
 |  | WIN32_FIND_DATA * | ,
 |  | BY_HANDLE_FILE_INFORMATION * | ,
 |  | bool | do_access = true
 | ) | [protected]

Definition at line 37 of file shellfs.cpp.

References ExplorerGlobals::_cfStrFName, _folder, CONTEXT, and g_Globals.

Referenced by read_directory().

00038 {
00039         CONTEXT("ShellDirectory::fill_w32fdata_shell()");
00040
00041         bool bhfi_valid = false;
00042
00043         if (do_access && !( (attribs&SFGAO_FILESYSTEM) && SUCCEEDED(
00044                                 SHGetDataFromIDList(_folder, pidl, SHGDFIL_FINDDATA, pw32fdata, sizeof(WIN32_FIND_DATA))) )) {
00045                 WIN32_FILE_ATTRIBUTE_DATA fad;
00046                 IDataObject* pDataObj;
00047
00048                 STGMEDIUM medium = {0, {0}, 0};
00049                 FORMATETC fmt = {g_Globals._cfStrFName, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
00050
00051                 HRESULT hr = _folder->GetUIObjectOf(0, 1, &pidl, IID_IDataObject, 0, (LPVOID*)&pDataObj);
00052
00053                 if (SUCCEEDED(hr)) {
00054                         hr = pDataObj->GetData(&fmt, &medium);
00055
00056                         pDataObj->Release();
00057
00058                         if (SUCCEEDED(hr)) {
00059                                 LPCTSTR path = (LPCTSTR)GlobalLock(medium.UNION_MEMBER(hGlobal));
00060
00061                                 if (path) {
00062                                          // fill with drive names "C:", ...
00063                                         assert(_tcslen(path) < GlobalSize(medium.UNION_MEMBER(hGlobal)));
00064                                         _tcscpy(pw32fdata->cFileName, path);
00065
00066                                         UINT sem_org = SetErrorMode(SEM_FAILCRITICALERRORS);
00067
00068                                         if (GetFileAttributesEx(path, GetFileExInfoStandard, &fad)) {
00069                                                 pw32fdata->dwFileAttributes = fad.dwFileAttributes;
00070                                                 pw32fdata->ftCreationTime = fad.ftCreationTime;
00071                                                 pw32fdata->ftLastAccessTime = fad.ftLastAccessTime;
00072                                                 pw32fdata->ftLastWriteTime = fad.ftLastWriteTime;
00073
00074                                                 if (!(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
00075                                                         pw32fdata->nFileSizeLow = fad.nFileSizeLow;
00076                                                         pw32fdata->nFileSizeHigh = fad.nFileSizeHigh;
00077                                                 }
00078                                         }
00079
00080                                         HANDLE hFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
00081                                                                                                 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
00082
00083                                         if (hFile != INVALID_HANDLE_VALUE) {
00084                                                 if (GetFileInformationByHandle(hFile, pbhfi))
00085                                                         bhfi_valid = true;
00086
00087                                                 CloseHandle(hFile);
00088                                         }
00089
00090                                         SetErrorMode(sem_org);
00091
00092                                         GlobalUnlock(medium.UNION_MEMBER(hGlobal));
00093                                         GlobalFree(medium.UNION_MEMBER(hGlobal));
00094                                 }
00095                         }
00096                 }
00097         }
00098
00099         if (!do_access || !(attribs&SFGAO_FILESYSTEM))  // Archiv files should not be displayed as folders in explorer view.
00100                 if (attribs & (SFGAO_FOLDER|SFGAO_HASSUBFOLDER))
00101                         pw32fdata->dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
00102
00103         if (attribs & SFGAO_READONLY)
00104                 pw32fdata->dwFileAttributes |= FILE_ATTRIBUTE_READONLY;
00105
00106         if (attribs & SFGAO_COMPRESSED)
00107                 pw32fdata->dwFileAttributes |= FILE_ATTRIBUTE_COMPRESSED;
00108
00109         return bhfi_valid;
00110 }

Entry * ShellDirectory::find_entry ( const void * ) [virtual]

Reimplemented from Entry.

Definition at line 464 of file shellfs.cpp.

References Entry::_down, Entry::_etype, Entry::_next, ShellEntry::_pidl, and ET_SHELL.

Referenced by ShellBrowser::OnDefaultCommand().

00465 {
00466         LPITEMIDLIST pidl = (LPITEMIDLIST) p;
00467
00468          // handle special case of empty trailing id list entry
00469         if (!pidl->mkid.cb)
00470                 return this;
00471
00472         for(Entry*entry=_down; entry; entry=entry->_next)
00473                 if (entry->_etype == ET_SHELL) {
00474                         ShellEntry* se = static_cast<ShellEntry*>(entry);
00475
00476                         if (se->_pidl && se->_pidl->mkid.cb==pidl->mkid.cb && !memcmp(se->_pidl, pidl, se->_pidl->mkid.cb))
00477                                 return entry;
00478                 }
00479
00480         return NULL;
00481 }

const void * ShellDirectory::get_next_path_component ( const void * ) const [virtual]

Reimplemented from Entry.

Definition at line 451 of file shellfs.cpp.

00452 {
00453         LPITEMIDLIST pidl = (LPITEMIDLIST)p;
00454
00455         if (!pidl || !pidl->mkid.cb)
00456                 return NULL;
00457
00458          // go to next element
00459         pidl = (LPITEMIDLIST)((LPBYTE)pidl+pidl->mkid.cb);
00460
00461         return pidl;
00462 }

bool ShellDirectory::get_path | ( | PTSTR | path,
 |  | size_t | path_count
 | ) | const [virtual]

Reimplemented from ShellEntry.

Definition at line 153 of file shellfs.cpp.

References _folder, ShellEntry::_pidl, CONTEXT, SIfacePtr< T >::empty(), ShellEntry::get_parent_folder(), and path_from_pidl.

Referenced by StartMenu::AddShellEntries(), and read_directory().

00154 {
00155         CONTEXT("ShellDirectory::get_path()");
00156
00157         if (!path || path_count==0)
00158                 return false;
00159
00160         path[0] = TEXT('\0');
00161
00162         if (_folder.empty())
00163                 return false;
00164
00165         SFGAOF attribs = SFGAO_FILESYSTEM;
00166
00167         if (FAILED(const_cast<ShellFolder&>(_folder)->GetAttributesOf(1, (LPCITEMIDLIST*)&_pidl, &attribs)))
00168                 return false;
00169
00170         if (!(attribs & SFGAO_FILESYSTEM))
00171                 return false;
00172
00173         if (FAILED(path_from_pidl(get_parent_folder(), &*_pidl, path, path_count)))
00174                 return false;
00175
00176         return true;
00177 }

Here is the call graph for this function:

void ShellDirectory::read_directory ( int scan_flags = SCAN_ALL ) [virtual]

Reimplemented from Entry.

Definition at line 231 of file shellfs.cpp.

References Entry::_bhfi, Entry::_bhfi_valid, Entry::_data, Entry::_display_name, _folder, ExplorerGlobals::_ftype_mgr, _hwnd, Entry::_icon_id, Entry::_level, Entry::_next, Entry::_scanned, Entry::_shell_attribs, ATTRIBUTE_SYMBOLIC_LINK, CONTEXT, COUNTOF, FETCH_ITEM_COUNT, fill_w32fdata_shell(), g_Globals, get_path(), HandleException(), ICID_FOLDER, ICID_NONE, name_from_pidl(), SCAN_DO_ACCESS, SCAN_FILESYSTEM, ScanNTFSStreams(), FileTypeManager::set_type(), ShellDirectory(), and ShellEntry::ShellEntry().

00232 {
00233         CONTEXT("ShellDirectory::read_directory()");
00234
00235         int level = _level + 1;
00236
00237         Entry* first_entry = NULL;
00238         Entry* last = NULL;
00239
00240         /*if (_folder.empty())
00241                 return;*/
00242
00243         TCHAR buffer[MAX_PATH];
00244
00245         if ((scan_flags&SCAN_FILESYSTEM) && get_path(buffer, COUNTOF(buffer)) && _tcsncmp(buffer,TEXT("::{"),3)) {
00246                 Entry* entry = NULL;    // eliminate useless GCC warning by initializing entry
00247
00248                 LPTSTR p = buffer + _tcslen(buffer);
00249
00250                 // TODO FIXME - this can overflow
00251                 lstrcpy(p, TEXT("\\*"));
00252
00253                 WIN32_FIND_DATA w32fd;
00254                 HANDLE hFind = FindFirstFile(buffer, &w32fd);
00255
00256                 if (hFind != INVALID_HANDLE_VALUE) {
00257                         do {
00258                                  // ignore hidden files (usefull in the start menu)
00259                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
00260                                         continue;
00261
00262                                  // ignore directory entries "." and ".."
00263                                 if ((w32fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) &&
00264                                         w32fd.cFileName[0]==TEXT('.') &&
00265                                         (w32fd.cFileName[1]==TEXT('\0') ||
00266                                         (w32fd.cFileName[1]==TEXT('.') && w32fd.cFileName[2]==TEXT('\0'))))
00267                                         continue;
00268
00269                                 lstrcpy(p+1, w32fd.cFileName);
00270
00271                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00272                                         entry = new WinDirectory(this, buffer);
00273                                 else
00274                                         entry = new WinEntry(this);
00275
00276                                 if (!first_entry)
00277                                         first_entry = entry;
00278
00279                                 if (last)
00280                                         last->_next = entry;
00281
00282                                 memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00283
00284                                 entry->_level = level;
00285
00286                                 if (scan_flags & SCAN_DO_ACCESS) {
00287                                         HANDLE hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
00288                                                                                                 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
00289
00290                                         if (hFile != INVALID_HANDLE_VALUE) {
00291                                                 if (GetFileInformationByHandle(hFile, &entry->_bhfi))
00292                                                         entry->_bhfi_valid = true;
00293
00294                                                 if (ScanNTFSStreams(entry, hFile))
00295                                                         entry->_scanned = true; // There exist named NTFS sub-streams in this file.
00296
00297                                                 CloseHandle(hFile);
00298                                         }
00299                                 }
00300
00301                                  // set file type name
00302                                 LPCTSTR ext = g_Globals._ftype_mgr.set_type(entry);
00303
00304                                 DWORD attribs = SFGAO_FILESYSTEM;
00305
00306                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00307                                         attribs |= SFGAO_FOLDER;
00308
00309                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
00310                                         attribs |= SFGAO_READONLY;
00311
00312                                 //if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
00313                                 //      attribs |= SFGAO_HIDDEN;
00314
00315                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_COMPRESSED)
00316                                         attribs |= SFGAO_COMPRESSED;
00317
00318                                 if (ext && !_tcsicmp(ext, _T(".lnk"))) {
00319                                         attribs |= SFGAO_LINK;
00320                                         w32fd.dwFileAttributes |= ATTRIBUTE_SYMBOLIC_LINK;
00321                                 }
00322
00323                                 entry->_shell_attribs = attribs;
00324
00325                                 if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00326                                         entry->_icon_id = ICID_FOLDER;
00327 /*                              else if (scan_flags & SCAN_EXTRACT_ICONS)
00328                                         entry->safe_extract_icon(large_icons);
00329 */
00330                                 last = entry;
00331                         } while(FindNextFile(hFind, &w32fd));
00332
00333                         FindClose(hFind);
00334                 }
00335
00336         } else { // !SCAN_FILESYSTEM
00337
00338                 ShellItemEnumerator enumerator(_folder, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE);
00339
00340                 TCHAR name[MAX_PATH];
00341                 HRESULT hr_next = S_OK;
00342
00343                 do {
00344 #define FETCH_ITEM_COUNT        32
00345                         LPITEMIDLIST pidls[FETCH_ITEM_COUNT];
00346                         ULONG cnt = 0;
00347
00348                         memset(pidls, 0, sizeof(pidls));
00349
00350                         hr_next = enumerator->Next(FETCH_ITEM_COUNT, pidls, &cnt);
00351
00352                         /* don't break yet now: Registry Explorer Plugin returns E_FAIL!
00353                         if (!SUCCEEDED(hr_next))
00354                                 break; */
00355
00356                         if (hr_next == S_FALSE)
00357                                 break;
00358
00359                         for(ULONG n=0; n<cnt; ++n) {
00360                                 WIN32_FIND_DATA w32fd;
00361                                 BY_HANDLE_FILE_INFORMATION bhfi;
00362                                 bool bhfi_valid = false;
00363
00364                                 memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
00365
00366                                 SFGAOF attribs_before = ~SFGAO_READONLY & ~SFGAO_VALIDATE;
00367                                 SFGAOF attribs = attribs_before;
00368                                 HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs);
00369                                 bool removeable = false;
00370
00371                                 if (SUCCEEDED(hr) && attribs!=attribs_before) {
00372                                          // avoid accessing floppy drives when browsing "My Computer"
00373                                         if (attribs & SFGAO_REMOVABLE) {
00374                                                 attribs |= SFGAO_HASSUBFOLDER;
00375                                                 removeable = true;
00376                                         } else if (scan_flags & SCAN_DO_ACCESS) {
00377                                                 DWORD attribs2 = SFGAO_READONLY;
00378
00379                                                 HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs2);
00380
00381                                                 if (SUCCEEDED(hr))
00382                                                         attribs |= attribs2;
00383                                         }
00384                                 } else
00385                                         attribs = 0;
00386
00387                                 bhfi_valid = fill_w32fdata_shell(pidls[n], attribs, &w32fd, &bhfi,
00388                                                                                                  (scan_flags&SCAN_DO_ACCESS) && !removeable);
00389
00390                                 try {
00391                                         Entry* entry = NULL;    // eliminate useless GCC warning by initializing entry
00392
00393                                         if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00394                                                 entry = new ShellDirectory(this, pidls[n], _hwnd);
00395                                         else
00396                                                 entry = new ShellEntry(this, pidls[n]);
00397
00398                                         if (!first_entry)
00399                                                 first_entry = entry;
00400
00401                                         if (last)
00402                                                 last->_next = entry;
00403
00404                                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00405
00406                                         if (bhfi_valid)
00407                                                 memcpy(&entry->_bhfi, &bhfi, sizeof(BY_HANDLE_FILE_INFORMATION));
00408
00409                                         if (SUCCEEDED(name_from_pidl(_folder, pidls[n], name, COUNTOF(name), SHGDN_INFOLDER|0x2000/*0x2000=SHGDN_INCLUDE_NONFILESYS*/))) {
00410                                                 if (!entry->_data.cFileName[0])
00411                                                         _tcscpy(entry->_data.cFileName, name);
00412                                                 else if (_tcscmp(entry->_display_name, name))
00413                                                         entry->_display_name = _tcsdup(name);   // store display name separate from file name; sort display by file name
00414                                         }
00415
00416                                         if (attribs & SFGAO_LINK)
00417                                                 w32fd.dwFileAttributes |= ATTRIBUTE_SYMBOLIC_LINK;
00418
00419                                         entry->_level = level;
00420                                         entry->_shell_attribs = attribs;
00421                                         entry->_bhfi_valid = bhfi_valid;
00422
00423                                          // set file type name
00424                                         g_Globals._ftype_mgr.set_type(entry);
00425
00426                                          // get icons for files and virtual objects
00427                                         if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
00428                                                 !(attribs & SFGAO_FILESYSTEM)) {
00429 /*                                              if (scan_flags & SCAN_EXTRACT_ICONS)
00430                                                         entry->extract_icon(large_icons);
00431 */                                      } else if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00432                                                 entry->_icon_id = ICID_FOLDER;
00433                                         else
00434                                                 entry->_icon_id = ICID_NONE;    // don't try again later
00435
00436                                         last = entry;
00437                                 } catch(COMException& e) {
00438                                         HandleException(e, _hwnd);
00439                                 }
00440                         }
00441                 } while(SUCCEEDED(hr_next));
00442         }
00443
00444         if (last)
00445                 last->_next = NULL;
00446
00447         _down = first_entry;
00448         _scanned = true;
00449 }

Here is the call graph for this function:

Member Data Documentation

ShellFolder ShellDirectory::_folder

Definition at line 110 of file shellfs.h.

Referenced by ShellEntry::do_context_menu(), fill_w32fdata_shell(), get_path(), BookmarkList::import_IE_favorites(), ShellBrowser::OnTreeItemExpanding(), read_directory(), and ShellDirectory().

HWND ShellDirectory::_hwnd

Definition at line 111 of file shellfs.h.

Referenced by read_directory().

The documentation for this struct was generated from the following files:
  • shellfs.h
  • shellfs.cpp


ROS Explorer: Member List

ShellDirectory Member List

This is the complete list of members for ShellDirectory, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_folder | ShellDirectory |
_hwnd | ShellDirectory |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_path | Directory | [protected]
_pidl | ShellEntry |
_scanned | Entry |
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | ShellEntry | [virtual]
Directory() | Directory | [inline, protected]
do_context_menu(HWND hwnd, LPPOINT pptScreen, CtxMenuInterfaces &cm_ifs) | ShellEntry | [virtual]
Entry::do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
extract_icons(ICONCACHE_FLAGS flags) | ShellDirectory |
fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA *, BY_HANDLE_FILE_INFORMATION *, bool do_access=true) | ShellDirectory | [protected]
find_entry(const void *) | ShellDirectory | [virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | ShellDirectory | [virtual]
get_parent_folder() const | ShellEntry | [inline]
get_path(PTSTR path, size_t path_count) const | ShellDirectory | [virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | ShellEntry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL) | ShellEntry | [virtual]
read_directory(int scan_flags=SCAN_ALL) | ShellDirectory | [virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
ShellDirectory(ShellFolder &root_folder, const ShellPath &shell_path, HWND hwnd) | ShellDirectory | [inline]
ShellDirectory(ShellDirectory *parent, LPITEMIDLIST shell_path, HWND hwnd) | ShellDirectory | [inline, explicit]
ShellDirectory(const ShellDirectory &other) | ShellDirectory | [inline]
ShellEntry(Entry *parent, LPITEMIDLIST shell_path) | ShellEntry | [inline]
ShellEntry(Entry *parent, const ShellPath &shell_path) | ShellEntry | [inline]
ShellEntry(LPITEMIDLIST shell_path) | ShellEntry | [inline, protected]
ShellEntry(const ShellPath &shell_path) | ShellEntry | [inline, protected]
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Directory() | Directory | [inline, protected, virtual]
~Entry() | Entry | [virtual]
~ShellDirectory() | ShellDirectory | [inline]


ROS Explorer: ShellEntry Struct Reference

ShellEntry Struct Reference

shell file/directory entry More...

#include <shellfs.h>

Inheritance diagram for ShellEntry:

[legend]
Collaboration diagram for ShellEntry:

[legend]
List of all members.

Public Member Functions

ShellEntry (Entry *parent, LPITEMIDLIST shell_path)
ShellEntry (Entry *parent, const ShellPath &shell_path)
virtual bool | get_path (PTSTR path, size_t path_count) const
virtual ShellPath | create_absolute_pidl () const
virtual HRESULT | GetUIObjectOf (HWND hWnd, REFIID riid, LPVOID *ppvOut)
virtual BOOL | launch_entry (HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL)
virtual HRESULT | do_context_menu (HWND hwnd, LPPOINT pptScreen, CtxMenuInterfaces &cm_ifs)
IShellFolder * | get_parent_folder () const

Public Attributes

ShellPath _pidl

Protected Member Functions

ShellEntry (LPITEMIDLIST shell_path)
ShellEntry (const ShellPath &shell_path)

Detailed Description

shell file/directory entry

Definition at line 30 of file shellfs.h.

Constructor & Destructor Documentation

ShellEntry::ShellEntry | ( | Entry * | parent,
 |  | LPITEMIDLIST | shell_path
 | ) | [inline]

Definition at line 32 of file shellfs.h.

Referenced by ShellDirectory::read_directory().

00032 : Entry(parent, ET_SHELL), _pidl(shell_path) {}

ShellEntry::ShellEntry | ( | Entry * | parent,
 |  | const ShellPath & | shell_path
 | ) | [inline]

Definition at line 33 of file shellfs.h.

00033 : Entry(parent, ET_SHELL), _pidl(shell_path) {}

ShellEntry::ShellEntry ( LPITEMIDLIST shell_path ) [inline, protected]

Definition at line 46 of file shellfs.h.

00046 : Entry(ET_SHELL), _pidl(shell_path) {}

ShellEntry::ShellEntry ( const ShellPath & shell_path ) [inline, protected]

Definition at line 47 of file shellfs.h.

00047 : Entry(ET_SHELL), _pidl(shell_path) {}

Member Function Documentation

ShellPath ShellEntry::create_absolute_pidl ( ) const [virtual]

Reimplemented from Entry.

Definition at line 113 of file shellfs.cpp.

References Entry::_etype, _pidl, Entry::_up, CONTEXT, Entry::create_absolute_pidl(), create_absolute_pidl(), ShellPath::create_absolute_pidl(), and ET_SHELL.

Referenced by create_absolute_pidl(), get_path(), and launch_entry().

00114 {
00115         CONTEXT("ShellEntry::create_absolute_pidl()");
00116
00117         if (_up)
00118                 if (_up->_etype == ET_SHELL) {
00119                         ShellDirectory* dir = static_cast<ShellDirectory*>(_up);
00120
00121                         if (dir->_pidl->mkid.cb)        // Caching of absolute PIDLs could enhance performance.
00122                                 return _pidl.create_absolute_pidl(dir->create_absolute_pidl());
00123                 } else
00124                         return _pidl.create_absolute_pidl(_up->create_absolute_pidl());
00125
00126         return _pidl;
00127 }

Here is the call graph for this function:

HRESULT ShellEntry::do_context_menu | ( | HWND | hwnd,
 |  | LPPOINT | pptScreen,
 |  | CtxMenuInterfaces & | cm_ifs
 | ) | [virtual]

Definition at line 212 of file shellfs.cpp.

References ShellDirectory::_folder, _pidl, Entry::_up, GetDesktopFolder(), and ShellFolderContextMenu().

00213 {
00214         ShellDirectory* dir = static_cast<ShellDirectory*>(_up);
00215
00216         ShellFolder folder = dir? dir->_folder: GetDesktopFolder();
00217         LPCITEMIDLIST pidl = _pidl;
00218
00219         return ShellFolderContextMenu(folder, hwnd, 1, &pidl, pptScreen->x, pptScreen->y, cm_ifs);
00220 }

Here is the call graph for this function:

IShellFolder * ShellEntry::get_parent_folder ( ) const [inline]

Definition at line 118 of file shellfs.h.

References Entry::_up, and GetDesktopFolder().

Referenced by MDIShellBrowserChild::entry_selected(), SDIMainFrame::entry_selected(), ShellDirectory::get_path(), and GetUIObjectOf().

00119 {
00120         if (_up)
00121                 return static_cast<ShellDirectory*>(_up)->_folder;
00122         else
00123                 return GetDesktopFolder();
00124 }

Here is the call graph for this function:

bool ShellEntry::get_path | ( | PTSTR | path,
 |  | size_t | path_count
 | ) | const [virtual]

Implements Entry.

Reimplemented in ShellDirectory.

Definition at line 131 of file shellfs.cpp.

References create_absolute_pidl().

Referenced by MDIShellBrowserChild::entry_selected(), and SDIMainFrame::entry_selected().

00132 {
00133         if (!path || path_count==0)
00134                 return false;
00135 /*
00136         path[0] = TEXT('\0');
00137
00138         if (FAILED(path_from_pidl(get_parent_folder(), &*_pidl, path, path_count)))
00139                 return false;
00140 */
00141         FileSysShellPath fs_path(create_absolute_pidl());
00142         LPCTSTR ret = fs_path;
00143
00144         if (ret) {
00145                 lstrcpyn(path, ret, path_count);
00146                 return true;
00147         } else
00148                 return false;
00149 }

Here is the call graph for this function:

HRESULT ShellEntry::GetUIObjectOf | ( | HWND | hWnd,
 |  | REFIID | riid,
 |  | LPVOID * | ppvOut
 | ) | [virtual]

Reimplemented from Entry.

Definition at line 223 of file shellfs.cpp.

References _pidl, and get_parent_folder().

00224 {
00225         LPCITEMIDLIST pidl = _pidl;
00226
00227         return get_parent_folder()->GetUIObjectOf(hWnd, 1, &pidl, riid, NULL, ppvOut);
00228 }

Here is the call graph for this function:

BOOL ShellEntry::launch_entry | ( | HWND | hwnd,
 |  | UINT | nCmdShow = SW_SHOWNORMAL
 | ) | [virtual]

Reimplemented from Entry.

Definition at line 180 of file shellfs.cpp.

References CONTEXT, create_absolute_pidl(), and display_error().

00181 {
00182         CONTEXT("ShellEntry::launch_entry()");
00183
00184         SHELLEXECUTEINFO shexinfo;
00185
00186         shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
00187         shexinfo.fMask = SEE_MASK_INVOKEIDLIST; // SEE_MASK_IDLIST is also possible.
00188         shexinfo.hwnd = hwnd;
00189         shexinfo.lpVerb = NULL;
00190         shexinfo.lpFile = NULL;
00191         shexinfo.lpParameters = NULL;
00192         shexinfo.lpDirectory = NULL;
00193         shexinfo.nShow = nCmdShow;
00194
00195         ShellPath shell_path = create_absolute_pidl();
00196         shexinfo.lpIDList = &*shell_path;
00197
00198          // add PIDL to the recent file list
00199         SHAddToRecentDocs(SHARD_PIDL, shexinfo.lpIDList);
00200
00201         BOOL ret = TRUE;
00202
00203         if (!ShellExecuteEx(&shexinfo)) {
00204                 display_error(hwnd, GetLastError());
00205                 ret = FALSE;
00206         }
00207
00208         return ret;
00209 }

Here is the call graph for this function:

Member Data Documentation

ShellPath ShellEntry::_pidl

Definition at line 43 of file shellfs.h.

Referenced by StartMenu::AddEntry(), create_absolute_pidl(), do_context_menu(), ShellDirectory::find_entry(), ShellDirectory::get_path(), and GetUIObjectOf().

The documentation for this struct was generated from the following files:
  • shellfs.h
  • shellfs.cpp


ROS Explorer: Member List

ShellEntry Member List

This is the complete list of members for ShellEntry, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_pidl | ShellEntry |
_scanned | Entry |
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | ShellEntry | [virtual]
do_context_menu(HWND hwnd, LPPOINT pptScreen, CtxMenuInterfaces &cm_ifs) | ShellEntry | [virtual]
Entry::do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
find_entry(const void *) | Entry | [inline, virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | Entry | [inline, virtual]
get_parent_folder() const | ShellEntry | [inline]
get_path(PTSTR path, size_t path_count) const | ShellEntry | [virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | ShellEntry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL) | ShellEntry | [virtual]
read_directory(int scan_flags=SCAN_ALL) | Entry | [inline, virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
ShellEntry(Entry *parent, LPITEMIDLIST shell_path) | ShellEntry | [inline]
ShellEntry(Entry *parent, const ShellPath &shell_path) | ShellEntry | [inline]
ShellEntry(LPITEMIDLIST shell_path) | ShellEntry | [inline, protected]
ShellEntry(const ShellPath &shell_path) | ShellEntry | [inline, protected]
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
~Entry() | Entry | [virtual]


ROS Explorer: ShellFolder Struct Reference

ShellFolder Struct Reference

IShellFolder smart pointer. More...

#include <shellclasses.h>

Inheritance diagram for ShellFolder:

[legend]
Collaboration diagram for ShellFolder:

[legend]
List of all members.

Public Types

typedef SIfacePtr< IShellFolder > | super

Public Member Functions

ShellFolder ()
ShellFolder (IShellFolder *p)
ShellFolder (IShellFolder *parent, LPCITEMIDLIST pidl)
ShellFolder (LPCITEMIDLIST pidl)
void | attach (IShellFolder *parent, LPCITEMIDLIST pidl)
String | get_name (LPCITEMIDLIST pidl, SHGDNF flags=SHGDN_NORMAL) const

Detailed Description

IShellFolder smart pointer.

Definition at line 593 of file shellclasses.h.

Member Typedef Documentation

typedef SIfacePtr<IShellFolder> ShellFolder::super

Definition at line 595 of file shellclasses.h.

Constructor & Destructor Documentation

ShellFolder::ShellFolder ( )

Definition at line 261 of file shellclasses.cpp.

References SIfacePtr< IShellFolder >::_p, CHECKERROR, and CONTEXT.

00262 {
00263         CONTEXT("ShellFolder::ShellFolder()");
00264
00265         CHECKERROR(SHGetDesktopFolder(&_p));
00266
00267         _p->AddRef();
00268 }

ShellFolder::ShellFolder ( IShellFolder * p )

Definition at line 270 of file shellclasses.cpp.

References SIfacePtr< IShellFolder >::_p, and CONTEXT.

00271  :      super(p)
00272 {
00273         CONTEXT("ShellFolder::ShellFolder(IShellFolder*)");
00274
00275         _p->AddRef();
00276 }

ShellFolder::ShellFolder | ( | IShellFolder * | parent,
 |  | LPCITEMIDLIST | pidl
 | ) |

Definition at line 278 of file shellclasses.cpp.

References SIfacePtr< IShellFolder >::_p, CHECKERROR, CONTEXT, and GetDesktopFolder().

00279 {
00280         CONTEXT("ShellFolder::ShellFolder(IShellFolder*, LPCITEMIDLIST)");
00281
00282         if (pidl && pidl->mkid.cb)
00283                 CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&_p));
00284         else
00285                 _p = GetDesktopFolder();
00286
00287         _p->AddRef();
00288 }

Here is the call graph for this function:

ShellFolder::ShellFolder ( LPCITEMIDLIST pidl )

Definition at line 290 of file shellclasses.cpp.

References SIfacePtr< IShellFolder >::_p, CHECKERROR, CONTEXT, and GetDesktopFolder().

00291 {
00292         CONTEXT("ShellFolder::ShellFolder(LPCITEMIDLIST)");
00293
00294         if (pidl && pidl->mkid.cb)
00295                 CHECKERROR(GetDesktopFolder()->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&_p));
00296         else
00297                 _p = GetDesktopFolder();
00298
00299         _p->AddRef();
00300 }

Here is the call graph for this function:

Member Function Documentation

void ShellFolder::attach | ( | IShellFolder * | parent,
 |  | LPCITEMIDLIST | pidl
 | ) |

Definition at line 302 of file shellclasses.cpp.

References SIfacePtr< IShellFolder >::_p, CHECKERROR, and CONTEXT.

00303 {
00304         CONTEXT("ShellFolder::ShellFolder(IShellFolder*, LPCITEMIDLIST)");
00305
00306         IShellFolder* h = _p;
00307
00308         CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&_p));
00309
00310         _p->AddRef();
00311         h->Release();
00312 }

String ShellFolder::get_name | ( | LPCITEMIDLIST | pidl,
 |  | SHGDNF | flags = SHGDN_NORMAL
 | ) | const

Definition at line 316 of file shellclasses.cpp.

References CHECKERROR, CONTEXT, COUNTOF, and StrRet.

Referenced by StartMenu::AddEntry(), BookmarkList::import_IE_favorites(), ShellBrowser::Init(), and ShellDirectory::ShellDirectory().

00317 {
00318         CONTEXT("ShellFolder::get_name()");
00319
00320         TCHAR buffer[MAX_PATH];
00321         StrRet strret;
00322
00323         HRESULT hr = ((IShellFolder*)*const_cast<ShellFolder*>(this))->GetDisplayNameOf(pidl, flags, &strret);
00324
00325         if (hr == S_OK)
00326                 strret.GetString(pidl->mkid, buffer, COUNTOF(buffer));
00327         else {
00328                 CHECKERROR(hr);
00329                 *buffer = TEXT('\0');
00330         }
00331
00332         return buffer;
00333 }

The documentation for this struct was generated from the following files:
  • shellclasses.h
  • shellclasses.cpp


ROS Explorer: Member List

ShellFolder Member List

This is the complete list of members for ShellFolder, including all inherited members.

_p | SIfacePtr< IShellFolder > | [protected]
attach(IShellFolder *parent, LPCITEMIDLIST pidl) | ShellFolder |
CreateInstance(REFIID clsid, REFIID riid) | SIfacePtr< IShellFolder > | [inline]
empty() const | SIfacePtr< IShellFolder > | [inline]
Free() | SIfacePtr< IShellFolder > | [inline]
get() | SIfacePtr< IShellFolder > | [inline]
get_name(LPCITEMIDLIST pidl, SHGDNF flags=SHGDN_NORMAL) const | ShellFolder |
operator &() | SIfacePtr< IShellFolder > | [inline]
operator IShellFolder *() | SIfacePtr< IShellFolder > | [inline]
operator->() | SIfacePtr< IShellFolder > | [inline]
operator->() const | SIfacePtr< IShellFolder > | [inline]
operator=(IShellFolder *p) | SIfacePtr< IShellFolder > | [inline]
operator=(SIfacePtr const &o) | SIfacePtr< IShellFolder > | [inline]
QueryInterface(REFIID riid, I *p) | SIfacePtr< IShellFolder > | [inline]
ShellFolder() | ShellFolder |
ShellFolder(IShellFolder *p) | ShellFolder |
ShellFolder(IShellFolder *parent, LPCITEMIDLIST pidl) | ShellFolder |
ShellFolder(LPCITEMIDLIST pidl) | ShellFolder |
SIfacePtr() | SIfacePtr< IShellFolder > | [inline]
SIfacePtr(IShellFolder *p) | SIfacePtr< IShellFolder > | [inline]
SIfacePtr(IUnknown *unknown, REFIID riid) | SIfacePtr< IShellFolder > | [inline]
SIfacePtr(const SIfacePtr &o) | SIfacePtr< IShellFolder > | [inline, protected]
super typedef | ShellFolder |
~SIfacePtr() | SIfacePtr< IShellFolder > | [inline]


ROS Explorer: ShellItemEnumerator Struct Reference

ShellItemEnumerator Struct Reference

wrapper class for enumerating shell namespace objects More...

#include <shellclasses.h>

Inheritance diagram for ShellItemEnumerator:

[legend]
Collaboration diagram for ShellItemEnumerator:

[legend]
List of all members.

Public Member Functions

ShellItemEnumerator (IShellFolder *folder, DWORD flags=SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN)

Detailed Description

wrapper class for enumerating shell namespace objects

Definition at line 1033 of file shellclasses.h.

Constructor & Destructor Documentation

ShellItemEnumerator::ShellItemEnumerator | ( | IShellFolder * | folder,
 |  | DWORD | flags = SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN
 | ) | [inline]

Definition at line 1035 of file shellclasses.h.

References CHECKERROR, and CONTEXT.

01036         {
01037                 CONTEXT("ShellItemEnumerator::ShellItemEnumerator()");
01038
01039                 CHECKERROR(folder->EnumObjects(0, flags, &_p));
01040         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

ShellItemEnumerator Member List

This is the complete list of members for ShellItemEnumerator, including all inherited members.

_p | SIfacePtr< IEnumIDList > | [protected]
CreateInstance(REFIID clsid, REFIID riid) | SIfacePtr< IEnumIDList > | [inline]
empty() const | SIfacePtr< IEnumIDList > | [inline]
Free() | SIfacePtr< IEnumIDList > | [inline]
get() | SIfacePtr< IEnumIDList > | [inline]
operator &() | SIfacePtr< IEnumIDList > | [inline]
operator IEnumIDList *() | SIfacePtr< IEnumIDList > | [inline]
operator->() | SIfacePtr< IEnumIDList > | [inline]
operator->() const | SIfacePtr< IEnumIDList > | [inline]
operator=(IEnumIDList *p) | SIfacePtr< IEnumIDList > | [inline]
operator=(SIfacePtr const &o) | SIfacePtr< IEnumIDList > | [inline]
QueryInterface(REFIID riid, I *p) | SIfacePtr< IEnumIDList > | [inline]
ShellItemEnumerator(IShellFolder *folder, DWORD flags=SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN) | ShellItemEnumerator | [inline]
SIfacePtr() | SIfacePtr< IEnumIDList > | [inline]
SIfacePtr(IEnumIDList *p) | SIfacePtr< IEnumIDList > | [inline]
SIfacePtr(IUnknown *unknown, REFIID riid) | SIfacePtr< IEnumIDList > | [inline]
SIfacePtr(const SIfacePtr &o) | SIfacePtr< IEnumIDList > | [inline, protected]
~SIfacePtr() | SIfacePtr< IEnumIDList > | [inline]


ROS Explorer: ShellLinkPtr Struct Reference

ShellLinkPtr Struct Reference

IShellLink smart pointer. More...

#include <shellclasses.h>

Inheritance diagram for ShellLinkPtr:

[legend]
Collaboration diagram for ShellLinkPtr:

[legend]
List of all members.

Public Types

typedef SIfacePtr< IShellLink > super

Public Member Functions

ShellLinkPtr (IShellLink *p)

Detailed Description

IShellLink smart pointer.

Definition at line 607 of file shellclasses.h.

Member Typedef Documentation

typedef SIfacePtr<IShellLink> ShellLinkPtr::super

Definition at line 609 of file shellclasses.h.

Constructor & Destructor Documentation

ShellLinkPtr::ShellLinkPtr ( IShellLink * p ) [inline]

Definition at line 611 of file shellclasses.h.

00612          :      super(p)
00613         {
00614                 _p->AddRef();
00615         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

ShellLinkPtr Member List

This is the complete list of members for ShellLinkPtr, including all inherited members.

_p | SIfacePtr< IShellLink > | [protected]
CreateInstance(REFIID clsid, REFIID riid) | SIfacePtr< IShellLink > | [inline]
empty() const | SIfacePtr< IShellLink > | [inline]
Free() | SIfacePtr< IShellLink > | [inline]
get() | SIfacePtr< IShellLink > | [inline]
operator &() | SIfacePtr< IShellLink > | [inline]
operator IShellLink *() | SIfacePtr< IShellLink > | [inline]
operator->() | SIfacePtr< IShellLink > | [inline]
operator->() const | SIfacePtr< IShellLink > | [inline]
operator=(IShellLink *p) | SIfacePtr< IShellLink > | [inline]
operator=(SIfacePtr const &o) | SIfacePtr< IShellLink > | [inline]
QueryInterface(REFIID riid, I *p) | SIfacePtr< IShellLink > | [inline]
ShellLinkPtr(IShellLink *p) | ShellLinkPtr | [inline]
SIfacePtr() | SIfacePtr< IShellLink > | [inline]
SIfacePtr(IShellLink *p) | SIfacePtr< IShellLink > | [inline]
SIfacePtr(IUnknown *unknown, REFIID riid) | SIfacePtr< IShellLink > | [inline]
SIfacePtr(const SIfacePtr &o) | SIfacePtr< IShellLink > | [inline, protected]
super typedef | ShellLinkPtr |
~SIfacePtr() | SIfacePtr< IShellLink > | [inline]


ROS Explorer: ShellMalloc Struct Reference

ShellMalloc Struct Reference

wrapper class for IMalloc with usage of common allocator More...

#include <shellclasses.h>

Collaboration diagram for ShellMalloc:

[legend]
List of all members.

Public Member Functions

ShellMalloc ()
IMalloc * | operator-> ()

Static Public Attributes

static CommonShellMalloc | s_cmn_shell_malloc

Detailed Description

wrapper class for IMalloc with usage of common allocator

Definition at line 252 of file shellclasses.h.

Constructor & Destructor Documentation

ShellMalloc::ShellMalloc ( ) [inline]

Definition at line 254 of file shellclasses.h.

00255         {
00256                  // initialize s_cmn_shell_malloc
00257                 s_cmn_shell_malloc.init();
00258         }

Member Function Documentation

IMalloc* ShellMalloc::operator-> ( ) [inline]

Definition at line 260 of file shellclasses.h.

00261         {
00262                 return s_cmn_shell_malloc;
00263         }

Member Data Documentation

CommonShellMalloc ShellMalloc::s_cmn_shell_malloc [static]

Definition at line 265 of file shellclasses.h.

The documentation for this struct was generated from the following files:
  • shellclasses.h
  • shellclasses.cpp


ROS Explorer: Member List

ShellMalloc Member List

This is the complete list of members for ShellMalloc, including all inherited members.

operator->() | ShellMalloc | [inline]
s_cmn_shell_malloc | ShellMalloc | [static]
ShellMalloc() | ShellMalloc | [inline]


ROS Explorer: ShellPath Struct Reference

ShellPath Struct Reference

wrapper class for item ID lists More...

#include <shellclasses.h>

Inheritance diagram for ShellPath:

[legend]
Collaboration diagram for ShellPath:

[legend]
List of all members.

Public Types

typedef SShellPtr< ITEMIDLIST > | super

Public Member Functions

ShellPath ()
ShellPath (IShellFolder *folder, LPCWSTR path)
ShellPath (LPCWSTR path)
ShellPath (IShellFolder *folder, LPCSTR path)
ShellPath (LPCSTR path)
ShellPath (const ShellPath &o)
ShellPath (LPITEMIDLIST p)
ShellPath (LPCITEMIDLIST p)
void | operator= (const ShellPath &o)
void | operator= (ITEMIDLIST *p)
void | operator= (const SHITEMID &o)
void | operator+= (const SHITEMID &o)
void | assign (LPCITEMIDLIST pidl, size_t size)
void | assign (LPCITEMIDLIST pidl)
void | split (ShellPath &parent, ShellPath &obj) const
void | GetUIObjectOf (REFIID riid, LPVOID *ppvOut, HWND hWnd=0, ShellFolder &sf=GetDesktopFolder())
ShellFolder get_folder ()
ShellFolder | get_folder (IShellFolder *parent)
ShellPath | create_absolute_pidl (LPCITEMIDLIST parent_pidl) const

Detailed Description

wrapper class for item ID lists

Definition at line 651 of file shellclasses.h.

Member Typedef Documentation

typedef SShellPtr<ITEMIDLIST> ShellPath::super

Definition at line 653 of file shellclasses.h.

Constructor & Destructor Documentation

ShellPath::ShellPath ( ) [inline]

Definition at line 655 of file shellclasses.h.

00656         {
00657         }

ShellPath::ShellPath | ( | IShellFolder * | folder,
 |  | LPCWSTR | path
 | ) | [inline]

Definition at line 659 of file shellclasses.h.

References CHECKERROR, and CONTEXT.

00660         {
00661                 CONTEXT("ShellPath::ShellPath(IShellFolder*, LPCWSTR)");
00662
00663                 if (path)
00664                         CHECKERROR(folder->ParseDisplayName(0, NULL, (LPOLESTR)path, NULL, &_p, NULL));
00665                 else
00666                         _p = NULL;
00667         }

ShellPath::ShellPath ( LPCWSTR path ) [inline]

Definition at line 669 of file shellclasses.h.

References CHECKERROR, GetDesktopFolder(), and OBJ_CONTEXT.

00670         {
00671                 OBJ_CONTEXT("ShellPath::ShellPath(LPCWSTR)", path);
00672
00673                 if (path)
00674                         CHECKERROR(GetDesktopFolder()->ParseDisplayName(0, NULL, (LPOLESTR)path, NULL, &_p, NULL));
00675                 else
00676                         _p = NULL;
00677         }

Here is the call graph for this function:

ShellPath::ShellPath | ( | IShellFolder * | folder,
 |  | LPCSTR | path
 | ) | [inline]

Definition at line 679 of file shellclasses.h.

References CHECKERROR, CONTEXT, and COUNTOF.

00680         {
00681                 CONTEXT("ShellPath::ShellPath(IShellFolder*, LPCSTR)");
00682
00683                 WCHAR b[MAX_PATH];
00684
00685                 if (path) {
00686                         MultiByteToWideChar(CP_ACP, 0, path, -1, b, COUNTOF(b));
00687                         CHECKERROR(folder->ParseDisplayName(0, NULL, b, NULL, &_p, NULL));
00688                 } else
00689                         _p = NULL;
00690         }

ShellPath::ShellPath ( LPCSTR path ) [inline]

Definition at line 692 of file shellclasses.h.

References CHECKERROR, CONTEXT, COUNTOF, and GetDesktopFolder().

00693         {
00694                 CONTEXT("ShellPath::ShellPath(LPCSTR)");
00695
00696                 WCHAR b[MAX_PATH];
00697
00698                 if (path) {
00699                         MultiByteToWideChar(CP_ACP, 0, path, -1, b, COUNTOF(b));
00700                         CHECKERROR(GetDesktopFolder()->ParseDisplayName(0, NULL, b, NULL, &_p, NULL));
00701                 } else
00702                         _p = NULL;
00703         }

Here is the call graph for this function:

ShellPath::ShellPath ( const ShellPath & o ) [inline]

Definition at line 705 of file shellclasses.h.

References SShellPtr< T >::_p, and ILGetSize.

00706          :      super(NULL)
00707         {
00708                 //CONTEXT("ShellPath::ShellPath(const ShellPath&)");
00709
00710                 if (o._p) {
00711                         int l = ILGetSize(o._p);
00712                         _p = (ITEMIDLIST*) _malloc->Alloc(l);
00713                         if (_p) memcpy(_p, o._p, l);
00714                 }
00715         }

ShellPath::ShellPath ( LPITEMIDLIST p ) [inline, explicit]

Definition at line 717 of file shellclasses.h.

00718          :      super(p)
00719         {
00720         }

ShellPath::ShellPath ( LPCITEMIDLIST p ) [inline]

Definition at line 722 of file shellclasses.h.

References ILGetSize.

00723         {
00724                 //CONTEXT("ShellPath::ShellPath(LPCITEMIDLIST)");
00725
00726                 if (p) {
00727                         int l = ILGetSize(p);
00728                         _p = (ITEMIDLIST*) _malloc->Alloc(l);
00729                         if (_p) memcpy(_p, p, l);
00730                 }
00731         }

Member Function Documentation

void ShellPath::assign ( LPCITEMIDLIST pidl ) [inline]

Definition at line 810 of file shellclasses.h.

References ILGetSize.

00811         {
00812                 //CONTEXT("ShellPath::assign(LPCITEMIDLIST)");
00813
00814                 ITEMIDLIST* h = _p;
00815
00816                 if (pidl) {
00817                         int l = ILGetSize(pidl);
00818                         _p = (ITEMIDLIST*) _malloc->Alloc(l);
00819                         if (_p) memcpy(_p, pidl, l);
00820                 } else
00821                         _p = NULL;
00822
00823                 _malloc->Free(h);
00824         }

void ShellPath::assign | ( | LPCITEMIDLIST | pidl,
 |  | size_t | size
 | ) | [inline]

Definition at line 794 of file shellclasses.h.

Referenced by SDIMainFrame::WndProc(), and MDIMainFrame::WndProc().

00795         {
00796                 //CONTEXT("ShellPath::assign(LPCITEMIDLIST, size_t)");
00797
00798                 ITEMIDLIST* h = _p;
00799
00800                 _p = (ITEMIDLIST*) _malloc->Alloc(size+sizeof(USHORT/*SHITEMID::cb*/));
00801
00802                 if (_p) {
00803                         memcpy(_p, pidl, size);
00804                         ((ITEMIDLIST*)((LPBYTE)_p+size))->mkid.cb = 0; // terminator
00805                 }
00806
00807                 _malloc->Free(h);
00808         }

ShellPath ShellPath::create_absolute_pidl ( LPCITEMIDLIST parent_pidl ) const

Definition at line 400 of file shellclasses.cpp.

References SShellPtr< ITEMIDLIST >::_malloc, SShellPtr< ITEMIDLIST >::_p, CONTEXT, and ILGetSize.

Referenced by ShellEntry::create_absolute_pidl(), and GetUIObjectOf().

00401 {
00402         CONTEXT("ShellPath::create_absolute_pidl()");
00403
00404         static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILCombine(TEXT("SHELL32"), 25);
00405
00406         if (ILCombine)
00407                 return (*ILCombine)(parent_pidl, _p);
00408
00409          // create a new item id list with _p append behind parent_pidl
00410         int l1 = ILGetSize(parent_pidl) - sizeof(USHORT/*SHITEMID::cb*/);
00411         int l2 = ILGetSize(_p);
00412
00413         LPITEMIDLIST p = (LPITEMIDLIST) _malloc->Alloc(l1+l2);
00414
00415         memcpy(p, parent_pidl, l1);
00416         memcpy((LPBYTE)p+l1, _p, l2);
00417
00418         return p;
00419 }

ShellFolder ShellPath::get_folder ( IShellFolder * parent ) [inline]

Definition at line 835 of file shellclasses.h.

References CONTEXT.

00836         {
00837                 CONTEXT("ShellPath::get_folder()");
00838                 return ShellFolder(parent, _p);
00839         }

ShellFolder ShellPath::get_folder ( ) [inline]

Definition at line 830 of file shellclasses.h.

Referenced by MDIShellBrowserChild::Init().

00831         {
00832                 return ShellFolder(_p);
00833         }

void ShellPath::GetUIObjectOf | ( | REFIID | riid,
 |  | LPVOID * | ppvOut,
 |  | HWND | hWnd = 0,
 |  | ShellFolder & | sf = GetDesktopFolder()
 | ) |

Definition at line 358 of file shellclasses.cpp.

References SShellPtr< ITEMIDLIST >::_p, CHECKERROR, CONTEXT, create_absolute_pidl(), and split().

00359 {
00360         CONTEXT("ShellPath::GetUIObjectOf()");
00361
00362         ShellPath parent, obj;
00363
00364         split(parent, obj);
00365
00366         LPCITEMIDLIST idl = obj;
00367
00368         if (parent && parent->mkid.cb)
00369                  // use the IShellFolder of the parent
00370                 CHECKERROR(ShellFolder((IShellFolder*)sf,parent)->GetUIObjectOf(hWnd, 1, &idl, riid, 0, ppvOut));
00371         else // else use desktop folder
00372                 CHECKERROR(sf->GetUIObjectOf(hWnd, 1, &idl, riid, 0, ppvOut));
00373 }

Here is the call graph for this function:

void ShellPath::operator+= ( const SHITEMID & o ) [inline]

Definition at line 779 of file shellclasses.h.

References ILGetSize.

00780         {
00781                 int l0 = ILGetSize(_p);
00782                 LPBYTE p = (LPBYTE)_malloc->Alloc(l0+o.cb);
00783                 int l = l0 - 2;
00784
00785                 if (p) {
00786                         memcpy(p, _p, l);
00787                         *(PWORD)((LPBYTE)memcpy(p+l, &o, o.cb)+o.cb) = 0;
00788                 }
00789
00790                 _malloc->Free(_p);
00791                 _p = (ITEMIDLIST*)p;
00792         }

void ShellPath::operator= ( const SHITEMID & o ) [inline]

Definition at line 768 of file shellclasses.h.

00769         {
00770                 ITEMIDLIST* h = _p;
00771
00772                 LPBYTE p = (LPBYTE)_malloc->Alloc(o.cb+2);
00773                 if (p) *(PWORD)((LPBYTE)memcpy(p, &o, o.cb)+o.cb) = 0;
00774                 _p = (ITEMIDLIST*)p;
00775
00776                 _malloc->Free(h);
00777         }

void ShellPath::operator= ( ITEMIDLIST * p ) [inline]

Definition at line 751 of file shellclasses.h.

References ILGetSize.

00752         {
00753                 //CONTEXT("ShellPath::operator=(ITEMIDLIST*)");
00754
00755                 ITEMIDLIST* h = _p;
00756
00757                 if (p) {
00758                         int l = ILGetSize(p);
00759                         _p = (ITEMIDLIST*) _malloc->Alloc(l);
00760                         if (_p) memcpy(_p, p, l);
00761                 }
00762                 else
00763                         _p = NULL;
00764
00765                 _malloc->Free(h);
00766         }

void ShellPath::operator= ( const ShellPath & o ) [inline]

Definition at line 733 of file shellclasses.h.

References SShellPtr< T >::_p, and ILGetSize.

00734         {
00735                 //CONTEXT("ShellPath::operator=(const ShellPath&)");
00736
00737                 ITEMIDLIST* h = _p;
00738
00739                 if (o._p) {
00740                         int l = ILGetSize(o._p);
00741
00742                         _p = (ITEMIDLIST*) _malloc->Alloc(l);
00743                         if (_p) memcpy(_p, o._p, l);
00744                 }
00745                 else
00746                         _p = NULL;
00747
00748                 _malloc->Free(h);
00749         }

void ShellPath::split | ( | ShellPath & | parent,
 |  | ShellPath & | obj
 | ) | const

Definition at line 336 of file shellclasses.cpp.

References SShellPtr< ITEMIDLIST >::_p.

Referenced by GetUIObjectOf().

00337 {
00338         SHITEMID *piid, *piidLast;
00339         int size = 0;
00340
00341          // find last item-id and calculate total size of pidl
00342         for(piid=piidLast=&_p->mkid; piid->cb; ) {
00343                 piidLast = piid;
00344                 size += (piid->cb);
00345                 piid = (SHITEMID*)((LPBYTE)piid + (piid->cb));
00346         }
00347
00348          // copy parent folder portion
00349         size -= piidLast->cb;  // don't count "object" item-id
00350
00351         if (size > 0)
00352                 parent.assign(_p, size);
00353
00354          // copy "object" portion
00355         obj.assign((ITEMIDLIST*)piidLast, piidLast->cb);
00356 }

The documentation for this struct was generated from the following files:
  • shellclasses.h
  • shellclasses.cpp


ROS Explorer: Member List

ShellPath Member List

This is the complete list of members for ShellPath, including all inherited members.

_malloc | SShellPtr< ITEMIDLIST > | [mutable, protected]
_p | SShellPtr< ITEMIDLIST > | [protected]
assign(LPCITEMIDLIST pidl, size_t size) | ShellPath | [inline]
assign(LPCITEMIDLIST pidl) | ShellPath | [inline]
create_absolute_pidl(LPCITEMIDLIST parent_pidl) const | ShellPath |
Free() | SShellPtr< ITEMIDLIST > | [inline, protected]
get_folder() | ShellPath | [inline]
get_folder(IShellFolder *parent) | ShellPath | [inline]
GetUIObjectOf(REFIID riid, LPVOID *ppvOut, HWND hWnd=0, ShellFolder &sf=GetDesktopFolder()) | ShellPath |
operator *() const | SShellPtr< ITEMIDLIST > | [inline]
operator *() | SShellPtr< ITEMIDLIST > | [inline]
operator ITEMIDLIST const *() const | SShellPtr< ITEMIDLIST > | [inline]
operator+=(const SHITEMID &o) | ShellPath | [inline]
operator->() | SShellPtr< ITEMIDLIST > | [inline]
operator->() const | SShellPtr< ITEMIDLIST > | [inline]
operator=(const ShellPath &o) | ShellPath | [inline]
operator=(ITEMIDLIST *p) | ShellPath | [inline]
operator=(const SHITEMID &o) | ShellPath | [inline]
ShellPath() | ShellPath | [inline]
ShellPath(IShellFolder *folder, LPCWSTR path) | ShellPath | [inline]
ShellPath(LPCWSTR path) | ShellPath | [inline]
ShellPath(IShellFolder *folder, LPCSTR path) | ShellPath | [inline]
ShellPath(LPCSTR path) | ShellPath | [inline]
ShellPath(const ShellPath &o) | ShellPath | [inline]
ShellPath(LPITEMIDLIST p) | ShellPath | [inline, explicit]
ShellPath(LPCITEMIDLIST p) | ShellPath | [inline]
split(ShellPath &parent, ShellPath &obj) const | ShellPath |
SShellPtr() | SShellPtr< ITEMIDLIST > | [inline, protected]
SShellPtr(ITEMIDLIST *p) | SShellPtr< ITEMIDLIST > | [inline, protected]
super typedef | ShellPath |
~SShellPtr() | SShellPtr< ITEMIDLIST > | [inline]


ROS Explorer: ShellPathInfo Struct Reference

ShellPathInfo Struct Reference

information structure to hold current shell folder information More...

#include <shellbrowser.h>

Collaboration diagram for ShellPathInfo:

[legend]
List of all members.

Public Member Functions

ShellPathInfo (int mode=0)
ShellPathInfo (const ShellChildWndInfo &info)

Public Attributes

ShellPath _shell_path
ShellPath _root_shell_path
int _open_mode

Detailed Description

information structure to hold current shell folder information

Definition at line 33 of file shellbrowser.h.

Constructor & Destructor Documentation

ShellPathInfo::ShellPathInfo ( int mode = 0 ) [inline]

Definition at line 35 of file shellbrowser.h.

00035 : _open_mode(mode) {}

ShellPathInfo::ShellPathInfo ( const ShellChildWndInfo & info ) [inline]

Definition at line 37 of file shellbrowser.h.

00038          :      _shell_path(info._shell_path),
00039                 _root_shell_path(info._root_shell_path),
00040                 _open_mode(info._open_mode)
00041         {
00042         }

Member Data Documentation

int ShellPathInfo::_open_mode

Definition at line 47 of file shellbrowser.h.

Referenced by SDIMainFrame::jump_to(), and ShellBrowser::UpdateFolderView().

ShellPath ShellPathInfo::_root_shell_path

Definition at line 45 of file shellbrowser.h.

Referenced by ShellBrowser::Init(), and SDIMainFrame::jump_to().

ShellPath ShellPathInfo::_shell_path

Definition at line 44 of file shellbrowser.h.

Referenced by ShellBrowser::Init(), and SDIMainFrame::jump_to().

The documentation for this struct was generated from the following file:
  • shellbrowser.h


ROS Explorer: Member List

ShellPathInfo Member List

This is the complete list of members for ShellPathInfo, including all inherited members.

_open_mode | ShellPathInfo |
_root_shell_path | ShellPathInfo |
_shell_path | ShellPathInfo |
ShellPathInfo(int mode=0) | ShellPathInfo | [inline]
ShellPathInfo(const ShellChildWndInfo &info) | ShellPathInfo | [inline]


ROS Explorer: SIfacePtr< T > Struct Template Reference

SIfacePtr< T > Struct Template Reference

wrapper class for COM interface pointers More...

#include <shellclasses.h>

Inheritance diagram for SIfacePtr< T >:

[legend]
Collaboration diagram for SIfacePtr< T >:

[legend]
List of all members.

Public Member Functions

SIfacePtr ()
SIfacePtr (T *p)
SIfacePtr (IUnknown *unknown, REFIID riid)
~SIfacePtr ()
T * | operator-> ()
const T * | operator-> () const
operator T * ()
T ** | operator & ()
bool | empty () const
SIfacePtr & | operator= (T *p)
void | operator= (SIfacePtr const &o)
HRESULT | CreateInstance (REFIID clsid, REFIID riid)
template<typename I>
HRESULT | QueryInterface (REFIID riid, I *p)
T * | get ()
void | Free ()

Protected Member Functions

SIfacePtr (const SIfacePtr &o)

Protected Attributes

T * | _p

Detailed Description

template<typename T>
struct SIfacePtr< T >

wrapper class for COM interface pointers

Definition at line 332 of file shellclasses.h.

Constructor & Destructor Documentation

template<typename T>
SIfacePtr< T >::SIfacePtr ( ) [inline]

Definition at line 334 of file shellclasses.h.

00335          :      _p(0)
00336         {
00337         }

template<typename T>
SIfacePtr< T >::SIfacePtr ( T * p ) [inline]

Definition at line 339 of file shellclasses.h.

00340          :      _p(p)
00341         {
00342                 if (p)
00343                         p->AddRef();
00344         }

template<typename T>
SIfacePtr< T >::SIfacePtr | ( | IUnknown * | unknown,
 |  | REFIID | riid
 | ) | [inline]

Definition at line 346 of file shellclasses.h.

00347         {
00348                 CHECKERROR(unknown->QueryInterface(riid, (LPVOID*)&_p));
00349         }

template<typename T>
SIfacePtr< T >::~SIfacePtr ( ) [inline]

Definition at line 351 of file shellclasses.h.

00352         {
00353                 Free();
00354         }

template<typename T>
SIfacePtr< T >::SIfacePtr ( const SIfacePtr< T > & o ) [inline, protected]

Definition at line 437 of file shellclasses.h.

00438          :      _p(o._p)
00439         {
00440                 if (_p)
00441                         _p->AddRef();
00442         }

Member Function Documentation

template<typename T>
HRESULT SIfacePtr< T >::CreateInstance | ( | REFIID | clsid,
 |  | REFIID | riid
 | ) | [inline]

Definition at line 412 of file shellclasses.h.

00413         {
00414                 return CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, riid, (LPVOID*)&_p);
00415         }

template<typename T>
bool SIfacePtr< T >::empty ( ) const [inline]

Definition at line 382 of file shellclasses.h.

Referenced by ShellDirectory::get_path().

00382                                       : GCC seems not to work correctly when defining operator bool() AND operator T*() at one time
00383         {
00384                 return !_p;
00385         }

template<typename T>
void SIfacePtr< T >::Free ( ) [inline]

Definition at line 427 of file shellclasses.h.

Referenced by Entry::GetUIObjectOf().

00428         {
00429                 T* h = _p;
00430                 _p = NULL;
00431
00432                 if (h)
00433                         h->Release();
00434         }

template<typename T>
T* SIfacePtr< T >::get ( ) [inline]

Definition at line 422 of file shellclasses.h.

00423         {
00424                 return _p;
00425         }

template<typename T>
T** SIfacePtr< T >::operator & ( ) [inline]

Definition at line 377 of file shellclasses.h.

00378         {
00379                 return &_p;
00380         }

template<typename T>
SIfacePtr< T >::operator T * ( ) [inline]

Definition at line 372 of file shellclasses.h.

00373         {
00374                 return _p;
00375         }

template<typename T>
const T* SIfacePtr< T >::operator-> ( ) const [inline]

Definition at line 361 of file shellclasses.h.

00362         {
00363                 return _p;
00364         }

template<typename T>
T* SIfacePtr< T >::operator-> ( ) [inline]

Definition at line 356 of file shellclasses.h.

00357         {
00358                 return _p;
00359         }

template<typename T>
void SIfacePtr< T >::operator= ( SIfacePtr< T > const & o ) [inline]

Definition at line 399 of file shellclasses.h.

00400         {
00401                 T* h = _p;
00402
00403                 if (o._p)
00404                         o._p->AddRef();
00405
00406                 _p = o._p;
00407
00408                 if (h)
00409                         h->Release();
00410         }

template<typename T>
SIfacePtr& SIfacePtr< T >::operator= ( T * p ) [inline]

Definition at line 387 of file shellclasses.h.

00388         {
00389                 Free();
00390
00391                 if (p) {
00392                         p->AddRef();
00393                         _p = p;
00394                 }
00395
00396                 return *this;
00397         }

template<typename T>
template<typename I>
HRESULT SIfacePtr< T >::QueryInterface | ( | REFIID | riid,
 |  | I * | p
 | ) | [inline]

Definition at line 417 of file shellclasses.h.

Referenced by IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::create_control().

00418         {
00419                 return _p->QueryInterface(riid, (LPVOID*)p);
00420         }

Member Data Documentation

template<typename T>
T* SIfacePtr< T >::_p [protected]

Definition at line 444 of file shellclasses.h.

Referenced by SIfacePtr< IShellLink >::operator=().

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

SIfacePtr< T > Member List

This is the complete list of members for SIfacePtr< T >, including all inherited members.

_p | SIfacePtr< T > | [protected]
CreateInstance(REFIID clsid, REFIID riid) | SIfacePtr< T > | [inline]
empty() const | SIfacePtr< T > | [inline]
Free() | SIfacePtr< T > | [inline]
get() | SIfacePtr< T > | [inline]
operator &() | SIfacePtr< T > | [inline]
operator T *() | SIfacePtr< T > | [inline]
operator->() | SIfacePtr< T > | [inline]
operator->() const | SIfacePtr< T > | [inline]
operator=(T *p) | SIfacePtr< T > | [inline]
operator=(SIfacePtr const &o) | SIfacePtr< T > | [inline]
QueryInterface(REFIID riid, I *p) | SIfacePtr< T > | [inline]
SIfacePtr() | SIfacePtr< T > | [inline]
SIfacePtr(T *p) | SIfacePtr< T > | [inline]
SIfacePtr(IUnknown *unknown, REFIID riid) | SIfacePtr< T > | [inline]
SIfacePtr(const SIfacePtr &o) | SIfacePtr< T > | [inline, protected]
~SIfacePtr() | SIfacePtr< T > | [inline]


ROS Explorer: SimpleComObject Struct Reference

SimpleComObject Struct Reference

#include <shellclasses.h>

Inheritance diagram for SimpleComObject:

[legend]
Collaboration diagram for SimpleComObject:

[legend]
List of all members.

Public Member Functions

ULONG | IncRef ()
ULONG | DecRef ()

Detailed Description

Definition at line 457 of file shellclasses.h.

Member Function Documentation

ULONG SimpleComObject::DecRef ( ) [inline]

Definition at line 460 of file shellclasses.h.

00460 {ULONG ref=--_ref; if (!ref) {_ref++; delete this;} return ref;}

ULONG SimpleComObject::IncRef ( ) [inline]

Definition at line 459 of file shellclasses.h.

00459 {return ++_ref;}

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

SimpleComObject Member List

This is the complete list of members for SimpleComObject, including all inherited members.

_ref | ComSrvObject | [protected]
ComSrvObject() | ComSrvObject | [inline, protected]
DecRef() | SimpleComObject | [inline]
IncRef() | SimpleComObject | [inline]
~ComSrvObject() | ComSrvObject | [inline, protected, virtual]


ROS Explorer: SmallIcon Struct Reference

SmallIcon Struct Reference

convenient loading of small (16x16) icon resources More...

#include <globals.h>

Collaboration diagram for SmallIcon:

[legend]
List of all members.

Public Member Functions

SmallIcon (UINT nid)
operator HICON () const

Protected Attributes

HICON _hicon

Detailed Description

convenient loading of small (16x16) icon resources

Definition at line 300 of file globals.h.

Constructor & Destructor Documentation

SmallIcon::SmallIcon ( UINT nid )

Definition at line 574 of file explorer.cpp.

References _hicon, and ExplorerGlobals::_hInstance.

00575 {
00576         _hicon = (HICON)LoadImage(g_Globals._hInstance, MAKEINTRESOURCE(nid), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
00577 }

Member Function Documentation

SmallIcon::operator HICON ( ) const [inline]

Definition at line 304 of file globals.h.

References _hicon.

00304 {return _hicon;}

Member Data Documentation

HICON SmallIcon::_hicon [protected]

Definition at line 307 of file globals.h.

Referenced by operator HICON(), and SmallIcon().

The documentation for this struct was generated from the following files:
  • globals.h
  • explorer.cpp


ROS Explorer: Member List

SmallIcon Member List

This is the complete list of members for SmallIcon, including all inherited members.

_hicon | SmallIcon | [protected]
operator HICON() const | SmallIcon | [inline]
SmallIcon(UINT nid) | SmallIcon |


ROS Explorer: SMBtnInfo Struct Reference

SMBtnInfo Struct Reference

#include <startmenu.h>

Collaboration diagram for SMBtnInfo:

[legend]
List of all members.

Public Member Functions

SMBtnInfo (const StartMenuEntry &entry, int id, bool hasSubmenu=false, bool enabled=true)
SMBtnInfo (LPCTSTR title, ICON_ID icon_id, int id, bool hasSubmenu=false, bool enabled=true)

Public Attributes

String _title
ICON_ID _icon_id
int | _id
bool | _hasSubmenu
bool | _enabled

Detailed Description

Definition at line 161 of file startmenu.h.

Constructor & Destructor Documentation

SMBtnInfo::SMBtnInfo | ( | const StartMenuEntry & | entry,
 |  | int | id,
 |  | bool | hasSubmenu = false,
 |  | bool | enabled = true
 | ) | [inline]

Definition at line 163 of file startmenu.h.

00164          :      _title(entry._title),
00165                 _icon_id(entry._icon_id),
00166                 _id(id),
00167                 _hasSubmenu(hasSubmenu),
00168                 _enabled(enabled)
00169         {
00170         }

SMBtnInfo::SMBtnInfo | ( | LPCTSTR | title,
 |  | ICON_ID | icon_id,
 |  | int | id,
 |  | bool | hasSubmenu = false,
 |  | bool | enabled = true
 | ) | [inline]

Definition at line 172 of file startmenu.h.

00173          :      _title(title),
00174                 _icon_id(icon_id),
00175                 _id(id),
00176                 _hasSubmenu(hasSubmenu),
00177                 _enabled(enabled)
00178         {
00179         }

Member Data Documentation

bool SMBtnInfo::_enabled

Definition at line 185 of file startmenu.h.

Referenced by StartMenu::SelectButton().

bool SMBtnInfo::_hasSubmenu

Definition at line 184 of file startmenu.h.

Referenced by StartMenu::OpenSubmenu(), and StartMenu::SelectButton().

ICON_ID SMBtnInfo::_icon_id

Definition at line 182 of file startmenu.h.

int SMBtnInfo::_id

Definition at line 183 of file startmenu.h.

String SMBtnInfo::_title

Definition at line 181 of file startmenu.h.

The documentation for this struct was generated from the following file:
  • startmenu.h


ROS Explorer: Member List

SMBtnInfo Member List

This is the complete list of members for SMBtnInfo, including all inherited members.

_enabled | SMBtnInfo |
_hasSubmenu | SMBtnInfo |
_icon_id | SMBtnInfo |
_id | SMBtnInfo |
_title | SMBtnInfo |
SMBtnInfo(const StartMenuEntry &entry, int id, bool hasSubmenu=false, bool enabled=true) | SMBtnInfo | [inline]
SMBtnInfo(LPCTSTR title, ICON_ID icon_id, int id, bool hasSubmenu=false, bool enabled=true) | SMBtnInfo | [inline]


ROS Explorer: SpecialFolder Struct Reference

SpecialFolder Struct Reference

Retrieval of special shell folder. More...

#include <shellclasses.h>

Inheritance diagram for SpecialFolder:

[legend]
Collaboration diagram for SpecialFolder:

[legend]
List of all members.

Public Member Functions

SpecialFolder (int folder, HWND hwnd)

Detailed Description

Retrieval of special shell folder.

Definition at line 988 of file shellclasses.h.

Constructor & Destructor Documentation

SpecialFolder::SpecialFolder | ( | int | folder,
 |  | HWND | hwnd
 | ) | [inline]

Definition at line 990 of file shellclasses.h.

00991          :      ShellFolder(GetDesktopFolder(), SpecialFolderPath(folder, hwnd))
00992         {
00993         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

SpecialFolder Member List

This is the complete list of members for SpecialFolder, including all inherited members.

_p | SIfacePtr< IShellFolder > | [protected]
attach(IShellFolder *parent, LPCITEMIDLIST pidl) | ShellFolder |
CreateInstance(REFIID clsid, REFIID riid) | SIfacePtr< IShellFolder > | [inline]
empty() const | SIfacePtr< IShellFolder > | [inline]
Free() | SIfacePtr< IShellFolder > | [inline]
get() | SIfacePtr< IShellFolder > | [inline]
get_name(LPCITEMIDLIST pidl, SHGDNF flags=SHGDN_NORMAL) const | ShellFolder |
operator &() | SIfacePtr< IShellFolder > | [inline]
operator IShellFolder *() | SIfacePtr< IShellFolder > | [inline]
operator->() | SIfacePtr< IShellFolder > | [inline]
operator->() const | SIfacePtr< IShellFolder > | [inline]
operator=(IShellFolder *p) | SIfacePtr< IShellFolder > | [inline]
operator=(SIfacePtr const &o) | SIfacePtr< IShellFolder > | [inline]
QueryInterface(REFIID riid, I *p) | SIfacePtr< IShellFolder > | [inline]
ShellFolder() | ShellFolder |
ShellFolder(IShellFolder *p) | ShellFolder |
ShellFolder(IShellFolder *parent, LPCITEMIDLIST pidl) | ShellFolder |
ShellFolder(LPCITEMIDLIST pidl) | ShellFolder |
SIfacePtr() | SIfacePtr< IShellFolder > | [inline]
SIfacePtr(IShellFolder *p) | SIfacePtr< IShellFolder > | [inline]
SIfacePtr(IUnknown *unknown, REFIID riid) | SIfacePtr< IShellFolder > | [inline]
SIfacePtr(const SIfacePtr &o) | SIfacePtr< IShellFolder > | [inline, protected]
SpecialFolder(int folder, HWND hwnd) | SpecialFolder | [inline]
super typedef | ShellFolder |
~SIfacePtr() | SIfacePtr< IShellFolder > | [inline]


ROS Explorer: SpecialFolderFSPath Struct Reference

SpecialFolderFSPath Struct Reference

file system path of special folder More...

#include <shellclasses.h>

Collaboration diagram for SpecialFolderFSPath:

[legend]
List of all members.

Public Member Functions

SpecialFolderFSPath (int folder, HWND hwnd)
file system path of special folder
operator LPCTSTR ()

Protected Attributes

TCHAR _fullpath [MAX_PATH]

Detailed Description

file system path of special folder

Definition at line 1003 of file shellclasses.h.

Constructor & Destructor Documentation

SpecialFolderFSPath::SpecialFolderFSPath | ( | int | folder,
 |  | HWND | hwnd
 | ) |

file system path of special folder

Definition at line 445 of file shellclasses.cpp.

References _fullpath, CSIDL_FLAG_CREATE, and HWND.

00446 {
00447         _fullpath[0] = '\0';
00448
00449 #ifdef UNICODE
00450         static DynamicFct<BOOL (__stdcall*)(HWND hwnd, LPTSTR pszPath, int csidl, BOOL fCreate)> s_pSHGetSpecialFolderPath(TEXT("shell32"), "SHGetSpecialFolderPathW");
00451 #else
00452         static DynamicFct<BOOL (__stdcall*)(HWND hwnd, LPTSTR pszPath, int csidl, BOOL fCreate)> s_pSHGetSpecialFolderPath(TEXT("shell32"), "SHGetSpecialFolderPathA");
00453 #endif
00454         if (*s_pSHGetSpecialFolderPath)
00455                 (*s_pSHGetSpecialFolderPath)(hwnd, _fullpath, folder, TRUE);
00456         else {
00457                  // SHGetSpecialFolderPath() is not compatible to WIN95/NT4
00458 #ifdef UNICODE
00459                 static DynamicFct<HRESULT (__stdcall*)(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)> s_pSHGetFolderPath_shell32(TEXT("shell32"), "SHGetFolderPathW");
00460 #else
00461                 static DynamicFct<HRESULT (__stdcall*)(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)> s_pSHGetFolderPath_shell32(TEXT("shell32"), "SHGetFolderPathA");
00462 #endif
00463                 if (*s_pSHGetFolderPath_shell32)
00464                         (*s_pSHGetFolderPath_shell32)(hwnd, folder|CSIDL_FLAG_CREATE, 0, 0, _fullpath);
00465                 else {
00466                          // SHGetFolderPath() is only present in shfolder.dll on some platforms.
00467 #ifdef UNICODE
00468                         static DynamicLoadLibFct<HRESULT (__stdcall*)(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)> s_pSHGetFolderPath_shfolder(TEXT("shfolder"), "SHGetFolderPathW");
00469 #else
00470                         static DynamicLoadLibFct<HRESULT (__stdcall*)(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)> s_pSHGetFolderPath_shfolder(TEXT("shfolder"), "SHGetFolderPathA");
00471 #endif
00472                         if (*s_pSHGetFolderPath_shfolder)
00473                                 (*s_pSHGetFolderPath_shfolder)(hwnd, folder|CSIDL_FLAG_CREATE, 0, 0, _fullpath);
00474                 }
00475         }
00476 }

Member Function Documentation

SpecialFolderFSPath::operator LPCTSTR ( ) [inline]

Definition at line 1007 of file shellclasses.h.

01008         {
01009                 return _fullpath;
01010         }

Member Data Documentation

TCHAR SpecialFolderFSPath::_fullpath[MAX_PATH] [protected]

Definition at line 1013 of file shellclasses.h.

Referenced by SpecialFolderFSPath().

The documentation for this struct was generated from the following files:
  • shellclasses.h
  • shellclasses.cpp


ROS Explorer: Member List

SpecialFolderFSPath Member List

This is the complete list of members for SpecialFolderFSPath, including all inherited members.

_fullpath | SpecialFolderFSPath | [protected]
operator LPCTSTR() | SpecialFolderFSPath | [inline]
SpecialFolderFSPath(int folder, HWND hwnd) | SpecialFolderFSPath |


ROS Explorer: SpecialFolderPath Struct Reference

SpecialFolderPath Struct Reference

Retrieval of special shell folder paths. More...

#include <shellclasses.h>

Inheritance diagram for SpecialFolderPath:

[legend]
Collaboration diagram for SpecialFolderPath:

[legend]
List of all members.

Public Member Functions

SpecialFolderPath (int folder, HWND hwnd)

Detailed Description

Retrieval of special shell folder paths.

Definition at line 969 of file shellclasses.h.

Constructor & Destructor Documentation

SpecialFolderPath::SpecialFolderPath | ( | int | folder,
 |  | HWND | hwnd
 | ) | [inline]

Definition at line 971 of file shellclasses.h.

References CHECKERROR.

00972         {
00973                 HRESULT hr = SHGetSpecialFolderLocation(hwnd, folder, &_p);
00974                 CHECKERROR(hr);
00975         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

SpecialFolderPath Member List

This is the complete list of members for SpecialFolderPath, including all inherited members.

_malloc | SShellPtr< ITEMIDLIST > | [mutable, protected]
_p | SShellPtr< ITEMIDLIST > | [protected]
assign(LPCITEMIDLIST pidl, size_t size) | ShellPath | [inline]
assign(LPCITEMIDLIST pidl) | ShellPath | [inline]
create_absolute_pidl(LPCITEMIDLIST parent_pidl) const | ShellPath |
Free() | SShellPtr< ITEMIDLIST > | [inline, protected]
get_folder() | ShellPath | [inline]
get_folder(IShellFolder *parent) | ShellPath | [inline]
GetUIObjectOf(REFIID riid, LPVOID *ppvOut, HWND hWnd=0, ShellFolder &sf=GetDesktopFolder()) | ShellPath |
operator *() const | SShellPtr< ITEMIDLIST > | [inline]
operator *() | SShellPtr< ITEMIDLIST > | [inline]
operator ITEMIDLIST const *() const | SShellPtr< ITEMIDLIST > | [inline]
operator+=(const SHITEMID &o) | ShellPath | [inline]
operator->() | SShellPtr< ITEMIDLIST > | [inline]
operator->() const | SShellPtr< ITEMIDLIST > | [inline]
operator=(const ShellPath &o) | ShellPath | [inline]
operator=(ITEMIDLIST *p) | ShellPath | [inline]
operator=(const SHITEMID &o) | ShellPath | [inline]
ShellPath() | ShellPath | [inline]
ShellPath(IShellFolder *folder, LPCWSTR path) | ShellPath | [inline]
ShellPath(LPCWSTR path) | ShellPath | [inline]
ShellPath(IShellFolder *folder, LPCSTR path) | ShellPath | [inline]
ShellPath(LPCSTR path) | ShellPath | [inline]
ShellPath(const ShellPath &o) | ShellPath | [inline]
ShellPath(LPITEMIDLIST p) | ShellPath | [inline, explicit]
ShellPath(LPCITEMIDLIST p) | ShellPath | [inline]
SpecialFolderPath(int folder, HWND hwnd) | SpecialFolderPath | [inline]
split(ShellPath &parent, ShellPath &obj) const | ShellPath |
SShellPtr() | SShellPtr< ITEMIDLIST > | [inline, protected]
SShellPtr(ITEMIDLIST *p) | SShellPtr< ITEMIDLIST > | [inline, protected]
super typedef | ShellPath |
~SShellPtr() | SShellPtr< ITEMIDLIST > | [inline]


ROS Explorer: SShellPtr< T > Struct Template Reference

SShellPtr< T > Struct Template Reference

wrapper template class for pointers to shell objects managed by IMalloc More...

#include <shellclasses.h>

Collaboration diagram for SShellPtr< T >:

[legend]
List of all members.

Public Member Functions

~SShellPtr ()
T * | operator-> ()
T const * | operator-> () const
operator T const * () const
const T & | operator * () const
T & | operator * ()

Protected Member Functions

SShellPtr ()
SShellPtr (T *p)
void | Free ()

Protected Attributes

T * | _p
ShellMalloc _malloc

Detailed Description

template<typename T>
struct SShellPtr< T >

wrapper template class for pointers to shell objects managed by IMalloc

Definition at line 271 of file shellclasses.h.

Constructor & Destructor Documentation

template<typename T>
SShellPtr< T >::~SShellPtr ( ) [inline]

Definition at line 273 of file shellclasses.h.

00274         {
00275                 _malloc->Free(_p);
00276         }

template<typename T>
SShellPtr< T >::SShellPtr ( ) [inline, protected]

Definition at line 304 of file shellclasses.h.

00305          :      _p(0)
00306         {
00307         }

template<typename T>
SShellPtr< T >::SShellPtr ( T * p ) [inline, protected]

Definition at line 309 of file shellclasses.h.

00310          :      _p(p)
00311         {
00312         }

Member Function Documentation

template<typename T>
void SShellPtr< T >::Free ( ) [inline, protected]

Definition at line 314 of file shellclasses.h.

00315         {
00316                 _malloc->Free(_p);
00317                 _p = NULL;
00318         }

template<typename T>
T& SShellPtr< T >::operator * ( ) [inline]

Definition at line 298 of file shellclasses.h.

00299         {
00300                 return *_p;
00301         }

template<typename T>
const T& SShellPtr< T >::operator * ( ) const [inline]

Definition at line 293 of file shellclasses.h.

00294         {
00295                 return *_p;
00296         }

template<typename T>
SShellPtr< T >::operator T const * ( ) const [inline]

Definition at line 288 of file shellclasses.h.

00289         {
00290                 return _p;
00291         }

template<typename T>
T const* SShellPtr< T >::operator-> ( ) const [inline]

Definition at line 283 of file shellclasses.h.

00284         {
00285                 return _p;
00286         }

template<typename T>
T* SShellPtr< T >::operator-> ( ) [inline]

Definition at line 278 of file shellclasses.h.

00279         {
00280                 return _p;
00281         }

Member Data Documentation

template<typename T>
ShellMalloc SShellPtr< T >::_malloc [mutable, protected]

Definition at line 321 of file shellclasses.h.

template<typename T>
T* SShellPtr< T >::_p [protected]

Definition at line 320 of file shellclasses.h.

Referenced by ShellPath::operator=(), and ShellPath::ShellPath().

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

SShellPtr< T > Member List

This is the complete list of members for SShellPtr< T >, including all inherited members.

_malloc | SShellPtr< T > | [mutable, protected]
_p | SShellPtr< T > | [protected]
Free() | SShellPtr< T > | [inline, protected]
operator *() const | SShellPtr< T > | [inline]
operator *() | SShellPtr< T > | [inline]
operator T const *() const | SShellPtr< T > | [inline]
operator->() | SShellPtr< T > | [inline]
operator->() const | SShellPtr< T > | [inline]
SShellPtr() | SShellPtr< T > | [inline, protected]
SShellPtr(T *p) | SShellPtr< T > | [inline, protected]
~SShellPtr() | SShellPtr< T > | [inline]


ROS Explorer: StartButton Struct Reference

StartButton Struct Reference

special "Start" button with one click activation More...

#include <desktopbar.h>

Inheritance diagram for StartButton:

[legend]
Collaboration diagram for StartButton:

[legend]
List of all members.

Public Types

typedef PictureButton | super

Public Member Functions

StartButton (HWND hwnd)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Detailed Description

special "Start" button with one click activation

Definition at line 123 of file desktopbar.h.

Member Typedef Documentation

typedef PictureButton StartButton::super

Reimplemented from PictureButton.

Definition at line 125 of file desktopbar.h.

Constructor & Destructor Documentation

StartButton::StartButton ( HWND hwnd )

Definition at line 170 of file desktopbar.cpp.

00171  :      PictureButton(hwnd, SmallIcon(IDI_STARTMENU), GetSysColorBrush(COLOR_BTNFACE))
00172 {
00173 }

Member Function Documentation

LRESULT StartButton::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from OwnerdrawnButton.

Definition at line 175 of file desktopbar.cpp.

References WindowHandle::_hwnd, ClientToScreen(), HWND, ScreenToClient(), and OwnerdrawnButton::WndProc().

00176 {
00177         switch(nmsg) {
00178            // one click activation: handle button-down message, don't wait for button-up
00179           case WM_LBUTTONDOWN:
00180                 if (!Button_GetState(_hwnd)) {
00181                         Button_SetState(_hwnd, TRUE);
00182
00183                         SetCapture(_hwnd);
00184
00185                         SendMessage(GetParent(_hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(_hwnd),0), 0);
00186                 }
00187
00188                 Button_SetState(_hwnd, FALSE);
00189                 break;
00190
00191            // re-target mouse move messages while moving the mouse cursor through the start menu
00192           case WM_MOUSEMOVE:
00193                 if (GetCapture() == _hwnd) {
00194                         POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)};
00195
00196                         ClientToScreen(_hwnd, &pt);
00197                         HWND hwnd = WindowFromPoint(pt);
00198
00199                         if (hwnd && hwnd!=_hwnd) {
00200                                 ScreenToClient(hwnd, &pt);
00201                                 SendMessage(hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(pt.x, pt.y));
00202                         }
00203                 }
00204                 break;
00205
00206           case WM_LBUTTONUP:
00207                 if (GetCapture() == _hwnd) {
00208                         ReleaseCapture();
00209
00210                         POINT pt = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)};
00211
00212                         ClientToScreen(_hwnd, &pt);
00213                         HWND hwnd = WindowFromPoint(pt);
00214
00215                         if (hwnd && hwnd!=_hwnd) {
00216                                 ScreenToClient(hwnd, &pt);
00217                                 PostMessage(hwnd, WM_LBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y));
00218                                 PostMessage(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(pt.x, pt.y));
00219                         }
00220                 }
00221                 break;
00222
00223           case WM_CANCELMODE:
00224                 ReleaseCapture();
00225                 break;
00226
00227           default:
00228                 return super::WndProc(nmsg, wparam, lparam);
00229         }
00230
00231         return 0;
00232 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • desktopbar.h
  • desktopbar.cpp


ROS Explorer: Member List

StartButton Member List

This is the complete list of members for StartButton, including all inherited members.

_cx | PictureButton | [protected]
_cy | PictureButton | [protected]
_flat | PictureButton | [protected]
_hBmp | PictureButton | [protected]
_hBrush | PictureButton | [protected]
_hIcon | PictureButton | [protected]
_hwnd | WindowHandle | [protected]
_orgWndProc | SubclassedWindow | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | SubclassedWindow | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawItem(LPDRAWITEMSTRUCT dis) | PictureButton | [protected, virtual]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | SubclassedWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerdrawnButton(HWND hwnd) | OwnerdrawnButton | [inline]
PictureButton(HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) | PictureButton | [inline]
PictureButton(HWND hparent, int id, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) | PictureButton | [inline]
PictureButton(HWND hwnd, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) | PictureButton | [inline]
PictureButton(HWND hparent, int id, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false) | PictureButton | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
StartButton(HWND hwnd) | StartButton |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | StartButton |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | StartButton | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: StartMenu Struct Reference

StartMenu Struct Reference

Startmenu window. More...

#include <startmenu.h>

Inheritance diagram for StartMenu:

[legend]
Collaboration diagram for StartMenu:

[legend]
List of all members.

Public Types

typedef ExtContextMenuHandlerT<
OwnerDrawParent< Window > > 		super

Public Member Functions

StartMenu (HWND hwnd, bool large_icons=false)
StartMenu (HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false)
~StartMenu ()

Static Public Member Functions

static HWND | Create (int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="")

Static Public Attributes

static CREATORFUNC_INFO | s_def_creator = STARTMENU_CREATOR(StartMenu)

Protected Types

enum | SCROLL_MODE { SCROLL_NOT, SCROLL_UP, SCROLL_DOWN }

Protected Member Functions

LRESULT | Init (LPCREATESTRUCT pcs)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Command (int id, int code)
void | ResizeToButtons ()
int | ButtonHitTest (POINT pt)
void | InvalidateSelection ()
const SMBtnInfo * | GetButtonInfo (int id) const
bool | SelectButton (int id, bool open_sub=true)
bool | SelectButtonIndex (int idx, bool open_sub=true)
int | GetSelectionIndex ()
virtual void | ProcessKey (int vk)
bool | Navigate (int step)
bool | OpenSubmenu (bool select_first=false)
bool | JumpToNextShortcut (char c)
void | ResizeButtons (int cx)
virtual void | AddEntries ()
ShellEntryMap::iterator | AddEntry (const String &title, ICON_ID icon_id, Entry *entry)
ShellEntryMap::iterator | AddEntry (const String &title, ICON_ID icon_id=ICID_NONE, int id=-1)
ShellEntryMap::iterator | AddEntry (const ShellFolder folder, ShellEntry *entry)
ShellEntryMap::iterator | AddEntry (const ShellFolder folder, Entry *entry)
void | AddShellEntries (const ShellDirectory &dir, int max=-1, const String &ignore="")
void | AddButton (LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true)
void | AddSeparator ()
bool | CloseSubmenus ()
bool | CloseOtherSubmenus (int id=0)
void | CreateSubmenu (int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
bool | CreateSubmenu (int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
bool | CreateSubmenu (int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
void | CreateSubmenu (int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
void | ActivateEntry (int id, const ShellEntrySet &entries)
virtual void | CloseStartMenu (int id=0)
close all windows of the start menu popup
bool | GetButtonRect (int id, PRECT prect) const
void | DrawFloatingButton (HDC hdc)
void | GetFloatingButtonRect (LPRECT prect)
void | GetArrowButtonRects (LPRECT prect_up, LPRECT prect_down, bool large_icons)
void | DrawArrows (HDC hdc, bool large_icons)
void | Paint (PaintCanvas &canvas)
void | UpdateIcons ()

Static Protected Member Functions

static BtnWindowClass & | GetWndClasss ()

Protected Attributes

int | _next_id
ShellEntryMap _entries
StartMenuShellDirs _dirs
int | _submenu_id
WindowHandle _submenu
int | _border_left
int | _border_top
int | _bottom_max
bool | _floating_btn
bool | _arrow_btns
POINT | _last_pos
enum StartMenu::SCROLL_MODE | _scroll_mode
int | _scroll_pos
int | _invisible_lines
StartMenuCreateInfo _create_info
bool | _large_icons
SMBtnVector _buttons
int | _selected_id
LPARAM | _last_mouse_pos

Detailed Description

Startmenu window.

To create a start menu call its Create() function.

Definition at line 204 of file startmenu.h.

Member Typedef Documentation

typedef ExtContextMenuHandlerT<OwnerDrawParent<Window> > StartMenu::super

Reimplemented from ExtContextMenuHandlerT< OwnerDrawParent< Window > >.

Reimplemented in StartMenuHandler, StartMenuRoot, SettingsMenu, BrowseMenu, SearchMenu, RecentStartMenu, and FavoritesMenu.

Definition at line 212 of file startmenu.h.

Member Enumeration Documentation

enum StartMenu::SCROLL_MODE [protected]

Enumerator:
SCROLL_NOT
SCROLL_UP
SCROLL_DOWN

Definition at line 250 of file startmenu.h.

00250 {SCROLL_NOT, SCROLL_UP, SCROLL_DOWN} _scroll_mode;

Constructor & Destructor Documentation

StartMenu::StartMenu | ( | HWND | hwnd,
 |  | bool | large_icons = false
 | ) |

Definition at line 49 of file startmenu.cpp.

References _arrow_btns, _border_left, _border_top, _bottom_max, _floating_btn, _invisible_lines, _last_mouse_pos, _last_pos, _next_id, _scroll_mode, _scroll_pos, _selected_id, _submenu_id, IDC_FIRST_MENU, and SCROLL_NOT.

00050  :      super(hwnd),
00051         _large_icons(large_icons)
00052 {
00053         _next_id = IDC_FIRST_MENU;
00054         _submenu_id = 0;
00055
00056         _border_left = 0;
00057         _border_top = 0;
00058         _bottom_max = INT_MAX;
00059
00060         _floating_btn = false;
00061         _arrow_btns = false;
00062         _scroll_mode = SCROLL_NOT;
00063         _scroll_pos = 0;
00064         _invisible_lines = 0;
00065
00066         _last_pos = WindowRect(hwnd).pos();
00067 #ifdef _LIGHT_STARTMENU
00068         _selected_id = -1;
00069         _last_mouse_pos = 0;
00070 #endif
00071 }

StartMenu::StartMenu | ( | HWND | hwnd,
 |  | const StartMenuCreateInfo & | create_info,
 |  | bool | large_icons = false
 | ) |

Definition at line 73 of file startmenu.cpp.

References _arrow_btns, _border_left, StartMenuCreateInfo::_border_top, _border_top, _bottom_max, _dirs, _floating_btn, StartMenuCreateInfo::_folders, WindowHandle::_hwnd, _invisible_lines, _last_mouse_pos, _last_pos, _next_id, _scroll_mode, _scroll_pos, _selected_id, _submenu_id, GetDesktopFolder(), IDC_FIRST_MENU, and SCROLL_NOT.

00074  :      super(hwnd),
00075         _create_info(create_info),
00076         _large_icons(large_icons)
00077 {
00078         for(StartMenuFolders::const_iterator it=create_info._folders.begin(); it!=create_info._folders.end(); ++it)
00079                 if (*it)
00080                         _dirs.push_back(ShellDirectory(GetDesktopFolder(), *it, _hwnd));
00081
00082         _next_id = IDC_FIRST_MENU;
00083         _submenu_id = 0;
00084
00085         _border_left = 0;
00086         _border_top = create_info._border_top;
00087         _bottom_max = INT_MAX;
00088
00089         _floating_btn = create_info._border_top? true: false;
00090         _arrow_btns = false;
00091         _scroll_mode = SCROLL_NOT;
00092         _scroll_pos = 0;
00093         _invisible_lines = 0;
00094
00095         _last_pos = WindowRect(hwnd).pos();
00096 #ifdef _LIGHT_STARTMENU
00097         _selected_id = -1;
00098         _last_mouse_pos = 0;
00099 #endif
00100 }

Here is the call graph for this function:

StartMenu::~StartMenu ( )

Definition at line 102 of file startmenu.cpp.

References PM_STARTMENU_CLOSED, and Window::SendParent().

00103 {
00104         SendParent(PM_STARTMENU_CLOSED);
00105 }

Here is the call graph for this function:

Member Function Documentation

void StartMenu::ActivateEntry | ( | int | id,
 |  | const ShellEntrySet & | entries
 | ) | [protected]

Todo:
If the user explicitly clicked on a submenu, display this folder as floating start menu.
Todo:
launch in the background; specify correct HWND for error message box titles

Definition at line 1279 of file startmenu.cpp.

References Entry::_data, Entry::_display_name, Entry::_etype, COUNTOF, Entry::create_absolute_pidl(), ET_SHELL, and Entry::get_path().

Referenced by Command().

01280 {
01281         StartMenuFolders new_folders;
01282         String title;
01283
01284         for(ShellEntrySet::const_iterator it=entries.begin(); it!=entries.end(); ++it) {
01285                 Entry* entry = const_cast<Entry*>(*it);
01286
01287                 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01288
01290
01291                         if (entry->_etype == ET_SHELL)
01292                                 new_folders.push_back(entry->create_absolute_pidl());
01293                         else {
01294                                 TCHAR path[MAX_PATH];
01295
01296                                 if (entry->get_path(path, COUNTOF(path)))
01297                                         new_folders.push_back(path);
01298                         }
01299
01300                         if (title.empty())
01301                                 title = entry->_display_name;
01302                 } else {
01303                          // The entry is no subdirectory, so there can only be one shell entry.
01304                         assert(entries.size()==1);
01305
01306                         HWND hparent = GetParent(_hwnd);
01307                         ShellPath shell_path = entry->create_absolute_pidl();
01308
01309                          // close start menus when launching the selected entry
01310                         CloseStartMenu(id);
01311
01313                         SHELLEXECUTEINFO shexinfo;
01314
01315                         shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
01316                         shexinfo.fMask = SEE_MASK_IDLIST;       // SEE_MASK_INVOKEIDLIST is also possible.
01317                         shexinfo.hwnd = hparent;
01318                         shexinfo.lpVerb = NULL;
01319                         shexinfo.lpFile = NULL;
01320                         shexinfo.lpParameters = NULL;
01321                         shexinfo.lpDirectory = NULL;
01322                         shexinfo.nShow = SW_SHOWNORMAL;
01323
01324                         shexinfo.lpIDList = &*shell_path;
01325
01326                          // add PIDL to the recent file list
01327                         SHAddToRecentDocs(SHARD_PIDL, shexinfo.lpIDList);
01328
01329                         if (!ShellExecuteEx(&shexinfo))
01330                                 display_error(hparent, GetLastError());
01331
01332                          // we may have deleted 'this' - ensure we leave the loop and function
01333                         return;
01334                 }
01335         }
01336
01337         if (!new_folders.empty()) {
01338                  // Only open one submenu at a time.
01339                 if (!CloseOtherSubmenus(id))
01340                         return;
01341
01342                 CreateSubmenu(id, new_folders, title);
01343         }
01344 }

Here is the call graph for this function:

void StartMenu::AddButton | ( | LPCTSTR | title,
 |  | ICON_ID | icon_id = ICID_NONE,
 |  | bool | hasSubmenu = false,
 |  | int | id = -1,
 |  | bool | enabled = true
 | ) | [protected]

Definition at line 1124 of file startmenu.cpp.

References _border_left, _buttons, WindowHandle::_hwnd, ExplorerGlobals::_icon_cache, g_Globals, IconCache::get_icon(), GetStartMenuBtnTextWidth(), ICON_SIZE_X, and STARTMENU_LINE_HEIGHT.

Referenced by FavoritesMenu::AddEntries(), SearchMenu::AddEntries(), BrowseMenu::AddEntries(), SettingsMenu::AddEntries(), StartMenuRoot::AddEntries(), StartMenuRoot::Init(), and Init().

01125 {
01126 #ifdef _LIGHT_STARTMENU
01127         _buttons.push_back(SMBtnInfo(title, icon_id, id, hasSubmenu, enabled));
01128 #else
01129         DWORD style = enabled? WS_VISIBLE|WS_CHILD|BS_OWNERDRAW: WS_VISIBLE|WS_CHILD|BS_OWNERDRAW|WS_DISABLED;
01130
01131         WindowRect rect(_hwnd);
01132         ClientRect clnt(_hwnd);
01133
01134          // increase window height to make room for the new button
01135         rect.top -= STARTMENU_LINE_HEIGHT;
01136
01137          // move down if we are too high now
01138         if (rect.top < 0) {
01139                 rect.top += STARTMENU_LINE_HEIGHT;
01140                 rect.bottom += STARTMENU_LINE_HEIGHT;
01141         }
01142
01143         WindowCanvas canvas(_hwnd);
01144         FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
01145
01146          // widen window, if it is too small
01147         int text_width = GetStartMenuBtnTextWidth(canvas, title, _hwnd) + ICON_SIZE_X + 10/*placeholder*/ + 16/*arrow*/;
01148
01149         int cx = clnt.right - _border_left;
01150         if (text_width > cx)
01151                 rect.right += text_width-cx;
01152
01153         MoveWindow(_hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, TRUE);
01154
01155         StartMenuCtrl(_hwnd, _border_left, clnt.bottom, rect.right-rect.left-_border_left,
01156                                         title, id, g_Globals._icon_cache.get_icon(icon_id)._hIcon, hasSubmenu, style);
01157 #endif
01158 }

Here is the call graph for this function:

void StartMenu::AddEntries ( ) [protected, virtual]

Reimplemented in StartMenuRoot, SettingsMenu, BrowseMenu, SearchMenu, RecentStartMenu, and FavoritesMenu.

Definition at line 211 of file startmenu.cpp.

References _dirs, AddShellEntries(), SCAN_FILESYSTEM, and SORT_NAME.

Referenced by FavoritesMenu::AddEntries(), SearchMenu::AddEntries(), BrowseMenu::AddEntries(), SettingsMenu::AddEntries(), StartMenuRoot::AddEntries(), and Init().

00212 {
00213         for(StartMenuShellDirs::iterator it=_dirs.begin(); it!=_dirs.end(); ++it) {
00214                 StartMenuDirectory& smd = *it;
00215                 ShellDirectory& dir = smd._dir;
00216
00217                 if (!dir._scanned) {
00218                         WaitCursor wait;
00219
00220 #ifdef _LAZY_ICONEXTRACT
00221                         dir.smart_scan(SORT_NAME, SCAN_FILESYSTEM);     // lazy icon extraction, try to read directly from filesystem
00222 #else
00223                         dir.smart_scan(SORT_NAME, SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM);
00224 #endif
00225                 }
00226
00227                 AddShellEntries(dir, -1, smd._ignore);
00228         }
00229 }

Here is the call graph for this function:

ShellEntryMap::iterator StartMenu::AddEntry | ( | const ShellFolder | folder,
 |  | Entry * | entry
 | ) | [protected]

Definition at line 1111 of file startmenu.cpp.

References Entry::_data, Entry::_display_name, Entry::_icon_id, AddEntry(), and ICID_FOLDER.

01112 {
01113         ICON_ID icon_id;
01114
01115         if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
01116                 icon_id = ICID_FOLDER;
01117         else
01118                 icon_id = (ICON_ID)/*@@*/ entry->_icon_id;
01119
01120         return AddEntry(entry->_display_name, icon_id, entry);
01121 }

Here is the call graph for this function:

ShellEntryMap::iterator StartMenu::AddEntry | ( | const ShellFolder | folder,
 |  | ShellEntry * | entry
 | ) | [protected]

Definition at line 1099 of file startmenu.cpp.

References Entry::_data, Entry::_icon_id, ShellEntry::_pidl, AddEntry(), ShellFolder::get_name(), and ICID_FOLDER.

01100 {
01101         ICON_ID icon_id;
01102
01103         if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
01104                 icon_id = ICID_FOLDER;
01105         else
01106                 icon_id = (ICON_ID)/*@@*/ entry->_icon_id;
01107
01108         return AddEntry(folder.get_name(entry->_pidl), icon_id, entry);
01109 }

Here is the call graph for this function:

ShellEntryMap::iterator StartMenu::AddEntry | ( | const String & | title,
 |  | ICON_ID | icon_id = ICID_NONE,
 |  | int | id = -1
 | ) | [protected]

Definition at line 1084 of file startmenu.cpp.

References _entries, StartMenuEntry::_icon_id, _next_id, and StartMenuEntry::_title.

01085 {
01086         if (id == -1)
01087                 id = ++_next_id;
01088
01089         StartMenuEntry sme;
01090
01091         sme._title = title;
01092         sme._icon_id = icon_id;
01093
01094         ShellEntryMap::iterator it = _entries.insert(make_pair(id, sme)).first;
01095
01096         return it;
01097 }

ShellEntryMap::iterator StartMenu::AddEntry | ( | const String & | title,
 |  | ICON_ID | icon_id,
 |  | Entry * | entry
 | ) | [protected]

Todo:
speed up by using a map indexed by name

Definition at line 1059 of file startmenu.cpp.

References Entry::_data, and _entries.

Referenced by AddEntry().

01060 {
01061          // search for an already existing subdirectory entry with the same name
01062         if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
01063                 for(ShellEntryMap::iterator it=_entries.begin(); it!=_entries.end(); ++it) {
01064                         StartMenuEntry& sme = it->second;
01065
01066                         if (!_tcsicmp(sme._title, title))
01067                                 for(ShellEntrySet::iterator it2=sme._entries.begin(); it2!=sme._entries.end(); ++it2) {
01068                                         if ((*it2)->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
01069                                                  // merge the new shell entry with the existing of the same name
01070                                                 sme._entries.insert(entry);
01071
01072                                                 return it;
01073                                         }
01074                                 }
01075                 }
01076
01077         ShellEntryMap::iterator sme = AddEntry(title, icon_id);
01078
01079         sme->second._entries.insert(entry);
01080
01081         return sme;
01082 }

void StartMenu::AddSeparator ( ) [protected]

Definition at line 1160 of file startmenu.cpp.

References _border_left, _buttons, WindowHandle::_hwnd, ICID_NONE, STARTMENU_LINE_HEIGHT, and STARTMENU_SEP_HEIGHT.

Referenced by StartMenuRoot::Init().

01161 {
01162 #ifdef _LIGHT_STARTMENU
01163         _buttons.push_back(SMBtnInfo(NULL, ICID_NONE, -1, false));
01164 #else
01165         WindowRect rect(_hwnd);
01166         ClientRect clnt(_hwnd);
01167
01168          // increase window height to make room for the new separator
01169         rect.top -= STARTMENU_SEP_HEIGHT;
01170
01171          // move down if we are too high now
01172         if (rect.top < 0) {
01173                 rect.top += STARTMENU_LINE_HEIGHT;
01174                 rect.bottom += STARTMENU_LINE_HEIGHT;
01175         }
01176
01177         MoveWindow(_hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, TRUE);
01178
01179         StartMenuSeparator(_hwnd, _border_left, clnt.bottom, rect.right-rect.left-_border_left);
01180 #endif
01181 }

void StartMenu::AddShellEntries | ( | const ShellDirectory & | dir,
 |  | int | max = -1,
 |  | const String & | ignore = ""
 | ) | [protected]

Definition at line 245 of file startmenu.cpp.

References _MAX_EXT, _MAX_FNAME, _tsplitpath_s, COUNTOF, and ShellDirectory::get_path().

Referenced by RecentStartMenu::AddEntries(), and AddEntries().

00246 {
00247         TCHAR ignore_path[MAX_PATH], ignore_dir[MAX_PATH], ignore_name[_MAX_FNAME], ignore_ext[_MAX_EXT];
00248         TCHAR dir_path[MAX_PATH];
00249
00250         if (!ignore.empty()) {
00251                 _tsplitpath_s(ignore, ignore_path, COUNTOF(ignore_path), ignore_dir, COUNTOF(ignore_dir), ignore_name, COUNTOF(ignore_name), ignore_ext, COUNTOF(ignore_ext));
00252
00253                 _tcscat(ignore_path, ignore_dir);
00254                 _tcscat(ignore_name, ignore_ext);
00255
00256                 dir.get_path(dir_path, COUNTOF(dir_path));
00257
00258                 if (_tcsicmp(trim_path_slash(dir_path), trim_path_slash(ignore_path)))
00259                         *ignore_name = '\0';
00260         } else
00261                 *ignore_name = '\0';
00262
00263         String lwr_filter = _create_info._filter;
00264         lwr_filter.toLower();
00265
00266         int cnt = 0;
00267         for(Entry*entry=dir._down; entry; entry=entry->_next) {
00268                  // hide files like "desktop.ini"
00269                 if (entry->_shell_attribs & SFGAO_HIDDEN)
00270                 //not appropriate for drive roots: if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
00271                         continue;
00272
00273                  // hide "Programs" subfolders if requested
00274                 if (*ignore_name && !_tcsicmp(entry->_data.cFileName, ignore_name))
00275                         continue;
00276
00277                  // only 'max' entries shall be added.
00278                 if (++cnt == max)
00279                         break;
00280
00281                  // filter only non-directory entries
00282                 if (!(entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && !lwr_filter.empty()) {
00283                         String lwr_name = entry->_data.cFileName;
00284                         String lwr_disp = entry->_display_name;
00285
00286                         lwr_name.toLower();
00287                         lwr_disp.toLower();
00288
00289                         if (!_tcsstr(lwr_name,lwr_filter) && !_tcsstr(lwr_disp,lwr_filter))
00290                                 continue;
00291                 }
00292
00293                 if (entry->_etype == ET_SHELL)
00294                         AddEntry(dir._folder, static_cast<ShellEntry*>(entry));
00295                 else
00296                         AddEntry(dir._folder, entry);
00297         }
00298 }

Here is the call graph for this function:

int StartMenu::ButtonHitTest ( POINT pt ) [protected]

Definition at line 515 of file startmenu.cpp.

References _border_left, _border_top, _bottom_max, _buttons, WindowHandle::_hwnd, _large_icons, _scroll_pos, STARTMENU_LINE_HEIGHT, and STARTMENU_SEP_HEIGHT.

00516 {
00517         ClientRect clnt(_hwnd);
00518         const bool large_icons = _large_icons;
00519         RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT};
00520
00521         if (pt.x<rect.left || pt.x>rect.right)
00522                 return 0;
00523
00524         for(SMBtnVector::const_iterator it=_buttons.begin()+_scroll_pos; it!=_buttons.end(); ++it) {
00525                 const SMBtnInfo& info = *it;
00526
00527                 if (rect.top > pt.y)
00528                         break;
00529
00530                 rect.bottom = rect.top + (info._id==-1? STARTMENU_SEP_HEIGHT: STARTMENU_LINE_HEIGHT);
00531
00532                 if (rect.bottom > _bottom_max)
00533                         break;
00534
00535                 if (pt.y < rect.bottom) // PtInRect(&rect, pt)
00536                         return info._id;
00537
00538                 rect.top = rect.bottom;
00539         }
00540
00541         return 0;
00542 }

bool StartMenu::CloseOtherSubmenus ( int id = 0 ) [protected]

Definition at line 1184 of file startmenu.cpp.

References _submenu, and _submenu_id.

Referenced by CloseSubmenus(), FavoritesMenu::Command(), CreateSubmenu(), StartMenuRoot::ProcessKey(), ProcessKey(), and SelectButton().

01185 {
01186         if (_submenu) {
01187                 if (IsWindow(_submenu)) {
01188                         if (_submenu_id == id)
01189                                 return false;
01190                         else {
01191                                 _submenu_id = 0;
01192                                 DestroyWindow(_submenu);
01193                                 // _submenu should be reset automatically by PM_STARTMENU_CLOSED, but safety first...
01194                         }
01195                 }
01196
01197                 _submenu = 0;
01198         }
01199
01200         return true;
01201 }

void StartMenu::CloseStartMenu ( int id = 0 ) [protected, virtual]

close all windows of the start menu popup

Reimplemented in StartMenuRoot.

Definition at line 1348 of file startmenu.cpp.

References WindowHandle::_hwnd, _submenu, CloseSubmenus(), PM_STARTENTRY_LAUNCHED, and Window::SendParent().

Referenced by FavoritesMenu::Command(), StartMenuHandler::Command(), Command(), and ProcessKey().

01349 {
01350         if (!(GetWindowStyle(_hwnd) & WS_CAPTION)) {    // don't automatically close floating menus
01351                 if (!SendParent(PM_STARTENTRY_LAUNCHED, id, (LPARAM)_hwnd))
01352                         DestroyWindow(_hwnd);
01353         } else if (_submenu)    // instead close submenus of floating parent menus
01354                 CloseSubmenus();
01355 }

Here is the call graph for this function:

bool StartMenu::CloseSubmenus ( ) [inline, protected]

Definition at line 291 of file startmenu.h.

References CloseOtherSubmenus().

Referenced by StartMenuRoot::CloseStartMenu(), and CloseStartMenu().

00291 {return CloseOtherSubmenus();}

Here is the call graph for this function:

int StartMenu::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Window.

Reimplemented in StartMenuHandler, and FavoritesMenu.

Definition at line 1032 of file startmenu.cpp.

References _entries, ActivateEntry(), CloseStartMenu(), and Window::Command().

Referenced by StartMenuHandler::Command(), OpenSubmenu(), and ProcessKey().

01033 {
01034 #ifndef _LIGHT_STARTMENU
01035         switch(id) {
01036           case IDCANCEL:
01037                 CloseStartMenu(id);
01038                 break;
01039
01040           default: {
01041 #endif
01042                 ShellEntryMap::iterator found = _entries.find(id);
01043
01044                 if (found != _entries.end()) {
01045                         ActivateEntry(id, found->second._entries);
01046                         return 0;
01047                 }
01048
01049                 return super::Command(id, code);
01050 #ifndef _LIGHT_STARTMENU
01051           }
01052         }
01053
01054         return 0;
01055 #endif
01056 }

Here is the call graph for this function:

static HWND StartMenu::Create | ( | int | x,
 |  | int | y,
 |  | const StartMenuFolders & | ,
 |  | HWND | hwndParent,
 |  | LPCTSTR | title,
 |  | CREATORFUNC_INFO | creator = s_def_creator,
 |  | void * | info = NULL,
 |  | const String & | filter = ""
 | ) | [static]

void StartMenu::CreateSubmenu | ( | int | id,
 |  | const StartMenuFolders & | new_folders,
 |  | LPCTSTR | title,
 |  | CREATORFUNC_INFO | creator = s_def_creator,
 |  | void * | info = NULL
 | ) | [protected]

bool StartMenu::CreateSubmenu | ( | int | id,
 |  | int | folder1,
 |  | int | folder2,
 |  | LPCTSTR | title,
 |  | CREATORFUNC_INFO | creator = s_def_creator,
 |  | void * | info = NULL
 | ) | [protected]

Definition at line 1228 of file startmenu.cpp.

References WindowHandle::_hwnd.

01229 {
01230         StartMenuFolders new_folders;
01231
01232         try {
01233                 new_folders.push_back(SpecialFolderPath(folder_id1, _hwnd));
01234         } catch(COMException&) {
01235         }
01236
01237         try {
01238                 new_folders.push_back(SpecialFolderPath(folder_id2, _hwnd));
01239         } catch(COMException&) {
01240         }
01241
01242         if (!new_folders.empty()) {
01243                 CreateSubmenu(id, new_folders, title, creator, info);
01244                 return true;
01245         } else {
01246                 CloseOtherSubmenus(id);
01247                 _buttons[GetSelectionIndex()]._enabled = false; // disable entries for non-existing folders
01248                 return false;
01249         }
01250 }

bool StartMenu::CreateSubmenu | ( | int | id,
 |  | int | folder,
 |  | LPCTSTR | title,
 |  | CREATORFUNC_INFO | creator = s_def_creator,
 |  | void * | info = NULL
 | ) | [protected]

Definition at line 1209 of file startmenu.cpp.

References _buttons, WindowHandle::_hwnd, CloseOtherSubmenus(), CreateSubmenu(), and GetSelectionIndex().

01210 {
01211         try {
01212                 SpecialFolderPath folder(folder_id, _hwnd);
01213
01214                 StartMenuFolders new_folders;
01215                 new_folders.push_back(folder);
01216
01217                 CreateSubmenu(id, new_folders, title, creator, info);
01218
01219                 return true;
01220         } catch(COMException&) {
01221                 // ignore Exception and don't display anything
01222                 CloseOtherSubmenus(id);
01223                 _buttons[GetSelectionIndex()]._enabled = false; // disable entries for non-existing folders
01224                 return false;
01225         }
01226 }

Here is the call graph for this function:

void StartMenu::CreateSubmenu | ( | int | id,
 |  | LPCTSTR | title,
 |  | CREATORFUNC_INFO | creator = s_def_creator,
 |  | void * | info = NULL
 | ) | [protected]

Definition at line 1204 of file startmenu.cpp.

Referenced by FavoritesMenu::Command(), StartMenuHandler::Command(), and CreateSubmenu().

01205 {
01206         CreateSubmenu(id, StartMenuFolders(), title, creator, info);
01207 }

void StartMenu::DrawArrows | ( | HDC | hdc,
 |  | bool | large_icons
 | ) | [protected]

Definition at line 826 of file startmenu.cpp.

References _floating_btn, WindowHandle::_hwnd, IDI_ARROW_DOWN, and IDI_ARROW_UP.

Referenced by Paint().

00827 {
00828         int cx = large_icons? 16: 8;
00829         int cy = large_icons? 8: 4;
00830
00831         ResIconEx arrowUpIcon(IDI_ARROW_UP, cx, cy);
00832         ResIconEx arrowDownIcon(IDI_ARROW_DOWN, cx, cy);
00833
00834         ClientRect clnt(_hwnd);
00835
00836         DrawIconEx(hdc, clnt.right/2-cx/2, _floating_btn?3:1, arrowUpIcon, cx, cy, 0, 0, DI_NORMAL);
00837         DrawIconEx(hdc, clnt.right/2-cx/2, clnt.bottom-cy-1, arrowDownIcon, cx, cy, 0, 0, DI_NORMAL);
00838 }

void StartMenu::DrawFloatingButton ( HDC hdc ) [protected]

Definition at line 807 of file startmenu.cpp.

References WindowHandle::_hwnd, and IDI_FLOATING.

Referenced by Paint().

00808 {
00809         static ResIconEx floatingIcon(IDI_FLOATING, 8, 4);
00810
00811         ClientRect clnt(_hwnd);
00812
00813         DrawIconEx(hdc, clnt.right-12, 0, floatingIcon, 8, 4, 0, 0, DI_NORMAL);
00814 }

void StartMenu::GetArrowButtonRects | ( | LPRECT | prect_up,
 |  | LPRECT | prect_down,
 |  | bool | large_icons
 | ) | [protected]

Definition at line 840 of file startmenu.cpp.

References _floating_btn, and WindowHandle::_hwnd.

00841 {
00842         int cx = large_icons? 16: 8;
00843         int cy = large_icons? 8: 4;
00844
00845         GetClientRect(_hwnd, prect_up);
00846         *prect_down = *prect_up;
00847
00848 //      prect_up->left = prect_up->right/2 - cx/2;
00849 //      prect_up->right = prect_up->left + cy;
00850         prect_up->right -= cx;
00851         prect_up->top = _floating_btn? cy-1: 1;
00852         prect_up->bottom = prect_up->top + cy;
00853
00854 //      prect_down->left = prect_down->right/2 - cx/2;
00855 //      prect_down->right = prect_down->left + cy;
00856         prect_down->right -= cx;
00857         prect_down->top = prect_down->bottom - cy - 1;
00858 }

const SMBtnInfo * StartMenu::GetButtonInfo ( int id ) const [protected]

Definition at line 567 of file startmenu.cpp.

References _buttons.

Referenced by OpenSubmenu(), and SelectButton().

00568 {
00569         for(SMBtnVector::const_iterator it=_buttons.begin(); it!=_buttons.end(); ++it)
00570                 if (it->_id == id)
00571                         return &*it;
00572
00573         return NULL;
00574 }

bool StartMenu::GetButtonRect | ( | int | id,
 |  | PRECT | prect
 | ) | const [protected]

Definition at line 772 of file startmenu.cpp.

References _border_left, _border_top, _buttons, WindowHandle::_hwnd, _large_icons, _scroll_pos, and STARTMENU_LINE_HEIGHT.

Referenced by UpdateIcons().

00773 {
00774 #ifdef _LIGHT_STARTMENU
00775         ClientRect clnt(_hwnd);
00776         const bool large_icons = _large_icons;
00777         RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT};
00778
00779         for(SMBtnVector::const_iterator it=_buttons.begin()+_scroll_pos; it!=_buttons.end(); ++it) {
00780                 const SMBtnInfo& info = *it;
00781
00782                 rect.bottom = rect.top + (info._id==-1? STARTMENU_SEP_HEIGHT: STARTMENU_LINE_HEIGHT);
00783
00784                 if (info._id == id) {
00785                         *prect = rect;
00786                         return true;
00787                 }
00788
00789                 rect.top = rect.bottom;
00790         }
00791
00792         return false;
00793 #else
00794         HWND btn = GetDlgItem(_hwnd, id);
00795
00796         if (btn) {
00797                 GetWindowRect(btn, prect);
00798                 ScreenToClient(_hwnd, prect);
00799
00800                 return true;
00801         } else
00802                 return false;
00803 #endif
00804 }

void StartMenu::GetFloatingButtonRect ( LPRECT prect ) [protected]

Definition at line 816 of file startmenu.cpp.

References WindowHandle::_hwnd.

00817 {
00818         GetClientRect(_hwnd, prect);
00819
00820         prect->right -= 4;
00821         prect->left = prect->right - 8;
00822         prect->bottom = 4;
00823 }

int StartMenu::GetSelectionIndex ( ) [protected]

Definition at line 631 of file startmenu.cpp.

References _buttons, and _selected_id.

Referenced by CreateSubmenu(), JumpToNextShortcut(), and Navigate().

00632 {
00633         if (_selected_id == -1)
00634                 return -1;
00635
00636         for(int i=0; i<(int)_buttons.size(); ++i)
00637                 if (_buttons[i]._id == _selected_id)
00638                         return i;
00639
00640         return -1;
00641 }

BtnWindowClass & StartMenu::GetWndClasss ( ) [static, protected]

Definition at line 110 of file startmenu.cpp.

References CLASSNAME_STARTMENU.

Referenced by StartMenuRoot::Create().

00111 {
00112         static BtnWindowClass s_wcStartMenu(CLASSNAME_STARTMENU);
00113
00114         return s_wcStartMenu;
00115 }

LRESULT StartMenu::Init ( LPCREATESTRUCT pcs ) [protected, virtual]

Reimplemented from Window.

Reimplemented in StartMenuRoot.

Definition at line 166 of file startmenu.cpp.

References _buttons, _entries, WindowHandle::_hwnd, AddButton(), AddEntries(), ICID_NONE, IDS_EMPTY, Window::Init(), PM_UPDATE_ICONS, and ResizeToButtons().

Referenced by StartMenuRoot::Init().

00167 {
00168         try {
00169                 AddEntries();
00170
00171                 if (super::Init(pcs))
00172                         return 1;
00173
00174                  // create buttons for registered entries in _entries
00175                 for(ShellEntryMap::const_iterator it=_entries.begin(); it!=_entries.end(); ++it) {
00176                         const StartMenuEntry& sme = it->second;
00177                         bool hasSubmenu = false;
00178
00179                         for(ShellEntrySet::const_iterator it=sme._entries.begin(); it!=sme._entries.end(); ++it)
00180                                 if ((*it)->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00181                                         hasSubmenu = true;
00182
00183 #ifdef _LIGHT_STARTMENU
00184                         _buttons.push_back(SMBtnInfo(sme, it->first, hasSubmenu));
00185 #else
00186                         AddButton(sme._title, sme._hIcon, hasSubmenu, it->first);
00187 #endif
00188                 }
00189
00190 #ifdef _LIGHT_STARTMENU
00191                 if (_buttons.empty())
00192 #else
00193                 if (!GetWindow(_hwnd, GW_CHILD))
00194 #endif
00195                         AddButton(ResString(IDS_EMPTY), ICID_NONE, false, 0, false);
00196
00197 #ifdef _LIGHT_STARTMENU
00198                 ResizeToButtons();
00199 #endif
00200
00201 #ifdef _LAZY_ICONEXTRACT
00202                 PostMessage(_hwnd, PM_UPDATE_ICONS, 0, 0);
00203 #endif
00204         } catch(COMException& e) {
00205                 HandleException(e, pcs->hwndParent);    // destroys the start menu window while switching focus
00206         }
00207
00208         return 0;
00209 }

Here is the call graph for this function:

void StartMenu::InvalidateSelection ( ) [protected]

Definition at line 544 of file startmenu.cpp.

References _border_left, _border_top, _buttons, WindowHandle::_hwnd, _large_icons, _scroll_pos, _selected_id, and STARTMENU_LINE_HEIGHT.

Referenced by OpenSubmenu(), and SelectButton().

00545 {
00546         if (_selected_id <= 0)
00547                 return;
00548
00549         ClientRect clnt(_hwnd);
00550         const bool large_icons = _large_icons;
00551         RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT};
00552
00553         for(SMBtnVector::const_iterator it=_buttons.begin()+_scroll_pos; it!=_buttons.end(); ++it) {
00554                 const SMBtnInfo& info = *it;
00555
00556                 rect.bottom = rect.top + (info._id==-1? STARTMENU_SEP_HEIGHT: STARTMENU_LINE_HEIGHT);
00557
00558                 if (info._id == _selected_id) {
00559                         InvalidateRect(_hwnd, &rect, TRUE);
00560                         break;
00561                 }
00562
00563                 rect.top = rect.bottom;
00564         }
00565 }

bool StartMenu::JumpToNextShortcut ( char c ) [protected]

Definition at line 719 of file startmenu.cpp.

References _buttons, and GetSelectionIndex().

Referenced by ProcessKey().

00720 {
00721         int cur_idx = GetSelectionIndex();
00722
00723         if (cur_idx == -1)
00724                 cur_idx = 0;
00725
00726         int first_found = 0;
00727         int found_more = 0;
00728
00729         SMBtnVector::const_iterator cur_it = _buttons.begin();
00730         cur_it += cur_idx + 1;
00731
00732          // first search down from current item...
00733         SMBtnVector::const_iterator it = cur_it;
00734         for(; it!=_buttons.end(); ++it) {
00735                 const SMBtnInfo& btn = *it;
00736
00737                 if (!btn._title.empty() && toupper((TBYTE)btn._title.at(0)) == c) {
00738                         if (!first_found)
00739                                 first_found = btn._id;
00740                         else
00741                                 ++found_more;
00742                 }
00743         }
00744
00745          // ...now search from top to the current item
00746         it = _buttons.begin();
00747         for(; it!=_buttons.end() && it!=cur_it; ++it) {
00748                 const SMBtnInfo& btn = *it;
00749
00750                 if (!btn._title.empty() && toupper((TBYTE)btn._title.at(0)) == c) {
00751                         if (!first_found)
00752                                 first_found = btn._id;
00753                         else
00754                                 ++found_more;
00755                 }
00756         }
00757
00758         if (first_found) {
00759                 SelectButton(first_found);
00760
00761                 if (!found_more)
00762                         Command(first_found, BN_CLICKED);
00763
00764                 return true;
00765         } else
00766                 return false;
00767 }

Here is the call graph for this function:

bool StartMenu::Navigate ( int step ) [protected]

Definition at line 696 of file startmenu.cpp.

References _buttons, GetSelectionIndex(), and SelectButtonIndex().

Referenced by ProcessKey().

00697 {
00698         int idx = GetSelectionIndex();
00699
00700         if (idx == -1)
00701                 if (step > 0)
00702                         idx = 0 - step;
00703                 else
00704                         idx = _buttons.size() - step;
00705
00706         for(;;) {
00707                 idx += step;
00708
00709                 if (idx<0 || idx>(int)_buttons.size())
00710                         break;
00711
00712                 if (SelectButtonIndex(idx, false))
00713                         return true;
00714         }
00715
00716         return false;
00717 }

Here is the call graph for this function:

bool StartMenu::OpenSubmenu ( bool select_first = false ) [protected]

Definition at line 607 of file startmenu.cpp.

References SMBtnInfo::_hasSubmenu, WindowHandle::_hwnd, _selected_id, _submenu, Command(), GetButtonInfo(), InvalidateSelection(), and PM_SELECT_ENTRY.

Referenced by ProcessKey(), and SelectButton().

00608 {
00609         if (_selected_id == -1)
00610                 return false;
00611
00612         InvalidateSelection();
00613
00614         const SMBtnInfo* btn = GetButtonInfo(_selected_id);
00615
00616          // automatically open submenus
00617         if (btn->_hasSubmenu) {
00618                 //@@ allows destroying of startmenu when processing PM_UPDATE_ICONS -> GPF
00619                 UpdateWindow(_hwnd);    // draw focused button before waiting on submenu creation
00620                 Command(_selected_id, BN_CLICKED);
00621
00622                 if (select_first && _submenu)
00623                         SendMessage(_submenu, PM_SELECT_ENTRY, (WPARAM)false, 0);
00624
00625                 return true;
00626         } else
00627                 return false;
00628 }

Here is the call graph for this function:

void StartMenu::Paint ( PaintCanvas & canvas ) [protected]

Reimplemented in StartMenuRoot.

Definition at line 861 of file startmenu.cpp.

References _arrow_btns, _border_left, _border_top, _bottom_max, _buttons, _floating_btn, WindowHandle::_hwnd, _large_icons, _scroll_pos, _selected_id, DrawArrows(), DrawFloatingButton(), DrawStartMenuButton(), STARTMENU_LINE_HEIGHT, and STARTMENU_SEP_HEIGHT.

Referenced by StartMenuRoot::Paint(), and WndProc().

00862 {
00863         if (_floating_btn)
00864                 DrawFloatingButton(canvas);
00865
00866 #ifdef _LIGHT_STARTMENU
00867         if (_arrow_btns)
00868                 DrawArrows(canvas, _large_icons);
00869
00870         ClientRect clnt(_hwnd);
00871         const bool large_icons = _large_icons;
00872         RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT};
00873
00874         int sep_width = rect.right-rect.left - 4;
00875
00876         FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
00877         BkMode bk_mode(canvas, TRANSPARENT);
00878
00879         for(SMBtnVector::const_iterator it=_buttons.begin()+_scroll_pos; it!=_buttons.end(); ++it) {
00880                 const SMBtnInfo& btn = *it;
00881
00882                 if (rect.top > canvas.rcPaint.bottom)
00883                         break;
00884
00885                 if (btn._id == -1) {    // a separator?
00886                         rect.bottom = rect.top + STARTMENU_SEP_HEIGHT;
00887
00888                         if (rect.bottom > _bottom_max)
00889                                 break;
00890
00891                         BrushSelection brush_sel(canvas, GetSysColorBrush(COLOR_BTNSHADOW));
00892                         PatBlt(canvas, rect.left+2, rect.top+STARTMENU_SEP_HEIGHT/2-1, sep_width, 1, PATCOPY);
00893
00894                         SelectBrush(canvas, GetSysColorBrush(COLOR_BTNHIGHLIGHT));
00895                         PatBlt(canvas, rect.left+2, rect.top+STARTMENU_SEP_HEIGHT/2, sep_width, 1, PATCOPY);
00896                 } else {
00897                         rect.bottom = rect.top + STARTMENU_LINE_HEIGHT;
00898
00899                         if (rect.bottom > _bottom_max)
00900                                 break;
00901
00902                         if (rect.top >= canvas.rcPaint.top)
00903                                 DrawStartMenuButton(canvas, rect, btn._title, btn, btn._id==_selected_id, false, _large_icons);
00904                 }
00905
00906                 rect.top = rect.bottom;
00907         }
00908 #endif
00909 }

Here is the call graph for this function:

void StartMenu::ProcessKey ( int vk ) [protected, virtual]

Reimplemented in StartMenuRoot.

Definition at line 651 of file startmenu.cpp.

References _buttons, WindowHandle::_hwnd, _selected_id, _submenu, CloseOtherSubmenus(), CloseStartMenu(), Command(), JumpToNextShortcut(), Navigate(), OpenSubmenu(), and SelectButtonIndex().

Referenced by StartMenuRoot::ProcessKey().

00652 {
00653         switch(vk) {
00654           case VK_RETURN:
00655                 if (_selected_id)
00656                         Command(_selected_id, BN_CLICKED);
00657                 break;
00658
00659           case VK_UP:
00660                 Navigate(-1);
00661                 break;
00662
00663           case VK_DOWN:
00664                 Navigate(+1);
00665                 break;
00666
00667           case VK_HOME:
00668                 SelectButtonIndex(0, false);
00669                 break;
00670
00671           case VK_END:
00672                 SelectButtonIndex(_buttons.size()-1, false);
00673                 break;
00674
00675           case VK_LEFT:
00676                 if (_submenu)
00677                         CloseOtherSubmenus();
00678                 else if (!(GetWindowStyle(_hwnd) & WS_CAPTION)) // don't automatically close floating menus
00679                         DestroyWindow(_hwnd);
00680                 break;
00681
00682           case VK_RIGHT:
00683                 OpenSubmenu(true);
00684                 break;
00685
00686           case VK_ESCAPE:
00687                 CloseStartMenu();
00688                 break;
00689
00690           default:
00691                 if (vk>='0' && vk<='Z')
00692                         JumpToNextShortcut(vk);
00693         }
00694 }

Here is the call graph for this function:

void StartMenu::ResizeButtons ( int cx ) [protected]

Definition at line 1010 of file startmenu.cpp.

References WindowHandle::_hwnd, and HWND.

01011 {
01012         HDWP hdwp = BeginDeferWindowPos(10);
01013
01014         for(HWND ctrl=GetWindow(_hwnd,GW_CHILD); ctrl; ctrl=GetNextWindow(ctrl,GW_HWNDNEXT)) {
01015                 ClientRect rt(ctrl);
01016
01017                 if (rt.right != cx) {
01018                         int height = rt.bottom - rt.top;
01019
01020                          // special handling for separator controls
01021                         if (!height && (GetWindowStyle(ctrl)&SS_TYPEMASK)==SS_ETCHEDHORZ)
01022                                 height = 2;
01023
01024                         hdwp = DeferWindowPos(hdwp, ctrl, 0, 0, 0, cx, height, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
01025                 }
01026         }
01027
01028         EndDeferWindowPos(hdwp);
01029 }

void StartMenu::ResizeToButtons ( ) [protected]

Definition at line 1430 of file startmenu.cpp.

References _buttons, WindowHandle::_hwnd, _large_icons, GetStartMenuBtnTextWidth(), STARTMENU_LINE_HEIGHT, STARTMENU_SEP_HEIGHT, and STARTMENU_WIDTH_MIN.

Referenced by StartMenuRoot::Init(), Init(), and StartMenuRoot::TrackStartmenu().

01431 {
01432         WindowRect rect(_hwnd);
01433
01434         WindowCanvas canvas(_hwnd);
01435         FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
01436
01437         const bool large_icons = _large_icons;
01438
01439         int max_width = STARTMENU_WIDTH_MIN;
01440         int height = 0;
01441
01442         for(SMBtnVector::const_iterator it=_buttons.begin(); it!=_buttons.end(); ++it) {
01443                 int w = GetStartMenuBtnTextWidth(canvas, it->_title, _hwnd);
01444
01445                 if (w > max_width)
01446                         max_width = w;
01447
01448                 if (it->_id == -1)
01449                         height += STARTMENU_SEP_HEIGHT;
01450                 else
01451                         height += STARTMENU_LINE_HEIGHT;
01452         }
01453
01454          // calculate new window size
01455         int text_width = max_width + ICON_SIZE_X + 10/*placeholder*/ + 16/*arrow*/;
01456
01457         RECT rt_hgt = {rect.left, rect.bottom-_border_top-height, rect.left+_border_left+text_width, rect.bottom};
01458         AdjustWindowRectEx(&rt_hgt, GetWindowStyle(_hwnd), FALSE, GetWindowExStyle(_hwnd));
01459
01460          // ignore movement, only look at the size change
01461         rect.right = rect.left + (rt_hgt.right-rt_hgt.left);
01462         rect.top = rect.bottom - (rt_hgt.bottom-rt_hgt.top);
01463
01464          // move down if we are too high
01465         if (rect.top < 0) {
01466                 int dy = -rect.top;
01467                 rect.top += dy;
01468                 rect.bottom += dy;
01469         }
01470
01471          // enable scroll mode for long start menus, which span more than the whole screen height
01472         int cyscreen = GetSystemMetrics(SM_CYSCREEN);
01473         int bottom_max = 0;
01474
01475         if (rect.bottom > cyscreen) {
01476                 _arrow_btns = true;
01477
01478                 _invisible_lines = (rect.bottom-cyscreen+(STARTMENU_LINE_HEIGHT-1))/STARTMENU_LINE_HEIGHT + 1;
01479                 rect.bottom -= _invisible_lines * STARTMENU_LINE_HEIGHT;
01480
01481                 bottom_max = rect.bottom;
01482
01483                 if (_floating_btn)
01484                         rect.bottom += 6;       // lower scroll arrow
01485                 else {
01486                         _border_top += 6;       // upper scroll arrow
01487                         rect.bottom += 2*6;     // upper+lower scroll arrow
01488                 }
01489         }
01490
01491         MoveWindow(_hwnd, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, TRUE);
01492
01493         if (bottom_max) {
01494                 POINT pt = {0, bottom_max};
01495
01496                 ScreenToClient(_hwnd, &pt);
01497
01498                 _bottom_max = pt.y;
01499         }
01500 }

Here is the call graph for this function:

bool StartMenu::SelectButton | ( | int | id,
 |  | bool | open_sub = true
 | ) | [protected]

Definition at line 576 of file startmenu.cpp.

References SMBtnInfo::_enabled, SMBtnInfo::_hasSubmenu, _selected_id, CloseOtherSubmenus(), GetButtonInfo(), InvalidateSelection(), and OpenSubmenu().

Referenced by SelectButtonIndex().

00577 {
00578         if (id == -1)
00579                 return false;
00580
00581         if (id == _selected_id)
00582                 return true;
00583
00584         InvalidateSelection();
00585
00586         const SMBtnInfo* btn = GetButtonInfo(id);
00587
00588         if (btn && btn->_enabled) {
00589                 _selected_id = id;
00590
00591                 InvalidateSelection();
00592
00593                  // automatically open submenus
00594                 if (btn->_hasSubmenu) {
00595                         if (open_sub)
00596                                 OpenSubmenu();
00597                 } else
00598                         CloseOtherSubmenus();   // close any open submenu
00599
00600                 return true;
00601         } else {
00602                 _selected_id = -1;
00603                 return false;
00604         }
00605 }

Here is the call graph for this function:

bool StartMenu::SelectButtonIndex | ( | int | idx,
 |  | bool | open_sub = true
 | ) | [protected]

Definition at line 643 of file startmenu.cpp.

References _buttons, and SelectButton().

Referenced by Navigate(), and ProcessKey().

00644 {
00645         if (idx>=0 && idx<(int)_buttons.size())
00646                 return SelectButton(_buttons[idx]._id, open_sub);
00647         else
00648                 return false;
00649 }

Here is the call graph for this function:

void StartMenu::UpdateIcons ( ) [protected]

Definition at line 912 of file startmenu.cpp.

References _bottom_max, _buttons, StartMenuEntry::_entries, _entries, WindowHandle::_hwnd, Entry::_icon_id, _large_icons, _scroll_pos, _selected_id, DrawStartMenuButton(), GetButtonRect(), ICF_NORMAL, ICID_NONE, ICID_UNKNOWN, and Entry::safe_extract_icon().

00913 {
00914         UpdateWindow(_hwnd);
00915
00916 #ifdef _SINGLE_ICONEXTRACT
00917
00918         //if (idx >= 0)
00919         int idx = _scroll_pos;
00920
00921         for(; idx<(int)_buttons.size(); ++idx) {
00922                 SMBtnInfo& btn = _buttons[idx];
00923
00924                 if (btn._icon_id==ICID_UNKNOWN && btn._id>0) {
00925                         StartMenuEntry& sme = _entries[btn._id];
00926
00927                         btn._icon_id = ICID_NONE;
00928
00929                         for(ShellEntrySet::iterator it=sme._entries.begin(); it!=sme._entries.end(); ++it) {
00930                                 Entry* entry = *it;
00931
00932                                 if (entry->_icon_id == ICID_UNKNOWN)
00933                                         entry->_icon_id = entry->safe_extract_icon(_large_icons? ICF_LARGE: ICF_NORMAL);
00934
00935                                 if (entry->_icon_id > ICID_NONE) {
00936                                         btn._icon_id = (ICON_ID)/*@@*/ entry->_icon_id;
00937
00938                                         RECT rect;
00939
00940                                         GetButtonRect(btn._id, &rect);
00941
00942                                         if (rect.bottom > _bottom_max)
00943                                                 break;
00944
00945                                         WindowCanvas canvas(_hwnd);
00946                                         DrawStartMenuButton(canvas, rect, NULL, btn, btn._id==_selected_id, false, _large_icons);
00947
00948                                         //InvalidateRect(_hwnd, &rect, FALSE);
00949                                         //UpdateWindow(_hwnd);
00950                                         //break;
00951
00952                                         break;
00953                                 }
00954                         }
00955                 }
00956         }
00957
00958 //      if (++idx < (int)_buttons.size())
00959 //              PostMessage(_hwnd, PM_UPDATE_ICONS, idx, 0);
00960
00961 #else
00962
00963         int icons_extracted = 0;
00964         int icons_updated = 0;
00965
00966         for(StartMenuShellDirs::iterator it=_dirs.begin(); it!=_dirs.end(); ++it) {
00967                 ShellDirectory& dir = it->_dir;
00968
00969                 icons_extracted += dir.extract_icons();
00970         }
00971
00972         if (icons_extracted) {
00973                 for(ShellEntryMap::iterator it1=_entries.begin(); it1!=_entries.end(); ++it1) {
00974                         StartMenuEntry& sme = it1->second;
00975
00976                         if (!sme._hIcon) {
00977                                 sme._hIcon = (HICON)-1;
00978
00979                                 for(ShellEntrySet::const_iterator it2=sme._entries.begin(); it2!=sme._entries.end(); ++it2) {
00980                                         const Entry* sm_entry = *it2;
00981
00982                                         if (sm_entry->_hIcon) {
00983                                                 sme._hIcon = sm_entry->_hIcon;
00984                                                 break;
00985                                         }
00986                                 }
00987                         }
00988                 }
00989
00990                 for(SMBtnVector::iterator it=_buttons.begin(); it!=_buttons.end(); ++it) {
00991                         SMBtnInfo& info = *it;
00992
00993                         if (info._id>0 && !info._hIcon) {
00994                                 info._hIcon = _entries[info._id]._hIcon;
00995                                 ++icons_updated;
00996                         }
00997                 }
00998         }
00999
01000         if (icons_updated) {
01001                 InvalidateRect(_hwnd, NULL, FALSE);
01002                 UpdateWindow(_hwnd);
01003         }
01004 #endif
01005 }

Here is the call graph for this function:

LRESULT StartMenu::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:
do something similar to StartMenuRoot::TrackStartmenu() in order to automatically close submenus when clicking on the desktop background
Todo:
handle context menu for more than one entry

Reimplemented from ExtContextMenuHandlerT< OwnerDrawParent< Window > >.

Reimplemented in StartMenuRoot.

Definition at line 301 of file startmenu.cpp.

References WindowHandle::_hwnd, and Paint().

00302 {
00303         switch(nmsg) {
00304           case WM_PAINT: {
00305                 PaintCanvas canvas(_hwnd);
00306                 Paint(canvas);
00307                 break;}
00308
00309           case WM_SIZE:
00310                 ResizeButtons(LOWORD(lparam)-_border_left);
00311                 break;
00312
00313           case WM_MOVE: {
00314                 const POINTS& pos = MAKEPOINTS(lparam);
00315
00316                  // move open submenus of floating menus
00317                 if (_submenu) {
00318                         int dx = pos.x - _last_pos.x;
00319                         int dy = pos.y - _last_pos.y;
00320
00321                         if (dx || dy) {
00322                                 WindowRect rt(_submenu);
00323                                 SetWindowPos(_submenu, 0, rt.left+dx, rt.top+dy, 0, 0, SWP_NOSIZE|SWP_NOACTIVATE);
00324                                 //MoveVisible(_submenu);
00325                         }
00326                 }
00327
00328                 _last_pos.x = pos.x;
00329                 _last_pos.y = pos.y;
00330                 goto def;}
00331
00332           case WM_NCHITTEST: {
00333                 LRESULT res = super::WndProc(nmsg, wparam, lparam);
00334
00335                 if (res>=HTSIZEFIRST && res<=HTSIZELAST)
00336                         return HTCLIENT;        // disable window resizing
00337
00338                 return res;}
00339
00340           case WM_LBUTTONDOWN: {
00341                 RECT rect;
00342
00343                  // check mouse cursor for coordinates of floating button
00344                 GetFloatingButtonRect(&rect);
00345
00346                 if (PtInRect(&rect, Point(lparam))) {
00347                          // create a floating copy of the current start menu
00348                         WindowRect pos(_hwnd);
00349
00351                         StartMenu::Create(pos.left+3, pos.bottom-3, _create_info._folders, 0, _create_info._title, _create_info._creator, _create_info._info);
00352                         CloseStartMenu();
00353                 }
00354
00355 #ifdef _LIGHT_STARTMENU
00356                 int id = ButtonHitTest(Point(lparam));
00357
00358                 if (id)
00359                         Command(id, BN_CLICKED);
00360 #endif
00361                 break;}
00362
00363           case WM_SYSCOMMAND:
00364                 if ((wparam&0xFFF0) == SC_SIZE)
00365                         return 0;                       // disable window resizing
00366                 goto def;
00367
00368           case WM_ACTIVATEAPP:
00369                  // close start menu when activating another application
00370                 if (!wparam)
00371                         CloseStartMenu();
00372                 break;  // don't call super::WndProc in case "this" has been deleted
00373
00374           case WM_CANCELMODE:
00375                 CloseStartMenu();
00376
00377 #ifdef _LIGHT_STARTMENU
00378                 if (_scroll_mode != SCROLL_NOT) {
00379                         ReleaseCapture();
00380                         KillTimer(_hwnd, 0);
00381                 }
00382 #endif
00383                 break;
00384
00385 #ifdef _LIGHT_STARTMENU
00386           case WM_MOUSEMOVE: {
00387                  // automatically set the focus to startmenu entries when moving the mouse over them
00388                 if (lparam != _last_mouse_pos) { // don't process WM_MOUSEMOVE when opening submenus using keyboard navigation
00389                         Point pt(lparam);
00390
00391                         if (_arrow_btns) {
00392                                 RECT rect_up, rect_down;
00393
00394                                 GetArrowButtonRects(&rect_up, &rect_down, _large_icons);
00395
00396                                 SCROLL_MODE scroll_mode = SCROLL_NOT;
00397
00398                                 if (PtInRect(&rect_up, pt))
00399                                         scroll_mode = SCROLL_UP;
00400                                 else if (PtInRect(&rect_down, pt))
00401                                         scroll_mode = SCROLL_DOWN;
00402
00403                                 if (scroll_mode != _scroll_mode) {
00404                                         if (scroll_mode == SCROLL_NOT) {
00405                                                 ReleaseCapture();
00406                                                 KillTimer(_hwnd, 0);
00407                                         } else {
00408                                                 CloseSubmenus();
00409                                                 SetTimer(_hwnd, 0, 150, NULL);  // 150 ms scroll interval
00410                                                 SetCapture(_hwnd);
00411                                         }
00412
00413                                         _scroll_mode = scroll_mode;
00414                                 }
00415                         }
00416
00417                         int new_id = ButtonHitTest(pt);
00418
00419                         if (new_id > 0 && new_id != _selected_id)
00420                                 SelectButton(new_id);
00421
00422                         _last_mouse_pos = lparam;
00423                 }
00424                 break;}
00425
00426           case WM_TIMER:
00427                 if (_scroll_mode == SCROLL_UP) {
00428                         if (_scroll_pos > 0) {
00429                                 --_scroll_pos;
00430                                 InvalidateRect(_hwnd, NULL, TRUE);
00431                         }
00432                 } else {
00433                         if (_scroll_pos <= _invisible_lines) {
00434                                 ++_scroll_pos;
00435                                 InvalidateRect(_hwnd, NULL, TRUE);
00436                         }
00437                 }
00438                 break;
00439
00440           case WM_KEYDOWN:
00441                 ProcessKey(wparam);
00442                 break;
00443 #else
00444           case PM_STARTENTRY_FOCUSED: {
00445                 BOOL hasSubmenu = wparam;
00446                 HWND hctrl = (HWND)lparam;
00447
00448                  // automatically open submenus
00449                 if (hasSubmenu) {
00450                         UpdateWindow(_hwnd);    // draw focused button before waiting on submenu creation
00451                         //SendMessage(_hwnd, WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hctrl),BN_CLICKED), (LPARAM)hctrl);
00452                         Command(GetDlgCtrlID(hctrl), BN_CLICKED);
00453                 } else {
00454                          // close any open submenu
00455                         CloseOtherSubmenus();
00456                 }
00457                 break;}
00458 #endif
00459
00460 #ifdef _LAZY_ICONEXTRACT
00461           case PM_UPDATE_ICONS:
00462                 UpdateIcons(/*wparam*/);
00463                 break;
00464 #endif
00465
00466           case PM_STARTENTRY_LAUNCHED:
00467                 if (GetWindowStyle(_hwnd) & WS_CAPTION) // don't automatically close floating menus
00468                         return 0;
00469
00470                  // route message to the parent menu and close menus after launching an entry
00471                 if (!SendParent(nmsg, wparam, lparam))
00472                         CloseStartMenu();
00473                 return 1;       // signal that we have received and processed the message
00474
00475           case PM_STARTMENU_CLOSED:
00476                 _submenu = 0;
00477                 break;
00478
00479           case PM_SELECT_ENTRY:
00480                 SelectButtonIndex(0, wparam!=0);
00481                 break;
00482
00483 #ifdef _LIGHT_STARTMENU
00484           case WM_CONTEXTMENU: {
00485                 Point screen_pt(lparam), clnt_pt=screen_pt;
00486                 ScreenToClient(_hwnd, &clnt_pt);
00487
00488                 int id = ButtonHitTest(clnt_pt);
00489
00490                 if (id) {
00491                         StartMenuEntry& sme = _entries[id];
00492
00493                         for(ShellEntrySet::iterator it=sme._entries.begin(); it!=sme._entries.end(); ++it) {
00494                                 Entry* entry = *it;
00495
00496                                 if (entry) {
00497                                         CHECKERROR(entry->do_context_menu(_hwnd, screen_pt, _cm_ifs));  // may close start menu because of focus loss
00498                                         break;
00499                                 }
00500                         }
00501                 }
00502                 break;}
00503 #endif
00504
00505           default: def:
00506                 return super::WndProc(nmsg, wparam, lparam);
00507         }
00508
00509         return 0;
00510 }

Here is the call graph for this function:

Member Data Documentation

bool StartMenu::_arrow_btns [protected]

Definition at line 247 of file startmenu.h.

Referenced by Paint(), and StartMenu().

int StartMenu::_border_left [protected]

Definition at line 242 of file startmenu.h.

Referenced by AddButton(), AddSeparator(), ButtonHitTest(), GetButtonRect(), InvalidateSelection(), Paint(), StartMenuRoot::ReadLogoSize(), and StartMenu().

int StartMenu::_border_top [protected]

Definition at line 243 of file startmenu.h.

Referenced by ButtonHitTest(), GetButtonRect(), InvalidateSelection(), Paint(), and StartMenu().

int StartMenu::_bottom_max [protected]

Definition at line 244 of file startmenu.h.

Referenced by ButtonHitTest(), Paint(), StartMenu(), and UpdateIcons().

SMBtnVector StartMenu::_buttons [protected]

Definition at line 259 of file startmenu.h.

Referenced by AddButton(), AddSeparator(), ButtonHitTest(), CreateSubmenu(), GetButtonInfo(), GetButtonRect(), GetSelectionIndex(), Init(), InvalidateSelection(), JumpToNextShortcut(), Navigate(), Paint(), ProcessKey(), ResizeToButtons(), SelectButtonIndex(), and UpdateIcons().

StartMenuCreateInfo StartMenu::_create_info [protected]

Definition at line 254 of file startmenu.h.

Referenced by FavoritesMenu::AddEntries().

StartMenuShellDirs StartMenu::_dirs [protected]

Definition at line 237 of file startmenu.h.

Referenced by RecentStartMenu::AddEntries(), AddEntries(), StartMenu(), and StartMenuRoot::StartMenuRoot().

ShellEntryMap StartMenu::_entries [protected]

Reimplemented in FavoritesMenu.

Definition at line 236 of file startmenu.h.

Referenced by AddEntry(), Command(), Init(), and UpdateIcons().

bool StartMenu::_floating_btn [protected]

Definition at line 246 of file startmenu.h.

Referenced by DrawArrows(), GetArrowButtonRects(), Paint(), and StartMenu().

int StartMenu::_invisible_lines [protected]

Definition at line 252 of file startmenu.h.

Referenced by StartMenu().

bool StartMenu::_large_icons [protected]

Definition at line 256 of file startmenu.h.

Referenced by ButtonHitTest(), GetButtonRect(), InvalidateSelection(), Paint(), ResizeToButtons(), StartMenuRoot::TrackStartmenu(), and UpdateIcons().

LPARAM StartMenu::_last_mouse_pos [protected]

Definition at line 261 of file startmenu.h.

Referenced by StartMenu().

POINT StartMenu::_last_pos [protected]

Definition at line 249 of file startmenu.h.

Referenced by StartMenu().

int StartMenu::_next_id [protected]

Definition at line 235 of file startmenu.h.

Referenced by FavoritesMenu::AddEntries(), AddEntry(), and StartMenu().

enum StartMenu::SCROLL_MODE StartMenu::_scroll_mode [protected]

Referenced by StartMenu().

int StartMenu::_scroll_pos [protected]

Definition at line 251 of file startmenu.h.

Referenced by ButtonHitTest(), GetButtonRect(), InvalidateSelection(), Paint(), StartMenu(), and UpdateIcons().

int StartMenu::_selected_id [protected]

Definition at line 260 of file startmenu.h.

Referenced by GetSelectionIndex(), InvalidateSelection(), OpenSubmenu(), Paint(), ProcessKey(), SelectButton(), StartMenu(), StartMenuRoot::TrackStartmenu(), and UpdateIcons().

WindowHandle StartMenu::_submenu [protected]

Definition at line 240 of file startmenu.h.

Referenced by CloseOtherSubmenus(), StartMenuRoot::CloseStartMenu(), CloseStartMenu(), OpenSubmenu(), StartMenuRoot::ProcessKey(), and ProcessKey().

int StartMenu::_submenu_id [protected]

Definition at line 239 of file startmenu.h.

Referenced by CloseOtherSubmenus(), and StartMenu().

Window::CREATORFUNC_INFO StartMenu::s_def_creator = STARTMENU_CREATOR(StartMenu) [static]

Definition at line 223 of file startmenu.h.

The documentation for this struct was generated from the following files:
  • startmenu.h
  • startmenu.cpp


ROS Explorer: Member List

StartMenu Member List

This is the complete list of members for StartMenu, including all inherited members.

_arrow_btns | StartMenu | [protected]
_border_left | StartMenu | [protected]
_border_top | StartMenu | [protected]
_bottom_max | StartMenu | [protected]
_buttons | StartMenu | [protected]
_cm_ifs | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [protected]
_create_info | StartMenu | [protected]
_dirs | StartMenu | [protected]
_entries | StartMenu | [protected]
_floating_btn | StartMenu | [protected]
_hwnd | WindowHandle | [protected]
_invisible_lines | StartMenu | [protected]
_large_icons | StartMenu | [protected]
_last_mouse_pos | StartMenu | [protected]
_last_pos | StartMenu | [protected]
_next_id | StartMenu | [protected]
_scroll_mode | StartMenu | [protected]
_scroll_pos | StartMenu | [protected]
_selected_id | StartMenu | [protected]
_submenu | StartMenu | [protected]
_submenu_id | StartMenu | [protected]
ActivateEntry(int id, const ShellEntrySet &entries) | StartMenu | [protected]
AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true) | StartMenu | [protected]
AddEntries() | StartMenu | [protected, virtual]
AddEntry(const String &title, ICON_ID icon_id, Entry *entry) | StartMenu | [protected]
AddEntry(const String &title, ICON_ID icon_id=ICID_NONE, int id=-1) | StartMenu | [protected]
AddEntry(const ShellFolder folder, ShellEntry *entry) | StartMenu | [protected]
AddEntry(const ShellFolder folder, Entry *entry) | StartMenu | [protected]
AddSeparator() | StartMenu | [protected]
AddShellEntries(const ShellDirectory &dir, int max=-1, const String &ignore="") | StartMenu | [protected]
ButtonHitTest(POINT pt) | StartMenu | [protected]
CancelModes() | Window | [static]
CloseOtherSubmenus(int id=0) | StartMenu | [protected]
CloseStartMenu(int id=0) | StartMenu | [protected, virtual]
CloseSubmenus() | StartMenu | [inline, protected]
Command(int id, int code) | StartMenu | [protected, virtual]
Create(int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="") | StartMenu | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawArrows(HDC hdc, bool large_icons) | StartMenu | [protected]
DrawFloatingButton(HDC hdc) | StartMenu | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down, bool large_icons) | StartMenu | [protected]
GetButtonInfo(int id) const | StartMenu | [protected]
GetButtonRect(int id, PRECT prect) const | StartMenu | [protected]
GetFloatingButtonRect(LPRECT prect) | StartMenu | [protected]
GetSelectionIndex() | StartMenu | [protected]
GetStaticWindowData() | Window | [protected, static]
GetWndClasss() | StartMenu | [protected, static]
Init(LPCREATESTRUCT pcs) | StartMenu | [protected, virtual]
InvalidateSelection() | StartMenu | [protected]
JumpToNextShortcut(char c) | StartMenu | [protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Navigate(int step) | StartMenu | [protected]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
OpenSubmenu(bool select_first=false) | StartMenu | [protected]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< Window > | [inline]
Paint(PaintCanvas &canvas) | StartMenu | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
ProcessKey(int vk) | StartMenu | [protected, virtual]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeButtons(int cx) | StartMenu | [protected]
ResizeToButtons() | StartMenu | [protected]
s_def_creator | StartMenu | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SCROLL_DOWN enum value | StartMenu | [protected]
SCROLL_MODE enum name | StartMenu | [protected]
SCROLL_NOT enum value | StartMenu | [protected]
SCROLL_UP enum value | StartMenu | [protected]
SelectButton(int id, bool open_sub=true) | StartMenu | [protected]
SelectButtonIndex(int idx, bool open_sub=true) | StartMenu | [protected]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
StartMenu(HWND hwnd, bool large_icons=false) | StartMenu |
StartMenu(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenu |
super typedef | StartMenu |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
UpdateIcons() | StartMenu | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | StartMenu | [protected, virtual]
~StartMenu() | StartMenu |
~Window() | Window | [virtual]


ROS Explorer: StartMenuCreateInfo Struct Reference

StartMenuCreateInfo Struct Reference

structor containing information for creating of start menus More...

#include <startmenu.h>

Collaboration diagram for StartMenuCreateInfo:

[legend]
List of all members.

Public Member Functions

StartMenuCreateInfo ()

Public Attributes

StartMenuFolders _folders
int | _border_top
String _title
Window::CREATORFUNC_INFO _creator
void * | _info
String _filter

Detailed Description

structor containing information for creating of start menus

Definition at line 142 of file startmenu.h.

Constructor & Destructor Documentation

StartMenuCreateInfo::StartMenuCreateInfo ( ) [inline]

Definition at line 144 of file startmenu.h.

00144 : _border_top(0) {}

Member Data Documentation

int StartMenuCreateInfo::_border_top

Definition at line 147 of file startmenu.h.

Referenced by StartMenu::StartMenu().

Window::CREATORFUNC_INFO StartMenuCreateInfo::_creator

Definition at line 149 of file startmenu.h.

String StartMenuCreateInfo::_filter

Definition at line 151 of file startmenu.h.

Referenced by FavoritesMenu::AddEntries().

StartMenuFolders StartMenuCreateInfo::_folders

Definition at line 146 of file startmenu.h.

Referenced by StartMenu::StartMenu().

void* StartMenuCreateInfo::_info

Definition at line 150 of file startmenu.h.

String StartMenuCreateInfo::_title

Definition at line 148 of file startmenu.h.

The documentation for this struct was generated from the following file:
  • startmenu.h


ROS Explorer: Member List

StartMenuCreateInfo Member List

This is the complete list of members for StartMenuCreateInfo, including all inherited members.

_border_top | StartMenuCreateInfo |
_creator | StartMenuCreateInfo |
_filter | StartMenuCreateInfo |
_folders | StartMenuCreateInfo |
_info | StartMenuCreateInfo |
_title | StartMenuCreateInfo |
StartMenuCreateInfo() | StartMenuCreateInfo | [inline]


ROS Explorer: StartMenuDirectory Struct Reference

StartMenuDirectory Struct Reference

StartMenuDirectory is used to store the base directory of start menus. More...

#include <startmenu.h>

Collaboration diagram for StartMenuDirectory:

[legend]
List of all members.

Public Member Functions

StartMenuDirectory (const ShellDirectory &dir, const String &ignore="")
~StartMenuDirectory ()

Public Attributes

ShellDirectory _dir
String _ignore

Detailed Description

StartMenuDirectory is used to store the base directory of start menus.

Definition at line 57 of file startmenu.h.

Constructor & Destructor Documentation

StartMenuDirectory::StartMenuDirectory | ( | const ShellDirectory & | dir,
 |  | const String & | ignore = ""
 | ) | [inline]

Definition at line 59 of file startmenu.h.

00060          :      _dir(dir), _ignore(ignore)
00061         {
00062         }

StartMenuDirectory::~StartMenuDirectory ( ) [inline]

Definition at line 64 of file startmenu.h.

References _dir, and Entry::free_subentries().

00065         {
00066                 _dir.free_subentries();
00067         }

Here is the call graph for this function:

Member Data Documentation

ShellDirectory StartMenuDirectory::_dir

Definition at line 69 of file startmenu.h.

Referenced by ~StartMenuDirectory().

String StartMenuDirectory::_ignore

Definition at line 70 of file startmenu.h.

The documentation for this struct was generated from the following file:
  • startmenu.h


ROS Explorer: Member List

StartMenuDirectory Member List

This is the complete list of members for StartMenuDirectory, including all inherited members.

_dir | StartMenuDirectory |
_ignore | StartMenuDirectory |
StartMenuDirectory(const ShellDirectory &dir, const String &ignore="") | StartMenuDirectory | [inline]
~StartMenuDirectory() | StartMenuDirectory | [inline]


ROS Explorer: StartMenuEntry Struct Reference

StartMenuEntry Struct Reference

structure holding information about one start menu entry More...

#include <startmenu.h>

Collaboration diagram for StartMenuEntry:

[legend]
List of all members.

Public Member Functions

StartMenuEntry ()

Public Attributes

String _title
ICON_ID _icon_id
ShellEntrySet _entries

Detailed Description

structure holding information about one start menu entry

Definition at line 77 of file startmenu.h.

Constructor & Destructor Documentation

StartMenuEntry::StartMenuEntry ( ) [inline]

Definition at line 79 of file startmenu.h.

00079 : _icon_id(ICID_UNKNOWN) {}

Member Data Documentation

ShellEntrySet StartMenuEntry::_entries

Definition at line 83 of file startmenu.h.

Referenced by StartMenu::UpdateIcons().

ICON_ID StartMenuEntry::_icon_id

Definition at line 82 of file startmenu.h.

Referenced by StartMenu::AddEntry().

String StartMenuEntry::_title

Definition at line 81 of file startmenu.h.

Referenced by StartMenu::AddEntry().

The documentation for this struct was generated from the following file:
  • startmenu.h


ROS Explorer: Member List

StartMenuEntry Member List

This is the complete list of members for StartMenuEntry, including all inherited members.

_entries | StartMenuEntry |
_icon_id | StartMenuEntry |
_title | StartMenuEntry |
StartMenuEntry() | StartMenuEntry | [inline]


ROS Explorer: StartMenuHandler Struct Reference

StartMenuHandler Struct Reference

Handling of standard start menu commands. More...

#include <startmenu.h>

Inheritance diagram for StartMenuHandler:

[legend]
Collaboration diagram for StartMenuHandler:

[legend]
List of all members.

Public Types

typedef StartMenu | super

Public Member Functions

StartMenuHandler (HWND hwnd, bool large_icons=false)
StartMenuHandler (HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false)

Protected Member Functions

int | Command (int id, int code)

Static Protected Member Functions

static void | ShowLaunchDialog (HWND hwndOwner)
static void | ShowLogoffDialog (HWND hwndOwner)
static void | ShowSearchDialog ()
static void | ShowSearchComputer ()

Detailed Description

Handling of standard start menu commands.

Definition at line 337 of file startmenu.h.

Member Typedef Documentation

typedef StartMenu StartMenuHandler::super

Reimplemented from StartMenu.

Reimplemented in StartMenuRoot, SettingsMenu, BrowseMenu, and SearchMenu.

Definition at line 339 of file startmenu.h.

Constructor & Destructor Documentation

StartMenuHandler::StartMenuHandler | ( | HWND | hwnd,
 |  | bool | large_icons = false
 | ) | [inline]

Definition at line 341 of file startmenu.h.

00342          :      super(hwnd, large_icons)
00343         {
00344         }

StartMenuHandler::StartMenuHandler | ( | HWND | hwnd,
 |  | const StartMenuCreateInfo & | create_info,
 |  | bool | large_icons = false
 | ) | [inline]

Definition at line 346 of file startmenu.h.

00347          :      super(hwnd, create_info, large_icons)
00348         {
00349         }

Member Function Documentation

int StartMenuHandler::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Todo:
use printer start menu folder per default and allow opening "printers" cabinet window using the context menu
Todo:
to be removed when network browsing will be implemented in shell namespace
Todo:
exclude removable drives

Reimplemented from StartMenu.

Definition at line 1866 of file startmenu.cpp.

References ExplorerGlobals::_favorites, WindowHandle::_hwnd, ExplorerGlobals::_hwndDesktopBar, StartMenu::CloseStartMenu(), StartMenu::Command(), SDIMainFrame::Create(), MDIMainFrame::Create(), StartMenu::CreateSubmenu(), Dialog::DoModal(), explorer_show_frame(), ExplorerPropertySheet(), g_Globals, ExplorerGlobals::get_cfg(), ID_DESKTOPBAR_SETTINGS, IDC_ADMIN, IDC_BROWSE, IDC_CONNECTIONS, IDC_CONTROL_PANEL, IDC_DOCUMENTS, IDC_DRIVES, IDC_EXPLORE, IDC_FAVORITES, IDC_LAUNCH, IDC_LOGOFF, IDC_NETWORK, IDC_PRINTERS, IDC_RECENT, IDC_SEARCH, IDC_SEARCH_COMPUTER, IDC_SEARCH_FILES, IDC_SEARCH_PROGRAM, IDC_SETTINGS, IDC_SETTINGS_MENU, IDC_SHUTDOWN, IDC_START_HELP, IDC_TERMINATE, IDD_SEARCH_PROGRAM, IDS_ADMIN, IDS_BROWSE, IDS_CONNECTIONS, IDS_DOCUMENTS, IDS_DRIVES, IDS_FAVORITES, IDS_NETWORK, IDS_PRINTERS, IDS_PROGRAMS, IDS_RECENT, IDS_SEARCH, IDS_SETTINGS, IDS_SETTINGS_MENU, IDS_TITLE, launch_file(), SHELLPATH_CONTROL_PANEL, SHELLPATH_NET_CONNECTIONS, SHELLPATH_PRINTERS, ShowExitWindowsDialog(), ShowLaunchDialog(), ShowLogoffDialog(), ShowSearchComputer(), ShowSearchDialog(), STARTMENU_CREATOR, and WINDOW_CREATOR.

01867 {
01868         switch(id) {
01869
01870         // start menu root
01871
01872           case IDC_PROGRAMS:
01873                 CreateSubmenu(id, CSIDL_COMMON_PROGRAMS, CSIDL_PROGRAMS, ResString(IDS_PROGRAMS));
01874                 break;
01875
01876           case IDC_EXPLORE:
01877                 CloseStartMenu(id);
01878                 explorer_show_frame(SW_SHOWNORMAL);
01879                 break;
01880
01881           case IDC_LAUNCH:
01882                 CloseStartMenu(id);
01883                 ShowLaunchDialog(g_Globals._hwndDesktopBar);
01884                 break;
01885
01886           case IDC_DOCUMENTS:
01887                 CreateSubmenu(id, CSIDL_PERSONAL, ResString(IDS_DOCUMENTS));
01888                 break;
01889
01890           case IDC_RECENT:
01891                 CreateSubmenu(id, CSIDL_RECENT, ResString(IDS_RECENT), STARTMENU_CREATOR(RecentStartMenu));
01892                 break;
01893
01894           case IDC_FAVORITES:
01895 #ifndef _SHELL32_FAVORITES
01896                 CreateSubmenu(id, ResString(IDS_FAVORITES), STARTMENU_CREATOR(FavoritesMenu), &static_cast<BookmarkList&>(g_Globals._favorites));
01897 #else
01898                 CreateSubmenu(id, CSIDL_COMMON_FAVORITES, CSIDL_FAVORITES, ResString(IDS_FAVORITES));
01899 #endif
01900                 break;
01901
01902           case IDC_BROWSE:
01903                 CreateSubmenu(id, ResString(IDS_BROWSE), STARTMENU_CREATOR(BrowseMenu));
01904                 break;
01905
01906           case IDC_SETTINGS:
01907                 CreateSubmenu(id, ResString(IDS_SETTINGS), STARTMENU_CREATOR(SettingsMenu));
01908                 break;
01909
01910           case IDC_SEARCH:
01911                 CreateSubmenu(id, ResString(IDS_SEARCH), STARTMENU_CREATOR(SearchMenu));
01912                 break;
01913
01914           case IDC_START_HELP:
01915                 CloseStartMenu(id);
01916                 MessageBox(g_Globals._hwndDesktopBar, TEXT("Help not yet implemented"), ResString(IDS_TITLE), MB_OK);
01917                 break;
01918
01919           case IDC_LOGOFF:
01920                 CloseStartMenu(id);
01921                 ShowLogoffDialog(g_Globals._hwndDesktopBar);
01922                 break;
01923
01924 #ifndef _ROS_
01925           case IDC_TERMINATE:
01926                 DestroyWindow(GetParent(_hwnd));
01927                 break;
01928 #endif
01929
01930           case IDC_SHUTDOWN:
01931                 CloseStartMenu(id);
01932                 ShowExitWindowsDialog(g_Globals._hwndDesktopBar);
01933                 break;
01934
01935
01936         // settings menu
01937
01938           case ID_DESKTOPBAR_SETTINGS:
01939                 CloseStartMenu(id);
01940                 ExplorerPropertySheet(g_Globals._hwndDesktopBar);
01941                 break;
01942
01943           case IDC_CONTROL_PANEL: {
01944                 CloseStartMenu(id);
01945 #ifndef ROSSHELL
01946 #ifndef _NO_MDI
01947                 XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
01948                 bool mdi = XMLBool(explorer_options, "mdi", true);
01949
01950                 if (mdi)
01951                         MDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0);
01952                 else
01953 #endif
01954                         SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0);
01955 #else
01956                 launch_file(_hwnd, SHELLPATH_CONTROL_PANEL);
01957 #endif
01958                 break;}
01959
01960           case IDC_SETTINGS_MENU:
01961                 CreateSubmenu(id, CSIDL_CONTROLS, ResString(IDS_SETTINGS_MENU));
01962                 break;
01963
01964           case IDC_PRINTERS: {
01965                 CloseStartMenu(id);
01966
01967 #ifndef ROSSHELL
01968 #ifdef _ROS_    // to be removed when printer folder will be implemented
01969                 MessageBox(0, TEXT("printer folder not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
01970 #else
01971 #ifndef _NO_MDI
01972                 XMLPos explorer_options = g_Globals.get_cfg("general/explorer");
01973                 bool mdi = XMLBool(explorer_options, "mdi", true);
01974
01975                 if (mdi)
01976                         MDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}"), 0);
01977                 else
01978 #endif
01979                         SDIMainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}"), 0);
01980 #endif
01981 #else
01982                 launch_file(_hwnd, SHELLPATH_PRINTERS);
01983 #endif
01984                 break;}
01985
01986 #if 0
01987           case IDC_PRINTERS_MENU:
01988                 CreateSubmenu(id, CSIDL_PRINTERS, CSIDL_PRINTHOOD, ResString(IDS_PRINTERS));
01989 /*              StartMenuFolders new_folders;
01990
01991                 try {
01992                         new_folders.push_back(ShellPath(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}")));
01993                 } catch(COMException&) {
01994                 }
01995
01996                 CreateSubmenu(id, new_folders, ResString(IDS_PRINTERS));*/
01997                 break;
01998 #endif
01999
02000           case IDC_ADMIN:
02001 #ifndef ROSSHELL
02002                 CreateSubmenu(id, CSIDL_COMMON_ADMINTOOLS, CSIDL_ADMINTOOLS, ResString(IDS_ADMIN));
02003                 //CloseStartMenu(id);
02004                 //MainFrame::Create(SpecialFolderPath(CSIDL_COMMON_ADMINTOOLS, _hwnd), OWM_PIDL);
02005 #else
02006                 launch_file(_hwnd, SpecialFolderFSPath(CSIDL_COMMON_ADMINTOOLS, _hwnd));
02007 #endif
02008                 break;
02009
02010           case IDC_CONNECTIONS:
02011 #ifndef ROSSHELL
02012 #ifdef _ROS_    // to be removed when RAS will be implemented
02013                 MessageBox(0, TEXT("RAS folder not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02014 #else
02015                 CreateSubmenu(id, CSIDL_CONNECTIONS, ResString(IDS_CONNECTIONS));
02016                 //CloseStartMenu(id);
02017                 //MainFrame::Create(SpecialFolderPath(CSIDL_CONNECTIONS, _hwnd), OWM_PIDL);
02018 #endif
02019 #else
02020                 launch_file(_hwnd, SHELLPATH_NET_CONNECTIONS);
02021 #endif
02022                 break;
02023
02024
02025         // browse menu
02026
02027           case IDC_NETWORK:
02028 #ifdef _ROS_
02029                 MessageBox(0, TEXT("network not yet implemented"), ResString(IDS_TITLE), MB_OK);
02030 #else
02031                 CreateSubmenu(id, CSIDL_NETWORK, ResString(IDS_NETWORK));
02032 #endif
02033                 break;
02034
02035           case IDC_DRIVES:
02037                 CreateSubmenu(id, CSIDL_DRIVES, ResString(IDS_DRIVES));
02038                 break;
02039
02040
02041         // search menu
02042
02043           case IDC_SEARCH_PROGRAM:
02044                 CloseStartMenu(id);
02045                 Dialog::DoModal(IDD_SEARCH_PROGRAM, WINDOW_CREATOR(FindProgramDlg));
02046                 break;
02047
02048           case IDC_SEARCH_FILES:
02049                 CloseStartMenu(id);
02050                 ShowSearchDialog();
02051                 break;
02052
02053           case IDC_SEARCH_COMPUTER:
02054                 CloseStartMenu(id);
02055                 ShowSearchComputer();
02056                 break;
02057
02058
02059           default:
02060                 return super::Command(id, code);
02061         }
02062
02063         return 0;
02064 }

Here is the call graph for this function:

void StartMenuHandler::ShowLaunchDialog ( HWND hwndOwner ) [static, protected]

Todo:
All text phrases should be put into the resources.

Definition at line 2091 of file startmenu.cpp.

References RFF_CALCDIRECTORY, and W_VER_NT.

Referenced by Command().

02092 {
02094         static LPCSTR szTitle = "Run";
02095         static LPCSTR szText = "Type the name of a program, folder, document, or Internet resource, and Explorer will open it for you.";
02096
02097         static DynamicFct<RUNFILEDLG> RunFileDlg(TEXT("SHELL32"), 61);
02098
02099          // Show "Run..." dialog
02100         if (RunFileDlg) {
02101 #ifndef _ROS_ /* FIXME: our shell32 always expects Ansi strings */
02102                 if ((HIWORD(GetVersion())>>14) == W_VER_NT) {
02103                         WCHAR wTitle[40], wText[256];
02104
02105                         MultiByteToWideChar(CP_ACP, 0, szTitle, -1, wTitle, 40);
02106                         MultiByteToWideChar(CP_ACP, 0, szText, -1, wText, 256);
02107
02108                         (*RunFileDlg)(hwndOwner, 0, NULL, (LPCSTR)wTitle, (LPCSTR)wText, RFF_CALCDIRECTORY);
02109                 }
02110                 else
02111 #endif
02112                         (*RunFileDlg)(hwndOwner, 0, NULL, szTitle, szText, RFF_CALCDIRECTORY);
02113         }
02114 }

void StartMenuHandler::ShowLogoffDialog ( HWND hwndOwner ) [static, protected]

Definition at line 2116 of file startmenu.cpp.

References IDS_TITLE.

Referenced by Command().

02117 {
02118         static DynamicFct<LOGOFFWINDOWSDIALOG> LogoffWindowsDialog(TEXT("SHELL32"), 54);
02119 //      static DynamicFct<RESTARTWINDOWSDLG> RestartDialog(TEXT("SHELL32"), 59);
02120
02121         if (LogoffWindowsDialog)
02122                 (*LogoffWindowsDialog)(0);
02123 /* The RestartDialog function prompts about some system setting change. This is not what we want to display here.
02124         else if (RestartDialog)
02125                 return (*RestartDialog)(hwndOwner, (LPWSTR)L"You selected <Log Off>.\n\n", EWX_LOGOFF) == 1;    ///@todo ANSI string conversion if needed
02126 */
02127         else
02128                 MessageBox(hwndOwner, TEXT("LogoffWindowsDialog() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02129 }

void StartMenuHandler::ShowSearchComputer ( ) [static, protected]

Todo:
to be removed when SHFindComputer() will be implemented in shell32.dll

Definition at line 2079 of file startmenu.cpp.

References IDS_TITLE.

Referenced by Command().

02080 {
02081 #ifndef _ROS_
02082         static DynamicFct<SHFINDCOMPUTER> SHFindComputer(TEXT("SHELL32"), 91);
02083
02084         if (SHFindComputer)
02085                 (*SHFindComputer)(NULL, NULL);
02086         else
02087 #endif
02088                 MessageBox(0, TEXT("SHFindComputer() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02089 }

void StartMenuHandler::ShowSearchDialog ( ) [static, protected]

Todo:
to be removed when SHFindFiles() will be implemented in shell32.dll

Definition at line 2067 of file startmenu.cpp.

References IDS_TITLE.

Referenced by Command().

02068 {
02069 #ifndef _ROS_
02070         static DynamicFct<SHFINDFILES> SHFindFiles(TEXT("SHELL32"), 90);
02071
02072         if (SHFindFiles)
02073                 (*SHFindFiles)(NULL, NULL);
02074         else
02075 #endif
02076                 MessageBox(0, TEXT("SHFindFiles() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK);
02077 }

The documentation for this struct was generated from the following files:
  • startmenu.h
  • startmenu.cpp


ROS Explorer: Member List

StartMenuHandler Member List

This is the complete list of members for StartMenuHandler, including all inherited members.

_arrow_btns | StartMenu | [protected]
_border_left | StartMenu | [protected]
_border_top | StartMenu | [protected]
_bottom_max | StartMenu | [protected]
_buttons | StartMenu | [protected]
_cm_ifs | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [protected]
_create_info | StartMenu | [protected]
_dirs | StartMenu | [protected]
_entries | StartMenu | [protected]
_floating_btn | StartMenu | [protected]
_hwnd | WindowHandle | [protected]
_invisible_lines | StartMenu | [protected]
_large_icons | StartMenu | [protected]
_last_mouse_pos | StartMenu | [protected]
_last_pos | StartMenu | [protected]
_next_id | StartMenu | [protected]
_scroll_mode | StartMenu | [protected]
_scroll_pos | StartMenu | [protected]
_selected_id | StartMenu | [protected]
_submenu | StartMenu | [protected]
_submenu_id | StartMenu | [protected]
ActivateEntry(int id, const ShellEntrySet &entries) | StartMenu | [protected]
AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true) | StartMenu | [protected]
AddEntries() | StartMenu | [protected, virtual]
AddEntry(const String &title, ICON_ID icon_id, Entry *entry) | StartMenu | [protected]
AddEntry(const String &title, ICON_ID icon_id=ICID_NONE, int id=-1) | StartMenu | [protected]
AddEntry(const ShellFolder folder, ShellEntry *entry) | StartMenu | [protected]
AddEntry(const ShellFolder folder, Entry *entry) | StartMenu | [protected]
AddSeparator() | StartMenu | [protected]
AddShellEntries(const ShellDirectory &dir, int max=-1, const String &ignore="") | StartMenu | [protected]
ButtonHitTest(POINT pt) | StartMenu | [protected]
CancelModes() | Window | [static]
CloseOtherSubmenus(int id=0) | StartMenu | [protected]
CloseStartMenu(int id=0) | StartMenu | [protected, virtual]
CloseSubmenus() | StartMenu | [inline, protected]
Command(int id, int code) | StartMenuHandler | [protected, virtual]
Create(int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="") | StartMenu | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawArrows(HDC hdc, bool large_icons) | StartMenu | [protected]
DrawFloatingButton(HDC hdc) | StartMenu | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down, bool large_icons) | StartMenu | [protected]
GetButtonInfo(int id) const | StartMenu | [protected]
GetButtonRect(int id, PRECT prect) const | StartMenu | [protected]
GetFloatingButtonRect(LPRECT prect) | StartMenu | [protected]
GetSelectionIndex() | StartMenu | [protected]
GetStaticWindowData() | Window | [protected, static]
GetWndClasss() | StartMenu | [protected, static]
Init(LPCREATESTRUCT pcs) | StartMenu | [protected, virtual]
InvalidateSelection() | StartMenu | [protected]
JumpToNextShortcut(char c) | StartMenu | [protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Navigate(int step) | StartMenu | [protected]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
OpenSubmenu(bool select_first=false) | StartMenu | [protected]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< Window > | [inline]
Paint(PaintCanvas &canvas) | StartMenu | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
ProcessKey(int vk) | StartMenu | [protected, virtual]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeButtons(int cx) | StartMenu | [protected]
ResizeToButtons() | StartMenu | [protected]
s_def_creator | StartMenu | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SCROLL_DOWN enum value | StartMenu | [protected]
SCROLL_MODE enum name | StartMenu | [protected]
SCROLL_NOT enum value | StartMenu | [protected]
SCROLL_UP enum value | StartMenu | [protected]
SelectButton(int id, bool open_sub=true) | StartMenu | [protected]
SelectButtonIndex(int idx, bool open_sub=true) | StartMenu | [protected]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
ShowLaunchDialog(HWND hwndOwner) | StartMenuHandler | [protected, static]
ShowLogoffDialog(HWND hwndOwner) | StartMenuHandler | [protected, static]
ShowSearchComputer() | StartMenuHandler | [protected, static]
ShowSearchDialog() | StartMenuHandler | [protected, static]
StartMenu(HWND hwnd, bool large_icons=false) | StartMenu |
StartMenu(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenu |
StartMenuHandler(HWND hwnd, bool large_icons=false) | StartMenuHandler | [inline]
StartMenuHandler(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenuHandler | [inline]
super typedef | StartMenuHandler |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
UpdateIcons() | StartMenu | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | StartMenu | [protected, virtual]
~StartMenu() | StartMenu |
~Window() | Window | [virtual]


ROS Explorer: StartMenuRoot Struct Reference

StartMenuRoot Struct Reference

Startmenu root window. More...

#include <startmenu.h>

Inheritance diagram for StartMenuRoot:

[legend]
Collaboration diagram for StartMenuRoot:

[legend]
List of all members.

Public Types

typedef StartMenuHandler | super

Public Member Functions

StartMenuRoot (HWND hwnd)
void | TrackStartmenu ()

Static Public Member Functions

static HWND | Create (HWND hwndDesktopBar, bool large_icons)

Protected Member Functions

LRESULT | Init (LPCREATESTRUCT pcs)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual void | AddEntries ()
virtual void | ProcessKey (int vk)
void | Paint (PaintCanvas &canvas)
void | CloseStartMenu (int id=0)
close all windows of the start menu popup
void | ReadLogoSize ()
UINT | GetLogoResId ()

Protected Attributes

SIZE | _logo_size

Detailed Description

Startmenu root window.

Definition at line 362 of file startmenu.h.

Member Typedef Documentation

typedef StartMenuHandler StartMenuRoot::super

Reimplemented from StartMenuHandler.

Definition at line 364 of file startmenu.h.

Constructor & Destructor Documentation

StartMenuRoot::StartMenuRoot ( HWND hwnd )

Definition at line 1544 of file startmenu.cpp.

References StartMenu::_dirs, WindowHandle::_hwnd, g_Globals, and GetDesktopFolder().

01545  :      super(hwnd, false)
01546 {
01547 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01548         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCOMMONGROUPS))
01549 #endif
01550                 try {
01551                          // insert directory "All Users\Start Menu"
01552                         ShellDirectory cmn_startmenu(GetDesktopFolder(), SpecialFolderPath(CSIDL_COMMON_STARTMENU, _hwnd), _hwnd);
01553                         _dirs.push_back(StartMenuDirectory(cmn_startmenu, (LPCTSTR)SpecialFolderFSPath(CSIDL_COMMON_PROGRAMS, _hwnd)));
01554                 } catch(COMException&) {
01555                         // ignore exception and don't show additional shortcuts
01556                 }
01557
01558         try {
01559                  // insert directory "<user name>\Start Menu"
01560                 ShellDirectory usr_startmenu(GetDesktopFolder(), SpecialFolderPath(CSIDL_STARTMENU, _hwnd), _hwnd);
01561                 _dirs.push_back(StartMenuDirectory(usr_startmenu, (LPCTSTR)SpecialFolderFSPath(CSIDL_PROGRAMS, _hwnd)));
01562         } catch(COMException&) {
01563                 // ignore exception and don't show additional shortcuts
01564         }
01565
01566         ReadLogoSize();
01567 }

Here is the call graph for this function:

Member Function Documentation

void StartMenuRoot::AddEntries ( ) [protected, virtual]

Reimplemented from StartMenu.

Definition at line 1779 of file startmenu.cpp.

References StartMenu::AddButton(), StartMenu::AddEntries(), ICID_EXPLORER, IDC_EXPLORE, and IDS_EXPLORE.

01780 {
01781         super::AddEntries();
01782
01783         AddButton(ResString(IDS_EXPLORE),       ICID_EXPLORER, false, IDC_EXPLORE);
01784 }

Here is the call graph for this function:

void StartMenuRoot::CloseStartMenu ( int id = 0 ) [protected, virtual]

close all windows of the start menu popup

Reimplemented from StartMenu.

Definition at line 1843 of file startmenu.cpp.

References WindowHandle::_hwnd, StartMenu::_submenu, and StartMenu::CloseSubmenus().

Referenced by TrackStartmenu().

01844 {
01845         if (_submenu)
01846                 CloseSubmenus();
01847
01848         ShowWindow(_hwnd, SW_HIDE);
01849 }

Here is the call graph for this function:

HWND StartMenuRoot::Create | ( | HWND | hwndDesktopBar,
 |  | bool | large_icons
 | ) | [static]

Definition at line 1598 of file startmenu.cpp.

References Window::Create(), StartMenu::GetWndClasss(), TITLE_STARTMENU, and WINDOW_CREATOR.

Referenced by DesktopBar::Init().

01599 {
01600         RECT rect;
01601
01602         CalculateStartPos(hwndOwner, rect, large_icons);
01603
01604         return Window::Create(WINDOW_CREATOR(StartMenuRoot), 0, GetWndClasss(), TITLE_STARTMENU,
01605                                                         WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN,
01606                                                         rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, hwndOwner);
01607 }

Here is the call graph for this function:

UINT StartMenuRoot::GetLogoResId ( ) [protected]

Definition at line 1828 of file startmenu.cpp.

References WindowHandle::_hwnd, IDB_LOGOV, IDB_LOGOV16, and IDB_LOGOV256.

Referenced by Paint(), and ReadLogoSize().

01829 {
01830         WindowCanvas dc(_hwnd);
01831
01832         int clr_bits = GetDeviceCaps(dc, BITSPIXEL);
01833
01834         if (clr_bits > 8)
01835                 return IDB_LOGOV;
01836         else if (clr_bits > 4)
01837                 return IDB_LOGOV256;
01838         else
01839                 return IDB_LOGOV16;
01840 }

LRESULT StartMenuRoot::Init ( LPCREATESTRUCT pcs ) [protected, virtual]

Reimplemented from StartMenu.

Definition at line 1678 of file startmenu.cpp.

References StartMenu::AddButton(), StartMenu::AddSeparator(), g_Globals, ICID_ACTION, ICID_APPS, ICID_CONFIG, ICID_DOCUMENTS, ICID_FAVORITES, ICID_FOLDER, ICID_INFO, ICID_LOGOFF, ICID_SEARCH, IDC_BROWSE, IDC_DOCUMENTS, IDC_FAVORITES, IDC_LAUNCH, IDC_LOGOFF, IDC_PROGRAMS, IDC_RECENT, IDC_SEARCH, IDC_SETTINGS, IDC_SHUTDOWN, IDC_START_HELP, IDC_TERMINATE, IDS_BROWSE, IDS_DOCUMENTS, IDS_FAVORITES, IDS_LAUNCH, IDS_LOGOFF, IDS_PROGRAMS, IDS_RECENT, IDS_SEARCH, IDS_SETTINGS, IDS_SHUTDOWN, IDS_START_HELP, IDS_TERMINATE, StartMenu::Init(), and StartMenu::ResizeToButtons().

01679 {
01680          // add buttons for entries in _entries
01681         if (super::Init(pcs))
01682                 return 1;
01683
01684         AddSeparator();
01685
01686
01687 #ifdef __MINGW32__
01688         HKEY hkey, hkeyAdv;
01689         DWORD value, len;
01690
01691         if (RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"), &hkey))
01692                 hkey = 0;
01693
01694         if (RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"), &hkeyAdv))
01695                 hkeyAdv = 0;
01696
01697 #define IS_VALUE_ZERO(hk, name) \
01698         (!hk || (len=sizeof(value),RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE)&value, &len) || !value))
01699
01700 #define IS_VALUE_NOT_ZERO(hk, name) \
01701         (!hk || (len=sizeof(value),RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE)&value, &len) || value>0))
01702 #endif
01703
01704
01705          // insert hard coded start entries
01706         AddButton(ResString(IDS_PROGRAMS),              ICID_APPS, true, IDC_PROGRAMS);
01707
01708         AddButton(ResString(IDS_DOCUMENTS),             ICID_DOCUMENTS, true, IDC_DOCUMENTS);
01709
01710 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01711         if (!g_Globals._SHRestricted || !SHRestricted(REST_NORECENTDOCSMENU))
01712 #else
01713         if (IS_VALUE_ZERO(hkey, _T("NoRecentDocsMenu")))
01714 #endif
01715                 AddButton(ResString(IDS_RECENT),        ICID_DOCUMENTS, true, IDC_RECENT);
01716
01717         AddButton(ResString(IDS_FAVORITES),             ICID_FAVORITES, true, IDC_FAVORITES);
01718
01719         AddButton(ResString(IDS_SETTINGS),              ICID_CONFIG, true, IDC_SETTINGS);
01720
01721         AddButton(ResString(IDS_BROWSE),                ICID_FOLDER, true, IDC_BROWSE);
01722
01723 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01724         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOFIND))
01725 #else
01726         if (IS_VALUE_ZERO(hkey, _T("NoFind")))
01727 #endif
01728                 AddButton(ResString(IDS_SEARCH),        ICID_SEARCH, true, IDC_SEARCH);
01729
01730         AddButton(ResString(IDS_START_HELP),    ICID_INFO, false, IDC_START_HELP);
01731
01732 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01733         if (!g_Globals._SHRestricted || !SHRestricted(REST_NORUN))
01734 #else
01735         if (IS_VALUE_ZERO(hkey, _T("NoRun")))
01736 #endif
01737                 AddButton(ResString(IDS_LAUNCH),        ICID_ACTION, false, IDC_LAUNCH);
01738
01739
01740         AddSeparator();
01741
01742
01743 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01744         if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCLOSE))
01745 #else
01746         if (IS_VALUE_NOT_ZERO(hkeyAdv, _T("StartMenuLogoff")))
01747 #endif
01748                 AddButton(ResString(IDS_LOGOFF),        ICID_LOGOFF, false, IDC_LOGOFF);
01749
01750
01751 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
01752         if (!g_Globals._SHRestricted || SHRestricted(REST_STARTMENULOGOFF) != 1)
01753 #else
01754         if (IS_VALUE_ZERO(hkey, _T("NoClose")))
01755 #endif
01756                 AddButton(ResString(IDS_SHUTDOWN),      ICID_LOGOFF, false, IDC_SHUTDOWN);
01757
01758
01759 #ifndef _ROS_
01760         AddButton(ResString(IDS_TERMINATE),     ICID_LOGOFF, false, IDC_TERMINATE);
01761 #endif
01762
01763
01764 #ifdef __MINGW32__
01765         RegCloseKey(hkeyAdv);
01766         RegCloseKey(hkey);
01767 #endif
01768
01769
01770 #ifdef _LIGHT_STARTMENU
01771          // set the window size to fit all buttons
01772         ResizeToButtons();
01773 #endif
01774
01775         return 0;
01776 }

Here is the call graph for this function:

void StartMenuRoot::Paint ( PaintCanvas & canvas ) [protected]

Reimplemented from StartMenu.

Definition at line 1807 of file startmenu.cpp.

References WindowHandle::_hwnd, _logo_size, GetLogoResId(), and StartMenu::Paint().

Referenced by WndProc().

01808 {
01809         MemCanvas mem_dc;
01810         ResBitmap bmp(GetLogoResId());
01811         BitmapSelection sel(mem_dc, bmp);
01812
01813         ClientRect clnt(_hwnd);
01814         int h = min(_logo_size.cy, clnt.bottom);
01815
01816         RECT rect = {0, 0, _logo_size.cx, clnt.bottom-h};
01817         HBRUSH hbr = CreateSolidBrush(GetPixel(mem_dc, 0, 0));
01818         FillRect(canvas, &rect, hbr);
01819         DeleteObject(hbr);
01820
01821         PatBlt(canvas, _logo_size.cx, 0, 1, clnt.bottom, WHITENESS);
01822
01823     BitBlt(canvas, 0, clnt.bottom-h, _logo_size.cx, h, mem_dc, 0, ( h<_logo_size.cy ? _logo_size.cy-h : 0) , SRCCOPY);
01824
01825         super::Paint(canvas);
01826 }

Here is the call graph for this function:

void StartMenuRoot::ProcessKey ( int vk ) [protected, virtual]

Reimplemented from StartMenu.

Definition at line 1851 of file startmenu.cpp.

References StartMenu::_submenu, StartMenu::CloseOtherSubmenus(), and StartMenu::ProcessKey().

01852 {
01853         switch(vk) {
01854           case VK_LEFT:
01855                 if (_submenu)
01856                         CloseOtherSubmenus();
01857                 // don't close start menu root
01858                 break;
01859
01860           default:
01861                 super::ProcessKey(vk);
01862         }
01863 }

Here is the call graph for this function:

void StartMenuRoot::ReadLogoSize ( ) [protected]

Definition at line 1569 of file startmenu.cpp.

References StartMenu::_border_left, _logo_size, and GetLogoResId().

01570 {
01571          // read size of logo bitmap
01572         BITMAP bmp_hdr;
01573         GetObject(ResBitmap(GetLogoResId()), sizeof(BITMAP), &bmp_hdr);
01574         _logo_size.cx = bmp_hdr.bmWidth;
01575         _logo_size.cy = bmp_hdr.bmHeight;
01576
01577          // cache logo width
01578         _border_left = _logo_size.cx + 1;
01579 }

Here is the call graph for this function:

void StartMenuRoot::TrackStartmenu ( )

Definition at line 1610 of file startmenu.cpp.

References WindowHandle::_hwnd, StartMenu::_large_icons, StartMenu::_selected_id, CloseStartMenu(), HWND, StartMenu::ResizeToButtons(), and WINDOW_DYNAMIC_CAST.

Referenced by DesktopBar::ShowStartMenu().

01611 {
01612         MSG msg;
01613         HWND hwnd = _hwnd;
01614
01615 #ifdef _LIGHT_STARTMENU
01616         _selected_id = -1;
01617 #endif
01618
01619 #ifdef _LIGHT_STARTMENU
01620          // recalculate start menu root position
01621         RECT rect;
01622
01623         CalculateStartPos(GetParent(hwnd), rect, _large_icons);
01624
01625         SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, 0);
01626
01627         ResizeToButtons();
01628 #endif
01629
01630          // show previously hidden start menu
01631         ShowWindow(hwnd, SW_SHOW);
01632         SetForegroundWindow(hwnd);
01633
01634         while(IsWindow(hwnd) && IsWindowVisible(hwnd)) {
01635                 if (!GetMessage(&msg, 0, 0, 0)) {
01636                         PostQuitMessage(msg.wParam);
01637                         break;
01638                 }
01639
01640                  // Check for a mouse click on any window, that is not part of the start menu
01641                 if (msg.message==WM_LBUTTONDOWN || msg.message==WM_MBUTTONDOWN || msg.message==WM_RBUTTONDOWN) {
01642                         StartMenu* menu_wnd = NULL;
01643
01644                         for(HWND hwnd=msg.hwnd; hwnd; hwnd=GetParent(hwnd)) {
01645                                 menu_wnd = WINDOW_DYNAMIC_CAST(StartMenu, hwnd);
01646
01647                                 if (menu_wnd)
01648                                         break;
01649                         }
01650
01651                         if (!menu_wnd) {
01652                                 CloseStartMenu();
01653                                 break;
01654                         }
01655                 }
01656
01657                 try {
01658                         if (pretranslate_msg(&msg))
01659                                 continue;
01660
01661                         if (dispatch_dialog_msg(&msg))
01662                                 continue;
01663
01664                         TranslateMessage(&msg);
01665
01666                         try {
01667                                 DispatchMessage(&msg);
01668                         } catch(COMException& e) {
01669                                 HandleException(e, _hwnd);
01670                         }
01671                 } catch(COMException& e) {
01672                         HandleException(e, _hwnd);
01673                 }
01674         }
01675 }

Here is the call graph for this function:

LRESULT StartMenuRoot::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:
do something similar to StartMenuRoot::TrackStartmenu() in order to automatically close submenus when clicking on the desktop background
Todo:
handle context menu for more than one entry

Reimplemented from StartMenu.

Definition at line 1787 of file startmenu.cpp.

References WindowHandle::_hwnd, and Paint().

01788 {
01789         switch(nmsg) {
01790           case WM_PAINT: {
01791                 PaintCanvas canvas(_hwnd);
01792                 Paint(canvas);
01793                 break;}
01794
01795           case WM_DISPLAYCHANGE:
01796                  // re-evaluate logo size using the correct color depth
01797                 ReadLogoSize();
01798                 break;
01799
01800           default:
01801                 return super::WndProc(nmsg, wparam, lparam);
01802         }
01803
01804         return 0;
01805 }

Here is the call graph for this function:

Member Data Documentation

SIZE StartMenuRoot::_logo_size [protected]

Definition at line 375 of file startmenu.h.

Referenced by Paint(), and ReadLogoSize().

The documentation for this struct was generated from the following files:
  • startmenu.h
  • startmenu.cpp


ROS Explorer: Member List

StartMenuRoot Member List

This is the complete list of members for StartMenuRoot, including all inherited members.

_arrow_btns | StartMenu | [protected]
_border_left | StartMenu | [protected]
_border_top | StartMenu | [protected]
_bottom_max | StartMenu | [protected]
_buttons | StartMenu | [protected]
_cm_ifs | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [protected]
_create_info | StartMenu | [protected]
_dirs | StartMenu | [protected]
_entries | StartMenu | [protected]
_floating_btn | StartMenu | [protected]
_hwnd | WindowHandle | [protected]
_invisible_lines | StartMenu | [protected]
_large_icons | StartMenu | [protected]
_last_mouse_pos | StartMenu | [protected]
_last_pos | StartMenu | [protected]
_logo_size | StartMenuRoot | [protected]
_next_id | StartMenu | [protected]
_scroll_mode | StartMenu | [protected]
_scroll_pos | StartMenu | [protected]
_selected_id | StartMenu | [protected]
_submenu | StartMenu | [protected]
_submenu_id | StartMenu | [protected]
ActivateEntry(int id, const ShellEntrySet &entries) | StartMenu | [protected]
AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true) | StartMenu | [protected]
AddEntries() | StartMenuRoot | [protected, virtual]
AddEntry(const String &title, ICON_ID icon_id, Entry *entry) | StartMenu | [protected]
AddEntry(const String &title, ICON_ID icon_id=ICID_NONE, int id=-1) | StartMenu | [protected]
AddEntry(const ShellFolder folder, ShellEntry *entry) | StartMenu | [protected]
AddEntry(const ShellFolder folder, Entry *entry) | StartMenu | [protected]
AddSeparator() | StartMenu | [protected]
AddShellEntries(const ShellDirectory &dir, int max=-1, const String &ignore="") | StartMenu | [protected]
ButtonHitTest(POINT pt) | StartMenu | [protected]
CancelModes() | Window | [static]
CloseOtherSubmenus(int id=0) | StartMenu | [protected]
CloseStartMenu(int id=0) | StartMenuRoot | [protected, virtual]
CloseSubmenus() | StartMenu | [inline, protected]
Command(int id, int code) | StartMenuHandler | [protected, virtual]
Create(HWND hwndDesktopBar, bool large_icons) | StartMenuRoot | [static]
StartMenuHandler::Create(int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="") | StartMenu | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
ExtContextMenuHandlerT< OwnerDrawParent< Window > >::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CreateSubmenu(int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL) | StartMenu | [protected]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DrawArrows(HDC hdc, bool large_icons) | StartMenu | [protected]
DrawFloatingButton(HDC hdc) | StartMenu | [protected]
ExtContextMenuHandlerT(HWND hwnd) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
ExtContextMenuHandlerT(HWND hwnd, const PARA &info) | ExtContextMenuHandlerT< OwnerDrawParent< Window > > | [inline]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down, bool large_icons) | StartMenu | [protected]
GetButtonInfo(int id) const | StartMenu | [protected]
GetButtonRect(int id, PRECT prect) const | StartMenu | [protected]
GetFloatingButtonRect(LPRECT prect) | StartMenu | [protected]
GetLogoResId() | StartMenuRoot | [protected]
GetSelectionIndex() | StartMenu | [protected]
GetStaticWindowData() | Window | [protected, static]
GetWndClasss() | StartMenu | [protected, static]
Init(LPCREATESTRUCT pcs) | StartMenuRoot | [protected, virtual]
InvalidateSelection() | StartMenu | [protected]
JumpToNextShortcut(char c) | StartMenu | [protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Navigate(int step) | StartMenu | [protected]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
OpenSubmenu(bool select_first=false) | StartMenu | [protected]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
OwnerDrawParent(HWND hwnd) | OwnerDrawParent< Window > | [inline]
Paint(PaintCanvas &canvas) | StartMenuRoot | [protected]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
ProcessKey(int vk) | StartMenuRoot | [protected, virtual]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
ReadLogoSize() | StartMenuRoot | [protected]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeButtons(int cx) | StartMenu | [protected]
ResizeToButtons() | StartMenu | [protected]
s_def_creator | StartMenu | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SCROLL_DOWN enum value | StartMenu | [protected]
SCROLL_MODE enum name | StartMenu | [protected]
SCROLL_NOT enum value | StartMenu | [protected]
SCROLL_UP enum value | StartMenu | [protected]
SelectButton(int id, bool open_sub=true) | StartMenu | [protected]
SelectButtonIndex(int idx, bool open_sub=true) | StartMenu | [protected]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
ShowLaunchDialog(HWND hwndOwner) | StartMenuHandler | [protected, static]
ShowLogoffDialog(HWND hwndOwner) | StartMenuHandler | [protected, static]
ShowSearchComputer() | StartMenuHandler | [protected, static]
ShowSearchDialog() | StartMenuHandler | [protected, static]
StartMenu(HWND hwnd, bool large_icons=false) | StartMenu |
StartMenu(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenu |
StartMenuHandler(HWND hwnd, bool large_icons=false) | StartMenuHandler | [inline]
StartMenuHandler(HWND hwnd, const StartMenuCreateInfo &create_info, bool large_icons=false) | StartMenuHandler | [inline]
StartMenuRoot(HWND hwnd) | StartMenuRoot |
super typedef | StartMenuRoot |
TrackStartmenu() | StartMenuRoot |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
UpdateIcons() | StartMenu | [protected]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | StartMenuRoot | [protected, virtual]
~StartMenu() | StartMenu |
~Window() | Window | [virtual]


ROS Explorer: StartmenuSettingsDlg Struct Reference

StartmenuSettingsDlg Struct Reference

"Startmenu Settings" Property Sheet Dialog More...

#include <settings.h>

Inheritance diagram for StartmenuSettingsDlg:

[legend]
Collaboration diagram for StartmenuSettingsDlg:

[legend]
List of all members.

Public Types

typedef PropSheetPageDlg | super

Public Member Functions

StartmenuSettingsDlg (HWND hwnd)
virtual int | Command (int id, int code)

Detailed Description

"Startmenu Settings" Property Sheet Dialog

Definition at line 80 of file settings.h.

Member Typedef Documentation

typedef PropSheetPageDlg StartmenuSettingsDlg::super

Reimplemented from PropSheetPageDlg.

Definition at line 82 of file settings.h.

Constructor & Destructor Documentation

StartmenuSettingsDlg::StartmenuSettingsDlg ( HWND hwnd )

Definition at line 216 of file settings.cpp.

00217  :      super(hwnd)
00218 {
00219 }

Member Function Documentation

int StartmenuSettingsDlg::Command | ( | int | id,
 |  | int | code
 | ) | [virtual]

Reimplemented from PropSheetPageDlg.

Definition at line 221 of file settings.cpp.

00222 {
00223 /*
00224         switch(id) {
00225           case ID_CONFIG_NOTIFYAREA:
00226                 Dialog::DoModal(IDD_NOTIFYAREA, WINDOW_CREATOR(TrayNotifyDlg), _hwnd);
00227                 return 0;
00228         }
00229 */
00230         return 1;
00231 }

The documentation for this struct was generated from the following files:
  • settings.h
  • settings.cpp


ROS Explorer: Member List

StartmenuSettingsDlg Member List

This is the complete list of members for StartmenuSettingsDlg, including all inherited members.

_hwnd | WindowHandle | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | StartmenuSettingsDlg | [virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
Dialog(HWND) | Dialog |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | PropSheetPageDlg | [protected, static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0) | Dialog | [static]
DoModal(UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0) | Dialog | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropertySheetDialog | PropSheetPageDlg | [friend]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
PropSheetPage | PropSheetPageDlg | [friend]
PropSheetPageDlg(HWND) | PropSheetPageDlg |
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
StartmenuSettingsDlg(HWND hwnd) | StartmenuSettingsDlg |
super typedef | StartmenuSettingsDlg |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | Dialog | [protected, virtual]
~Dialog() | Dialog |
~Window() | Window | [virtual]


ROS Explorer: Static Struct Reference

Static Struct Reference

This class constructs static controls. More...

#include <window.h>

Inheritance diagram for Static:

[legend]
Collaboration diagram for Static:

[legend]
List of all members.

Public Member Functions

Static (HWND parent, LPCTSTR text, int left, int top, int width, int height, int id, DWORD flags=WS_VISIBLE|WS_CHILD|SS_SIMPLE, DWORD ex_flags=0)

Detailed Description

This class constructs static controls.

The control will remain existent when the C++ object is destroyed. There is no conjunction between C++ object and windows control life time.

Definition at line 583 of file window.h.

Constructor & Destructor Documentation

Static::Static | ( | HWND | parent,
 |  | LPCTSTR | text,
 |  | int | left,
 |  | int | top,
 |  | int | width,
 |  | int | height,
 |  | int | id,
 |  | DWORD | flags = WS_VISIBLE|WS_CHILD|SS_SIMPLE,
 |  | DWORD | ex_flags = 0
 | ) |

Definition at line 862 of file window.cpp.

00864  :      WindowHandle(CreateWindowEx(exStyle, TEXT("STATIC"), title, flags, left, top, width, height,
00865                                                         parent, (HMENU)id, g_Globals._hInstance, 0))
00866 {
00867 }

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

Static Member List

This is the complete list of members for Static, including all inherited members.

_hwnd | WindowHandle | [protected]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
Static(HWND parent, LPCTSTR text, int left, int top, int width, int height, int id, DWORD flags=WS_VISIBLE|WS_CHILD|SS_SIMPLE, DWORD ex_flags=0) | Static |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]


ROS Explorer: string Class Reference

string Class Reference

Inheritance diagram for string:

[legend]
The documentation for this class was generated from the following file:
  • xmlstorage.h


ROS Explorer: string Class Reference

string Class Reference

Inheritance diagram for string:

[legend]
The documentation for this class was generated from the following file:
  • utility.h


ROS Explorer: String Struct Reference

String Struct Reference

string class for TCHAR strings More...

#include <utility.h>

Inheritance diagram for String:

[legend]
Collaboration diagram for String:

[legend]
List of all members.

Public Types

typedef string | super

Public Member Functions

String ()
String (LPCTSTR s)
String (LPCTSTR s, int l)
String (const super &other)
String (const String &other)
String (LPCWSTR s)
String (LPCWSTR s, int l)
String (const wstring &other)
String & | operator= (LPCWSTR s)
void | assign (LPCWSTR s)
void | assign (LPCWSTR s, int l)
void | assign (const BStr &s)
String (const BStr &s)
String & | operator= (const BStr &s)
String & | operator= (LPCTSTR s)
String & | operator= (const super &s)
void | assign (LPCTSTR s)
void | assign (LPCTSTR s, int l)
operator LPCTSTR () const
operator wstring () const
LPTSTR | str ()
String & | printf (LPCTSTR fmt,...)
return modifyable character string pointer
String & | vprintf (LPCTSTR fmt, va_list l)
String & | appendf (LPCTSTR fmt,...)
String & | vappendf (LPCTSTR fmt, va_list l)
void | toLower ()

Detailed Description

string class for TCHAR strings

Definition at line 771 of file utility.h.

Member Typedef Documentation

typedef string String::super

Definition at line 781 of file utility.h.

Constructor & Destructor Documentation

String::String ( ) [inline]

Definition at line 784 of file utility.h.

00784 {}

String::String ( LPCTSTR s ) [inline]

Definition at line 786 of file utility.h.

00786 {if (s) super::assign(s);}

String::String | ( | LPCTSTR | s,
 |  | int | l
 | ) | [inline]

Definition at line 787 of file utility.h.

00787 : super(s, l) {}

String::String ( const super & other ) [inline]

Definition at line 789 of file utility.h.

00789 : super(other) {}

String::String ( const String & other ) [inline]

Definition at line 790 of file utility.h.

00790 : super(other) {}

String::String ( LPCWSTR s ) [inline]

Definition at line 801 of file utility.h.

00801 {assign(s);}

String::String | ( | LPCWSTR | s,
 |  | int | l
 | ) | [inline]

Definition at line 802 of file utility.h.

00802 {assign(s, l);}

String::String ( const wstring & other ) [inline]

Definition at line 803 of file utility.h.

00803 {assign(other.c_str());}

String::String ( const BStr & s ) [inline]

Definition at line 809 of file utility.h.

00809 {assign(s);}

Member Function Documentation

String& String::appendf | ( | LPCTSTR | fmt,
 |  |  | ...
 | ) | [inline]

Definition at line 848 of file utility.h.

References BUFFER_LEN, and COUNTOF.

Referenced by Context::toString().

00849         {
00850                 va_list l;
00851                 TCHAR b[BUFFER_LEN];
00852
00853                 va_start(l, fmt);
00854                 super::append(b, _vsntprintf(b, COUNTOF(b), fmt, l));
00855                 va_end(l);
00856
00857                 return *this;
00858         }

void String::assign | ( | LPCTSTR | s,
 |  | int | l
 | ) | [inline]

Definition at line 815 of file utility.h.

00815 {super::assign(s, l);}

void String::assign ( LPCTSTR s ) [inline]

Definition at line 814 of file utility.h.

00814 {super::assign(s);}

void String::assign ( const BStr & s ) [inline]

Definition at line 807 of file utility.h.

References BUFFER_LEN, and BStr::length().

00807 {int l = s.length(); if (l) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, l, b, BUFFER_LEN, 0, 0));} else erase();}

Here is the call graph for this function:

void String::assign | ( | LPCWSTR | s,
 |  | int | l
 | ) | [inline]

Definition at line 806 of file utility.h.

References BUFFER_LEN.

00806 {if (s) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, l, b, BUFFER_LEN, 0, 0));} else erase();}

void String::assign ( LPCWSTR s ) [inline]

Definition at line 805 of file utility.h.

References BUFFER_LEN.

Referenced by HyperlinkCtrl::init(), NotifyInfo::modify(), and NotifyHook::ModulePathCopyData().

00805 {if (s) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, -1, b, BUFFER_LEN, 0, 0)-1);} else erase();}

String::operator LPCTSTR ( ) const [inline]

Definition at line 817 of file utility.h.

00817 {return c_str();}

String::operator wstring ( ) const [inline]

Definition at line 822 of file utility.h.

References BUFFER_LEN.

00822 {WCHAR b[BUFFER_LEN]; return wstring(b, MultiByteToWideChar(CP_ACP, 0, c_str(), -1, b, BUFFER_LEN)-1);}

String& String::operator= ( const super & s ) [inline]

Definition at line 813 of file utility.h.

00813 {super::assign(s); return *this;}

String& String::operator= ( LPCTSTR s ) [inline]

Definition at line 812 of file utility.h.

00812 {if (s) super::assign(s); else erase(); return *this;}

String& String::operator= ( const BStr & s ) [inline]

Definition at line 810 of file utility.h.

00810 {assign(s); return *this;}

String& String::operator= ( LPCWSTR s ) [inline]

Definition at line 804 of file utility.h.

00804 {assign(s); return *this;}

String& String::printf | ( | LPCTSTR | fmt,
 |  |  | ...
 | ) | [inline]

return modifyable character string pointer

Definition at line 827 of file utility.h.

References BUFFER_LEN, and COUNTOF.

Referenced by get_windows_version_str(), ExplorerGlobals::read_persistent(), TrayNotifyDlg::RefreshProperties(), and SplitFileSysURL().

00828         {
00829                 va_list l;
00830                 TCHAR b[BUFFER_LEN];
00831
00832                 va_start(l, fmt);
00833                 super::assign(b, _vsntprintf(b, COUNTOF(b), fmt, l));
00834                 va_end(l);
00835
00836                 return *this;
00837         }

LPTSTR String::str ( ) [inline]

Definition at line 825 of file utility.h.

Referenced by MainFrameBase::FillBookmarks(), and TrayNotifyDlg::Refresh().

00825 {return (LPTSTR)data();}

void String::toLower ( ) [inline]

Definition at line 869 of file utility.h.

Referenced by FindProgramDlg::add_entry(), and FavoritesMenu::AddEntries().

00870         {
00871                 if (!empty())
00872                         CharLower(str());
00873         }

String& String::vappendf | ( | LPCTSTR | fmt,
 |  | va_list | l
 | ) | [inline]

Definition at line 860 of file utility.h.

References BUFFER_LEN, and COUNTOF.

00861         {
00862                 TCHAR b[BUFFER_LEN];
00863
00864                 super::append(b, _vsntprintf(b, COUNTOF(b), fmt, l));
00865
00866                 return *this;
00867         }

String& String::vprintf | ( | LPCTSTR | fmt,
 |  | va_list | l
 | ) | [inline]

Definition at line 839 of file utility.h.

References BUFFER_LEN, and COUNTOF.

00840         {
00841                 TCHAR b[BUFFER_LEN];
00842
00843                 super::assign(b, _vsntprintf(b, COUNTOF(b), fmt, l));
00844
00845                 return *this;
00846         }

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

String Member List

This is the complete list of members for String, including all inherited members.

appendf(LPCTSTR fmt,...) | String | [inline]
assign(LPCWSTR s) | String | [inline]
assign(LPCWSTR s, int l) | String | [inline]
assign(const BStr &s) | String | [inline]
assign(LPCTSTR s) | String | [inline]
assign(LPCTSTR s, int l) | String | [inline]
operator LPCTSTR() const | String | [inline]
operator wstring() const | String | [inline]
operator=(LPCWSTR s) | String | [inline]
operator=(const BStr &s) | String | [inline]
operator=(LPCTSTR s) | String | [inline]
operator=(const super &s) | String | [inline]
printf(LPCTSTR fmt,...) | String | [inline]
str() | String | [inline]
String() | String | [inline]
String(LPCTSTR s) | String | [inline]
String(LPCTSTR s, int l) | String | [inline]
String(const super &other) | String | [inline]
String(const String &other) | String | [inline]
String(LPCWSTR s) | String | [inline]
String(LPCWSTR s, int l) | String | [inline]
String(const wstring &other) | String | [inline]
String(const BStr &s) | String | [inline]
super typedef | String |
toLower() | String | [inline]
vappendf(LPCTSTR fmt, va_list l) | String | [inline]
vprintf(LPCTSTR fmt, va_list l) | String | [inline]


ROS Explorer: XMLStorage::String_from_XML_Char Struct Reference

XMLStorage::String_from_XML_Char

XMLStorage::String_from_XML_Char Struct Reference

converter from Expat strings to XMLStorage internal strings More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::String_from_XML_Char:

[legend]
Collaboration diagram for XMLStorage::String_from_XML_Char:

[legend]
List of all members.

Public Member Functions

String_from_XML_Char (const XML_Char *str)

Detailed Description

converter from Expat strings to XMLStorage internal strings

Definition at line 356 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::String_from_XML_Char::String_from_XML_Char ( const XML_Char * str ) [inline]

Definition at line 358 of file xmlstorage.h.

References XMLStorage::assign_utf8().

00359         {
00360                 assign_utf8(*this, str);
00361         }

Here is the call graph for this function:

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::String_from_XML_Char Member List

This is the complete list of members for XMLStorage::String_from_XML_Char, including all inherited members.

appendf(LPCXSSTR fmt,...) | XMLStorage::XS_String | [inline]
assign(LPCWSTR s) | XMLStorage::XS_String | [inline]
assign(LPCWSTR s, size_t l) | XMLStorage::XS_String | [inline]
assign(LPCXSSTR s) | XMLStorage::XS_String | [inline]
assign(LPCXSSTR s, size_t l) | XMLStorage::XS_String | [inline]
operator LPCXSSTR() const | XMLStorage::XS_String | [inline]
operator std::wstring() const | XMLStorage::XS_String | [inline]
operator=(LPCWSTR s) | XMLStorage::XS_String | [inline]
operator=(LPCXSSTR s) | XMLStorage::XS_String | [inline]
operator=(const super &s) | XMLStorage::XS_String | [inline]
printf(LPCXSSTR fmt,...) | XMLStorage::XS_String | [inline]
String_from_XML_Char(const XML_Char *str) | XMLStorage::String_from_XML_Char | [inline]
super typedef | XMLStorage::XS_String |
vappendf(LPCXSSTR fmt, va_list l) | XMLStorage::XS_String | [inline]
vprintf(LPCXSSTR fmt, va_list l) | XMLStorage::XS_String | [inline]
XS_String() | XMLStorage::XS_String | [inline]
XS_String(LPCXSSTR s) | XMLStorage::XS_String | [inline]
XS_String(LPCXSSTR s, size_t l) | XMLStorage::XS_String | [inline]
XS_String(const super &other) | XMLStorage::XS_String | [inline]
XS_String(const XS_String &other) | XMLStorage::XS_String | [inline]
XS_String(LPCWSTR s) | XMLStorage::XS_String | [inline]
XS_String(LPCWSTR s, size_t l) | XMLStorage::XS_String | [inline]
XS_String(const std::wstring &other) | XMLStorage::XS_String | [inline]


ROS Explorer: STRRET Class Reference

STRRET Class Reference

Inheritance diagram for STRRET:

[legend]
The documentation for this class was generated from the following file:
  • shellclasses.h


ROS Explorer: StrRetA Struct Reference

StrRetA Struct Reference

easy retrieval of multi byte strings out of STRRET structures More...

#include <shellclasses.h>

Inheritance diagram for StrRetA:

[legend]
Collaboration diagram for StrRetA:

[legend]
List of all members.

Public Member Functions

~StrRetA ()
void GetString (const SHITEMID &shiid, LPSTR b, int l)

Detailed Description

easy retrieval of multi byte strings out of STRRET structures

Definition at line 867 of file shellclasses.h.

Constructor & Destructor Documentation

StrRetA::~StrRetA ( ) [inline]

Definition at line 869 of file shellclasses.h.

00870         {
00871                 if (uType == STRRET_WSTR)
00872                         ShellMalloc()->Free(pOleStr);
00873         }

Member Function Documentation

void StrRetA::GetString | ( | const SHITEMID & | shiid,
 |  | LPSTR | b,
 |  | int | l
 | ) | [inline]

Definition at line 875 of file shellclasses.h.

References UNION_MEMBER.

Referenced by path_from_pidlA().

00876         {
00877                 switch(uType) {
00878                   case STRRET_WSTR:
00879                         WideCharToMultiByte(CP_ACP, 0, UNION_MEMBER(pOleStr), -1, b, l, NULL, NULL);
00880                         break;
00881
00882                   case STRRET_OFFSET:
00883                         lstrcpynA(b, (LPCSTR)&shiid+UNION_MEMBER(uOffset), l);
00884                         break;
00885
00886                   case STRRET_CSTR:
00887                         lstrcpynA(b, UNION_MEMBER(cStr), l);
00888                 }
00889         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

StrRetA Member List

This is the complete list of members for StrRetA, including all inherited members.

GetString(const SHITEMID &shiid, LPSTR b, int l) | StrRetA | [inline]
~StrRetA() | StrRetA | [inline]


ROS Explorer: StrRetW Struct Reference

StrRetW Struct Reference

easy retrieval of wide char strings out of STRRET structures More...

#include <shellclasses.h>

Inheritance diagram for StrRetW:

[legend]
Collaboration diagram for StrRetW:

[legend]
List of all members.

Public Member Functions

~StrRetW ()
void GetString (const SHITEMID &shiid, LPWSTR b, int l)

Detailed Description

easy retrieval of wide char strings out of STRRET structures

Definition at line 893 of file shellclasses.h.

Constructor & Destructor Documentation

StrRetW::~StrRetW ( ) [inline]

Definition at line 895 of file shellclasses.h.

00896         {
00897                 if (uType == STRRET_WSTR)
00898                         ShellMalloc()->Free(pOleStr);
00899         }

Member Function Documentation

void StrRetW::GetString | ( | const SHITEMID & | shiid,
 |  | LPWSTR | b,
 |  | int | l
 | ) | [inline]

Definition at line 901 of file shellclasses.h.

References UNION_MEMBER.

Referenced by path_from_pidlW().

00902         {
00903                 switch(uType) {
00904                   case STRRET_WSTR:
00905                         lstrcpynW(b, UNION_MEMBER(pOleStr), l);
00906                         break;
00907
00908                   case STRRET_OFFSET:
00909                         MultiByteToWideChar(CP_ACP, 0, (LPCSTR)&shiid+UNION_MEMBER(uOffset), -1, b, l);
00910                         break;
00911
00912                   case STRRET_CSTR:
00913                         MultiByteToWideChar(CP_ACP, 0, UNION_MEMBER(cStr), -1, b, l);
00914                 }
00915         }

The documentation for this struct was generated from the following file:
  • shellclasses.h


ROS Explorer: Member List

StrRetW Member List

This is the complete list of members for StrRetW, including all inherited members.

GetString(const SHITEMID &shiid, LPWSTR b, int l) | StrRetW | [inline]
~StrRetW() | StrRetW | [inline]


ROS Explorer: SubclassedWindow Struct Reference

SubclassedWindow Struct Reference

SubclassedWindow is used to wrap already existing window handles into C++ Window objects. More...

#include <window.h>

Inheritance diagram for SubclassedWindow:

[legend]
Collaboration diagram for SubclassedWindow:

[legend]
List of all members.

Public Types

typedef Window | super

Public Member Functions

SubclassedWindow (HWND)

Protected Member Functions

virtual LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual int | Command (int id, int code)
virtual int | Notify (int id, NMHDR *pnmh)

Static Protected Member Functions

static LRESULT CALLBACK | SubclassedWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)

Protected Attributes

WNDPROC | _orgWndProc

Detailed Description

SubclassedWindow is used to wrap already existing window handles into C++ Window objects.

To construct a object, use the "new" operator to put it in the heap. It is automatically freed, when the window gets destroyed.

Definition at line 176 of file window.h.

Member Typedef Documentation

typedef Window SubclassedWindow::super

Reimplemented in BackgroundWindow, DesktopShellView, Pane, StartButton, QuickLaunchBar, OwnerdrawnButton, FlatButton, PictureButton, ColorStatic, HyperlinkCtrl, EditController, and ExtContextMenuHandlerT< SubclassedWindow >.

Definition at line 178 of file window.h.

Constructor & Destructor Documentation

SubclassedWindow::SubclassedWindow ( HWND )

Definition at line 299 of file window.cpp.

References WindowHandle::_hwnd, _orgWndProc, and SubclassedWndProc().

00300  :      super(hwnd)
00301 {
00302         _orgWndProc = SubclassWindow(_hwnd, SubclassedWndProc);
00303
00304         if (!_orgWndProc)
00305                 delete this;
00306 }

Here is the call graph for this function:

Member Function Documentation

int SubclassedWindow::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Window.

Reimplemented in DesktopShellView, and QuickLaunchBar.

Definition at line 346 of file window.cpp.

Referenced by DesktopShellView::Command(), and SubclassedWndProc().

00347 {
00348         return 1;       // no command handler found
00349 }

int SubclassedWindow::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from Window.

Reimplemented in DesktopShellView, Pane, and QuickLaunchBar.

Definition at line 351 of file window.cpp.

References WindowHandle::_hwnd, and _orgWndProc.

Referenced by DesktopShellView::Notify(), and SubclassedWndProc().

00352 {
00353         return CallWindowProc(_orgWndProc, _hwnd, WM_NOTIFY, id, (LPARAM)pnmh);
00354 }

LRESULT CALLBACK SubclassedWindow::SubclassedWndProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static, protected]

Definition at line 308 of file window.cpp.

References Command(), GET_WINDOW, Window::Init(), NFR_CURRENT, Notify(), and WndProc().

Referenced by SubclassedWindow().

00309 {
00310         SubclassedWindow* pThis = GET_WINDOW(SubclassedWindow, hwnd);
00311         assert(pThis);
00312
00313         if (pThis) {
00314                 switch(nmsg) {
00315                   case WM_COMMAND:
00316                         if (!pThis->Command(LOWORD(wparam), HIWORD(wparam)))
00317                                 return 0;
00318                         break;
00319
00320                   case WM_NOTIFY:
00321                         return pThis->Notify(wparam, (NMHDR*)lparam);
00322
00323                   case WM_NOTIFYFORMAT:
00324                         return NFR_CURRENT;
00325
00326                   case WM_CREATE:
00327                         return pThis->Init((LPCREATESTRUCT)lparam);
00328
00329                   case WM_NCDESTROY:
00330                         delete pThis;
00331                         return 0;
00332
00333                   default:
00334                         return pThis->WndProc(nmsg, wparam, lparam);
00335                 }
00336         }
00337
00338         return CallWindowProc(pThis->_orgWndProc, hwnd, nmsg, wparam, lparam);
00339 }

Here is the call graph for this function:

LRESULT SubclassedWindow::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from Window.

Reimplemented in BackgroundWindow, DesktopShellView, Pane, StartButton, QuickLaunchBar, OwnerdrawnButton, FlatButton, ColorStatic, HyperlinkCtrl, EditController, and ExtContextMenuHandlerT< SubclassedWindow >.

Definition at line 341 of file window.cpp.

References WindowHandle::_hwnd, and _orgWndProc.

Referenced by SubclassedWndProc(), OwnerdrawnButton::WndProc(), and BackgroundWindow::WndProc().

00342 {
00343         return CallWindowProc(_orgWndProc, _hwnd, nmsg, wparam, lparam);
00344 }

Member Data Documentation

WNDPROC SubclassedWindow::_orgWndProc [protected]

Definition at line 183 of file window.h.

Referenced by Notify(), SubclassedWindow(), and WndProc().

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

SubclassedWindow Member List

This is the complete list of members for SubclassedWindow, including all inherited members.

_hwnd | WindowHandle | [protected]
_orgWndProc | SubclassedWindow | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | SubclassedWindow | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | SubclassedWindow | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SubclassedWindow(HWND) | SubclassedWindow |
SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, static]
super typedef | SubclassedWindow |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | SubclassedWindow | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: SysCacheIcon Struct Reference

SysCacheIcon Struct Reference

#include <globals.h>

Inheritance diagram for SysCacheIcon:

[legend]
Collaboration diagram for SysCacheIcon:

[legend]
List of all members.

Public Member Functions

SysCacheIcon (int id, int sys_idx)

Detailed Description

Definition at line 112 of file globals.h.

Constructor & Destructor Documentation

SysCacheIcon::SysCacheIcon | ( | int | id,
 |  | int | sys_idx
 | ) | [inline]

Definition at line 113 of file globals.h.

00114          :      Icon(IT_SYSCACHE, id, sys_idx) {}

The documentation for this struct was generated from the following file:
  • globals.h


ROS Explorer: Member List

SysCacheIcon Member List

This is the complete list of members for SysCacheIcon, including all inherited members.

_hicon | Icon | [protected]
_id | Icon | [protected]
_itype | Icon | [protected]
_sys_idx | Icon | [protected]
add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const | Icon |
create_bitmap(COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const | Icon |
destroy() | Icon | [inline]
draw(HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const | Icon |
get_hicon() const | Icon | [inline]
get_sysiml_idx() const | Icon | [inline]
Icon() | Icon |
Icon(ICON_ID id, UINT nid) | Icon |
Icon(ICON_TYPE itype, int id, HICON hIcon) | Icon |
Icon(ICON_TYPE itype, int id, int sys_idx) | Icon |
operator ICON_ID() const | Icon | [inline]
SysCacheIcon(int id, int sys_idx) | SysCacheIcon | [inline]


ROS Explorer: TaskBar Struct Reference

TaskBar Struct Reference

Taskbar window. More...

#include <taskbar.h>

Inheritance diagram for TaskBar:

[legend]
Collaboration diagram for TaskBar:

[legend]
List of all members.

Public Types

typedef Window | super

Public Member Functions

TaskBar (HWND hwnd)
~TaskBar ()

Static Public Member Functions

static HWND | Create (HWND hwndParent)

Protected Member Functions

LRESULT | Init (LPCREATESTRUCT pcs)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
int | Command (int id, int code)
int | Notify (int id, NMHDR *pnmh)
void | ActivateApp (TaskBarMap::iterator it, bool can_minimize=true, bool can_restore=true)
void | ShowAppSystemMenu (TaskBarMap::iterator it)
void | Refresh ()
void | ResizeButtons ()

Static Protected Member Functions

static BOOL CALLBACK | EnumWndProc (HWND hwnd, LPARAM lparam)

Protected Attributes

WindowHandle _htoolbar
TaskBarMap _map
int | _next_id
WindowHandle _last_foreground_wnd
int | _last_btn_width
MINIMIZEDMETRICS | _mmMetrics_org
const UINT | WM_SHELLHOOK

Detailed Description

Taskbar window.

Definition at line 73 of file taskbar.h.

Member Typedef Documentation

typedef Window TaskBar::super

Definition at line 75 of file taskbar.h.

Constructor & Destructor Documentation

TaskBar::TaskBar ( HWND hwnd )

Definition at line 70 of file taskbar.cpp.

References _last_btn_width, and _mmMetrics_org.

00071  :      super(hwnd),
00072         WM_SHELLHOOK(RegisterWindowMessage(WINMSG_SHELLHOOK))
00073 {
00074         _last_btn_width = 0;
00075
00076         _mmMetrics_org.cbSize = sizeof(MINIMIZEDMETRICS);
00077
00078         SystemParametersInfo(SPI_GETMINIMIZEDMETRICS, sizeof(_mmMetrics_org), &_mmMetrics_org, 0);
00079
00080          // configure the window manager to hide windows when they are minimized
00081          // This is neccessary to enable shell hook messages.
00082         if (!(_mmMetrics_org.iArrange & ARW_HIDE)) {
00083                 MINIMIZEDMETRICS _mmMetrics_new = _mmMetrics_org;
00084
00085                 _mmMetrics_new.iArrange |= ARW_HIDE;
00086
00087                 SystemParametersInfo(SPI_SETMINIMIZEDMETRICS, sizeof(_mmMetrics_new), &_mmMetrics_new, 0);
00088         }
00089 }

TaskBar::~TaskBar ( )

Definition at line 91 of file taskbar.cpp.

References WindowHandle::_hwnd, _mmMetrics_org, g_DeregisterShellHookWindow, and g_SetTaskmanWindow.

00092 {
00093 //      if (g_RegisterShellHook)
00094 //              (*g_RegisterShellHook)(_hwnd, RSH_UNREGISTER);
00095
00096         if (g_DeregisterShellHookWindow)
00097                 (*g_DeregisterShellHookWindow)(_hwnd);
00098         else
00099                 KillTimer(_hwnd, 0);
00100
00101         if (g_SetTaskmanWindow)
00102                 (*g_SetTaskmanWindow)(0);
00103
00104         SystemParametersInfo(SPI_GETMINIMIZEDMETRICS, sizeof(_mmMetrics_org), &_mmMetrics_org, 0);
00105 }

Member Function Documentation

void TaskBar::ActivateApp | ( | TaskBarMap::iterator | it,
 |  | bool | can_minimize = true,
 |  | bool | can_restore = true
 | ) | [protected]

Definition at line 280 of file taskbar.cpp.

References _last_foreground_wnd, HWND, and Refresh().

Referenced by Command(), Notify(), and ShowAppSystemMenu().

00281 {
00282         HWND hwnd = it->first;
00283
00284         bool minimize_it = can_minimize && !IsIconic(hwnd) &&
00285                                                 (hwnd==GetForegroundWindow() || hwnd==_last_foreground_wnd);
00286
00287          // switch to selected application window
00288         if (can_restore && !minimize_it)
00289                 if (IsIconic(hwnd))
00290                         PostMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
00291
00292          // In case minimize_it is true, we _have_ to switch to the app before
00293          // posting SW_MINIMIZE to be compatible with some applications (e.g. "Sleipnir")
00294         SetForegroundWindow(hwnd);
00295
00296         if (minimize_it) {
00297                 PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
00298                 _last_foreground_wnd = 0;
00299         } else
00300                 _last_foreground_wnd = hwnd;
00301
00302         Refresh();
00303 }

Here is the call graph for this function:

int TaskBar::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 229 of file taskbar.cpp.

References _map, ActivateApp(), and TaskBarMap::find_id().

00230 {
00231         TaskBarMap::iterator found = _map.find_id(id);
00232
00233         if (found != _map.end()) {
00234                 ActivateApp(found);
00235                 return 0;
00236         }
00237
00238         return super::Command(id, code);
00239 }

Here is the call graph for this function:

HWND TaskBar::Create ( HWND hwndParent ) [static]

Definition at line 107 of file taskbar.cpp.

References CLASSNAME_TASKBAR, Window::Create(), NOTIFYAREA_WIDTH_DEF, TITLE_TASKBAR, and WINDOW_CREATOR.

Referenced by DesktopBar::Init().

00108 {
00109         ClientRect clnt(hwndParent);
00110
00111         int taskbar_pos = 80;   // This start position will be adjusted in DesktopBar::Resize().
00112
00113         return Window::Create(WINDOW_CREATOR(TaskBar), 0,
00114                                                         BtnWindowClass(CLASSNAME_TASKBAR), TITLE_TASKBAR,
00115                                                         WS_CHILD|WS_VISIBLE | CCS_TOP|CCS_NODIVIDER|CCS_NORESIZE,
00116                                                         taskbar_pos, 0, clnt.right-taskbar_pos-(NOTIFYAREA_WIDTH_DEF+1), clnt.bottom, hwndParent);
00117 }

Here is the call graph for this function:

BOOL CALLBACK TaskBar::EnumWndProc | ( | HWND | hwnd,
 |  | LPARAM | lparam
 | ) | [static, protected]

Definition at line 374 of file taskbar.cpp.

References TaskBarEntry::_bmp_idx, TaskBarEntry::_btn_idx, TaskBarEntry::_fsState, TaskBarEntry::_hbmp, _htoolbar, TaskBarEntry::_id, _last_foreground_wnd, _map, _next_id, TaskBarEntry::_title, TaskBarEntry::_used, BUFFER_LEN, create_bitmap_from_icon(), get_window_icon_small(), HWND, and ResizeButtons().

Referenced by Refresh().

00375 {
00376         TaskBar* pThis = (TaskBar*)lparam;
00377
00378         DWORD style = GetWindowStyle(hwnd);
00379         DWORD ex_style = GetWindowExStyle(hwnd);
00380
00381         if ((style&WS_VISIBLE) && !(ex_style&WS_EX_TOOLWINDOW) &&
00382                 !GetParent(hwnd) && !GetWindow(hwnd,GW_OWNER)) {
00383                 TCHAR title[BUFFER_LEN];
00384
00385                 if (!GetWindowText(hwnd, title, BUFFER_LEN))
00386                         title[0] = '\0';
00387
00388                 TaskBarMap::iterator found = pThis->_map.find(hwnd);
00389                 int last_id = 0;
00390
00391                 if (found != pThis->_map.end()) {
00392                         last_id = found->second._id;
00393
00394                         if (!last_id)
00395                                 found->second._id = pThis->_next_id++;
00396                 } else {
00397                         HBITMAP hbmp;
00398                         HICON hIcon = get_window_icon_small(hwnd);
00399                         BOOL delete_icon = FALSE;
00400
00401                         if (!hIcon) {
00402                                 hIcon = LoadIcon(0, IDI_APPLICATION);
00403                                 delete_icon = TRUE;
00404                         }
00405
00406                         if (hIcon) {
00407                                 hbmp = create_bitmap_from_icon(hIcon, GetSysColorBrush(COLOR_BTNFACE), WindowCanvas(pThis->_htoolbar));
00408                                 if (delete_icon)
00409                                         DestroyIcon(hIcon); // some icons can be freed, some not - so ignore any error return of DestroyIcon()
00410                         } else
00411                                 hbmp = 0;
00412
00413                         TBADDBITMAP ab = {0, (UINT_PTR)hbmp};
00414                         int bmp_idx = SendMessage(pThis->_htoolbar, TB_ADDBITMAP, 1, (LPARAM)&ab);
00415
00416                         TaskBarEntry entry;
00417
00418                         entry._id = pThis->_next_id++;
00419                         entry._hbmp = hbmp;
00420                         entry._bmp_idx = bmp_idx;
00421                         entry._title = title;
00422
00423                         pThis->_map[hwnd] = entry;
00424                         found = pThis->_map.find(hwnd);
00425                 }
00426
00427                 TBBUTTON btn = {-2/*I_IMAGENONE*/, 0, TBSTATE_ENABLED/*|TBSTATE_ELLIPSES*/, BTNS_BUTTON, {0, 0}, 0, 0};
00428                 TaskBarEntry& entry = found->second;
00429
00430                 ++entry._used;
00431                 btn.idCommand = entry._id;
00432
00433                 HWND foreground = GetForegroundWindow();
00434                 HWND foreground_owner = GetWindow(foreground, GW_OWNER);
00435
00436                 if (hwnd==foreground || hwnd==foreground_owner) {
00437                         btn.fsState |= TBSTATE_PRESSED|TBSTATE_CHECKED;
00438                         pThis->_last_foreground_wnd = hwnd;
00439                 }
00440
00441                 if (!last_id) {
00442                          // create new toolbar buttons for new windows
00443                         if (title[0])
00444                                 btn.iString = (INT_PTR)title;
00445
00446                         btn.iBitmap = entry._bmp_idx;
00447                         entry._btn_idx = SendMessage(pThis->_htoolbar, TB_BUTTONCOUNT, 0, 0);
00448
00449                         SendMessage(pThis->_htoolbar, TB_INSERTBUTTON, entry._btn_idx, (LPARAM)&btn);
00450
00451                         pThis->ResizeButtons();
00452                 } else {
00453                          // refresh attributes of existing buttons
00454                         if (btn.fsState != entry._fsState)
00455                                 SendMessage(pThis->_htoolbar, TB_SETSTATE, entry._id, MAKELONG(btn.fsState,0));
00456
00457                         if (entry._title != title) {
00458                                 TBBUTTONINFO info;
00459
00460                                 info.cbSize = sizeof(TBBUTTONINFO);
00461                                 info.dwMask = TBIF_TEXT;
00462                                 info.pszText = title;
00463
00464                                 SendMessage(pThis->_htoolbar, TB_SETBUTTONINFO, entry._id, (LPARAM)&info);
00465
00466                                 entry._title = title;
00467                         }
00468                 }
00469
00470                 entry._fsState = btn.fsState;
00471
00472 #ifdef _ROS_    // now handled by activating the ARW_HIDE flag with SystemParametersInfo(SPI_SETMINIMIZEDMETRICS)
00473                  // move minimized windows out of sight
00474                 if (IsIconic(hwnd)) {
00475                         RECT rect;
00476
00477                         GetWindowRect(hwnd, &rect);
00478
00479                         if (rect.bottom > 0)
00480                                 SetWindowPos(hwnd, 0, -32000, -32000, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
00481                 }
00482 #endif
00483         }
00484
00485         return TRUE;
00486 }

Here is the call graph for this function:

LRESULT TaskBar::Init ( LPCREATESTRUCT pcs ) [protected, virtual]

Reimplemented from Window.

Definition at line 119 of file taskbar.cpp.

References _htoolbar, WindowHandle::_hwnd, _next_id, g_RegisterShellHookWindow, g_SetTaskmanWindow, IDC_FIRST_APP, IDW_TASKTOOLBAR, Window::Init(), LOG, Refresh(), and TASKBUTTONWIDTH_MAX.

00120 {
00121         if (super::Init(pcs))
00122                 return 1;
00123
00124         /* FIXME: There's an internal padding for non-flat toolbar. Get rid of it somehow. */
00125         _htoolbar = CreateToolbarEx(_hwnd,
00126                                                                 WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|
00127                                                                 CCS_TOP|CCS_NODIVIDER|TBSTYLE_LIST|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,//|TBSTYLE_AUTOSIZE
00128                                                                 IDW_TASKTOOLBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
00129
00130         SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(TASKBUTTONWIDTH_MAX,TASKBUTTONWIDTH_MAX));
00131         //SendMessage(_htoolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
00132         //SendMessage(_htoolbar, TB_SETDRAWTEXTFLAGS, DT_CENTER|DT_VCENTER, DT_CENTER|DT_VCENTER);
00133         //SetWindowFont(_htoolbar, GetStockFont(ANSI_VAR_FONT), FALSE);
00134         //SendMessage(_htoolbar, TB_SETPADDING, 0, MAKELPARAM(8,8));
00135
00136 #ifndef __MINGW32__     // TBMETRICS missing in MinGW (as of 20.09.2005)
00137          // set metrics for the Taskbar toolbar to enable button spacing
00138         TBMETRICS metrics;
00139
00140         metrics.cbSize = sizeof(TBMETRICS);
00141         metrics.dwMask = TBMF_BARPAD | TBMF_BUTTONSPACING;
00142         metrics.cxBarPad = 0;
00143         metrics.cyBarPad = 0;
00144         metrics.cxButtonSpacing = 3;
00145         metrics.cyButtonSpacing = 3;
00146
00147         SendMessage(_htoolbar, TB_SETMETRICS, 0, (LPARAM)&metrics);
00148 #endif
00149
00150         _next_id = IDC_FIRST_APP;
00151
00152          // register the taskbar window as task manager window to make the following call to RegisterShellHookWindow working
00153         if (g_SetTaskmanWindow)
00154                 (*g_SetTaskmanWindow)(_hwnd);
00155
00156         if (g_RegisterShellHookWindow) {
00157                 LOG(TEXT("Using shell hooks for notification of shell events."));
00158
00159                 (*g_RegisterShellHookWindow)(_hwnd);
00160         } else {
00161                 LOG(TEXT("Shell hooks not available."));
00162
00163                 SetTimer(_hwnd, 0, 200, NULL);
00164         }
00165
00166 /* Alternatively we could use the RegisterShellHook() function in SHELL32, but this is not yet implemented in the WINE code.
00167         if (g_RegisterShellHook) {
00168                 (*g_RegisterShellHook)(0, RSH_REGISTER);
00169
00170                 if ((HIWORD(GetVersion())>>14) == W_VER_NT)
00171                         (*g_RegisterShellHook)(_hwnd, RSH_REGISTER_TASKMAN);
00172                 else
00173                         (*g_RegisterShellHook)(_hwnd, RSH_REGISTER);
00174         }
00175 */
00176         Refresh();
00177
00178         return 0;
00179 }

Here is the call graph for this function:

int TaskBar::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 241 of file taskbar.cpp.

References _htoolbar, _map, ActivateApp(), TaskBarMap::find_id(), ScreenToClient(), and ShowAppSystemMenu().

00242 {
00243         if (pnmh->hwndFrom == _htoolbar)
00244                 switch(pnmh->code) {
00245                   case NM_RCLICK: {
00246                         TBBUTTONINFO btninfo;
00247                         TaskBarMap::iterator it;
00248                         Point pt(GetMessagePos());
00249                         ScreenToClient(_htoolbar, &pt);
00250
00251                         btninfo.cbSize = sizeof(TBBUTTONINFO);
00252                         btninfo.dwMask = TBIF_BYINDEX|TBIF_COMMAND;
00253
00254                         int idx = SendMessage(_htoolbar, TB_HITTEST, 0, (LPARAM)&pt);
00255
00256                         if (idx>=0 &&
00257                                 SendMessage(_htoolbar, TB_GETBUTTONINFO, idx, (LPARAM)&btninfo)!=-1 &&
00258                                 (it=_map.find_id(btninfo.idCommand))!=_map.end()) {
00259                                 //TaskBarEntry& entry = it->second;
00260
00261                                 ActivateApp(it, false, false);  // don't restore minimized windows on right button click
00262
00263 #ifndef __MINGW32__     // SHRestricted() missing in MinGW (as of 29.10.2003)
00264                                 static DynamicFct<DWORD(STDAPICALLTYPE*)(RESTRICTIONS)> pSHRestricted(TEXT("SHELL32"), "SHRestricted");
00265
00266                                 if (pSHRestricted && !(*pSHRestricted)(REST_NOTRAYCONTEXTMENU))
00267 #endif
00268                                         ShowAppSystemMenu(it);
00269                         }
00270                         break;}
00271
00272                   default:
00273                         return super::Notify(id, pnmh);
00274                 }
00275
00276         return 0;
00277 }

Here is the call graph for this function:

void TaskBar::Refresh ( ) [protected]

Definition at line 488 of file taskbar.cpp.

References _map, and EnumWndProc().

Referenced by ActivateApp(), Init(), and WndProc().

00489 {
00490         for(TaskBarMap::iterator it=_map.begin(); it!=_map.end(); ++it)
00491                 it->second._used = 0;
00492
00493         EnumWindows(EnumWndProc, (LPARAM)this);
00494         //EnumDesktopWindows(GetThreadDesktop(GetCurrentThreadId()), EnumWndProc, (LPARAM)_htoolbar);
00495
00496         set<int> btn_idx_to_delete;
00497         set<HBITMAP> hbmp_to_delete;
00498
00499         for(TaskBarMap::iterator it=_map.begin(); it!=_map.end(); ++it) {
00500                 TaskBarEntry& entry = it->second;
00501
00502                 if (!entry._used && entry._id) {
00503                          // store button indexes to remove
00504                         btn_idx_to_delete.insert(entry._btn_idx);
00505                         hbmp_to_delete.insert(entry._hbmp);
00506                         entry._id = 0;
00507                 }
00508         }
00509
00510         if (!btn_idx_to_delete.empty()) {
00511                  // remove buttons from right to left
00512                 for(set<int>::reverse_iterator it=btn_idx_to_delete.rbegin(); it!=btn_idx_to_delete.rend(); ++it) {
00513                         int idx = *it;
00514
00515                         SendMessage(_htoolbar, TB_DELETEBUTTON, idx, 0);
00516
00517                         for(TaskBarMap::iterator it=_map.begin(); it!=_map.end(); ++it) {
00518                                 TaskBarEntry& entry = it->second;
00519
00520                                  // adjust button indexes
00521                                 if (entry._btn_idx > idx) {
00522                                         --entry._btn_idx;
00523                                         --entry._bmp_idx;
00524
00525                                         TBBUTTONINFO info;
00526
00527                                         info.cbSize = sizeof(TBBUTTONINFO);
00528                                         info.dwMask = TBIF_IMAGE;
00529                                         info.iImage = entry._bmp_idx;
00530
00531                                         SendMessage(_htoolbar, TB_SETBUTTONINFO, entry._id, (LPARAM)&info);
00532                                 }
00533                         }
00534                 }
00535
00536                 for(set<HBITMAP>::iterator it=hbmp_to_delete.begin(); it!=hbmp_to_delete.end(); ++it) {
00537                         HBITMAP hbmp = *it;
00538
00539                         TBREPLACEBITMAP tbrepl = {0, (UINT_PTR)hbmp, 0, 0};
00540                         SendMessage(_htoolbar, TB_REPLACEBITMAP, 0, (LPARAM)&tbrepl);
00541
00542                         DeleteObject(hbmp);
00543
00544                         for(TaskBarMap::iterator it=_map.begin(); it!=_map.end(); ++it)
00545                                 if (it->second._hbmp == hbmp) {
00546                                         _map.erase(it);
00547                                         break;
00548                                 }
00549                 }
00550
00551                 ResizeButtons();
00552         }
00553 }

Here is the call graph for this function:

void TaskBar::ResizeButtons ( ) [protected]

Definition at line 564 of file taskbar.cpp.

References WindowHandle::_hwnd, _last_btn_width, _map, TASKBUTTONWIDTH_MAX, and TASKBUTTONWIDTH_MIN.

Referenced by EnumWndProc(), and WndProc().

00565 {
00566         int btns = _map.size();
00567
00568         if (btns > 0) {
00569                 int bar_width = ClientRect(_hwnd).right;
00570                 int btn_width = (bar_width / btns) - 3;
00571
00572                 if (btn_width < TASKBUTTONWIDTH_MIN)
00573                         btn_width = TASKBUTTONWIDTH_MIN;
00574                 else if (btn_width > TASKBUTTONWIDTH_MAX)
00575                         btn_width = TASKBUTTONWIDTH_MAX;
00576
00577                 if (btn_width != _last_btn_width) {
00578                         _last_btn_width = btn_width;
00579
00580                         SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(btn_width,btn_width));
00581                         SendMessage(_htoolbar, TB_AUTOSIZE, 0, 0);
00582                 }
00583         }
00584 }

void TaskBar::ShowAppSystemMenu ( TaskBarMap::iterator it ) [protected]

Definition at line 305 of file taskbar.cpp.

References WindowHandle::_hwnd, and ActivateApp().

Referenced by Notify().

00306 {
00307         HMENU hmenu = GetSystemMenu(it->first, FALSE);
00308
00309         if (hmenu) {
00310                 POINT pt;
00311
00312                 GetCursorPos(&pt);
00313                 int cmd = TrackPopupMenu(hmenu, TPM_LEFTBUTTON|TPM_RIGHTBUTTON|TPM_RETURNCMD, pt.x, pt.y, 0, _hwnd, NULL);
00314
00315                 if (cmd) {
00316                         ActivateApp(it, false, false);  // reactivate window after the context menu has closed
00317                         PostMessage(it->first, WM_SYSCOMMAND, cmd, 0);
00318                 }
00319         }
00320 }

Here is the call graph for this function:

LRESULT TaskBar::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 181 of file taskbar.cpp.

References _htoolbar, _last_foreground_wnd, HWND, PM_GET_LAST_ACTIVE, Refresh(), ResizeButtons(), ScreenToClient(), and WM_SHELLHOOK.

00182 {
00183         switch(nmsg) {
00184           case WM_SIZE:
00185                 SendMessage(_htoolbar, WM_SIZE, 0, 0);
00186                 ResizeButtons();
00187                 break;
00188
00189           case WM_TIMER:
00190                 Refresh();
00191                 return 0;
00192
00193           case WM_CONTEXTMENU: {
00194                 Point pt(lparam);
00195                 ScreenToClient(_htoolbar, &pt);
00196
00197                 if ((HWND)wparam==_htoolbar && SendMessage(_htoolbar, TB_HITTEST, 0, (LPARAM)&pt)>=0)
00198                         break;  // avoid displaying context menu for application button _and_ desktop bar at the same time
00199
00200                 goto def;}
00201
00202           case PM_GET_LAST_ACTIVE:
00203                 return (LRESULT)(HWND)_last_foreground_wnd;
00204
00205           default: def:
00206                 if (nmsg == WM_SHELLHOOK) {
00207                         switch(wparam) {
00208                           case HSHELL_WINDOWCREATED:
00209                           case HSHELL_WINDOWDESTROYED:
00210                           case HSHELL_WINDOWACTIVATED:
00211                           case HSHELL_REDRAW:
00212 #ifdef HSHELL_FLASH
00213                           case HSHELL_FLASH:
00214 #endif
00215 #ifdef HSHELL_RUDEAPPACTIVATED
00216                           case HSHELL_RUDEAPPACTIVATED:
00217 #endif
00218                                 Refresh();
00219                                 break;
00220                         }
00221                 } else {
00222                         return super::WndProc(nmsg, wparam, lparam);
00223                 }
00224         }
00225
00226         return 0;
00227 }

Here is the call graph for this function:

Member Data Documentation

WindowHandle TaskBar::_htoolbar [protected]

Definition at line 83 of file taskbar.h.

Referenced by EnumWndProc(), Init(), Notify(), and WndProc().

int TaskBar::_last_btn_width [protected]

Definition at line 87 of file taskbar.h.

Referenced by ResizeButtons(), and TaskBar().

WindowHandle TaskBar::_last_foreground_wnd [protected]

Definition at line 86 of file taskbar.h.

Referenced by ActivateApp(), EnumWndProc(), and WndProc().

TaskBarMap TaskBar::_map [protected]

Definition at line 84 of file taskbar.h.

Referenced by Command(), EnumWndProc(), Notify(), Refresh(), and ResizeButtons().

MINIMIZEDMETRICS TaskBar::_mmMetrics_org [protected]

Definition at line 88 of file taskbar.h.

Referenced by TaskBar(), and ~TaskBar().

int TaskBar::_next_id [protected]

Definition at line 85 of file taskbar.h.

Referenced by EnumWndProc(), and Init().

const UINT TaskBar::WM_SHELLHOOK [protected]

Definition at line 90 of file taskbar.h.

Referenced by WndProc().

The documentation for this struct was generated from the following files:
  • taskbar.h
  • taskbar.cpp


ROS Explorer: Member List

TaskBar Member List

This is the complete list of members for TaskBar, including all inherited members.

_htoolbar | TaskBar | [protected]
_hwnd | WindowHandle | [protected]
_last_btn_width | TaskBar | [protected]
_last_foreground_wnd | TaskBar | [protected]
_map | TaskBar | [protected]
_mmMetrics_org | TaskBar | [protected]
_next_id | TaskBar | [protected]
ActivateApp(TaskBarMap::iterator it, bool can_minimize=true, bool can_restore=true) | TaskBar | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | TaskBar | [protected, virtual]
Create(HWND hwndParent) | TaskBar | [static]
Window::Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Window::Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
EnumWndProc(HWND hwnd, LPARAM lparam) | TaskBar | [protected, static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | TaskBar | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | TaskBar | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
Refresh() | TaskBar | [protected]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeButtons() | TaskBar | [protected]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
ShowAppSystemMenu(TaskBarMap::iterator it) | TaskBar | [protected]
super typedef | TaskBar |
TaskBar(HWND hwnd) | TaskBar |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WM_SHELLHOOK | TaskBar | [protected]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | TaskBar | [protected, virtual]
~TaskBar() | TaskBar |
~Window() | Window | [virtual]


ROS Explorer: TaskBarEntry Struct Reference

TaskBarEntry Struct Reference

internal task bar button management entry More...

#include <taskbar.h>

Collaboration diagram for TaskBarEntry:

[legend]
List of all members.

Public Member Functions

TaskBarEntry ()

Public Attributes

int | _id
HBITMAP | _hbmp
int | _bmp_idx
int | _used
int | _btn_idx
String _title
BYTE | _fsState

Detailed Description

internal task bar button management entry

Definition at line 50 of file taskbar.h.

Constructor & Destructor Documentation

TaskBarEntry::TaskBarEntry ( )

Definition at line 50 of file taskbar.cpp.

References _bmp_idx, _btn_idx, _fsState, _hbmp, _id, and _used.

00051 {
00052         _id = 0;
00053         _hbmp = 0;
00054         _bmp_idx = 0;
00055         _used = 0;
00056         _btn_idx = 0;
00057         _fsState = 0;
00058 }

Member Data Documentation

int TaskBarEntry::_bmp_idx

Definition at line 56 of file taskbar.h.

Referenced by TaskBar::EnumWndProc(), and TaskBarEntry().

int TaskBarEntry::_btn_idx

Definition at line 58 of file taskbar.h.

Referenced by TaskBar::EnumWndProc(), and TaskBarEntry().

BYTE TaskBarEntry::_fsState

Definition at line 60 of file taskbar.h.

Referenced by TaskBar::EnumWndProc(), and TaskBarEntry().

HBITMAP TaskBarEntry::_hbmp

Definition at line 55 of file taskbar.h.

Referenced by TaskBar::EnumWndProc(), and TaskBarEntry().

int TaskBarEntry::_id

Definition at line 54 of file taskbar.h.

Referenced by TaskBar::EnumWndProc(), and TaskBarEntry().

String TaskBarEntry::_title

Definition at line 59 of file taskbar.h.

Referenced by TaskBar::EnumWndProc().

int TaskBarEntry::_used

Definition at line 57 of file taskbar.h.

Referenced by TaskBar::EnumWndProc(), and TaskBarEntry().

The documentation for this struct was generated from the following files:
  • taskbar.h
  • taskbar.cpp


ROS Explorer: Member List

TaskBarEntry Member List

This is the complete list of members for TaskBarEntry, including all inherited members.

_bmp_idx | TaskBarEntry
_btn_idx | TaskBarEntry
_fsState | TaskBarEntry
_hbmp | TaskBarEntry
_id | TaskBarEntry
_title | TaskBarEntry
_used | TaskBarEntry
TaskBarEntry() | TaskBarEntry


ROS Explorer: TaskBarMap Struct Reference

TaskBarMap Struct Reference

map for managing the task bar buttons, mapped by application window handle More...

#include <taskbar.h>

Inheritance diagram for TaskBarMap:

[legend]
Collaboration diagram for TaskBarMap:

[legend]
List of all members.

Public Member Functions

~TaskBarMap ()
iterator find_id (int id)

Detailed Description

map for managing the task bar buttons, mapped by application window handle

Definition at line 64 of file taskbar.h.

Constructor & Destructor Documentation

TaskBarMap::~TaskBarMap ( )

Definition at line 60 of file taskbar.cpp.

00061 {
00062         while(!empty()) {
00063                 iterator it = begin();
00064                 DeleteBitmap(it->second._hbmp);
00065                 erase(it);
00066         }
00067 }

Member Function Documentation

TaskBarMap::iterator TaskBarMap::find_id ( int id )

Definition at line 555 of file taskbar.cpp.

Referenced by TaskBar::Command(), and TaskBar::Notify().

00556 {
00557         for(iterator it=begin(); it!=end(); ++it)
00558                 if (it->second._id == id)
00559                         return it;
00560
00561         return end();
00562 }

The documentation for this struct was generated from the following files:
  • taskbar.h
  • taskbar.cpp


ROS Explorer: Member List

TaskBarMap Member List

This is the complete list of members for TaskBarMap, including all inherited members.

find_id(int id) | TaskBarMap
~TaskBarMap() | TaskBarMap


ROS Explorer: TaskbarSettingsDlg Struct Reference

TaskbarSettingsDlg Struct Reference

"Taskbar Settings" Property Sheet Dialog More...

#include <settings.h>

Inheritance diagram for TaskbarSettingsDlg:

[legend]
Collaboration diagram for TaskbarSettingsDlg:

[legend]
List of all members.

Public Types

typedef PropSheetPageDlg | super

Public Member Functions

TaskbarSettingsDlg (HWND hwnd)
virtual int | Command (int id, int code)
virtual int | Notify (int id, NMHDR *pnmh)

Protected Attributes

XMLDoc | _cfg_org

Detailed Description

"Taskbar Settings" Property Sheet Dialog

Definition at line 65 of file settings.h.

Member Typedef Documentation

typedef PropSheetPageDlg TaskbarSettingsDlg::super

Reimplemented from PropSheetPageDlg.

Definition at line 67 of file settings.h.

Constructor & Destructor Documentation

TaskbarSettingsDlg::TaskbarSettingsDlg ( HWND hwnd )

Definition at line 158 of file settings.cpp.

References g_Globals, ExplorerGlobals::get_cfg(), ID_HIDE_INACTIVE_ICONS, and ID_SHOW_CLOCK.

00159  :      super(hwnd),
00160         _cfg_org(g_Globals._cfg)
00161 {
00162         XMLPos options = g_Globals.get_cfg("desktopbar/options");
00163
00164         CheckDlgButton(hwnd, ID_SHOW_CLOCK, XMLBool(options, "show-clock", true)? BST_CHECKED: BST_UNCHECKED);
00165         CheckDlgButton(hwnd, ID_HIDE_INACTIVE_ICONS, XMLBool(options, "hide-inactive", true)? BST_CHECKED: BST_UNCHECKED);
00166 }

Here is the call graph for this function:

Member Function Documentation

int TaskbarSettingsDlg::Command | ( | int | id,
 |  | int | code
 | ) | [virtual]

Reimplemented from PropSheetPageDlg.

Definition at line 187 of file settings.cpp.

References WindowHandle::_hwnd, ExplorerGlobals::_hwndDesktopBar, Dialog::DoModal(), g_Globals, ExplorerGlobals::get_cfg(), ID_HIDE_INACTIVE_ICONS, ID_SHOW_CLOCK, IDD_NOTIFYAREA, PM_REFRESH_CONFIG, XMLStorage::XMLBoolRef::toggle(), and WINDOW_CREATOR.

00188 {
00189         switch(id) {
00190           case ID_CONFIG_NOTIFYAREA:
00191                 Dialog::DoModal(IDD_NOTIFYAREA, WINDOW_CREATOR(TrayNotifyDlg), _hwnd);
00192                 break;
00193
00194           case ID_SHOW_CLOCK: {
00195                 XMLBoolRef boolRef1(XMLPos(g_Globals.get_cfg("desktopbar/options")), "show-clock", true);
00196                 boolRef1.toggle();
00197                 SendMessage(g_Globals._hwndDesktopBar, PM_REFRESH_CONFIG, 0, 0);
00198                 PropSheet_Changed(GetParent(_hwnd), _hwnd);
00199                 break;}
00200
00201           case ID_HIDE_INACTIVE_ICONS: {
00202                 XMLBoolRef boolRef2(XMLPos(g_Globals.get_cfg("notify-icons/options")), "hide-inactive", true);
00203         boolRef2.toggle();
00204                 SendMessage(g_Globals._hwndDesktopBar, PM_REFRESH_CONFIG, 0, 0);
00205                 PropSheet_Changed(GetParent(_hwnd), _hwnd);
00206                 break;}
00207
00208           default:
00209                 return 1;
00210         }
00211
00212         return 0;
00213 }

Here is the call graph for this function:

int TaskbarSettingsDlg::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [virtual]

Reimplemented from Window.

Definition at line 168 of file settings.cpp.

References ExplorerGlobals::_cfg, _cfg_org, ExplorerGlobals::_hwndDesktopBar, g_Globals, Window::Notify(), and PM_REFRESH_CONFIG.

00169 {
00170         switch(pnmh->code) {
00171           case PSN_APPLY:
00172                 _cfg_org = g_Globals._cfg;
00173                 break;
00174
00175           case PSN_RESET:
00176                 g_Globals._cfg = _cfg_org;
00177                 SendMessage(g_Globals._hwndDesktopBar, PM_REFRESH_CONFIG, 0, 0);
00178                 break;
00179
00180           default:
00181                 return super::Notify(id, pnmh);
00182         }
00183
00184         return 0;
00185 }

Here is the call graph for this function:

Member Data Documentation

XMLDoc TaskbarSettingsDlg::_cfg_org [protected]

Definition at line 75 of file settings.h.

Referenced by Notify().

The documentation for this struct was generated from the following files:
  • settings.h
  • settings.cpp


ROS Explorer: Member List

TaskbarSettingsDlg Member List

This is the complete list of members for TaskbarSettingsDlg, including all inherited members.

_cfg_org | TaskbarSettingsDlg | [protected]
_hwnd | WindowHandle | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | TaskbarSettingsDlg | [virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
Dialog(HWND) | Dialog |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | PropSheetPageDlg | [protected, static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0) | Dialog | [static]
DoModal(UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0) | Dialog | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | TaskbarSettingsDlg | [virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropertySheetDialog | PropSheetPageDlg | [friend]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
PropSheetPage | PropSheetPageDlg | [friend]
PropSheetPageDlg(HWND) | PropSheetPageDlg |
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
super typedef | TaskbarSettingsDlg |
TaskbarSettingsDlg(HWND hwnd) | TaskbarSettingsDlg |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | Dialog | [protected, virtual]
~Dialog() | Dialog |
~Window() | Window | [virtual]


ROS Explorer: TextColor Struct Reference

TextColor Struct Reference

TextColor locally selects a text color for drawing. More...

#include <utility.h>

Collaboration diagram for TextColor:

[legend]
List of all members.

Public Member Functions

TextColor (HDC hdc, COLORREF color)
~TextColor ()

Protected Attributes

HDC | _hdc
COLORREF | _old_color

Detailed Description

TextColor locally selects a text color for drawing.

Definition at line 589 of file utility.h.

Constructor & Destructor Documentation

TextColor::TextColor | ( | HDC | hdc,
 |  | COLORREF | color
 | ) | [inline]

Definition at line 591 of file utility.h.

00592          : _hdc(hdc), _old_color(SetTextColor(hdc, color)) {}

TextColor::~TextColor ( ) [inline]

Definition at line 594 of file utility.h.

00594 {SetTextColor(_hdc, _old_color);}

Member Data Documentation

HDC TextColor::_hdc [protected]

Definition at line 597 of file utility.h.

COLORREF TextColor::_old_color [protected]

Definition at line 598 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

TextColor Member List

This is the complete list of members for TextColor, including all inherited members.

_hdc | TextColor | [protected]
_old_color | TextColor | [protected]
TextColor(HDC hdc, COLORREF color) | TextColor | [inline]
~TextColor() | TextColor | [inline]


ROS Explorer: Thread Struct Reference

Thread Struct Reference

Thread base class. More...

#include <utility.h>

Inheritance diagram for Thread:

[legend]
Collaboration diagram for Thread:

[legend]
List of all members.

Public Member Functions

Thread ()
virtual | ~Thread ()
void | Start ()
void | Stop ()
virtual int | Run ()=0
bool | is_alive () const

Public Attributes

CritSect _crit_sect

Static Protected Member Functions

static DWORD WINAPI | ThreadProc (void *para)

Protected Attributes

HANDLE | _hThread
HANDLE | _evtFinish
bool | _alive
bool | _destroy

Detailed Description

Thread base class.

Definition at line 341 of file utility.h.

Constructor & Destructor Documentation

Thread::Thread ( ) [inline]

Definition at line 343 of file utility.h.

00344          :      _alive(false),
00345                 _destroy(false)
00346         {
00347                 _hThread = INVALID_HANDLE_VALUE;
00348                 _evtFinish = CreateEvent(NULL, TRUE, FALSE, NULL);
00349         }

virtual Thread::~Thread ( ) [inline, virtual]

Definition at line 351 of file utility.h.

00352         {
00353                 Stop();
00354
00355                 CloseHandle(_evtFinish);
00356                 CloseHandle(_hThread);
00357
00358                 if (_destroy)
00359                         delete this;
00360         }

Member Function Documentation

bool Thread::is_alive ( ) const [inline]

Definition at line 387 of file utility.h.

Referenced by FindProgramDlg::collect_programs_callback().

00387 {return _alive;}

virtual int Thread::Run ( ) [pure virtual]

Implemented in CollectProgramsThread.

Referenced by ThreadProc().

void Thread::Start ( ) [inline]

Definition at line 362 of file utility.h.

Referenced by _tWinMain(), and FindProgramDlg::Refresh().

00363         {
00364                 if (!_alive) {
00365                         _alive = true;
00366                         _hThread = CreateThread(NULL, 0, ThreadProc, this, 0, NULL);
00367                 }
00368         }

void Thread::Stop ( ) [inline]

Definition at line 370 of file utility.h.

Referenced by _tWinMain(), FindProgramDlg::Refresh(), and FindProgramDlg::~FindProgramDlg().

00371         {
00372                 SetEvent(_evtFinish);
00373
00374                 if (_alive) {
00375                         {
00376                         Lock lock(_crit_sect);
00377                         _alive = false;
00378                         }
00379
00380                          // wait for finishing
00381                         WaitForSingleObject(_hThread, INFINITE);
00382                 }
00383         }

DWORD WINAPI Thread::ThreadProc ( void * para ) [static, protected]

Definition at line 37 of file utility.cpp.

References _alive, and Run().

00038 {
00039         Thread* pThis = (Thread*) para;
00040
00041         int ret = pThis->Run();
00042
00043         pThis->_alive = false;
00044
00045         return ret;
00046 }

Here is the call graph for this function:

Member Data Documentation

bool Thread::_alive [protected]

Definition at line 396 of file utility.h.

Referenced by CollectProgramsThread::collect_programs(), CollectProgramsThread::Run(), and ThreadProc().

CritSect Thread::_crit_sect

Definition at line 389 of file utility.h.

Referenced by FindProgramDlg::collect_programs_callback(), and FindProgramDlg::LaunchSelected().

bool Thread::_destroy [protected]

Definition at line 397 of file utility.h.

HANDLE Thread::_evtFinish [protected]

Definition at line 395 of file utility.h.

HANDLE Thread::_hThread [protected]

Definition at line 394 of file utility.h.

The documentation for this struct was generated from the following files:
  • utility.h
  • utility.cpp


ROS Explorer: Member List

Thread Member List

This is the complete list of members for Thread, including all inherited members.

_alive | Thread | [protected]
_crit_sect | Thread |
_destroy | Thread | [protected]
_evtFinish | Thread | [protected]
_hThread | Thread | [protected]
is_alive() const | Thread | [inline]
Run()=0 | Thread | [pure virtual]
Start() | Thread | [inline]
Stop() | Thread | [inline]
Thread() | Thread | [inline]
ThreadProc(void *para) | Thread | [protected, static]
~Thread() | Thread | [inline, virtual]


ROS Explorer: XMLStorage::tifstream Struct Reference

XMLStorage::tifstream

XMLStorage::tifstream Struct Reference

input file stream with ANSI/UNICODE file names More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::tifstream:

[legend]
Collaboration diagram for XMLStorage::tifstream:

[legend]
List of all members.

Public Types

typedef std::istream super

Public Member Functions

tifstream (LPCTSTR path)

Protected Attributes

STDIO_FILEBUF _buf

Detailed Description

input file stream with ANSI/UNICODE file names

Definition at line 296 of file xmlstorage.h.

Member Typedef Documentation

typedef std::istream XMLStorage::tifstream::super

Definition at line 298 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::tifstream::tifstream ( LPCTSTR path ) [inline]

Definition at line 300 of file xmlstorage.h.

00301          :      super(&_buf),
00302                 FileHolder(path, TEXT("r")),
00303 #ifdef __GNUC__
00304                 _buf(_pfile, ios::in)
00305 #else
00306                 _buf(_pfile)
00307 #endif
00308         {
00309         }

Member Data Documentation

STDIO_FILEBUF XMLStorage::tifstream::_buf [protected]

Definition at line 312 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::tifstream Member List

This is the complete list of members for XMLStorage::tifstream, including all inherited members.

_buf | XMLStorage::tifstream | [protected]
_pfile | XMLStorage::FileHolder | [private]
FileHolder(LPCTSTR path, LPCTSTR mode) | XMLStorage::FileHolder | [inline, private]
super typedef | XMLStorage::tifstream |
tifstream(LPCTSTR path) | XMLStorage::tifstream | [inline]
~FileHolder() | XMLStorage::FileHolder | [inline, private]


ROS Explorer: XMLStorage::tofstream Struct Reference

XMLStorage::tofstream

XMLStorage::tofstream Struct Reference

output file stream with ANSI/UNICODE file names More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::tofstream:

[legend]
Collaboration diagram for XMLStorage::tofstream:

[legend]
List of all members.

Public Types

typedef std::ostream super

Public Member Functions

tofstream (LPCTSTR path)
~tofstream ()

Protected Attributes

STDIO_FILEBUF _buf

Detailed Description

output file stream with ANSI/UNICODE file names

Definition at line 316 of file xmlstorage.h.

Member Typedef Documentation

typedef std::ostream XMLStorage::tofstream::super

Definition at line 318 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::tofstream::tofstream ( LPCTSTR path ) [inline]

Definition at line 320 of file xmlstorage.h.

00321          :      super(&_buf),
00322                 FileHolder(path, TEXT("w")),
00323 #ifdef __GNUC__
00324                 _buf(_pfile, ios::out)
00325 #else
00326                 _buf(_pfile)
00327 #endif
00328         {
00329         }

XMLStorage::tofstream::~tofstream ( ) [inline]

Definition at line 331 of file xmlstorage.h.

00332         {
00333                 flush();
00334         }

Member Data Documentation

STDIO_FILEBUF XMLStorage::tofstream::_buf [protected]

Definition at line 337 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::tofstream Member List

This is the complete list of members for XMLStorage::tofstream, including all inherited members.

_buf | XMLStorage::tofstream | [protected]
_pfile | XMLStorage::FileHolder | [private]
FileHolder(LPCTSTR path, LPCTSTR mode) | XMLStorage::FileHolder | [inline, private]
super typedef | XMLStorage::tofstream |
tofstream(LPCTSTR path) | XMLStorage::tofstream | [inline]
~FileHolder() | XMLStorage::FileHolder | [inline, private]
~tofstream() | XMLStorage::tofstream | [inline]


ROS Explorer: ToolTip Struct Reference

ToolTip Struct Reference

encapsulation of tool tip controls More...

#include <window.h>

Inheritance diagram for ToolTip:

[legend]
Collaboration diagram for ToolTip:

[legend]
List of all members.

Public Types

typedef WindowHandle | super

Public Member Functions

ToolTip (HWND owner)
void | activate (BOOL active=TRUE)
void | add (HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
void | add (HWND hparent, UINT id, const RECT &rect, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
void | remove (HWND hparent, HWND htool)
void | remove (HWND hparent, UINT id)

Detailed Description

encapsulation of tool tip controls

Definition at line 849 of file window.h.

Member Typedef Documentation

typedef WindowHandle ToolTip::super

Definition at line 851 of file window.h.

Constructor & Destructor Documentation

ToolTip::ToolTip ( HWND owner )

Definition at line 1252 of file window.cpp.

References activate().

01253  :      super(CreateWindowEx(WS_EX_TOPMOST|WS_EX_NOPARENTNOTIFY, TOOLTIPS_CLASS, 0,
01254                                  WS_POPUP|TTS_NOPREFIX|TTS_ALWAYSTIP, CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
01255                                  owner, 0, g_Globals._hInstance, 0))
01256 {
01257         activate();
01258 }

Here is the call graph for this function:

Member Function Documentation

void ToolTip::activate ( BOOL active = TRUE ) [inline]

Definition at line 855 of file window.h.

References WindowHandle::_hwnd.

Referenced by ToolTip().

00856         {
00857                 SendMessage(_hwnd, TTM_ACTIVATE, active, 0);
00858         }

void ToolTip::add | ( | HWND | hparent,
 |  | UINT | id,
 |  | const RECT & | rect,
 |  | LPCTSTR | txt = LPSTR_TEXTCALLBACK,
 |  | LPARAM | lparam = 0
 | ) | [inline]

Definition at line 876 of file window.h.

References WindowHandle::_hwnd.

00877         {
00878                 TOOLINFO ti = {
00879                         sizeof(TOOLINFO), TTF_SUBCLASS|TTF_TRANSPARENT, hparent, id,
00880                         {rect.left,rect.top,rect.right,rect.bottom}, 0, (LPTSTR)txt, lparam
00881                 };
00882
00883 #ifdef UNICODE
00884                 if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti))
00885                         SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
00886 #else
00887                 if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti))
00888                         SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti);
00889 #endif
00890         }

void ToolTip::add | ( | HWND | hparent,
 |  | HWND | htool,
 |  | LPCTSTR | txt = LPSTR_TEXTCALLBACK,
 |  | LPARAM | lparam = 0
 | ) | [inline]

Todo:
Why is it neccesary to try both TTM_ADDTOOLW and TTM_ADDTOOLW ?!

Definition at line 860 of file window.h.

References WindowHandle::_hwnd.

Referenced by ClockWindow::ClockWindow().

00861         {
00862                 TOOLINFO ti = {
00863                         sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND|TTF_TRANSPARENT, hparent, (UINT)htool,
00864                         {0,0,0,0}, 0, (LPTSTR)txt, lparam
00865                 };
00866
00867 #ifdef UNICODE
00868                 if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti))
00869                         SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
00870 #else
00871                 if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti))
00872                         SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti);
00873 #endif
00874         }

void ToolTip::remove | ( | HWND | hparent,
 |  | UINT | id
 | ) | [inline]

Definition at line 902 of file window.h.

References WindowHandle::_hwnd.

00903         {
00904                 TOOLINFO ti = {
00905                         sizeof(TOOLINFO), 0, hparent, id,
00906                         {0,0,0,0}, 0, 0, 0
00907                 };
00908
00909                 SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti);
00910         }

void ToolTip::remove | ( | HWND | hparent,
 |  | HWND | htool
 | ) | [inline]

Definition at line 892 of file window.h.

References WindowHandle::_hwnd.

00893         {
00894                 TOOLINFO ti = {
00895                         sizeof(TOOLINFO), TTF_IDISHWND, hparent, (UINT)htool,
00896                         {0,0,0,0}, 0, 0, 0
00897                 };
00898
00899                 SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti);
00900         }

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

ToolTip Member List

This is the complete list of members for ToolTip, including all inherited members.

_hwnd | WindowHandle | [protected]
activate(BOOL active=TRUE) | ToolTip | [inline]
add(HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0) | ToolTip | [inline]
add(HWND hparent, UINT id, const RECT &rect, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0) | ToolTip | [inline]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
remove(HWND hparent, HWND htool) | ToolTip | [inline]
remove(HWND hparent, UINT id) | ToolTip | [inline]
super typedef | ToolTip |
ToolTip(HWND owner) | ToolTip |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]


ROS Explorer: TrayIcon Struct Reference

TrayIcon Struct Reference

#include <window.h>

Collaboration diagram for TrayIcon:

[legend]
List of all members.

Public Member Functions

TrayIcon (HWND hparent, UINT id)
~TrayIcon ()
void | Add (HICON hIcon, LPCTSTR tooltip=NULL)
void | Modify (HICON hIcon, LPCTSTR tooltip=NULL)
void | Remove ()

Protected Member Functions

void | Set (DWORD dwMessage, UINT id, HICON hIcon, LPCTSTR tooltip=NULL)

Protected Attributes

HWND _hparent
UINT | _id

Detailed Description

Definition at line 990 of file window.h.

Constructor & Destructor Documentation

TrayIcon::TrayIcon | ( | HWND | hparent,
 |  | UINT | id
 | ) | [inline]

Definition at line 992 of file window.h.

00993          :      _hparent(hparent), _id(id) {}

TrayIcon::~TrayIcon ( ) [inline]

Definition at line 995 of file window.h.

00996                 {Remove();}

Member Function Documentation

void TrayIcon::Add | ( | HICON | hIcon,
 |  | LPCTSTR | tooltip = NULL
 | ) | [inline]

Definition at line 998 of file window.h.

00999                 {Set(NIM_ADD, _id, hIcon, tooltip);}

void TrayIcon::Modify | ( | HICON | hIcon,
 |  | LPCTSTR | tooltip = NULL
 | ) | [inline]

Definition at line 1001 of file window.h.

01002                 {Set(NIM_MODIFY, _id, hIcon, tooltip);}

void TrayIcon::Remove ( ) [inline]

Definition at line 1004 of file window.h.

01005         {
01006                 NOTIFYICONDATA nid = {
01007                         sizeof(NOTIFYICONDATA), // cbSize
01008                         _hparent,                               // hWnd
01009                         _id,                                    // uID
01010                 };
01011
01012                 Shell_NotifyIcon(NIM_DELETE, &nid);
01013         }

void TrayIcon::Set | ( | DWORD | dwMessage,
 |  | UINT | id,
 |  | HICON | hIcon,
 |  | LPCTSTR | tooltip = NULL
 | ) | [inline, protected]

Definition at line 1019 of file window.h.

References COUNTOF, and PM_TRAYICON.

01020         {
01021                 NOTIFYICONDATA nid = {
01022                         sizeof(NOTIFYICONDATA), // cbSize
01023                         _hparent,                               // hWnd
01024                         id,                                             // uID
01025                         NIF_MESSAGE|NIF_ICON,   // uFlags
01026                         PM_TRAYICON,                    // uCallbackMessage
01027                         hIcon                                   // hIcon
01028                 };
01029
01030                 if (tooltip)
01031                         lstrcpyn(nid.szTip, tooltip, COUNTOF(nid.szTip));
01032
01033                 if (nid.szTip[0])
01034                         nid.uFlags |= NIF_TIP;
01035
01036                 Shell_NotifyIcon(dwMessage, &nid);
01037         }

Member Data Documentation

HWND TrayIcon::_hparent [protected]

Definition at line 1016 of file window.h.

UINT TrayIcon::_id [protected]

Definition at line 1017 of file window.h.

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

TrayIcon Member List

This is the complete list of members for TrayIcon, including all inherited members.

_hparent | TrayIcon | [protected]
_id | TrayIcon | [protected]
Add(HICON hIcon, LPCTSTR tooltip=NULL) | TrayIcon | [inline]
Modify(HICON hIcon, LPCTSTR tooltip=NULL) | TrayIcon | [inline]
Remove() | TrayIcon | [inline]
Set(DWORD dwMessage, UINT id, HICON hIcon, LPCTSTR tooltip=NULL) | TrayIcon | [inline, protected]
TrayIcon(HWND hparent, UINT id) | TrayIcon | [inline]
~TrayIcon() | TrayIcon | [inline]


ROS Explorer: TrayIconControllerTemplate< BASE > Struct Template Reference

TrayIconControllerTemplate< BASE > Struct Template Reference

#include <window.h>

Inheritance diagram for TrayIconControllerTemplate< BASE >:

[legend]
Collaboration diagram for TrayIconControllerTemplate< BASE >:

[legend]
List of all members.

Public Types

typedef BASE | super

Public Member Functions

TrayIconControllerTemplate (HWND hwnd)
LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual void | AddTrayIcons ()=0
virtual void | TrayMouseOver (UINT id)
virtual void | TrayClick (UINT id, int btn)
virtual void | TrayDblClick (UINT id, int btn)

Protected Attributes

const UINT | WM_TASKBARCREATED

Detailed Description

template<typename BASE>
struct TrayIconControllerTemplate< BASE >

Definition at line 1041 of file window.h.

Member Typedef Documentation

template<typename BASE>
typedef BASE TrayIconControllerTemplate< BASE >::super

Definition at line 1043 of file window.h.

Constructor & Destructor Documentation

template<typename BASE>
TrayIconControllerTemplate< BASE >::TrayIconControllerTemplate ( HWND hwnd ) [inline]

Definition at line 1045 of file window.h.

01045                                               : BASE(hwnd),
01046                 WM_TASKBARCREATED(RegisterWindowMessage(WINMSG_TASKBARCREATED))
01047         {
01048         }

Member Function Documentation

template<typename BASE>
virtual void TrayIconControllerTemplate< BASE >::AddTrayIcons ( ) [pure virtual]

template<typename BASE>
virtual void TrayIconControllerTemplate< BASE >::TrayClick | ( | UINT | id,
 |  | int | btn
 | ) | [inline, virtual]

Definition at line 1093 of file window.h.

01093 {}

template<typename BASE>
virtual void TrayIconControllerTemplate< BASE >::TrayDblClick | ( | UINT | id,
 |  | int | btn
 | ) | [inline, virtual]

Definition at line 1094 of file window.h.

01094 {}

template<typename BASE>
virtual void TrayIconControllerTemplate< BASE >::TrayMouseOver ( UINT id ) [inline, virtual]

Definition at line 1092 of file window.h.

01092 {}

template<typename BASE>
LRESULT TrayIconControllerTemplate< BASE >::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [inline]

Definition at line 1050 of file window.h.

References PM_TRAYICON, TRAYBUTTON_LEFT, and TRAYBUTTON_RIGHT.

01051         {
01052                 if (nmsg == PM_TRAYICON) {
01053                         switch(lparam) {
01054                           case WM_MOUSEMOVE:
01055                                 TrayMouseOver(wparam);
01056                                 break;
01057
01058                           case WM_LBUTTONDOWN:
01059                                 TrayClick(wparam, TRAYBUTTON_LEFT);
01060                                 break;
01061
01062                           case WM_LBUTTONDBLCLK:
01063                                 TrayDblClick(wparam, TRAYBUTTON_LEFT);
01064                                 break;
01065
01066                           case WM_RBUTTONDOWN:
01067                                 TrayClick(wparam, TRAYBUTTON_RIGHT);
01068                                 break;
01069
01070                           case WM_RBUTTONDBLCLK:
01071                                 TrayDblClick(wparam, TRAYBUTTON_RIGHT);
01072                                 break;
01073
01074                           case WM_MBUTTONDOWN:
01075                                 TrayClick(wparam, TRAYBUTTON_MIDDLE);
01076                                 break;
01077
01078                           case WM_MBUTTONDBLCLK:
01079                                 TrayDblClick(wparam, TRAYBUTTON_MIDDLE);
01080                                 break;
01081                         }
01082
01083                         return 0;
01084                 } else if (nmsg == WM_TASKBARCREATED) {
01085                         AddTrayIcons();
01086                         return 0;
01087                 } else
01088                         return super::WndProc(nmsg, wparam, lparam);
01089         }

Member Data Documentation

template<typename BASE>
const UINT TrayIconControllerTemplate< BASE >::WM_TASKBARCREATED [protected]

Definition at line 1097 of file window.h.

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

TrayIconControllerTemplate< BASE > Member List

This is the complete list of members for TrayIconControllerTemplate< BASE >, including all inherited members.

AddTrayIcons()=0 | TrayIconControllerTemplate< BASE > | [pure virtual]
super typedef | TrayIconControllerTemplate< BASE > |
TrayClick(UINT id, int btn) | TrayIconControllerTemplate< BASE > | [inline, virtual]
TrayDblClick(UINT id, int btn) | TrayIconControllerTemplate< BASE > | [inline, virtual]
TrayIconControllerTemplate(HWND hwnd) | TrayIconControllerTemplate< BASE > | [inline]
TrayMouseOver(UINT id) | TrayIconControllerTemplate< BASE > | [inline, virtual]
WM_TASKBARCREATED | TrayIconControllerTemplate< BASE > | [protected]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | TrayIconControllerTemplate< BASE > | [inline]


ROS Explorer: TrayNotifyCDS Struct Reference

TrayNotifyCDS Struct Reference

copy data structure for tray notifications More...

Collaboration diagram for TrayNotifyCDS:

[legend]
List of all members.

Public Attributes

DWORD | cookie
DWORD | notify_code
NOTIFYICONDATA | nicon_data

Detailed Description

copy data structure for tray notifications

Definition at line 459 of file desktopbar.cpp.

Member Data Documentation

DWORD TrayNotifyCDS::cookie

Definition at line 460 of file desktopbar.cpp.

NOTIFYICONDATA TrayNotifyCDS::nicon_data

Definition at line 462 of file desktopbar.cpp.

Referenced by DesktopBar::ProcessCopyData().

DWORD TrayNotifyCDS::notify_code

Definition at line 461 of file desktopbar.cpp.

Referenced by DesktopBar::ProcessCopyData().

The documentation for this struct was generated from the following file:
  • desktopbar.cpp


ROS Explorer: Member List

TrayNotifyCDS Member List

This is the complete list of members for TrayNotifyCDS, including all inherited members.

cookie | TrayNotifyCDS
nicon_data | TrayNotifyCDS
notify_code | TrayNotifyCDS


ROS Explorer: TrayNotifyDlg Struct Reference

TrayNotifyDlg Struct Reference

configuration dialog for notification icons More...

#include <traynotify.h>

Inheritance diagram for TrayNotifyDlg:

[legend]
Collaboration diagram for TrayNotifyDlg:

[legend]
List of all members.

Public Types

typedef ResizeController<
Dialog > 		super

Public Member Functions

TrayNotifyDlg (HWND hwnd)
~TrayNotifyDlg ()

Protected Types

typedef pair< NOTIFYICONMODE,
DWORD > 		IconStatePair
typedef map< NotifyIconIndex,
IconStatePair > 		IconStateMap

Protected Member Functions

virtual LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual int | Command (int id, int code)
virtual int | Notify (int id, NMHDR *pnmh)
void | Refresh ()
void | InsertItem (HTREEITEM hparent, HTREEITEM after, const NotifyInfo &, HDC)
void | InsertItem (HTREEITEM hparent, HTREEITEM after, const NotifyIconDlgInfo &, HDC, HICON, NOTIFYICONMODE)
void | SetIconMode (NOTIFYICONMODE mode)
void | RefreshProperties (const NotifyIconDlgInfo &entry)

Protected Attributes

HWND _tree_ctrl
HACCEL | _haccel
HIMAGELIST | _himl
NotifyArea * _pNotifyArea
NotifyIconDlgInfoMap _info
NotifyIconCfgList _cfg_org
IconStateMap _icon_states_org
bool | _show_hidden_org
HTREEITEM | _hitemCurrent
HTREEITEM | _hitemCurrent_visible
HTREEITEM | _hitemCurrent_hidden
HTREEITEM | _hitemConfig
HTREEITEM | _selectedItem

Detailed Description

configuration dialog for notification icons

Definition at line 198 of file traynotify.h.

Member Typedef Documentation

typedef map<NotifyIconIndex, IconStatePair> TrayNotifyDlg::IconStateMap [protected]

Definition at line 213 of file traynotify.h.

typedef pair<NOTIFYICONMODE, DWORD> TrayNotifyDlg::IconStatePair [protected]

Definition at line 212 of file traynotify.h.

typedef ResizeController<Dialog> TrayNotifyDlg::super

Reimplemented from ResizeController< Dialog >.

Definition at line 200 of file traynotify.h.

Constructor & Destructor Documentation

TrayNotifyDlg::TrayNotifyDlg ( HWND hwnd )

Definition at line 891 of file traynotify.cpp.

References NotifyArea::_cfg, _cfg_org, _haccel, _himl, ExplorerGlobals::_hInstance, WindowHandle::_hwnd, NotifyArea::_icon_map, _icon_states_org, _pNotifyArea, ResizeController< Dialog >::_resize_mgr, _selectedItem, NotifyArea::_show_hidden, _show_hidden_org, _tree_ctrl, ResizeManager::Add(), g_Globals, ID_SHOW_HIDDEN_ICONS, IDA_TRAYNOTIFY, IDC_LABEL1, IDC_LABEL2, IDC_LABEL3, IDC_LABEL4, IDC_LABEL6, IDC_LAST_CHANGE, IDC_NOTIFY_AUTOHIDE, IDC_NOTIFY_HIDE, IDC_NOTIFY_ICONS, IDC_NOTIFY_MODULE, IDC_NOTIFY_SHOW, IDC_NOTIFY_TITLE, IDC_NOTIFY_TOOLTIP, IDC_PICTURE, IDI_DOT, IDI_DOT_RED, IDI_DOT_TRANS, IDI_REACTOS, ImageList_AddAlphaIcon(), MOVE, MOVE_Y, Refresh(), Window::register_pretranslate(), ResizeManager::Resize(), RESIZE, RESIZE_X, and SetWindowIcon().

00892  :      super(hwnd),
00893         _tree_ctrl(GetDlgItem(hwnd, IDC_NOTIFY_ICONS)),
00894         _himl(ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR24, 3, 0)),
00895         _pNotifyArea(static_cast<NotifyArea*>(Window::get_window((HWND)SendMessage(g_Globals._hwndDesktopBar, PM_GET_NOTIFYAREA, 0, 0))))
00896 {
00897         _selectedItem = 0;
00898
00899         if (_pNotifyArea) {
00900                  // save original icon states and configuration data
00901                 for(NotifyIconMap::const_iterator it=_pNotifyArea->_icon_map.begin(); it!=_pNotifyArea->_icon_map.end(); ++it)
00902                         _icon_states_org[it->first] = IconStatePair(it->second._mode, it->second._dwState);
00903
00904                 _cfg_org = _pNotifyArea->_cfg;
00905                 _show_hidden_org = _pNotifyArea->_show_hidden;
00906         }
00907
00908         SetWindowIcon(hwnd, IDI_REACTOS);
00909
00910         _haccel = LoadAccelerators(g_Globals._hInstance, MAKEINTRESOURCE(IDA_TRAYNOTIFY));
00911
00912         {
00913         WindowCanvas canvas(_hwnd);
00914         HBRUSH hbkgnd = GetStockBrush(WHITE_BRUSH);
00915
00916         ImageList_AddAlphaIcon(_himl, SmallIcon(IDI_DOT), hbkgnd, canvas);
00917         ImageList_AddAlphaIcon(_himl, SmallIcon(IDI_DOT_TRANS), hbkgnd, canvas);
00918         ImageList_AddAlphaIcon(_himl, SmallIcon(IDI_DOT_RED), hbkgnd, canvas);
00919         }
00920
00921         (void)TreeView_SetImageList(_tree_ctrl, _himl, TVSIL_NORMAL);
00922
00923         _resize_mgr.Add(IDC_NOTIFY_ICONS,       RESIZE);
00924         _resize_mgr.Add(IDC_LABEL1,                     MOVE_Y);
00925         _resize_mgr.Add(IDC_NOTIFY_TOOLTIP,     RESIZE_X|MOVE_Y);
00926         _resize_mgr.Add(IDC_LABEL2,                     MOVE_Y);
00927         _resize_mgr.Add(IDC_NOTIFY_TITLE,       RESIZE_X|MOVE_Y);
00928         _resize_mgr.Add(IDC_LABEL3,                     MOVE_Y);
00929         _resize_mgr.Add(IDC_NOTIFY_MODULE,      RESIZE_X|MOVE_Y);
00930
00931         _resize_mgr.Add(IDC_LABEL4,                     MOVE_Y);
00932         _resize_mgr.Add(IDC_NOTIFY_SHOW,        MOVE_Y);
00933         _resize_mgr.Add(IDC_NOTIFY_HIDE,        MOVE_Y);
00934         _resize_mgr.Add(IDC_NOTIFY_AUTOHIDE,MOVE_Y);
00935
00936         _resize_mgr.Add(IDC_PICTURE,            MOVE);
00937         _resize_mgr.Add(ID_SHOW_HIDDEN_ICONS,MOVE_Y);
00938
00939         _resize_mgr.Add(IDC_LABEL6,                     MOVE_Y);
00940         _resize_mgr.Add(IDC_LAST_CHANGE,        MOVE_Y);
00941
00942         _resize_mgr.Add(IDOK,                           MOVE);
00943         _resize_mgr.Add(IDCANCEL,                       MOVE);
00944
00945         _resize_mgr.Resize(+150, +200);
00946
00947         Refresh();
00948
00949         SetTimer(_hwnd, 0, 3000, NULL);
00950         register_pretranslate(hwnd);
00951 }

Here is the call graph for this function:

TrayNotifyDlg::~TrayNotifyDlg ( )

Definition at line 953 of file traynotify.cpp.

References _himl, WindowHandle::_hwnd, and Window::unregister_pretranslate().

00954 {
00955         KillTimer(_hwnd, 0);
00956         unregister_pretranslate(_hwnd);
00957         ImageList_Destroy(_himl);
00958 }

Here is the call graph for this function:

Member Function Documentation

int TrayNotifyDlg::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented from Dialog.

Definition at line 1105 of file traynotify.cpp.

References _cfg_org, WindowHandle::_hwnd, _icon_states_org, _pNotifyArea, _show_hidden_org, ID_SHOW_HIDDEN_ICONS, IDC_NOTIFY_AUTOHIDE, IDC_NOTIFY_HIDE, IDC_NOTIFY_SHOW, NIM_AUTO, NIM_HIDE, NIM_SHOW, PM_REFRESH, Refresh(), and SetIconMode().

01106 {
01107         if (code == BN_CLICKED) {
01108                 switch(id) {
01109                   case ID_REFRESH:
01110                         Refresh();
01111                         break;
01112
01113                   case IDC_NOTIFY_SHOW:
01114                         SetIconMode(NIM_SHOW);
01115                         break;
01116
01117                   case IDC_NOTIFY_HIDE:
01118                         SetIconMode(NIM_HIDE);
01119                         break;
01120
01121                   case IDC_NOTIFY_AUTOHIDE:
01122                         SetIconMode(NIM_AUTO);
01123                         break;
01124
01125                   case ID_SHOW_HIDDEN_ICONS:
01126                         if (_pNotifyArea)
01127                                 SendMessage(*_pNotifyArea, WM_COMMAND, MAKEWPARAM(id,code), 0);
01128                         break;
01129
01130                   case IDOK:
01131                         EndDialog(_hwnd, id);
01132                         break;
01133
01134                   case IDCANCEL:
01135                          // rollback changes
01136                         if (_pNotifyArea) {
01137                                  // restore original icon states and configuration data
01138                                 _pNotifyArea->_cfg = _cfg_org;
01139                                 _pNotifyArea->_show_hidden = _show_hidden_org;
01140
01141                                 for(IconStateMap::const_iterator it=_icon_states_org.begin(); it!=_icon_states_org.end(); ++it) {
01142                                         NotifyInfo& info = _pNotifyArea->_icon_map[it->first];
01143
01144                                         info._mode = it->second.first;
01145                                         info._dwState = it->second.second;
01146                                 }
01147
01148                                 SendMessage(*_pNotifyArea, PM_REFRESH, 0, 0);
01149                         }
01150
01151                         EndDialog(_hwnd, id);
01152                         break;
01153                 }
01154
01155                 return 0;
01156         }
01157
01158         return 1;
01159 }

Here is the call graph for this function:

void TrayNotifyDlg::InsertItem | ( | HTREEITEM | hparent,
 |  | HTREEITEM | after,
 |  | const NotifyIconDlgInfo & | ,
 |  | HDC | ,
 |  | HICON | ,
 |  | NOTIFYICONMODE |
 | ) | [protected]

Definition at line 1053 of file traynotify.cpp.

References _info, IDS_NOTIFY_AUTOHIDE, IDS_NOTIFY_HIDE, IDS_NOTIFY_SHOW, NIM_AUTO, NIM_HIDE, and string_from_mode().

01055 {
01056         int idx = _info.size() + 1;
01057         _info[idx] = entry;
01058
01059         String mode_str = string_from_mode(mode);
01060
01061         switch(mode) {
01062           case NIM_SHOW:        mode_str = ResString(IDS_NOTIFY_SHOW);          break;
01063           case NIM_HIDE:        mode_str = ResString(IDS_NOTIFY_HIDE);          break;
01064           case NIM_AUTO:        mode_str = ResString(IDS_NOTIFY_AUTOHIDE);
01065         }
01066
01067         FmtString txt(TEXT("%s  -  %s  [%s]"), entry._tipText.c_str(), entry._windowTitle.c_str(), mode_str.c_str());
01068
01069         TV_INSERTSTRUCT tvi;
01070
01071         tvi.hParent = hparent;
01072         tvi.hInsertAfter = after;
01073
01074         TV_ITEM& tv = tvi.item;
01075         tv.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
01076
01077         tv.lParam = (LPARAM)idx;
01078         tv.pszText = txt.str();
01079         tv.iSelectedImage = tv.iImage = ImageList_AddAlphaIcon(_himl, hicon, GetStockBrush(WHITE_BRUSH), hdc);
01080         (void)TreeView_InsertItem(_tree_ctrl, &tvi);
01081 }

Here is the call graph for this function:

void TrayNotifyDlg::InsertItem | ( | HTREEITEM | hparent,
 |  | HTREEITEM | after,
 |  | const NotifyInfo & | ,
 |  | HDC |
 | ) | [protected]

Definition at line 1048 of file traynotify.cpp.

References NotifyInfo::_hIcon, and NotifyIconConfig::_mode.

Referenced by Refresh().

01049 {
01050         InsertItem(hparent, after, entry, hdc, entry._hIcon, entry._mode);
01051 }

int TrayNotifyDlg::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented from Window.

Definition at line 1161 of file traynotify.cpp.

References WindowHandle::_hwnd, _info, _selectedItem, IDC_NOTIFY_AUTOHIDE, IDC_NOTIFY_SHOW, and RefreshProperties().

01162 {
01163         switch(pnmh->code) {
01164           case TVN_SELCHANGED: {
01165                 NMTREEVIEW* pnmtv = (NMTREEVIEW*)pnmh;
01166                 int idx = pnmtv->itemNew.lParam;
01167
01168                 if (idx) {
01169                         RefreshProperties(_info[idx]);
01170                         _selectedItem = pnmtv->itemNew.hItem;
01171                 } else {
01172                         /*
01173                         SetDlgItemText(_hwnd, IDC_NOTIFY_TOOLTIP, NULL);
01174                         SetDlgItemText(_hwnd, IDC_NOTIFY_TITLE, NULL);
01175                         SetDlgItemText(_hwnd, IDC_NOTIFY_MODULE, NULL);
01176                         */
01177                         CheckRadioButton(_hwnd, IDC_NOTIFY_SHOW, IDC_NOTIFY_AUTOHIDE, 0);
01178                 }
01179                 break;}
01180         }
01181
01182         return 0;
01183 }

Here is the call graph for this function:

void TrayNotifyDlg::Refresh ( ) [protected]

Todo:
refresh incrementally

Definition at line 960 of file traynotify.cpp.

References NotifyArea::_cfg, _hitemConfig, _hitemCurrent, _hitemCurrent_hidden, _hitemCurrent_visible, WindowHandle::_hwnd, NotifyArea::_icon_map, _info, _pNotifyArea, _tree_ctrl, IDS_ITEMS_CONFIGURED, IDS_ITEMS_CUR, IDS_ITEMS_HIDDEN, IDS_ITEMS_VISIBLE, InsertItem(), and String::str().

Referenced by Command(), and TrayNotifyDlg().

00961 {
00963
00964         HiddenWindow hide(_tree_ctrl);
00965
00966         TreeView_DeleteAllItems(_tree_ctrl);
00967
00968         TV_INSERTSTRUCT tvi;
00969
00970         tvi.hParent = 0;
00971         tvi.hInsertAfter = TVI_LAST;
00972
00973         TV_ITEM& tv = tvi.item;
00974         tv.mask = TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
00975
00976         ResString str_cur(IDS_ITEMS_CUR);
00977         tv.pszText = str_cur.str();
00978         tv.iSelectedImage = tv.iImage = 0;      // IDI_DOT
00979         _hitemCurrent = TreeView_InsertItem(_tree_ctrl, &tvi);
00980
00981         ResString str_conf(IDS_ITEMS_CONFIGURED);
00982         tv.pszText = str_conf.str();
00983         tv.iSelectedImage = tv.iImage = 2;      // IDI_DOT_RED
00984         _hitemConfig = TreeView_InsertItem(_tree_ctrl, &tvi);
00985
00986         tvi.hParent = _hitemCurrent;
00987
00988         ResString str_visible(IDS_ITEMS_VISIBLE);
00989         tv.pszText = str_visible.str();
00990         tv.iSelectedImage = tv.iImage = 0;      // IDI_DOT
00991         _hitemCurrent_visible = TreeView_InsertItem(_tree_ctrl, &tvi);
00992
00993         ResString str_hidden(IDS_ITEMS_HIDDEN);
00994         tv.pszText = str_hidden.str();
00995         tv.iSelectedImage = tv.iImage = 1;      // IDI_DOT_TRANS
00996         _hitemCurrent_hidden = TreeView_InsertItem(_tree_ctrl, &tvi);
00997
00998         if (_pNotifyArea) {
00999                 _info.clear();
01000
01001                 tv.mask |= TVIF_PARAM;
01002
01003                 WindowCanvas canvas(_hwnd);
01004
01005                  // insert current (visible and hidden) items
01006                 for(NotifyIconMap::const_iterator it=_pNotifyArea->_icon_map.begin(); it!=_pNotifyArea->_icon_map.end(); ++it) {
01007                         const NotifyInfo& entry = it->second;
01008
01009                         InsertItem(entry._dwState&NIS_HIDDEN? _hitemCurrent_hidden: _hitemCurrent_visible, TVI_LAST, entry, canvas);
01010                 }
01011
01012                  // insert configured items in tree view
01013                 const NotifyIconCfgList& cfg = _pNotifyArea->_cfg;
01014                 for(NotifyIconCfgList::const_iterator it=cfg.begin(); it!=cfg.end(); ++it) {
01015                         const NotifyIconConfig& cfg_entry = *it;
01016
01017                         HICON hicon = 0;
01018
01019                         if (!cfg_entry._modulePath.empty()) {
01020                                 if ((int)ExtractIconEx(cfg_entry._modulePath, 0, NULL, &hicon, 1) <= 0)
01021                                         hicon = 0;
01022
01023                                 if (!hicon) {
01024                                         SHFILEINFO sfi;
01025
01026                                         if (SHGetFileInfo(cfg_entry._modulePath, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_SMALLICON))
01027                                                 hicon = sfi.hIcon;
01028                                 }
01029                         }
01030
01031                         InsertItem(_hitemConfig, TVI_SORT, cfg_entry, canvas, hicon, cfg_entry._mode);
01032
01033                         if (hicon)
01034                                 DestroyIcon(hicon);
01035                 }
01036
01037                 CheckDlgButton(_hwnd, ID_SHOW_HIDDEN_ICONS, _pNotifyArea->_show_hidden? BST_CHECKED: BST_UNCHECKED);
01038         }
01039
01040         TreeView_Expand(_tree_ctrl, _hitemCurrent_visible, TVE_EXPAND);
01041         TreeView_Expand(_tree_ctrl, _hitemCurrent_hidden, TVE_EXPAND);
01042         TreeView_Expand(_tree_ctrl, _hitemCurrent, TVE_EXPAND);
01043         TreeView_Expand(_tree_ctrl, _hitemConfig, TVE_EXPAND);
01044
01045         TreeView_EnsureVisible(_tree_ctrl, _hitemCurrent_visible);
01046 }

Here is the call graph for this function:

void TrayNotifyDlg::RefreshProperties ( const NotifyIconDlgInfo & entry ) [protected]

Definition at line 1185 of file traynotify.cpp.

References ExplorerGlobals::_hInstance, WindowHandle::_hwnd, NotifyIconDlgInfo::_lastChange, NotifyIconConfig::_mode, NotifyIconConfig::_modulePath, NotifyIconConfig::_tipText, NotifyIconConfig::_windowTitle, g_Globals, IDC_LAST_CHANGE, IDC_NOTIFY_AUTOHIDE, IDC_NOTIFY_MODULE, IDC_NOTIFY_SHOW, IDC_NOTIFY_TITLE, IDC_NOTIFY_TOOLTIP, and String::printf().

Referenced by Notify().

01186 {
01187         SetDlgItemText(_hwnd, IDC_NOTIFY_TOOLTIP, entry._tipText);
01188         SetDlgItemText(_hwnd, IDC_NOTIFY_TITLE, entry._windowTitle);
01189         SetDlgItemText(_hwnd, IDC_NOTIFY_MODULE, entry._modulePath);
01190
01191         CheckRadioButton(_hwnd, IDC_NOTIFY_SHOW, IDC_NOTIFY_AUTOHIDE, IDC_NOTIFY_SHOW+entry._mode);
01192
01193         String change_str;
01194         if (entry._lastChange)
01195                 change_str.printf(TEXT("before %d s"), (GetTickCount()-entry._lastChange+500)/1000);
01196         SetDlgItemText(_hwnd, IDC_LAST_CHANGE, change_str);
01197
01198         HICON hicon = 0; //get_window_icon_big(entry._hWnd, false);
01199
01200          // If we could not find an icon associated with the owner window, try to load one from the owning module.
01201         if (!hicon && !entry._modulePath.empty()) {
01202                 hicon = ExtractIcon(g_Globals._hInstance, entry._modulePath, 0);
01203
01204                 if (!hicon) {
01205                         SHFILEINFO sfi;
01206
01207                         if (SHGetFileInfo(entry._modulePath, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_LARGEICON))
01208                                 hicon = sfi.hIcon;
01209                 }
01210         }
01211
01212         if (hicon) {
01213                 SendMessage(GetDlgItem(_hwnd, IDC_PICTURE), STM_SETICON, (LPARAM)hicon, 0);
01214                 DestroyIcon(hicon);
01215         } else
01216                 SendMessage(GetDlgItem(_hwnd, IDC_PICTURE), STM_SETICON, 0, 0);
01217 }

Here is the call graph for this function:

void TrayNotifyDlg::SetIconMode ( NOTIFYICONMODE mode ) [protected]

Todo:
select treeview item at new position in tree view -> refresh HTREEITEM in _selectedItem

Definition at line 1219 of file traynotify.cpp.

References NotifyArea::_cfg, _info, NotifyIconConfig::_mode, _pNotifyArea, _selectedItem, _tree_ctrl, PM_REFRESH, and TreeView_GetItemData().

Referenced by Command().

01220 {
01221         int idx = TreeView_GetItemData(_tree_ctrl, _selectedItem);
01222
01223         if (!idx)
01224                 return;
01225
01226         NotifyIconConfig& entry = _info[idx];
01227
01228         if (entry._mode != mode) {
01229                 entry._mode = mode;
01230
01231                  // trigger refresh in notify area and this dialog
01232                 if (_pNotifyArea)
01233                         SendMessage(*_pNotifyArea, PM_REFRESH, 0, 0);
01234         }
01235
01236         if (_pNotifyArea) {
01237                 bool found = false;
01238
01239                 NotifyIconCfgList& cfg = _pNotifyArea->_cfg;
01240                 for(NotifyIconCfgList::iterator it=cfg.begin(); it!=cfg.end(); ++it) {
01241                         NotifyIconConfig& cfg_entry = *it;
01242
01243                         if (cfg_entry.match(entry)) {
01244                                 cfg_entry._mode = mode;
01245                                 ++found;
01246                                 break;
01247                         }
01248                 }
01249
01250                 if (!found) {
01251                          // insert new configuration entry
01252                         NotifyIconConfig cfg_entry = entry;
01253
01254                         cfg_entry._mode = mode;
01255
01256                         _pNotifyArea->_cfg.push_back(cfg_entry);
01257                 }
01258         }
01259
01260         Refresh();
01262 }

Here is the call graph for this function:

LRESULT TrayNotifyDlg::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented from ResizeController< Dialog >.

Definition at line 1083 of file traynotify.cpp.

References _haccel, and WindowHandle::_hwnd.

01084 {
01085         switch(nmsg) {
01086           case PM_TRANSLATE_MSG: {
01087                 MSG* pmsg = (MSG*) lparam;
01088
01089                 if (TranslateAccelerator(_hwnd, _haccel, pmsg))
01090                         return TRUE;
01091
01092                 return FALSE;}
01093
01094           case WM_TIMER:
01095                 Refresh();
01096                 break;
01097
01098           default:
01099                 return super::WndProc(nmsg, wparam, lparam);
01100         }
01101
01102         return 0;
01103 }

Member Data Documentation

NotifyIconCfgList TrayNotifyDlg::_cfg_org [protected]

Definition at line 215 of file traynotify.h.

Referenced by Command(), and TrayNotifyDlg().

HACCEL TrayNotifyDlg::_haccel [protected]

Definition at line 207 of file traynotify.h.

Referenced by TrayNotifyDlg(), and WndProc().

HIMAGELIST TrayNotifyDlg::_himl [protected]

Definition at line 208 of file traynotify.h.

Referenced by TrayNotifyDlg(), and ~TrayNotifyDlg().

HTREEITEM TrayNotifyDlg::_hitemConfig [protected]

Definition at line 222 of file traynotify.h.

Referenced by Refresh().

HTREEITEM TrayNotifyDlg::_hitemCurrent [protected]

Definition at line 219 of file traynotify.h.

Referenced by Refresh().

HTREEITEM TrayNotifyDlg::_hitemCurrent_hidden [protected]

Definition at line 221 of file traynotify.h.

Referenced by Refresh().

HTREEITEM TrayNotifyDlg::_hitemCurrent_visible [protected]

Definition at line 220 of file traynotify.h.

Referenced by Refresh().

IconStateMap TrayNotifyDlg::_icon_states_org [protected]

Definition at line 216 of file traynotify.h.

Referenced by Command(), and TrayNotifyDlg().

NotifyIconDlgInfoMap TrayNotifyDlg::_info [protected]

Definition at line 210 of file traynotify.h.

Referenced by InsertItem(), Notify(), Refresh(), and SetIconMode().

NotifyArea* TrayNotifyDlg::_pNotifyArea [protected]

Definition at line 209 of file traynotify.h.

Referenced by Command(), Refresh(), SetIconMode(), and TrayNotifyDlg().

HTREEITEM TrayNotifyDlg::_selectedItem [protected]

Definition at line 223 of file traynotify.h.

Referenced by Notify(), SetIconMode(), and TrayNotifyDlg().

bool TrayNotifyDlg::_show_hidden_org [protected]

Definition at line 217 of file traynotify.h.

Referenced by Command(), and TrayNotifyDlg().

HWND TrayNotifyDlg::_tree_ctrl [protected]

Definition at line 206 of file traynotify.h.

Referenced by Refresh(), SetIconMode(), and TrayNotifyDlg().

The documentation for this struct was generated from the following files:
  • traynotify.h
  • traynotify.cpp


ROS Explorer: Member List

TrayNotifyDlg Member List

This is the complete list of members for TrayNotifyDlg, including all inherited members.

_cfg_org | TrayNotifyDlg | [protected]
_haccel | TrayNotifyDlg | [protected]
_himl | TrayNotifyDlg | [protected]
_hitemConfig | TrayNotifyDlg | [protected]
_hitemCurrent | TrayNotifyDlg | [protected]
_hitemCurrent_hidden | TrayNotifyDlg | [protected]
_hitemCurrent_visible | TrayNotifyDlg | [protected]
_hwnd | WindowHandle | [protected]
_icon_states_org | TrayNotifyDlg | [protected]
_info | TrayNotifyDlg | [protected]
_pNotifyArea | TrayNotifyDlg | [protected]
_resize_mgr | ResizeController< Dialog > | [protected]
_selectedItem | TrayNotifyDlg | [protected]
_show_hidden_org | TrayNotifyDlg | [protected]
_tree_ctrl | TrayNotifyDlg | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | TrayNotifyDlg | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
Dialog(HWND) | Dialog |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0) | Dialog | [static]
DoModal(UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0) | Dialog | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetClientSpace(PRECT prect) | ResizeController< Dialog > | [inline, virtual]
GetStaticWindowData() | Window | [protected, static]
IconStateMap typedef | TrayNotifyDlg | [protected]
IconStatePair typedef | TrayNotifyDlg | [protected]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
InsertItem(HTREEITEM hparent, HTREEITEM after, const NotifyInfo &, HDC) | TrayNotifyDlg | [protected]
InsertItem(HTREEITEM hparent, HTREEITEM after, const NotifyIconDlgInfo &, HDC, HICON, NOTIFYICONMODE) | TrayNotifyDlg | [protected]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | TrayNotifyDlg | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
Refresh() | TrayNotifyDlg | [protected]
RefreshProperties(const NotifyIconDlgInfo &entry) | TrayNotifyDlg | [protected]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
ResizeController(HWND hwnd) | ResizeController< Dialog > | [inline]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
SetIconMode(NOTIFYICONMODE mode) | TrayNotifyDlg | [protected]
super typedef | TrayNotifyDlg |
TrayNotifyDlg(HWND hwnd) | TrayNotifyDlg |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | TrayNotifyDlg | [protected, virtual]
~Dialog() | Dialog |
~TrayNotifyDlg() | TrayNotifyDlg |
~Window() | Window | [virtual]


ROS Explorer: TreeDropTarget Class Reference

TreeDropTarget Class Reference

OLE drop target for tree controls. More...

#include <treedroptarget.h>

Inheritance diagram for TreeDropTarget:

[legend]
Collaboration diagram for TreeDropTarget:

[legend]
List of all members.

Public Member Functions

TreeDropTarget (HWND hTargetWnd)
virtual bool | OnDrop (FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)
virtual HRESULT STDMETHODCALLTYPE | DragOver (DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
virtual HRESULT STDMETHODCALLTYPE | DragLeave (void)

Detailed Description

OLE drop target for tree controls.

Definition at line 13 of file treedroptarget.h.

Constructor & Destructor Documentation

TreeDropTarget::TreeDropTarget ( HWND hTargetWnd ) [inline]

Definition at line 16 of file treedroptarget.h.

00016 : IDropTargetImpl(hTargetWnd) {}

Member Function Documentation

virtual HRESULT STDMETHODCALLTYPE TreeDropTarget::DragLeave ( void ) [inline, virtual]

Reimplemented from IDropTargetImpl.

Definition at line 75 of file treedroptarget.h.

References IDropTargetImpl::DragLeave().

00076         {
00077                 TreeView_SelectDropTarget(m_hTargetWnd, NULL);
00078
00079                 return IDropTargetImpl::DragLeave();
00080         }

Here is the call graph for this function:

virtual HRESULT STDMETHODCALLTYPE TreeDropTarget::DragOver | ( | DWORD | grfKeyState,
 |  | POINTL | pt,
 |  | DWORD __RPC_FAR * | pdwEffect
 | ) | [inline, virtual]

Reimplemented from IDropTargetImpl.

Definition at line 58 of file treedroptarget.h.

References IDropTargetImpl::DragOver(), and ScreenToClient().

00062         {
00063                 TVHITTESTINFO hit;
00064                 hit.pt = (POINT&)pt;
00065                 ScreenToClient(m_hTargetWnd, &hit.pt);
00066                 hit.flags = TVHT_ONITEM;
00067                 HTREEITEM hItem = TreeView_HitTest(m_hTargetWnd,&hit);
00068
00069                 if (hItem != NULL)
00070                         TreeView_SelectDropTarget(m_hTargetWnd, hItem);
00071
00072                 return IDropTargetImpl::DragOver(grfKeyState, pt, pdwEffect);
00073         }

Here is the call graph for this function:

virtual bool TreeDropTarget::OnDrop | ( | FORMATETC * | pFmtEtc,
 |  | STGMEDIUM & | medium,
 |  | DWORD * | pdwEffect
 | ) | [inline, virtual]

Todo:
Add the code to handle Copy
Todo:
Add the code to handle Move

Implements IDropTargetImpl.

Definition at line 18 of file treedroptarget.h.

00019         {
00020                 if (pFmtEtc->cfFormat == CF_HDROP && medium.tymed == TYMED_HGLOBAL)
00021                 {
00022                         HDROP hDrop = (HDROP)GlobalLock(medium.hGlobal);
00023                         if (hDrop != NULL)
00024                         {
00025                                 TCHAR szFileName[MAX_PATH];
00026
00027                                 UINT cFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
00028
00029                                 for(UINT i = 0; i < cFiles; ++i)
00030                                 {
00031                                         DragQueryFile(hDrop, i, szFileName, sizeof(szFileName));
00032
00033                                         if (DROPEFFECT_COPY & *pdwEffect)
00034                                         {
00035                                                  // copy the file or dir
00036
00038
00039                                         }
00040                                         else if (DROPEFFECT_MOVE & *pdwEffect)
00041                                         {
00042                                                  // move the file or dir
00043
00045
00046                                         }
00047                                 }
00048                                 //DragFinish(hDrop); // base class calls ReleaseStgMedium
00049                         }
00050                         GlobalUnlock(medium.hGlobal);
00051                 }
00052
00053                 TreeView_SelectDropTarget(m_hTargetWnd, NULL);
00054
00055                 return true; //let base free the medium
00056         }

The documentation for this class was generated from the following file:
  • treedroptarget.h


ROS Explorer: Member List

TreeDropTarget Member List

This is the complete list of members for TreeDropTarget, including all inherited members.

AddRef() | IDropTargetImpl | [inline, virtual]
AddSuportedFormat(FORMATETC &ftetc) | IDropTargetImpl | [inline]
DragEnter(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) | IDropTargetImpl | [virtual]
DragLeave(void) | TreeDropTarget | [inline, virtual]
DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) | TreeDropTarget | [inline, virtual]
Drop(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) | IDropTargetImpl | [virtual]
IDropTargetImpl(HWND m_hTargetWnd) | IDropTargetImpl |
m_hTargetWnd | IDropTargetImpl | [protected]
OnDrop(FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect) | TreeDropTarget | [inline, virtual]
QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect) | IDropTargetImpl |
QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject) | IDropTargetImpl | [virtual]
Release() | IDropTargetImpl | [virtual]
TreeDropTarget(HWND hTargetWnd) | TreeDropTarget | [inline]
~IDropTargetImpl() | IDropTargetImpl | [virtual]


ROS Explorer: TypeCheck< CLASS > Struct Template Reference

TypeCheck< CLASS > Struct Template Reference

dynamic casting of Window pointers More...

#include <window.h>

List of all members.

Static Public Member Functions

static CLASS * dyn_cast (Window *wnd)

Detailed Description

template<typename CLASS>
struct TypeCheck< CLASS >

dynamic casting of Window pointers

Definition at line 160 of file window.h.

Member Function Documentation

template<typename CLASS>
static CLASS* TypeCheck< CLASS >::dyn_cast ( Window * wnd ) [inline, static]

Definition at line 162 of file window.h.

00163                 {return dynamic_cast<CLASS*>(wnd);}

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

TypeCheck< CLASS > Member List

This is the complete list of members for TypeCheck< CLASS >, including all inherited members.

dyn_cast(Window *wnd) TypeCheck< CLASS > [inline, static]


ROS Explorer: UNC Struct Reference

UNC Struct Reference

#include <utility.h>

Collaboration diagram for UNC:

[legend]
List of all members.

Public Member Functions

UNC (LPCSTR s)
~UNC ()
operator LPCWSTR ()

Protected Attributes

LPWSTR _str

Detailed Description

Definition at line 922 of file utility.h.

Constructor & Destructor Documentation

UNC::UNC ( LPCSTR s ) [inline]

Definition at line 924 of file utility.h.

00925         {
00926                 int l = strlen(s) + 1;
00927                 _str = (LPWSTR) malloc(2*l);
00928
00929                 if (_str && MultiByteToWideChar(CP_ACP, 0, s, -1, _str, l) <= 0)
00930                         *_str = '\0';
00931         }

UNC::~UNC ( ) [inline]

Definition at line 933 of file utility.h.

00934         {
00935                 free(_str);
00936         }

Member Function Documentation

UNC::operator LPCWSTR ( ) [inline]

Definition at line 938 of file utility.h.

00938 {return _str;}

Member Data Documentation

LPWSTR UNC::_str [protected]

Definition at line 941 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

UNC Member List

This is the complete list of members for UNC, including all inherited members.

_str | UNC | [protected]
operator LPCWSTR() | UNC | [inline]
UNC(LPCSTR s) | UNC | [inline]
~UNC() | UNC | [inline]


ROS Explorer: UnicodeString Struct Reference

UnicodeString Struct Reference

Inheritance diagram for UnicodeString:

[legend]
Collaboration diagram for UnicodeString:

[legend]
List of all members.

Public Member Functions

UnicodeString (LPCWSTR str)
UnicodeString (size_t len, LPWSTR buffer)
operator LPCWSTR () const

Detailed Description

Definition at line 135 of file ntobjfs.cpp.

Constructor & Destructor Documentation

UnicodeString::UnicodeString ( LPCWSTR str ) [inline]

Definition at line 136 of file ntobjfs.cpp.

References NTDLL::RtlInitUnicodeString.

00137         {
00138                 (*g_NTDLL->RtlInitUnicodeString)(this, str);
00139         }

UnicodeString::UnicodeString | ( | size_t | len,
 |  | LPWSTR | buffer
 | ) | [inline]

Definition at line 141 of file ntobjfs.cpp.

References RtlUnicodeString::alloc_len, and RtlUnicodeString::string_ptr.

00142         {
00143                 alloc_len = len;
00144                 string_ptr = buffer;
00145         }

Member Function Documentation

UnicodeString::operator LPCWSTR ( ) const [inline]

Definition at line 147 of file ntobjfs.cpp.

References RtlUnicodeString::string_ptr.

00147 {return string_ptr;}

The documentation for this struct was generated from the following file:
  • ntobjfs.cpp


ROS Explorer: Member List

UnicodeString Member List

This is the complete list of members for UnicodeString, including all inherited members.

alloc_len | RtlUnicodeString |
operator LPCWSTR() const | UnicodeString | [inline]
string_len | RtlUnicodeString |
string_ptr | RtlUnicodeString |
UnicodeString(LPCWSTR str) | UnicodeString | [inline]
UnicodeString(size_t len, LPWSTR buffer) | UnicodeString | [inline]


ROS Explorer: Variant Struct Reference

Variant Struct Reference

#include <utility.h>

Inheritance diagram for Variant:

[legend]
Collaboration diagram for Variant:

[legend]
List of all members.

Public Member Functions

Variant ()
Variant (const VARIANT &var)
Variant (const VARIANT *var)
~Variant ()
operator long () const
operator bool () const
operator VARIANT_BOOL () const
operator IDispatch * () const

Detailed Description

Definition at line 700 of file utility.h.

Constructor & Destructor Documentation

Variant::Variant ( ) [inline]

Definition at line 702 of file utility.h.

00702 {VariantInit(this);}

Variant::Variant ( const VARIANT & var )

Definition at line 54 of file webchild.cpp.

References CheckError().

00055 {
00056         VariantInit(this);
00057         CheckError(VariantCopy(this, const_cast<VARIANT*>(&var)));
00058 }

Here is the call graph for this function:

Variant::Variant ( const VARIANT * var )

Definition at line 60 of file webchild.cpp.

References CheckError().

00061 {
00062         VariantInit(this);
00063         CheckError(VariantCopy(this, const_cast<VARIANT*>(var)));
00064 }

Here is the call graph for this function:

Variant::~Variant ( )

Definition at line 66 of file webchild.cpp.

00067 {
00068         VariantClear(this);
00069 }

Member Function Documentation

Variant::operator bool ( ) const

Definition at line 79 of file webchild.cpp.

References CheckError().

00080 {
00081         Variant v;
00082         CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_BOOL));
00083         return V_BOOL(&v)? true: false;
00084 }

Here is the call graph for this function:

Variant::operator IDispatch * ( ) const

Definition at line 86 of file webchild.cpp.

References CheckError().

00087 {
00088         Variant v;
00089         CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_DISPATCH));
00090         return V_DISPATCH(&v);
00091 }

Here is the call graph for this function:

Variant::operator long ( ) const

Definition at line 72 of file webchild.cpp.

References CheckError().

00073 {
00074         Variant v;
00075         CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_I4));
00076         return V_I4(&v);
00077 }

Here is the call graph for this function:

Variant::operator VARIANT_BOOL ( ) const

Definition at line 93 of file webchild.cpp.

References CheckError().

00094 {
00095         Variant v;
00096         CheckError(VariantChangeType(&v, (VARIANT*)this, 0, VT_BOOL));
00097         return V_BOOL(&v);
00098 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • utility.h
  • webchild.cpp


ROS Explorer: Member List

Variant Member List

This is the complete list of members for Variant, including all inherited members.

operator bool() const | Variant |
operator IDispatch *() const | Variant |
operator long() const | Variant |
operator VARIANT_BOOL() const | Variant |
Variant() | Variant | [inline]
Variant(const VARIANT &var) | Variant |
Variant(const VARIANT *var) | Variant |
~Variant() | Variant |


ROS Explorer: VARIANT Class Reference

VARIANT Class Reference

Inheritance diagram for VARIANT:

[legend]
The documentation for this class was generated from the following file:
  • utility.h


ROS Explorer: WaitCursor Struct Reference

WaitCursor Struct Reference

#include <utility.h>

Collaboration diagram for WaitCursor:

[legend]
List of all members.

Public Member Functions

WaitCursor ()
~WaitCursor ()

Protected Attributes

HCURSOR _old_cursor

Detailed Description

Todo:
integrate with WM_SETCURSOR to enable multithreaded background tasks as program launching

Definition at line 254 of file utility.h.

Constructor & Destructor Documentation

WaitCursor::WaitCursor ( ) [inline]

Definition at line 256 of file utility.h.

00257         {
00258                 _old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
00259         }

WaitCursor::~WaitCursor ( ) [inline]

Definition at line 261 of file utility.h.

00262         {
00263                 SetCursor(_old_cursor);
00264         }

Member Data Documentation

HCURSOR WaitCursor::_old_cursor [protected]

Definition at line 267 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

WaitCursor Member List

This is the complete list of members for WaitCursor, including all inherited members.

_old_cursor | WaitCursor | [protected]
WaitCursor() | WaitCursor | [inline]
~WaitCursor() | WaitCursor | [inline]


ROS Explorer: WebChildWindow Struct Reference

WebChildWindow Struct Reference

encapsulation of Web control in MDI child windows More...

#include <webchild.h>

Inheritance diagram for WebChildWindow:

[legend]
Collaboration diagram for WebChildWindow:

[legend]
List of all members.

Public Types

typedef IPCtrlWindow< ChildWindow,
SIfacePtr< IWebBrowser2 > > 		super
typedef DWebBrowserEvents2Impl | web_super

Public Member Functions

WebChildWindow (HWND hwnd, const WebChildWndInfo &info)
void | BeforeNavigate2 (IDispatch *pDisp, const Variant &url, const Variant &flags, const Variant &targetFrameName, const Variant &postData, const Variant &headers, VARIANT_BOOL &cancel)
void | NavigateComplete2 (IDispatch *pDisp, const Variant &url)
void | StatusTextChange (const BStr &text)
void | ProgressChange (long Progress, long ProgressMax)
void | WindowMove ()
void | WindowResize ()
void | WindowActivate ()
void | PropertyChange (const BStr &Property)
void | CommandStateChange (long command, bool enable)
void | DownloadBegin ()
void | NewWindow2 (IDispatch **ppDisp, VARIANT_BOOL &cancel)
void | TitleChange (const BStr &text)
void | TitleIconChange (const BStr &text)
void | FrameBeforeNavigate (const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &cancel)
void | FrameNavigateComplete (const BStr &url)
void | FrameNewWindow (const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &processed)
void | OnQuit ()
void | OnVisible (bool Visible)
void | OnToolbar (bool Visible)
void | OnMenubar (bool Visible)
void | OnStatusbar (bool Visible)
void | OnFullscreen (bool Visible)
void | DocumentComplete ()
void | OnTheatermode (bool Visible)
void | OnAddressbar (bool Visible)
void | WindowSetResizable (bool Visible)
void | WindowClosing (VARIANT_BOOL IsChildWindow, VARIANT_BOOL &cancel)
void | WindowSetLeft (long Left)
void | WindowSetTop (long Top)
void | WindowSetWidth (long Width)
void | WindowSetHeight (long Height)
void | ClientToHostWindow (long &CX, long &CY)
void | SetSecureLockIcon (long SecureLockIcon)
void | FileDownload (Variant &cancel)
void | NavigateError (IDispatch *pDisp, const Variant &url, const Variant &Frame, const Variant &StatusCode, VARIANT_BOOL &cancel)
void | PrivacyImpactedStateChange (bool bImpacted)

Static Public Member Functions

static WebChildWindow * | create (const FileChildWndInfo &info)

Protected Member Functions

LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual String | jump_to_int (LPCTSTR url)

Protected Attributes

BrowserNavigator _navigator
auto_ptr< EventConnector > | _connector

Detailed Description

encapsulation of Web control in MDI child windows

Definition at line 829 of file webchild.h.

Member Typedef Documentation

typedef IPCtrlWindow<ChildWindow, SIfacePtr<IWebBrowser2> > WebChildWindow::super

Reimplemented from DWebBrowserEvents2Impl.

Definition at line 832 of file webchild.h.

typedef DWebBrowserEvents2Impl WebChildWindow::web_super

Definition at line 833 of file webchild.h.

Constructor & Destructor Documentation

WebChildWindow::WebChildWindow | ( | HWND | hwnd,
 |  | const WebChildWndInfo & | info
 | ) |

Definition at line 209 of file webchild.cpp.

References _connector, IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::_control, _navigator, FileChildWndInfo::_path, BrowserNavigator::attach(), and IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::create_control().

00210  :      super(hwnd, info),
00211         web_super(_navigator)
00212 {
00213          // first try to create a web control with MS IE's CLASSID
00214         HRESULT hr = create_control(hwnd, CLSID_WebBrowser, IID_IWebBrowser2);
00215
00216          // If this failed, try to use Mozilla's web control
00217         if (FAILED(hr))
00218                 hr = create_control(hwnd, CLSID_MozillaBrowser, IID_IWebBrowser2);
00219
00220         if (SUCCEEDED(hr)) {
00221                 _navigator.attach(_control);
00222
00223                 _connector = auto_ptr<EventConnector>(new EventConnector(_control, DIID_DWebBrowserEvents2, this));
00224
00225                 _control->Navigate(BStr(info._path), &vtMissing, &vtMissing, &vtMissing, &vtMissing);
00226                 //browser->Navigate2(&Variant(info._path), &vtMissing, &vtMissing, &vtMissing, &vtMissing);
00227         }
00228 }

Here is the call graph for this function:

Member Function Documentation

void WebChildWindow::BeforeNavigate2 | ( | IDispatch * | pDisp,
 |  | const Variant & | url,
 |  | const Variant & | flags,
 |  | const Variant & | targetFrameName,
 |  | const Variant & | postData,
 |  | const Variant & | headers,
 |  | VARIANT_BOOL & | cancel
 | ) | [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 848 of file webchild.h.

00851         {
00852                 //String adr = (BStr)url;
00853         }

void WebChildWindow::ClientToHostWindow | ( | long & | CX,
 |  | long & | CY
 | ) | [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 985 of file webchild.h.

00986         {
00987         }

void WebChildWindow::CommandStateChange | ( | long | command,
 |  | bool | enable
 | ) | [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 890 of file webchild.h.

00891         {
00892         }

static WebChildWindow* WebChildWindow::create ( const FileChildWndInfo & info ) [inline, static]

Definition at line 837 of file webchild.h.

References FileChildWndInfo::_pos, CLASSNAME_CHILDWND, ChildWindow::create(), and WINDOW_CREATOR_INFO.

Referenced by create_webchildwindow().

00838         {
00839                 ChildWindow* child = ChildWindow::create(info, info._pos.rcNormalPosition,
00840                         WINDOW_CREATOR_INFO(WebChildWindow,WebChildWndInfo), CLASSNAME_CHILDWND, NULL, info._pos.showCmd==SW_SHOWMAXIMIZED? WS_MAXIMIZE: 0);
00841
00842                 return static_cast<WebChildWindow*>(child);
00843         }

Here is the call graph for this function:

void WebChildWindow::DocumentComplete ( ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 949 of file webchild.h.

00950         {
00951         }

void WebChildWindow::DownloadBegin ( ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 894 of file webchild.h.

00895         {
00896         }

void WebChildWindow::FileDownload ( Variant & cancel ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 993 of file webchild.h.

00994         {
00995         }

void WebChildWindow::FrameBeforeNavigate | ( | const BStr & | url,
 |  | long | flags,
 |  | const BStr & | targetFrameName,
 |  | VARIANT * | postData,
 |  | const BStr & | headers,
 |  | VARIANT_BOOL & | cancel
 | ) | [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 913 of file webchild.h.

00914         {
00915         }

void WebChildWindow::FrameNavigateComplete ( const BStr & url ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 917 of file webchild.h.

00918         {
00919         }

void WebChildWindow::FrameNewWindow | ( | const BStr & | url,
 |  | long | flags,
 |  | const BStr & | targetFrameName,
 |  | VARIANT * | postData,
 |  | const BStr & | headers,
 |  | VARIANT_BOOL & | processed
 | ) | [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 921 of file webchild.h.

00922         {
00923         }

String WebChildWindow::jump_to_int ( LPCTSTR url ) [protected, virtual]

Implements ChildWindow.

Definition at line 304 of file webchild.cpp.

References _navigator, and BrowserNavigator::goto_url().

00305 {
00306         _navigator.goto_url(url);
00307
00308         return url;
00309 }

Here is the call graph for this function:

void WebChildWindow::NavigateComplete2 | ( | IDispatch * | pDisp,
 |  | const Variant & | url
 | ) | [inline, virtual]

Reimplemented from DWebBrowserEvents2Impl.

Definition at line 855 of file webchild.h.

00856         {
00857                 web_super::NavigateComplete2(pDisp, url);
00858
00859                 set_url(String(BStr(url)));
00860         }

void WebChildWindow::NavigateError | ( | IDispatch * | pDisp,
 |  | const Variant & | url,
 |  | const Variant & | Frame,
 |  | const Variant & | StatusCode,
 |  | VARIANT_BOOL & | cancel
 | ) | [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 997 of file webchild.h.

00998         {
00999         }

void WebChildWindow::NewWindow2 | ( | IDispatch ** | ppDisp,
 |  | VARIANT_BOOL & | cancel
 | ) | [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 898 of file webchild.h.

00899         {
00900                 //*ppDisp = ;
00901                 //cancel = TRUE;
00902         }

void WebChildWindow::OnAddressbar ( bool Visible ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 957 of file webchild.h.

00958         {
00959         }

void WebChildWindow::OnFullscreen ( bool Visible ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 945 of file webchild.h.

00946         {
00947         }

void WebChildWindow::OnMenubar ( bool Visible ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 937 of file webchild.h.

00938         {
00939         }

void WebChildWindow::OnQuit ( ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 925 of file webchild.h.

00926         {
00927         }

void WebChildWindow::OnStatusbar ( bool Visible ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 941 of file webchild.h.

00942         {
00943         }

void WebChildWindow::OnTheatermode ( bool Visible ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 953 of file webchild.h.

00954         {
00955         }

void WebChildWindow::OnToolbar ( bool Visible ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 933 of file webchild.h.

00934         {
00935         }

void WebChildWindow::OnVisible ( bool Visible ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 929 of file webchild.h.

00930         {
00931         }

void WebChildWindow::PrivacyImpactedStateChange ( bool bImpacted ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 1001 of file webchild.h.

01002         {
01003         }

void WebChildWindow::ProgressChange | ( | long | Progress,
 |  | long | ProgressMax
 | ) | [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 868 of file webchild.h.

00869         {
00870         }

void WebChildWindow::PropertyChange ( const BStr & Property ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 884 of file webchild.h.

00885         {
00886                 Variant value;
00887                 _control->GetProperty(Property, &value);
00888         }

void WebChildWindow::SetSecureLockIcon ( long SecureLockIcon ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 989 of file webchild.h.

00990         {
00991         }

void WebChildWindow::StatusTextChange ( const BStr & text ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 862 of file webchild.h.

References PM_SETSTATUSTEXT.

00863         {
00864                 _statusText = text;
00865                 SendMessage(_hwndFrame, PM_SETSTATUSTEXT, 0, (LPARAM)_statusText.c_str());
00866         }

void WebChildWindow::TitleChange ( const BStr & text ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 904 of file webchild.h.

00905         {
00906                 SetWindowText(_hwnd, String(text));
00907         }

void WebChildWindow::TitleIconChange ( const BStr & text ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 909 of file webchild.h.

00910         {
00911         }

void WebChildWindow::WindowActivate ( ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 880 of file webchild.h.

00881         {
00882         }

void WebChildWindow::WindowClosing | ( | VARIANT_BOOL | IsChildWindow,
 |  | VARIANT_BOOL & | cancel
 | ) | [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 965 of file webchild.h.

00966         {
00967         }

void WebChildWindow::WindowMove ( ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 872 of file webchild.h.

00873         {
00874         }

void WebChildWindow::WindowResize ( ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 876 of file webchild.h.

00877         {
00878         }

void WebChildWindow::WindowSetHeight ( long Height ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 981 of file webchild.h.

00982         {
00983         }

void WebChildWindow::WindowSetLeft ( long Left ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 969 of file webchild.h.

00970         {
00971         }

void WebChildWindow::WindowSetResizable ( bool Visible ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 961 of file webchild.h.

00962         {
00963         }

void WebChildWindow::WindowSetTop ( long Top ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 973 of file webchild.h.

00974         {
00975         }

void WebChildWindow::WindowSetWidth ( long Width ) [inline, virtual]

Reimplemented from DWebBrowserEvents2IF.

Definition at line 977 of file webchild.h.

00978         {
00979         }

LRESULT WebChildWindow::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Todo:

Reimplemented from IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >.

Definition at line 230 of file webchild.cpp.

References IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::_control, WindowHandle::_hwnd, ID_GO_FORWARD, ID_GO_HOME, ID_GO_SEARCH, ID_GO_UP, ID_REFRESH, ID_STOP, PM_DISPATCH_COMMAND, THROW_EXCEPTION, and IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::WndProc().

00231 {
00232         try {
00233                 switch(nmsg) {
00234                   case WM_ERASEBKGND:
00235                         if (!_control) {
00236                                 HDC hdc = (HDC)wparam;
00237                                 ClientRect rect(_hwnd);
00238
00239                                 HBRUSH hbrush = CreateSolidBrush(RGB(200,200,235));
00240                                 BkMode mode(hdc, TRANSPARENT);
00241                                 TextColor color(hdc, RGB(200,40,40));
00242                                 FillRect(hdc, &rect, hbrush);
00243                                 DrawText(hdc, TEXT("Sorry - no web browser control could be loaded."), -1, &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
00244                                 DeleteObject(hbrush);
00245                         }
00246
00247                         return TRUE;
00248
00249                   case PM_DISPATCH_COMMAND: {
00250                         if (!_control)
00251                                 return FALSE;
00252
00253                         HRESULT hr = E_FAIL;
00254
00255                         switch(LOWORD(wparam)) {
00256                           case ID_GO_BACK:
00257                                 hr = _control->GoBack();
00258                                 break;
00259
00260                           case ID_GO_FORWARD:
00261                                 hr = _control->GoForward();
00262                                 break;
00263
00264                           case ID_GO_UP:
00266                                 break;
00267
00268                           case ID_GO_HOME:
00269                                 hr = _control->GoHome();
00270                                 break;
00271
00272                           case ID_GO_SEARCH:
00273                                 hr = _control->GoSearch();
00274                                 break;
00275
00276                           case ID_REFRESH:
00277                                 hr = _control->Refresh();
00278                                 break;
00279
00280                           case ID_STOP:
00281                                 hr = _control->Stop();
00282                                 break;
00283
00284                           default:
00285                                 return super::WndProc(nmsg, wparam, lparam);
00286                         }
00287
00288                         if (FAILED(hr) && hr!=E_FAIL)
00289                                 THROW_EXCEPTION(hr);
00290
00291                         return TRUE;}
00292
00293                   default:
00294                         return super::WndProc(nmsg, wparam, lparam);
00295                 }
00296         } catch(COMException& e) {
00297                 HandleException(e, _hwnd);
00298         }
00299
00300         return 0;
00301 }

Here is the call graph for this function:

Member Data Documentation

auto_ptr<EventConnector> WebChildWindow::_connector [protected]

Definition at line 1008 of file webchild.h.

Referenced by WebChildWindow().

BrowserNavigator WebChildWindow::_navigator [protected]

Reimplemented from DWebBrowserEvents2Impl.

Definition at line 1007 of file webchild.h.

Referenced by jump_to_int(), and WebChildWindow().

The documentation for this struct was generated from the following files:
  • webchild.h
  • webchild.cpp


ROS Explorer: Member List

WebChildWindow Member List

This is the complete list of members for WebChildWindow, including all inherited members.

_callback | DWebBrowserEvents2Impl |
_client_side | IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > > | [protected]
_connector | WebChildWindow | [protected]
_control | IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > > | [protected]
_focus_pane | ChildWindow | [protected]
_hwnd | WindowHandle | [protected]
_hwndFrame | ChildWindow | [protected]
_in_place_object | IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > > | [protected]
_last_split | ChildWindow | [protected]
_left_hwnd | ChildWindow | [protected]
_menu_info | ChildWindow | [protected]
_navigator | WebChildWindow | [protected]
_ref | ComSrvObject | [protected]
_right_hwnd | ChildWindow | [protected]
_split_pos | ChildWindow | [protected]
_statusText | ChildWindow | [protected]
_url | ChildWindow | [protected]
_url_history | ChildWindow | [protected]
_usingCOM | IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > > | [protected]
_uuid_base | IComSrvQI< FixedDWebBrowserEvents2 > | [protected]
BeforeNavigate2(IDispatch *pDisp, const Variant &url, const Variant &flags, const Variant &targetFrameName, const Variant &postData, const Variant &headers, VARIANT_BOOL &cancel) | WebChildWindow | [inline, virtual]
CancelModes() | Window | [static]
ChildWindow(HWND hwnd, const ChildWndInfo &info) | ChildWindow |
ClientToHostWindow(long &CX, long &CY) | WebChildWindow | [inline, virtual]
Command(int id, int code) | Window | [protected, virtual]
CommandStateChange(long command, bool enable) | WebChildWindow | [inline, virtual]
ComSrvObject() | ComSrvObject | [inline, protected]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create(const FileChildWndInfo &info) | WebChildWindow | [inline, static]
IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::create(const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0) | ChildWindow | [static]
create_control(HWND hwnd, REFIID clsid, REFIID riid) | IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > > | [inline]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DecRef() | SimpleComObject | [inline]
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
DocumentComplete() | WebChildWindow | [inline, virtual]
DownloadBegin() | WebChildWindow | [inline, virtual]
DownloadComplete() | DWebBrowserEvents2IF | [inline, virtual]
DWebBrowserEvents2Impl(BrowserNavigator &navigator) | DWebBrowserEvents2Impl | [inline]
FileDownload(Variant &cancel) | WebChildWindow | [inline, virtual]
FrameBeforeNavigate(const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &cancel) | WebChildWindow | [inline, virtual]
FrameNavigateComplete(const BStr &url) | WebChildWindow | [inline, virtual]
FrameNewWindow(const BStr &url, long flags, const BStr &targetFrameName, VARIANT *postData, const BStr &headers, VARIANT_BOOL &processed) | WebChildWindow | [inline, virtual]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetIDsOfNames | DWebBrowserEvents2Impl | [inline]
GetStaticWindowData() | Window | [protected, static]
GetTypeInfo | DWebBrowserEvents2Impl | [inline]
GetTypeInfoCount | DWebBrowserEvents2Impl | [inline]
go_to(LPCTSTR url) | ChildWindow |
IComSrvBase(REFIID uuid_base) | IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl > | [inline, protected]
IComSrvQI(REFIID uuid_base) | IComSrvQI< FixedDWebBrowserEvents2 > | [inline]
IComSrvQI() | IComSrvQI< FixedDWebBrowserEvents2 > | [inline, protected]
IncRef() | SimpleComObject | [inline]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
Invoke | DWebBrowserEvents2Impl | [inline]
IPCtrlWindow(HWND hwnd) | IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > > | [inline]
IPCtrlWindow(HWND hwnd, T &info) | IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > > | [inline]
jump_to_int(LPCTSTR url) | WebChildWindow | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
NavigateComplete2(IDispatch *pDisp, const Variant &url) | WebChildWindow | [inline, virtual]
NavigateError(IDispatch *pDisp, const Variant &url, const Variant &Frame, const Variant &StatusCode, VARIANT_BOOL &cancel) | WebChildWindow | [inline, virtual]
NewWindow2(IDispatch **ppDisp, VARIANT_BOOL &cancel) | WebChildWindow | [inline, virtual]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
OnAddressbar(bool Visible) | WebChildWindow | [inline, virtual]
OnFullscreen(bool Visible) | WebChildWindow | [inline, virtual]
OnMenubar(bool Visible) | WebChildWindow | [inline, virtual]
OnQuit() | WebChildWindow | [inline, virtual]
OnStatusbar(bool Visible) | WebChildWindow | [inline, virtual]
OnTheatermode(bool Visible) | WebChildWindow | [inline, virtual]
OnToolbar(bool Visible) | WebChildWindow | [inline, virtual]
OnVisible(bool Visible) | WebChildWindow | [inline, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PrivacyImpactedStateChange(bool bImpacted) | WebChildWindow | [inline, virtual]
ProgressChange(long Progress, long ProgressMax) | WebChildWindow | [inline, virtual]
PropertyChange(const BStr &Property) | WebChildWindow | [inline, virtual]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
QueryInterface(REFIID riid, LPVOID *ppv) | IComSrvQI< FixedDWebBrowserEvents2 > | [inline]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
resize_children(int cx, int cy) | ChildWindow | [protected, virtual]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
set_url(LPCTSTR url) | ChildWindow | [protected]
SetSecureLockIcon(long SecureLockIcon) | WebChildWindow | [inline, virtual]
StatusTextChange(const BStr &text) | WebChildWindow | [inline, virtual]
STDMETHODIMP_(ULONG) AddRef() | IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl > | [inline]
STDMETHODIMP_(ULONG) Release() | IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl > | [inline]
super typedef | WebChildWindow |
TitleChange(const BStr &text) | WebChildWindow | [inline, virtual]
TitleIconChange(const BStr &text) | WebChildWindow | [inline, virtual]
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
web_super typedef | WebChildWindow |
WebChildWindow(HWND hwnd, const WebChildWndInfo &info) | WebChildWindow |
Window(HWND hwnd) | Window |
WindowActivate() | WebChildWindow | [inline, virtual]
WindowClosing(VARIANT_BOOL IsChildWindow, VARIANT_BOOL &cancel) | WebChildWindow | [inline, virtual]
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowMove() | WebChildWindow | [inline, virtual]
WindowResize() | WebChildWindow | [inline, virtual]
WindowSetHeight(long Height) | WebChildWindow | [inline, virtual]
WindowSetLeft(long Left) | WebChildWindow | [inline, virtual]
WindowSetResizable(bool Visible) | WebChildWindow | [inline, virtual]
WindowSetTop(long Top) | WebChildWindow | [inline, virtual]
WindowSetWidth(long Width) | WebChildWindow | [inline, virtual]
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | WebChildWindow | [protected, virtual]
~ComSrvObject() | ComSrvObject | [inline, protected, virtual]
~DWebBrowserEvents2IF() | DWebBrowserEvents2IF | [inline, virtual]
~IComSrvQI() | IComSrvQI< FixedDWebBrowserEvents2 > | [inline, protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: WebChildWndInfo Struct Reference

WebChildWndInfo Struct Reference

information structure for creation of WebChildWindow More...

#include <filechild.h>

Inheritance diagram for WebChildWndInfo:

[legend]
Collaboration diagram for WebChildWndInfo:

[legend]
List of all members.

Public Types

typedef FileChildWndInfo super

Public Member Functions

WebChildWndInfo (HWND hmdiclient, LPCTSTR url)

Detailed Description

information structure for creation of WebChildWindow

Definition at line 79 of file filechild.h.

Member Typedef Documentation

typedef FileChildWndInfo WebChildWndInfo::super

Reimplemented from FileChildWndInfo.

Definition at line 81 of file filechild.h.

Constructor & Destructor Documentation

WebChildWndInfo::WebChildWndInfo | ( | HWND | hmdiclient,
 |  | LPCTSTR | url
 | ) |

Definition at line 90 of file filechild.cpp.

00091  :      FileChildWndInfo(hmdiclient, url, ET_WEB)
00092 {
00093 }

The documentation for this struct was generated from the following files:
  • filechild.h
  • filechild.cpp


ROS Explorer: Member List

WebChildWndInfo Member List

This is the complete list of members for WebChildWndInfo, including all inherited members.

_etype | FileChildWndInfo |
_hmdiclient | ChildWndInfo |
_open_mode | FileChildWndInfo |
_path | FileChildWndInfo |
_pos | FileChildWndInfo |
ChildWndInfo(HWND hmdiclient) | ChildWndInfo | [inline]
FileChildWndInfo(HWND hmdiclient, LPCTSTR path, ENTRY_TYPE etype=ET_UNKNOWN) | FileChildWndInfo |
super typedef | WebChildWndInfo |
WebChildWndInfo(HWND hmdiclient, LPCTSTR url) | WebChildWndInfo |


ROS Explorer: WinDirectory Struct Reference

WinDirectory Struct Reference

Windows file system directory-entry. More...

#include <winfs.h>

Inheritance diagram for WinDirectory:

[legend]
Collaboration diagram for WinDirectory:

[legend]
List of all members.

Public Member Functions

WinDirectory (LPCTSTR root_path)
WinDirectory (Entry *parent, LPCTSTR path)
~WinDirectory ()
virtual void | read_directory (int scan_flags=SCAN_ALL)
virtual const void * | get_next_path_component (const void *) const
virtual Entry * | find_entry (const void *)

Detailed Description

Windows file system directory-entry.

Definition at line 43 of file winfs.h.

Constructor & Destructor Documentation

WinDirectory::WinDirectory ( LPCTSTR root_path ) [inline]

Definition at line 45 of file winfs.h.

References Directory::_path.

Referenced by read_directory().

00046          :      WinEntry()
00047         {
00048                 _path = _tcsdup(root_path);
00049         }

WinDirectory::WinDirectory | ( | Entry * | parent,
 |  | LPCTSTR | path
 | ) | [inline]

Definition at line 51 of file winfs.h.

References Directory::_path.

00052          :      WinEntry(parent)
00053         {
00054                 _path = _tcsdup(path);
00055         }

WinDirectory::~WinDirectory ( ) [inline]

Definition at line 57 of file winfs.h.

References Directory::_path.

00058         {
00059                 free(_path);
00060                 _path = NULL;
00061         }

Member Function Documentation

Entry * WinDirectory::find_entry ( const void * ) [virtual]

Reimplemented from Entry.

Definition at line 205 of file winfs.cpp.

References Entry::_data, Entry::_down, and Entry::_next.

00206 {
00207         LPCTSTR name = (LPCTSTR)p;
00208
00209         for(Entry*entry=_down; entry; entry=entry->_next) {
00210                 LPCTSTR p = name;
00211                 LPCTSTR q = entry->_data.cFileName;
00212
00213                 do {
00214                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00215                                 return entry;
00216                 } while(tolower(*p++) == tolower(*q++));
00217
00218                 p = name;
00219                 q = entry->_data.cAlternateFileName;
00220
00221                 do {
00222                         if (!*p || *p==TEXT('\\') || *p==TEXT('/'))
00223                                 return entry;
00224                 } while(tolower(*p++) == tolower(*q++));
00225         }
00226
00227         return NULL;
00228 }

const void * WinDirectory::get_next_path_component ( const void * ) const [virtual]

Reimplemented from Entry.

Definition at line 188 of file winfs.cpp.

00189 {
00190         LPCTSTR s = (LPCTSTR) p;
00191
00192         while(*s && *s!=TEXT('\\') && *s!=TEXT('/'))
00193                 ++s;
00194
00195         while(*s==TEXT('\\') || *s==TEXT('/'))
00196                 ++s;
00197
00198         if (!*s)
00199                 return NULL;
00200
00201         return s;
00202 }

void WinDirectory::read_directory ( int scan_flags = SCAN_ALL ) [virtual]

Reimplemented from Entry.

Definition at line 119 of file winfs.cpp.

References Entry::_bhfi, Entry::_bhfi_valid, Entry::_data, Entry::_down, ExplorerGlobals::_ftype_mgr, Entry::_level, Entry::_next, Directory::_path, Entry::_scanned, CONTEXT, g_Globals, SCAN_DO_ACCESS, ScanNTFSStreams(), FileTypeManager::set_type(), WinDirectory(), and WinEntry::WinEntry().

00120 {
00121         CONTEXT("WinDirectory::read_directory()");
00122
00123         int level = _level + 1;
00124
00125         Entry* first_entry = NULL;
00126         Entry* last = NULL;
00127         Entry* entry;
00128
00129         LPCTSTR path = (LPCTSTR)_path;
00130         TCHAR buffer[MAX_PATH], *pname;
00131         for(pname=buffer; *path; )
00132                 *pname++ = *path++;
00133
00134         lstrcpy(pname, TEXT("\\*"));
00135
00136         WIN32_FIND_DATA w32fd;
00137         HANDLE hFind = FindFirstFile(buffer, &w32fd);
00138
00139         if (hFind != INVALID_HANDLE_VALUE) {
00140                 do {
00141                         lstrcpy(pname+1, w32fd.cFileName);
00142
00143                         if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00144                                 entry = new WinDirectory(this, buffer);
00145                         else
00146                                 entry = new WinEntry(this);
00147
00148                         if (!first_entry)
00149                                 first_entry = entry;
00150
00151                         if (last)
00152                                 last->_next = entry;
00153
00154                         memcpy(&entry->_data, &w32fd, sizeof(WIN32_FIND_DATA));
00155                         entry->_level = level;
00156
00157                          // display file type names, but don't hide file extensions
00158                         g_Globals._ftype_mgr.set_type(entry, true);
00159
00160                         if (scan_flags & SCAN_DO_ACCESS) {
00161                                 HANDLE hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
00162                                                                                         0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
00163
00164                                 if (hFile != INVALID_HANDLE_VALUE) {
00165                                         if (GetFileInformationByHandle(hFile, &entry->_bhfi))
00166                                                 entry->_bhfi_valid = true;
00167
00168                                         if (ScanNTFSStreams(entry, hFile))
00169                                                 entry->_scanned = true; // There exist named NTFS sub-streams in this file.
00170
00171                                         CloseHandle(hFile);
00172                                 }
00173                         }
00174
00175                         last = entry;   // There is always at least one entry, because FindFirstFile() succeeded and we don't filter the file entries.
00176                 } while(FindNextFile(hFind, &w32fd));
00177
00178                 last->_next = NULL;
00179
00180                 FindClose(hFind);
00181         }
00182
00183         _down = first_entry;
00184         _scanned = true;
00185 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • winfs.h
  • winfs.cpp


ROS Explorer: Member List

WinDirectory Member List

This is the complete list of members for WinDirectory, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_path | Directory | [protected]
_scanned | Entry |
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | WinEntry | [protected, virtual]
Directory() | Directory | [inline, protected]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
find_entry(const void *) | WinDirectory | [virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | WinDirectory | [virtual]
get_path(PTSTR path, size_t path_count) const | WinEntry | [protected, virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL) | Entry | [virtual]
read_directory(int scan_flags=SCAN_ALL) | WinDirectory | [virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
WinDirectory(LPCTSTR root_path) | WinDirectory | [inline]
WinDirectory(Entry *parent, LPCTSTR path) | WinDirectory | [inline]
WinEntry(Entry *parent) | WinEntry | [inline]
WinEntry() | WinEntry | [inline, protected]
~Directory() | Directory | [inline, protected, virtual]
~Entry() | Entry | [virtual]
~WinDirectory() | WinDirectory | [inline]


ROS Explorer: Window Struct Reference

Window Struct Reference

Class Window is the base class for several C++ window wrapper classes. More...

#include <window.h>

Inheritance diagram for Window:

[legend]
Collaboration diagram for Window:

[legend]
List of all members.

Public Types

typedef map< HWND, Window * > | WindowMap
typedef Window *(* | CREATORFUNC )(HWND)
typedef Window *(* | CREATORFUNC_INFO )(HWND, const void *)

Public Member Functions

Window (HWND hwnd)
virtual | ~Window ()
LRESULT | SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
LRESULT | PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)

Static Public Member Functions

static HWND | Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
static HWND | Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
static Window * | create_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
static LRESULT CALLBACK | WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
static INT_PTR CALLBACK | DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
static Window * | get_window (HWND hwnd)
get window controller from window handle
template<typename CLASS>
static CLASS * | get_window (HWND hwnd)
static void | register_pretranslate (HWND hwnd)
static void | unregister_pretranslate (HWND hwnd)
static BOOL | pretranslate_msg (LPMSG pmsg)
static void | register_dialog (HWND hwnd)
static void | unregister_dialog (HWND hwnd)
static BOOL | dispatch_dialog_msg (LPMSG pmsg)
static int | MessageLoop ()
static void | CancelModes ()

Protected Member Functions

virtual LRESULT | Init (LPCREATESTRUCT pcs)
virtual LRESULT | WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
virtual int | Command (int id, int code)
virtual int | Notify (int id, NMHDR *pnmh)

Static Protected Member Functions

static Window * | create_controller (HWND hwnd)
create controller for a new window
static StaticWindowData & | GetStaticWindowData ()
static LRESULT CALLBACK | MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
static LRESULT CALLBACK | PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)

Static Protected Attributes

static WindowMap | s_wnd_map
static const void * | s_new_info = NULL
static CREATORFUNC | s_window_creator = NULL
static HHOOK | s_hcbtHook = 0
static WindowSet | s_pretranslate_windows
static WindowSet | s_dialogs

Classes

struct | StaticWindowData
structure for managing critical sections as static class information in struct Window More...

Detailed Description

Class Window is the base class for several C++ window wrapper classes.

Window objects are allocated from the heap. They are automatically freed when the window gets destroyed.

Definition at line 58 of file window.h.

Member Typedef Documentation

typedef Window*(* Window::CREATORFUNC)(HWND)

Definition at line 66 of file window.h.

typedef Window*(* Window::CREATORFUNC_INFO)(HWND, const void *)

Definition at line 67 of file window.h.

typedef map<HWND,Window*> Window::WindowMap

Definition at line 64 of file window.h.

Constructor & Destructor Documentation

Window::Window ( HWND hwnd )

Definition at line 74 of file window.cpp.

References WindowHandle::_hwnd, GetStaticWindowData(), and s_wnd_map.

00075  :      WindowHandle(hwnd)
00076 {
00077         Lock lock(GetStaticWindowData()._map_crit_sect);        // protect access to s_wnd_map
00078
00079         s_wnd_map[_hwnd] = this;
00080 }

Here is the call graph for this function:

Window::~Window ( ) [virtual]

Definition at line 82 of file window.cpp.

References WindowHandle::_hwnd, GetStaticWindowData(), and s_wnd_map.

00083 {
00084         Lock lock(GetStaticWindowData()._map_crit_sect);        // protect access to s_wnd_map
00085
00086         s_wnd_map.erase(_hwnd);
00087 }

Here is the call graph for this function:

Member Function Documentation

void Window::CancelModes ( ) [static]

Reimplemented in NotifyArea.

Definition at line 293 of file window.cpp.

00294 {
00295         PostMessage(HWND_BROADCAST, WM_CANCELMODE, 0, 0);
00296 }

int Window::Command | ( | int | id,
 |  | int | code
 | ) | [protected, virtual]

Reimplemented in DesktopShellView, FindProgramDlg, DesktopSettingsDlg, TaskbarSettingsDlg, StartmenuSettingsDlg, MdiSdiDlg, FileChildWindow, MainFrameBase, MDIMainFrame, SDIMainFrame, DesktopBar, QuickLaunchBar, StartMenu, StartMenuHandler, FavoritesMenu, TaskBar, NotifyArea, TrayNotifyDlg, SubclassedWindow, Dialog, and PropSheetPageDlg.

Definition at line 283 of file window.cpp.

Referenced by StartMenu::Command(), DialogProc(), and WindowWndProc().

00284 {
00285         return 1;       // no command handler found
00286 }

HWND Window::Create | ( | CREATORFUNC_INFO | creator,
 |  | const void * | info,
 |  | DWORD | dwExStyle,
 |  | LPCTSTR | lpClassName,
 |  | LPCTSTR | lpWindowName,
 |  | DWORD | dwStyle,
 |  | int | x,
 |  | int | y,
 |  | int | w,
 |  | int | h,
 |  | HWND | hwndParent = 0,
 |  | HMENU | hMenu = 0
 | ) | [static]

Definition at line 105 of file window.cpp.

References ExplorerGlobals::_hInstance, g_Globals, GetStaticWindowData(), s_new_info, and s_window_creator.

00109 {
00110         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00111
00112         s_window_creator = (CREATORFUNC) creator;
00113         s_new_info = info;
00114
00115         return CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle,
00116                                                         x, y, w, h,
00117                                                         hwndParent, hMenu, g_Globals._hInstance, 0/*lpParam*/);
00118 }

Here is the call graph for this function:

HWND Window::Create | ( | CREATORFUNC | creator,
 |  | DWORD | dwExStyle,
 |  | LPCTSTR | lpClassName,
 |  | LPCTSTR | lpWindowName,
 |  | DWORD | dwStyle,
 |  | int | x,
 |  | int | y,
 |  | int | w,
 |  | int | h,
 |  | HWND | hwndParent = 0,
 |  | HMENU | hMenu = 0
 | ) | [static]

Definition at line 90 of file window.cpp.

References ExplorerGlobals::_hInstance, g_Globals, GetStaticWindowData(), s_new_info, and s_window_creator.

Referenced by ClockWindow::Create(), NotifyArea::Create(), TaskBar::Create(), StartMenuRoot::Create(), SDIMainFrame::Create(), MDIMainFrame::Create(), DesktopBar::Create(), and DesktopWindow::Create().

00094 {
00095         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00096
00097         s_window_creator = creator;
00098         s_new_info = NULL;
00099
00100         return CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle,
00101                                                         x, y, w, h,
00102                                                         hwndParent, hMenu, g_Globals._hInstance, 0/*lpParam*/);
00103 }

Here is the call graph for this function:

Window * Window::create_controller ( HWND hwnd ) [static, protected]

create controller for a new window

Definition at line 218 of file window.cpp.

References GetStaticWindowData(), s_new_info, and s_window_creator.

Referenced by MDICBTHookProc(), PropSheetCBTHookProc(), and WindowWndProc().

00219 {
00220         if (s_window_creator) { // protect for recursion and create the window object only for the first window
00221                 Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00222
00223                 const void* info = s_new_info;
00224                 s_new_info = NULL;
00225
00226                 CREATORFUNC window_creator = s_window_creator;
00227                 s_window_creator = NULL;
00228
00229                 if (info)
00230                         return CREATORFUNC_INFO(window_creator)(hwnd, info);
00231                 else
00232                         return CREATORFUNC(window_creator)(hwnd);
00233         }
00234
00235         return NULL;
00236 }

Here is the call graph for this function:

Window * Window::create_mdi_child | ( | const ChildWndInfo & | info,
 |  | const MDICREATESTRUCT & | mcs,
 |  | CREATORFUNC_INFO | creator
 | ) | [static]

Definition at line 121 of file window.cpp.

References ChildWndInfo::_hmdiclient, WindowHandle::_hwnd, get_window(), GetStaticWindowData(), HWND, MDICBTHookProc(), s_hcbtHook, s_new_info, and s_window_creator.

Referenced by ChildWindow::create(), and FileChildWindow::create().

00122 {
00123         Lock lock(GetStaticWindowData()._create_crit_sect);     // protect access to s_window_creator and s_new_info
00124
00125         s_window_creator = (CREATORFUNC) creator;
00126         s_new_info = &info;
00127
00128         s_hcbtHook = SetWindowsHookEx(WH_CBT, MDICBTHookProc, 0, GetCurrentThreadId());
00129
00130         HWND hwnd = (HWND) SendMessage(info._hmdiclient, WM_MDICREATE, 0, (LPARAM)&mcs);
00131
00132         UnhookWindowsHookEx(s_hcbtHook);
00133
00134         Window* child = get_window(hwnd);
00135         s_new_info = NULL;
00136
00137         if (child && (!hwnd || !child->_hwnd))
00138                 child = NULL;
00139
00140         return child;
00141 }

Here is the call graph for this function:

INT_PTR CALLBACK Window::DialogProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Reimplemented in PropSheetPageDlg.

Definition at line 712 of file window.cpp.

References Command(), get_window(), NFR_CURRENT, Notify(), and WndProc().

Referenced by Dialog::DoModal().

00713 {
00714         Window* pThis = get_window(hwnd);
00715
00716         if (pThis) {
00717                 switch(nmsg) {
00718                   case WM_COMMAND:
00719                         pThis->Command(LOWORD(wparam), HIWORD(wparam));
00720                         return TRUE;    // message has been processed
00721
00722                   case WM_NOTIFY:
00723                         pThis->Notify(wparam, (NMHDR*)lparam);
00724                         return TRUE;    // message has been processed
00725
00726                   case WM_NOTIFYFORMAT:
00727                         SetWindowLong(hwnd, DWLP_MSGRESULT, NFR_CURRENT);       // set return value NFR_CURRENT
00728                         return TRUE;    // message has been processed
00729
00730                   case WM_NCDESTROY:
00731                         delete pThis;
00732                         return TRUE;    // message has been processed
00733
00734                   default:
00735                         return pThis->WndProc(nmsg, wparam, lparam);
00736                 }
00737         } else if (nmsg == WM_INITDIALOG) {
00738                 pThis = create_controller(hwnd);
00739
00740                 if (pThis)
00741                         return pThis->Init(NULL);
00742         }
00743
00744         return FALSE;   // message has not been processed
00745 }

Here is the call graph for this function:

static BOOL Window::dispatch_dialog_msg ( LPMSG pmsg ) [static]

Referenced by PropertySheetDialog::DoModal(), and MessageLoop().

template<typename CLASS>
static CLASS* Window::get_window ( HWND hwnd ) [inline, static]

Definition at line 87 of file window.h.

References get_window().

00087 {return static_cast<CLASS*>(get_window(hwnd));}

Here is the call graph for this function:

Window * Window::get_window ( HWND hwnd ) [static]

get window controller from window handle

Definition at line 201 of file window.cpp.

References GetStaticWindowData(), and s_wnd_map.

Referenced by create_mdi_child(), DialogProc(), get_window(), MDICBTHookProc(), PropSheetCBTHookProc(), and WindowWndProc().

00202 {
00203         {
00204                 Lock lock(GetStaticWindowData()._map_crit_sect);        // protect access to s_wnd_map
00205
00206                 WindowMap::const_iterator found = s_wnd_map.find(hwnd);
00207
00208                 if (found!=s_wnd_map.end())
00209                         return found->second;
00210         }
00211
00212         return NULL;
00213 }

Here is the call graph for this function:

Window::StaticWindowData & Window::GetStaticWindowData ( ) [static, protected]

Definition at line 66 of file window.cpp.

Referenced by Create(), create_controller(), create_mdi_child(), Dialog::DoModal(), get_window(), Window(), and ~Window().

00067 {
00068         static StaticWindowData s_initialized_data;
00069
00070         return s_initialized_data;
00071 }

LRESULT Window::Init ( LPCREATESTRUCT pcs ) [protected, virtual]

Reimplemented in DesktopWindow, MDIShellBrowserChild, DesktopBar, StartMenu, StartMenuRoot, TaskBar, and NotifyArea.

Definition at line 239 of file window.cpp.

Referenced by NotifyArea::Init(), TaskBar::Init(), StartMenu::Init(), MDIShellBrowserChild::Init(), DesktopBar::Init(), DesktopWindow::Init(), SubclassedWindow::SubclassedWndProc(), and WindowWndProc().

00240 {
00241         return 0;
00242 }

LRESULT CALLBACK Window::MDICBTHookProc | ( | int | code,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static, protected]

Definition at line 143 of file window.cpp.

References create_controller(), get_window(), HWND, and s_hcbtHook.

Referenced by create_mdi_child().

00144 {
00145         if (code == HCBT_CREATEWND) {
00146                 HWND hwnd = (HWND)wparam;
00147
00148                  // create Window controller and associate it with the window handle
00149                 Window* child = get_window(hwnd);
00150
00151                 if (!child)
00152                         child = create_controller(hwnd);
00153         }
00154
00155         return CallNextHookEx(s_hcbtHook, code, wparam, lparam);
00156 }

Here is the call graph for this function:

int Window::MessageLoop ( ) [static]

Definition at line 616 of file window.cpp.

References dispatch_dialog_msg(), HandleException(), and pretranslate_msg().

00617 {
00618         MSG msg;
00619
00620         while(GetMessage(&msg, 0, 0, 0)) {
00621                 try {
00622                         if (pretranslate_msg(&msg))
00623                                 continue;
00624
00625                         if (dispatch_dialog_msg(&msg))
00626                                 continue;
00627
00628                         TranslateMessage(&msg);
00629
00630                         try {
00631                                 DispatchMessage(&msg);
00632                         } catch(COMException& e) {
00633                                 HandleException(e, 0);
00634                         }
00635                 } catch(COMException& e) {
00636                         HandleException(e, 0);
00637                 }
00638         }
00639
00640         return msg.wParam;
00641 }

Here is the call graph for this function:

int Window::Notify | ( | int | id,
 |  | NMHDR * | pnmh
 | ) | [protected, virtual]

Reimplemented in DesktopShellView, FindProgramDlg, DesktopSettingsDlg, TaskbarSettingsDlg, FileChildWindow, MainFrameBase, Pane, DesktopBar, QuickLaunchBar, TaskBar, NotifyArea, TrayNotifyDlg, ClockWindow, SubclassedWindow, ShellBrowserChildT< ChildWindow >, and ShellBrowserChildT< MainFrameBase >.

Definition at line 288 of file window.cpp.

Referenced by PropSheetPageDlg::DialogProc(), DialogProc(), TaskbarSettingsDlg::Notify(), DesktopSettingsDlg::Notify(), and WindowWndProc().

00289 {
00290         return 0;
00291 }

LRESULT Window::PostParent | ( | UINT | nmsg,
 |  | WPARAM | wparam = 0,
 |  | LPARAM | lparam = 0
 | ) |

Definition at line 654 of file window.cpp.

References WindowHandle::_hwnd, and HWND.

00655 {
00656         HWND parent = GetParent(_hwnd);
00657
00658         if (!parent)
00659                 return 0;
00660
00661         return PostMessage(parent, nmsg, wparam, lparam);
00662 }

BOOL Window::pretranslate_msg ( LPMSG pmsg ) [static]

Definition at line 584 of file window.cpp.

References PM_TRANSLATE_MSG, and s_pretranslate_windows.

Referenced by PropertySheetDialog::DoModal(), and MessageLoop().

00585 {
00586         for(WindowSet::const_iterator it=Window::s_pretranslate_windows.begin(); it!=s_pretranslate_windows.end(); ++it)
00587                 if (SendMessage(*it, PM_TRANSLATE_MSG, 0, (LPARAM)pmsg))
00588                         return TRUE;
00589
00590         return FALSE;
00591 }

LRESULT CALLBACK Window::PropSheetCBTHookProc | ( | int | code,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static, protected]

Definition at line 183 of file window.cpp.

References create_controller(), get_window(), HWND, and s_hcbtHook.

00184 {
00185         if (code == HCBT_CREATEWND) {
00186                 HWND hwnd = (HWND)wparam;
00187
00188                  // create Window controller and associate it with the window handle
00189                 Window* child = get_window(hwnd);
00190
00191                 if (!child)
00192                         child = create_controller(hwnd);
00193         }
00194
00195         return CallNextHookEx(s_hcbtHook, code, wparam, lparam);
00196 }

Here is the call graph for this function:

void Window::register_dialog ( HWND hwnd ) [static]

Definition at line 596 of file window.cpp.

References s_dialogs.

Referenced by Dialog::Dialog(), and DialogWindow::DialogWindow().

00597 {
00598         s_dialogs.insert(hwnd);
00599 }

void Window::register_pretranslate ( HWND hwnd ) [static]

Definition at line 574 of file window.cpp.

References s_pretranslate_windows.

Referenced by FindProgramDlg::FindProgramDlg(), PreTranslateWindow::PreTranslateWindow(), and TrayNotifyDlg::TrayNotifyDlg().

00575 {
00576         s_pretranslate_windows.insert(hwnd);
00577 }

LRESULT Window::SendParent | ( | UINT | nmsg,
 |  | WPARAM | wparam = 0,
 |  | LPARAM | lparam = 0
 | ) |

Definition at line 644 of file window.cpp.

References WindowHandle::_hwnd, and HWND.

Referenced by StartMenu::CloseStartMenu(), and StartMenu::~StartMenu().

00645 {
00646         HWND parent = GetParent(_hwnd);
00647
00648         if (!parent)
00649                 return 0;
00650
00651         return SendMessage(parent, nmsg, wparam, lparam);
00652 }

void Window::unregister_dialog ( HWND hwnd ) [static]

Definition at line 601 of file window.cpp.

References s_dialogs.

Referenced by Dialog::~Dialog(), and DialogWindow::~DialogWindow().

00602 {
00603         s_dialogs.erase(hwnd);
00604 }

void Window::unregister_pretranslate ( HWND hwnd ) [static]

Definition at line 579 of file window.cpp.

References s_pretranslate_windows.

Referenced by FindProgramDlg::~FindProgramDlg(), PreTranslateWindow::~PreTranslateWindow(), and TrayNotifyDlg::~TrayNotifyDlg().

00580 {
00581         s_pretranslate_windows.erase(hwnd);
00582 }

LRESULT CALLBACK Window::WindowWndProc | ( | HWND | hwnd,
 |  | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [static]

Definition at line 245 of file window.cpp.

References Command(), create_controller(), get_window(), Init(), NFR_CURRENT, Notify(), and WndProc().

00246 {
00247         Window* pThis = get_window(hwnd);
00248
00249         if (!pThis)
00250                 pThis = create_controller(hwnd);
00251
00252         if (pThis) {
00253                 switch(nmsg) {
00254                   case WM_COMMAND:
00255                         return pThis->Command(LOWORD(wparam), HIWORD(wparam));
00256
00257                   case WM_NOTIFY:
00258                         return pThis->Notify(wparam, (NMHDR*)lparam);
00259
00260                   case WM_NOTIFYFORMAT:
00261                         return NFR_CURRENT;
00262
00263                   case WM_CREATE:
00264                         return pThis->Init((LPCREATESTRUCT)lparam);
00265
00266                   case WM_NCDESTROY:
00267                         delete pThis;
00268                         return 0;
00269
00270                   default:
00271                         return pThis->WndProc(nmsg, wparam, lparam);
00272                 }
00273         }
00274         else
00275                 return DefWindowProc(hwnd, nmsg, wparam, lparam);
00276 }

Here is the call graph for this function:

LRESULT Window::WndProc | ( | UINT | nmsg,
 |  | WPARAM | wparam,
 |  | LPARAM | lparam
 | ) | [protected, virtual]

Reimplemented in ExplorerAboutDlg, BackgroundWindow, DesktopWindow, DesktopShellView, FindProgramDlg, FileChildWindow, MainFrameBase, MDIMainFrame, SDIMainFrame, Pane, MDIShellBrowserChild, WebChildWindow, DesktopBar, StartButton, QuickLaunchBar, StartMenu, StartMenuRoot, TaskBar, NotifyArea, TrayNotifyDlg, ClockWindow, SubclassedWindow, ChildWindow, Dialog, OwnerdrawnButton, FlatButton, ColorStatic, HyperlinkCtrl, EditController, ShellBrowserChildT< ChildWindow >, ShellBrowserChildT< MainFrameBase >, IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >, ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >, ExtContextMenuHandlerT< ChildWindow >, ExtContextMenuHandlerT< SubclassedWindow >, ExtContextMenuHandlerT< OwnerDrawParent< Window > >, ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >, ResizeController< Dialog >, CtlColorParent< OwnerDrawParent< Dialog > >, OwnerDrawParent< PropSheetPageDlg >, OwnerDrawParent< Window >, and OwnerDrawParent< Dialog >.

Definition at line 278 of file window.cpp.

References WindowHandle::_hwnd.

Referenced by DialogProc(), WindowWndProc(), ClockWindow::WndProc(), MainFrameBase::WndProc(), and DesktopWindow::WndProc().

00279 {
00280         return DefWindowProc(_hwnd, nmsg, wparam, lparam);
00281 }

Member Data Documentation

WindowSet Window::s_dialogs [static, protected]

Definition at line 138 of file window.h.

Referenced by register_dialog(), and unregister_dialog().

HHOOK Window::s_hcbtHook = 0 [static, protected]

Definition at line 133 of file window.h.

Referenced by create_mdi_child(), MDICBTHookProc(), and PropSheetCBTHookProc().

const void * Window::s_new_info = NULL [static, protected]

Definition at line 119 of file window.h.

Referenced by Create(), create_controller(), create_mdi_child(), and Dialog::DoModal().

WindowSet Window::s_pretranslate_windows [static, protected]

Definition at line 137 of file window.h.

Referenced by pretranslate_msg(), register_pretranslate(), and unregister_pretranslate().

Window::CREATORFUNC Window::s_window_creator = NULL [static, protected]

Definition at line 120 of file window.h.

Referenced by Create(), create_controller(), create_mdi_child(), and Dialog::DoModal().

Window::WindowMap Window::s_wnd_map [static, protected]

Definition at line 117 of file window.h.

Referenced by get_window(), Window(), and ~Window().

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

Window Member List

This is the complete list of members for Window, including all inherited members.

_hwnd | WindowHandle | [protected]
CancelModes() | Window | [static]
Command(int id, int code) | Window | [protected, virtual]
Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
Create(CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0) | Window | [static]
create_controller(HWND hwnd) | Window | [protected, static]
create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator) | Window | [static]
CREATORFUNC typedef | Window |
CREATORFUNC_INFO typedef | Window |
DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
dispatch_dialog_msg(LPMSG pmsg) | Window | [static]
get_window(HWND hwnd) | Window | [static]
get_window(HWND hwnd) | Window | [inline, static]
GetStaticWindowData() | Window | [protected, static]
Init(LPCREATESTRUCT pcs) | Window | [protected, virtual]
MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
MessageLoop() | Window | [static]
Notify(int id, NMHDR *pnmh) | Window | [protected, virtual]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
pretranslate_msg(LPMSG pmsg) | Window | [static]
PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam) | Window | [protected, static]
register_dialog(HWND hwnd) | Window | [static]
register_pretranslate(HWND hwnd) | Window | [static]
s_dialogs | Window | [protected, static]
s_hcbtHook | Window | [protected, static]
s_new_info | Window | [protected, static]
s_pretranslate_windows | Window | [protected, static]
s_window_creator | Window | [protected, static]
s_wnd_map | Window | [protected, static]
SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0) | Window |
unregister_dialog(HWND hwnd) | Window | [static]
unregister_pretranslate(HWND hwnd) | Window | [static]
Window(HWND hwnd) | Window |
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]
WindowMap typedef | Window |
WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [static]
WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) | Window | [protected, virtual]
~Window() | Window | [virtual]


ROS Explorer: Window::StaticWindowData Struct Reference

Window::StaticWindowData

Window::StaticWindowData Struct Reference

structure for managing critical sections as static class information in struct Window More...

#include <window.h>

Collaboration diagram for Window::StaticWindowData:

[legend]
List of all members.

Public Attributes

CritSect _map_crit_sect
CritSect _create_crit_sect

Detailed Description

structure for managing critical sections as static class information in struct Window

Definition at line 124 of file window.h.

Member Data Documentation

CritSect Window::StaticWindowData::_create_crit_sect

Definition at line 126 of file window.h.

CritSect Window::StaticWindowData::_map_crit_sect

Definition at line 125 of file window.h.

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

Window::StaticWindowData Member List

This is the complete list of members for Window::StaticWindowData, including all inherited members.

_create_crit_sect | Window::StaticWindowData
_map_crit_sect | Window::StaticWindowData


ROS Explorer: WindowCanvas Struct Reference

WindowCanvas Struct Reference

WindowCanvas is a encapsulation of client area device contexts. More...

#include <utility.h>

Inheritance diagram for WindowCanvas:

[legend]
Collaboration diagram for WindowCanvas:

[legend]
List of all members.

Public Member Functions

WindowCanvas (HWND hwnd)
~WindowCanvas ()

Protected Attributes

HWND _hwnd

Detailed Description

WindowCanvas is a encapsulation of client area device contexts.

Definition at line 506 of file utility.h.

Constructor & Destructor Documentation

WindowCanvas::WindowCanvas ( HWND hwnd ) [inline]

Definition at line 508 of file utility.h.

00509          :      Canvas(GetDC(hwnd)), _hwnd(hwnd) {}

WindowCanvas::~WindowCanvas ( ) [inline]

Definition at line 511 of file utility.h.

00511 {ReleaseDC(_hwnd, _hdc);}

Member Data Documentation

HWND WindowCanvas::_hwnd [protected]

Definition at line 514 of file utility.h.

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

WindowCanvas Member List

This is the complete list of members for WindowCanvas, including all inherited members.

_hdc | Canvas | [protected]
_hwnd | WindowCanvas | [protected]
Canvas(HDC hdc) | Canvas | [inline]
operator HDC() | Canvas | [inline]
WindowCanvas(HWND hwnd) | WindowCanvas | [inline]
~WindowCanvas() | WindowCanvas | [inline]


ROS Explorer: WindowClass Struct Reference

WindowClass Struct Reference

WindowClass is a neat wrapper for RegisterClassEx(). More...

#include <window.h>

Inheritance diagram for WindowClass:

[legend]
Collaboration diagram for WindowClass:

[legend]
List of all members.

Public Member Functions

WindowClass (LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc)
ATOM | Register ()
operator ATOM ()
operator LPCTSTR ()

Protected Attributes

ATOM | _atomClass

Detailed Description

WindowClass is a neat wrapper for RegisterClassEx().

Just construct a WindowClass object, override the attributes you want to change, then call Register() or simply request the ATOM value to register the window class. You don't have to worry calling Register() more than once. It checks if, the class has already been registered.

Definition at line 226 of file window.h.

Constructor & Destructor Documentation

WindowClass::WindowClass | ( | LPCTSTR | classname,
 |  | UINT | style = 0,
 |  | WNDPROC | wndproc = Window::WindowWndProc
 | ) |

Definition at line 34 of file window.cpp.

References _atomClass, ExplorerGlobals::_hInstance, and g_Globals.

00035 {
00036         memset(this, 0, sizeof(WNDCLASSEX));
00037
00038         cbSize = sizeof(WNDCLASSEX);
00039         style = style_;
00040         hInstance = g_Globals._hInstance;
00041         hCursor = LoadCursor(0, IDC_ARROW);
00042
00043         lpszClassName = classname;
00044         lpfnWndProc = wndproc;
00045
00046         _atomClass = 0;
00047 }

Member Function Documentation

WindowClass::operator ATOM ( ) [inline]

Definition at line 238 of file window.h.

00238 {return Register();}

WindowClass::operator LPCTSTR ( ) [inline]

Definition at line 241 of file window.h.

00241 {return (LPCTSTR)(int)Register();}

ATOM WindowClass::Register ( ) [inline]

Definition at line 230 of file window.h.

00231         {
00232                 if (!_atomClass)
00233                         _atomClass = RegisterClassEx(this);
00234
00235                 return _atomClass;
00236         }

Member Data Documentation

ATOM WindowClass::_atomClass [protected]

Definition at line 244 of file window.h.

Referenced by WindowClass().

The documentation for this struct was generated from the following files:
  • window.h
  • window.cpp


ROS Explorer: Member List

WindowClass Member List

This is the complete list of members for WindowClass, including all inherited members.

_atomClass | WindowClass | [protected]
operator ATOM() | WindowClass | [inline]
operator LPCTSTR() | WindowClass | [inline]
Register() | WindowClass | [inline]
WindowClass(LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc) | WindowClass |


ROS Explorer: WindowCreator< WND_CLASS > Struct Template Reference

WindowCreator< WND_CLASS > Struct Template Reference

template class used in macro WINDOW_CREATOR to define the creater functions for Window objects More...

#include <window.h>

List of all members.

Static Public Member Functions

static WND_CLASS * window_creator (HWND hwnd)

Detailed Description

template<typename WND_CLASS>
struct WindowCreator< WND_CLASS >

template class used in macro WINDOW_CREATOR to define the creater functions for Window objects

Definition at line 194 of file window.h.

Member Function Documentation

template<typename WND_CLASS>
static WND_CLASS* WindowCreator< WND_CLASS >::window_creator ( HWND hwnd ) [inline, static]

Definition at line 196 of file window.h.

00197         {
00198                 return new WND_CLASS(hwnd);
00199         }

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

WindowCreator< WND_CLASS > Member List

This is the complete list of members for WindowCreator< WND_CLASS >, including all inherited members.

window_creator(HWND hwnd) WindowCreator< WND_CLASS > [inline, static]


ROS Explorer: WindowCreatorInfo< WND_CLASS, INFO_CLASS > Struct Template Reference

WindowCreatorInfo< WND_CLASS, INFO_CLASS > Struct Template Reference

template class used in macro WINDOW_CREATOR_INFO to the define creater functions for Window objects with additional creation information More...

#include <window.h>

List of all members.

Static Public Member Functions

static WND_CLASS * window_creator (HWND hwnd, const void *info)

Detailed Description

template<typename WND_CLASS, typename INFO_CLASS>
struct WindowCreatorInfo< WND_CLASS, INFO_CLASS >

template class used in macro WINDOW_CREATOR_INFO to the define creater functions for Window objects with additional creation information

Definition at line 207 of file window.h.

Member Function Documentation

template<typename WND_CLASS, typename INFO_CLASS>
static WND_CLASS* WindowCreatorInfo< WND_CLASS, INFO_CLASS >::window_creator | ( | HWND | hwnd,
 |  | const void * | info
 | ) | [inline, static]

Definition at line 209 of file window.h.

00210         {
00211                 return new WND_CLASS(hwnd, *static_cast<const INFO_CLASS*>(info));
00212         }

The documentation for this struct was generated from the following file:
  • window.h


ROS Explorer: Member List

WindowCreatorInfo< WND_CLASS, INFO_CLASS > Member List

This is the complete list of members for WindowCreatorInfo< WND_CLASS, INFO_CLASS >, including all inherited members.

window_creator(HWND hwnd, const void *info) WindowCreatorInfo< WND_CLASS, INFO_CLASS > [inline, static]


ROS Explorer: WindowHandle Struct Reference

WindowHandle Struct Reference

base of all structures storing a window handle More...

#include <utility.h>

Inheritance diagram for WindowHandle:

[legend]
Collaboration diagram for WindowHandle:

[legend]
List of all members.

Public Member Functions

WindowHandle (HWND hwnd=0)
operator HWND () const
HWND * operator & ()

Protected Attributes

HWND _hwnd

Detailed Description

base of all structures storing a window handle

Definition at line 272 of file utility.h.

Constructor & Destructor Documentation

WindowHandle::WindowHandle ( HWND hwnd = 0 ) [inline]

Definition at line 274 of file utility.h.

00275          :      _hwnd(hwnd) {}

Member Function Documentation

HWND* WindowHandle::operator & ( ) [inline]

Definition at line 278 of file utility.h.

00278 {return &_hwnd;}

WindowHandle::operator HWND ( ) const [inline]

Definition at line 277 of file utility.h.

00277 {return _hwnd;}

Member Data Documentation

HWND WindowHandle::_hwnd [protected]

Definition at line 281 of file utility.h.

Referenced by ToolTip::activate(), ToolTip::add(), StartMenu::AddButton(), QuickLaunchBar::AddButton(), StartMenu::AddSeparator(), QuickLaunchBar::AddShortcuts(), StartMenu::ButtonHitTest(), Pane::calc_single_width(), Pane::calc_widths(), ClockWindow::ClockWindow(), StartMenuRoot::CloseStartMenu(), StartMenu::CloseStartMenu(), FindProgramDlg::collect_programs_callback(), Dialog::Command(), TrayNotifyDlg::Command(), FavoritesMenu::Command(), StartMenuHandler::Command(), MdiSdiDlg::Command(), TaskbarSettingsDlg::Command(), DesktopSettingsDlg::Command(), QuickLaunchBar::Command(), Pane::command(), MainFrameBase::Command(), DesktopBar::Command(), Window::create_mdi_child(), NotifyIconConfig::create_name(), MDIMainFrame::CreateChild(), StartMenu::CreateSubmenu(), DesktopSettingsDlg::DesktopSettingsDlg(), DesktopShellView::DoContextMenu(), DesktopShellView::DoDesktopContextMenu(), StartMenu::DrawArrows(), StartMenu::DrawFloatingButton(), FlatButton::DrawItem(), PictureButton::DrawItem(), MDIShellBrowserChild::entry_selected(), MainFrameBase::ExecuteCommandbar(), MainFrameBase::FillBookmarks(), MainFrameBase::frame_get_clientspace(), MainFrameBase::fullscreen_move(), Pane::get_frame(), StartMenu::GetArrowButtonRects(), StartMenu::GetButtonRect(), StartMenu::GetFloatingButtonRect(), StartMenuRoot::GetLogoResId(), DesktopWindow::GetWindow(), HyperlinkCtrl::init(), NotifyArea::Init(), TaskBar::Init(), StartMenu::Init(), Pane::init(), DesktopBar::Init(), DesktopWindow::Init(), DesktopShellView::InitDragDrop(), Pane::insert_entries(), StartMenu::InvalidateSelection(), HyperlinkCtrl::LaunchLink(), FindProgramDlg::LaunchSelected(), MainFrameBase::MainFrameBase(), SubclassedWindow::Notify(), TrayNotifyDlg::Notify(), NotifyArea::Notify(), DesktopSettingsDlg::Notify(), Pane::Notify(), StartMenu::OpenSubmenu(), ClockWindow::Paint(), NotifyArea::Paint(), StartMenuRoot::Paint(), StartMenu::Paint(), Window::PostParent(), StartMenu::ProcessKey(), MainFrameBase::ProcessMessage(), TrayNotifyDlg::Refresh(), FindProgramDlg::Refresh(), TrayNotifyDlg::RefreshProperties(), DesktopBar::RegisterHotkeys(), ToolTip::remove(), DesktopBar::Resize(), MainFrameBase::resize_frame_client(), TaskBar::ResizeButtons(), StartMenu::ResizeButtons(), StartMenu::ResizeToButtons(), Window::SendParent(), FileChildWindow::set_curdir(), Pane::set_header(), NotifyArea::show_clock(), TaskBar::ShowAppSystemMenu(), ListSort::sort(), StartMenu::StartMenu(), StartMenuRoot::StartMenuRoot(), SubclassedWindow::SubclassedWindow(), ClockWindow::TimerTick(), MainFrameBase::toggle_fullscreen(), StartMenuRoot::TrackStartmenu(), MainFrameBase::TranslateMsg(), TrayNotifyDlg::TrayNotifyDlg(), StartMenu::UpdateIcons(), Window::Window(), EditController::WndProc(), HyperlinkCtrl::WndProc(), FlatButton::WndProc(), ChildWindow::WndProc(), SubclassedWindow::WndProc(), Window::WndProc(), WebChildWindow::WndProc(), ClockWindow::WndProc(), TrayNotifyDlg::WndProc(), NotifyArea::WndProc(), StartMenuRoot::WndProc(), StartMenu::WndProc(), FindProgramDlg::WndProc(), QuickLaunchBar::WndProc(), Pane::WndProc(), StartButton::WndProc(), DesktopWindow::WndProc(), BackgroundWindow::WndProc(), Dialog::~Dialog(), DialogWindow::~DialogWindow(), FindProgramDlg::~FindProgramDlg(), MainFrameBase::~MainFrameBase(), NotifyArea::~NotifyArea(), PreTranslateWindow::~PreTranslateWindow(), TaskBar::~TaskBar(), TrayNotifyDlg::~TrayNotifyDlg(), and Window::~Window().

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

WindowHandle Member List

This is the complete list of members for WindowHandle, including all inherited members.

_hwnd | WindowHandle | [protected]
operator &() | WindowHandle | [inline]
operator HWND() const | WindowHandle | [inline]
WindowHandle(HWND hwnd=0) | WindowHandle | [inline]


ROS Explorer: WindowRect Struct Reference

WindowRect Struct Reference

ClientRect retreives the window rectangle of a window. More...

#include <utility.h>

Inheritance diagram for WindowRect:

[legend]
Collaboration diagram for WindowRect:

[legend]
List of all members.

Public Member Functions

WindowRect (HWND hwnd)
operator LPRECT ()
POINT & pos ()

Detailed Description

ClientRect retreives the window rectangle of a window.

Definition at line 417 of file utility.h.

Constructor & Destructor Documentation

WindowRect::WindowRect ( HWND hwnd ) [inline]

Definition at line 419 of file utility.h.

00420         {
00421                 GetWindowRect(hwnd, this);
00422         }

Member Function Documentation

WindowRect::operator LPRECT ( ) [inline]

Definition at line 424 of file utility.h.

00424 {return this;}

POINT& WindowRect::pos ( ) [inline]

Definition at line 426 of file utility.h.

00426 {return *(LPPOINT)this;}

The documentation for this struct was generated from the following file:
  • utility.h


ROS Explorer: Member List

WindowRect Member List

This is the complete list of members for WindowRect, including all inherited members.

operator LPRECT() | WindowRect | [inline]
pos() | WindowRect | [inline]
WindowRect(HWND hwnd) | WindowRect | [inline]


ROS Explorer: WinEntry Struct Reference

WinEntry Struct Reference

Windows file system file-entry. More...

#include <winfs.h>

Inheritance diagram for WinEntry:

[legend]
Collaboration diagram for WinEntry:

[legend]
List of all members.

Public Member Functions

WinEntry (Entry *parent)

Protected Member Functions

WinEntry ()
virtual bool | get_path (PTSTR path, size_t path_count) const
virtual ShellPath | create_absolute_pidl () const

Detailed Description

Windows file system file-entry.

Definition at line 30 of file winfs.h.

Constructor & Destructor Documentation

WinEntry::WinEntry ( Entry * parent ) [inline]

Definition at line 32 of file winfs.h.

00032 : Entry(parent, ET_WINDOWS) {}

WinEntry::WinEntry ( ) [inline, protected]

Definition at line 35 of file winfs.h.

Referenced by WinDirectory::read_directory().

00035 : Entry(ET_WINDOWS) {}

Member Function Documentation

ShellPath WinEntry::create_absolute_pidl ( ) const [protected, virtual]

Reimplemented from Entry.

Definition at line 237 of file winfs.cpp.

References CONTEXT, COUNTOF, and get_path().

00238 {
00239         CONTEXT("WinEntry::create_absolute_pidl()");
00240
00241         TCHAR path[MAX_PATH];
00242
00243         if (get_path(path, COUNTOF(path)))
00244                 return ShellPath(path);
00245
00246         return ShellPath();
00247 }

Here is the call graph for this function:

bool WinEntry::get_path | ( | PTSTR | path,
 |  | size_t | path_count
 | ) | const [protected, virtual]

Implements Entry.

Definition at line 232 of file winfs.cpp.

References ET_WINDOWS, and Entry::get_path_base().

Referenced by create_absolute_pidl().

00233 {
00234         return get_path_base ( path, path_count, ET_WINDOWS );
00235 }

Here is the call graph for this function:

The documentation for this struct was generated from the following files:
  • winfs.h
  • winfs.cpp


ROS Explorer: Member List

WinEntry Member List

This is the complete list of members for WinEntry, including all inherited members.

_bhfi | Entry |
_bhfi_valid | Entry |
_content | Entry |
_data | Entry |
_display_name | Entry |
_down | Entry |
_etype | Entry |
_expanded | Entry |
_icon_id | Entry |
_level | Entry |
_next | Entry |
_scanned | Entry |
_shell_attribs | Entry |
_type_name | Entry |
_up | Entry |
create_absolute_pidl() const | WinEntry | [protected, virtual]
do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs) | Entry | [virtual]
Entry(ENTRY_TYPE etype) | Entry | [protected]
Entry(Entry *parent, ENTRY_TYPE etype) | Entry | [protected]
Entry(const Entry &) | Entry | [protected]
extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
find_entry(const void *) | Entry | [inline, virtual]
free_subentries() | Entry |
get_next_path_component(const void *) const | Entry | [inline, virtual]
get_path(PTSTR path, size_t path_count) const | WinEntry | [protected, virtual]
get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const | Entry | [protected]
GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut) | Entry | [virtual]
launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL) | Entry | [virtual]
read_directory(int scan_flags=SCAN_ALL) | Entry | [inline, virtual]
read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL) | Entry |
smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL) | Entry |
sort_directory(SORT_ORDER sortOrder) | Entry |
WinEntry(Entry *parent) | WinEntry | [inline]
WinEntry() | WinEntry | [inline, protected]
~Entry() | Entry | [virtual]


ROS Explorer: WNDCLASSEX Class Reference

WNDCLASSEX Class Reference

Inheritance diagram for WNDCLASSEX:

[legend]
The documentation for this class was generated from the following file:
  • window.h


ROS Explorer: XMLStorage::XMLBool Struct Reference

XMLStorage::XMLBool

XMLStorage::XMLBool Struct Reference

type converter for boolean data More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLBool:

[legend]
List of all members.

Public Member Functions

XMLBool (bool value=false)
XMLBool (LPCXSSTR value, bool def=false)
XMLBool (const XMLNode *node, const XS_String &attr_name, bool def=false)
operator bool () const
bool | operator! () const
operator LPCXSSTR () const

Protected Attributes

bool | _value

Detailed Description

type converter for boolean data

Definition at line 1260 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLBool::XMLBool ( bool value = false ) [inline]

Definition at line 1262 of file xmlstorage.h.

01263          :      _value(value)
01264         {
01265         }

XMLStorage::XMLBool::XMLBool | ( | LPCXSSTR | value,
 |  | bool | def = false
 | ) | [inline]

Definition at line 1267 of file xmlstorage.h.

References XS_icmp, and XS_TRUE.

01268         {
01269                 if (value && *value)
01270                         _value = !XS_icmp(value, XS_TRUE);
01271                 else
01272                         _value = def;
01273         }

XMLStorage::XMLBool::XMLBool | ( | const XMLNode * | node,
 |  | const XS_String & | attr_name,
 |  | bool | def = false
 | ) | [inline]

Definition at line 1275 of file xmlstorage.h.

References XMLStorage::XMLNode::get(), XS_icmp, and XS_TRUE.

01276         {
01277                 const XS_String& value = node->get(attr_name);
01278
01279                 if (!value.empty())
01280                         _value = !XS_icmp(value.c_str(), XS_TRUE);
01281                 else
01282                         _value = def;
01283         }

Here is the call graph for this function:

Member Function Documentation

XMLStorage::XMLBool::operator bool ( ) const [inline]

Definition at line 1285 of file xmlstorage.h.

01286         {
01287                 return _value;
01288         }

XMLStorage::XMLBool::operator LPCXSSTR ( ) const [inline]

Definition at line 1295 of file xmlstorage.h.

References XS_FALSE, and XS_TRUE.

01296         {
01297                 return _value? XS_TRUE: XS_FALSE;
01298         }

bool XMLStorage::XMLBool::operator! ( ) const [inline]

Definition at line 1290 of file xmlstorage.h.

01291         {
01292                 return !_value;
01293         }

Member Data Documentation

bool XMLStorage::XMLBool::_value [protected]

Definition at line 1301 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLBool Member List

This is the complete list of members for XMLStorage::XMLBool, including all inherited members.

_value | XMLStorage::XMLBool | [protected]
operator bool() const | XMLStorage::XMLBool | [inline]
operator LPCXSSTR() const | XMLStorage::XMLBool | [inline]
operator!() const | XMLStorage::XMLBool | [inline]
XMLBool(bool value=false) | XMLStorage::XMLBool | [inline]
XMLBool(LPCXSSTR value, bool def=false) | XMLStorage::XMLBool | [inline]
XMLBool(const XMLNode *node, const XS_String &attr_name, bool def=false) | XMLStorage::XMLBool | [inline]


ROS Explorer: XMLStorage::XMLBoolRef Struct Reference

XMLStorage::XMLBoolRef

XMLStorage::XMLBoolRef Struct Reference

type converter for boolean data with write access More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLBoolRef:

[legend]
List of all members.

Public Member Functions

XMLBoolRef (XMLNode *node, const XS_String &attr_name, bool def=false)
operator bool () const
bool | operator! () const
XMLBoolRef & | operator= (bool value)
void | assign (bool value)
void | toggle ()

Protected Attributes

XS_String & _ref

Detailed Description

type converter for boolean data with write access

Definition at line 1308 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLBoolRef::XMLBoolRef | ( | XMLNode * | node,
 |  | const XS_String & | attr_name,
 |  | bool | def = false
 | ) | [inline]

Definition at line 1310 of file xmlstorage.h.

01311          :      _ref((*node)[attr_name])
01312         {
01313                 if (_ref.empty())
01314                         assign(def);
01315         }

Member Function Documentation

void XMLStorage::XMLBoolRef::assign ( bool value ) [inline]

Definition at line 1334 of file xmlstorage.h.

References XS_FALSE.

01335         {
01336                 _ref.assign(value? XS_TRUE: XS_FALSE);
01337         }

XMLStorage::XMLBoolRef::operator bool ( ) const [inline]

Definition at line 1317 of file xmlstorage.h.

References XS_icmp, and XS_TRUE.

01318         {
01319                 return !XS_icmp(_ref.c_str(), XS_TRUE);
01320         }

bool XMLStorage::XMLBoolRef::operator! ( ) const [inline]

Definition at line 1322 of file xmlstorage.h.

References XS_icmp, and XS_TRUE.

01323         {
01324                 return XS_icmp(_ref.c_str(), XS_TRUE)? true: false;
01325         }

XMLBoolRef& XMLStorage::XMLBoolRef::operator= ( bool value ) [inline]

Definition at line 1327 of file xmlstorage.h.

01328         {
01329                 assign(value);
01330
01331                 return *this;
01332         }

void XMLStorage::XMLBoolRef::toggle ( ) [inline]

Definition at line 1339 of file xmlstorage.h.

Referenced by TaskbarSettingsDlg::Command().

01340         {
01341                 assign(!operator bool());
01342         }

Member Data Documentation

XS_String& XMLStorage::XMLBoolRef::_ref [protected]

Definition at line 1345 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLBoolRef Member List

This is the complete list of members for XMLStorage::XMLBoolRef, including all inherited members.

_ref | XMLStorage::XMLBoolRef | [protected]
assign(bool value) | XMLStorage::XMLBoolRef | [inline]
operator bool() const | XMLStorage::XMLBoolRef | [inline]
operator!() const | XMLStorage::XMLBoolRef | [inline]
operator=(bool value) | XMLStorage::XMLBoolRef | [inline]
toggle() | XMLStorage::XMLBoolRef | [inline]
XMLBoolRef(XMLNode *node, const XS_String &attr_name, bool def=false) | XMLStorage::XMLBoolRef | [inline]


ROS Explorer: XMLStorage::XMLChildrenFilter Struct Reference

XMLStorage::XMLChildrenFilter

XMLStorage::XMLChildrenFilter Struct Reference

iterator access to children nodes with name filtering More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLChildrenFilter:

[legend]
List of all members.

Public Member Functions

XMLChildrenFilter (XMLNode::Children &children, const XS_String &name)
XMLChildrenFilter (XMLNode *node, const XS_String &name)
iterator begin ()
iterator end ()

Protected Attributes

iterator _begin
iterator _end

Classes

struct iterator
internal iterator class More...

Detailed Description

iterator access to children nodes with name filtering

Definition at line 716 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLChildrenFilter::XMLChildrenFilter | ( | XMLNode::Children & | children,
 |  | const XS_String & | name
 | ) | [inline]

Definition at line 718 of file xmlstorage.h.

00719          :      _begin(children.begin(), children.end(), name),
00720                 _end(children.end(), children.end(), name)
00721         {
00722         }

XMLStorage::XMLChildrenFilter::XMLChildrenFilter | ( | XMLNode * | node,
 |  | const XS_String & | name
 | ) | [inline]

Definition at line 724 of file xmlstorage.h.

00725          :      _begin(node->get_children().begin(), node->get_children().end(), name),
00726                 _end(node->get_children().end(), node->get_children().end(), name)
00727         {
00728         }

Member Function Documentation

iterator XMLStorage::XMLChildrenFilter::begin ( ) [inline]

Definition at line 798 of file xmlstorage.h.

References _begin.

00799         {
00800                 return _begin;
00801         }

iterator XMLStorage::XMLChildrenFilter::end ( ) [inline]

Definition at line 803 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_end.

00804         {
00805                 return _end;
00806         }

Member Data Documentation

iterator XMLStorage::XMLChildrenFilter::_begin [protected]

Definition at line 809 of file xmlstorage.h.

Referenced by XMLStorage::const_XMLChildrenFilter::begin(), and begin().

iterator XMLStorage::XMLChildrenFilter::_end [protected]

Definition at line 810 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLChildrenFilter Member List

This is the complete list of members for XMLStorage::XMLChildrenFilter, including all inherited members.

_begin | XMLStorage::XMLChildrenFilter | [protected]
_end | XMLStorage::XMLChildrenFilter | [protected]
begin() | XMLStorage::XMLChildrenFilter | [inline]
end() | XMLStorage::XMLChildrenFilter | [inline]
XMLChildrenFilter(XMLNode::Children &children, const XS_String &name) | XMLStorage::XMLChildrenFilter | [inline]
XMLChildrenFilter(XMLNode *node, const XS_String &name) | XMLStorage::XMLChildrenFilter | [inline]


ROS Explorer: XMLStorage::XMLChildrenFilter::iterator Struct Reference

XMLStorage::XMLChildrenFilter::iterator

XMLStorage::XMLChildrenFilter::iterator Struct Reference

internal iterator class More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLChildrenFilter::iterator:

[legend]
List of all members.

Public Types

typedef XMLNode::Children::iterator | BaseIterator

Public Member Functions

iterator (BaseIterator begin, BaseIterator end, const XS_String &filter_name)
operator BaseIterator ()
const XMLNode * | operator * () const
XMLNode * operator * ()
iterator & operator++ ()
iterator | operator++ (int)
bool | operator== (const BaseIterator &other) const
bool | operator!= (const BaseIterator &other) const

Protected Member Functions

void | search_next ()

Protected Attributes

BaseIterator _cur
BaseIterator _end
XS_String _filter_name

Detailed Description

internal iterator class

Definition at line 731 of file xmlstorage.h.

Member Typedef Documentation

typedef XMLNode::Children::iterator XMLStorage::XMLChildrenFilter::iterator::BaseIterator

Definition at line 733 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLChildrenFilter::iterator::iterator | ( | BaseIterator | begin,
 |  | BaseIterator | end,
 |  | const XS_String & | filter_name
 | ) | [inline]

Definition at line 735 of file xmlstorage.h.

References search_next().

00736                  :      _cur(begin),
00737                         _end(end),
00738                         _filter_name(filter_name)
00739                 {
00740                         search_next();
00741                 }

Here is the call graph for this function:

Member Function Documentation

XMLNode* XMLStorage::XMLChildrenFilter::iterator::operator * ( ) [inline]

Definition at line 753 of file xmlstorage.h.

References _cur.

00754                 {
00755                         return *_cur;
00756                 }

const XMLNode* XMLStorage::XMLChildrenFilter::iterator::operator * ( ) const [inline]

Definition at line 748 of file xmlstorage.h.

References _cur.

00749                 {
00750                         return *_cur;
00751                 }

XMLStorage::XMLChildrenFilter::iterator::operator BaseIterator ( ) [inline]

Definition at line 743 of file xmlstorage.h.

References _cur.

00744                 {
00745                         return _cur;
00746                 }

bool XMLStorage::XMLChildrenFilter::iterator::operator!= ( const BaseIterator & other ) const [inline]

Definition at line 781 of file xmlstorage.h.

References _cur.

00782                 {
00783                         return _cur != other;
00784                 }

iterator XMLStorage::XMLChildrenFilter::iterator::operator++ ( int ) [inline]

Definition at line 766 of file xmlstorage.h.

References _cur, and search_next().

00767                 {
00768                         iterator ret = *this;
00769
00770                         ++_cur;
00771                         search_next();
00772
00773                         return ret;
00774                 }

Here is the call graph for this function:

iterator& XMLStorage::XMLChildrenFilter::iterator::operator++ ( ) [inline]

Definition at line 758 of file xmlstorage.h.

References _cur, and search_next().

00759                 {
00760                         ++_cur;
00761                         search_next();
00762
00763                         return *this;
00764                 }

Here is the call graph for this function:

bool XMLStorage::XMLChildrenFilter::iterator::operator== ( const BaseIterator & other ) const [inline]

Definition at line 776 of file xmlstorage.h.

References _cur.

00777                 {
00778                         return _cur == other;
00779                 }

void XMLStorage::XMLChildrenFilter::iterator::search_next ( ) [inline, protected]

Definition at line 791 of file xmlstorage.h.

References _cur, _end, and _filter_name.

Referenced by XMLStorage::const_XMLChildrenFilter::const_iterator::const_iterator(), iterator(), XMLStorage::const_XMLChildrenFilter::const_iterator::operator++(), and operator++().

00792                 {
00793                         while(_cur!=_end && **_cur!=_filter_name)
00794                                 ++_cur;
00795                 }

Member Data Documentation

BaseIterator XMLStorage::XMLChildrenFilter::iterator::_cur [protected]

Definition at line 787 of file xmlstorage.h.

Referenced by XMLStorage::XMLPos::add_down(), XMLStorage::const_XMLPos::back(), XMLStorage::XMLPos::back(), XMLStorage::XMLPos::create_relative(), XMLStorage::const_XMLPos::cur(), XMLStorage::XMLPos::cur(), XMLStorage::const_XMLPos::get(), XMLStorage::XMLPos::get(), XMLStorage::const_XMLPos::go_down(), XMLStorage::XMLPos::go_down(), XMLStorage::const_XMLPos::go_to(), XMLStorage::XMLPos::go_to(), XMLStorage::const_XMLPos::operator *(), XMLStorage::XMLPos::operator *(), XMLStorage::const_XMLChildrenFilter::const_iterator::operator *(), operator *(), XMLStorage::const_XMLChildrenFilter::const_iterator::operator BaseIterator(), operator BaseIterator(), XMLStorage::const_XMLPos::operator const XMLNode *(), XMLStorage::XMLPos::operator const XMLNode *(), XMLStorage::XMLPos::operator XMLNode *(), XMLStorage::const_XMLChildrenFilter::const_iterator::operator!=(), operator!=(), XMLStorage::const_XMLChildrenFilter::const_iterator::operator++(), operator++(), XMLStorage::const_XMLPos::operator->(), XMLStorage::XMLPos::operator->(), XMLStorage::const_XMLChildrenFilter::const_iterator::operator==(), operator==(), XMLStorage::XMLPos::operator[](), XMLStorage::XMLPos::put(), XMLStorage::const_XMLChildrenFilter::const_iterator::search_next(), search_next(), XMLStorage::XMLPos::smart_create(), XMLStorage::const_XMLPos::str(), and XMLStorage::XMLPos::str().

BaseIterator XMLStorage::XMLChildrenFilter::iterator::_end [protected]

Definition at line 788 of file xmlstorage.h.

Referenced by XMLStorage::const_XMLChildrenFilter::end(), XMLStorage::XMLChildrenFilter::end(), XMLStorage::const_XMLChildrenFilter::const_iterator::search_next(), and search_next().

XS_String XMLStorage::XMLChildrenFilter::iterator::_filter_name [protected]

Definition at line 789 of file xmlstorage.h.

Referenced by XMLStorage::const_XMLChildrenFilter::const_iterator::search_next(), and search_next().

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLChildrenFilter::iterator Member List

This is the complete list of members for XMLStorage::XMLChildrenFilter::iterator, including all inherited members.

_cur | XMLStorage::XMLChildrenFilter::iterator | [protected]
_end | XMLStorage::XMLChildrenFilter::iterator | [protected]
_filter_name | XMLStorage::XMLChildrenFilter::iterator | [protected]
BaseIterator typedef | XMLStorage::XMLChildrenFilter::iterator |
iterator(BaseIterator begin, BaseIterator end, const XS_String &filter_name) | XMLStorage::XMLChildrenFilter::iterator | [inline]
operator *() const | XMLStorage::XMLChildrenFilter::iterator | [inline]
operator *() | XMLStorage::XMLChildrenFilter::iterator | [inline]
operator BaseIterator() | XMLStorage::XMLChildrenFilter::iterator | [inline]
operator!=(const BaseIterator &other) const | XMLStorage::XMLChildrenFilter::iterator | [inline]
operator++() | XMLStorage::XMLChildrenFilter::iterator | [inline]
operator++(int) | XMLStorage::XMLChildrenFilter::iterator | [inline]
operator==(const BaseIterator &other) const | XMLStorage::XMLChildrenFilter::iterator | [inline]
search_next() | XMLStorage::XMLChildrenFilter::iterator | [inline, protected]


ROS Explorer: XMLStorage::XMLDoc Struct Reference

XMLStorage::XMLDoc

XMLStorage::XMLDoc Struct Reference

XML document holder. More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::XMLDoc:

[legend]
Collaboration diagram for XMLStorage::XMLDoc:

[legend]
List of all members.

Public Member Functions

XMLDoc ()
XMLDoc (LPCTSTR path)
std::istream & | read (std::istream &in)
bool | read (LPCTSTR path)
bool | read (XMLReaderBase &reader)
bool | read (XMLReaderBase &reader, const std::string &display_path)
std::ostream & | write (std::ostream &out, WRITE_MODE mode=FORMAT_SMART) const
write XML stream preserving previous white space and comments
std::ostream & | write_formating (std::ostream &out) const
write XML stream with formating
void | write (LPCTSTR path, WRITE_MODE mode=FORMAT_SMART) const
void | write_formating (LPCTSTR path) const

Public Attributes

XMLHeader _header
XML_Error | _last_error
std::string | _last_error_msg

Detailed Description

XML document holder.

Definition at line 1647 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLDoc::XMLDoc ( ) [inline]

Definition at line 1649 of file xmlstorage.h.

01650          :      XMLNode(""),
01651                 _last_error(XML_ERROR_NONE)
01652         {
01653         }

XMLStorage::XMLDoc::XMLDoc ( LPCTSTR path ) [inline]

Definition at line 1655 of file xmlstorage.h.

01656          :      XMLNode(""),
01657                 _last_error(XML_ERROR_NONE)
01658         {
01659                 read(path);
01660         }

Member Function Documentation

bool XMLStorage::XMLDoc::read | ( | XMLReaderBase & | reader,
 |  | const std::string & | display_path
 | ) | [inline]

Definition at line 1701 of file xmlstorage.h.

References XMLStorage::XMLReaderBase::get_error_code(), XMLStorage::XMLReaderBase::get_error_string(), XMLStorage::XMLReaderBase::get_instructions(), XMLStorage::XMLReaderBase::get_position(), and XMLStorage::XMLReaderBase::read().

01702         {
01703                 XML_Status status = reader.read();
01704
01705                 _header._additional = reader.get_instructions();
01706
01707                 if (status == XML_STATUS_ERROR) {
01708                         std::ostringstream out;
01709
01710                         out << display_path << reader.get_position() << " " << reader.get_error_string();
01711
01712                         _last_error = reader.get_error_code();
01713                         _last_error_msg = out.str();
01714                 }
01715
01716                 return status != XML_STATUS_ERROR;
01717         }

Here is the call graph for this function:

bool XMLStorage::XMLDoc::read ( XMLReaderBase & reader ) [inline]

Definition at line 1683 of file xmlstorage.h.

References XMLStorage::XMLReaderBase::get_error_code(), XMLStorage::XMLReaderBase::get_error_string(), XMLStorage::XMLReaderBase::get_instructions(), XMLStorage::XMLReaderBase::get_position(), and XMLStorage::XMLReaderBase::read().

01684         {
01685                 XML_Status status = reader.read();
01686
01687                 _header._additional = reader.get_instructions();
01688
01689                 if (status == XML_STATUS_ERROR) {
01690                         std::ostringstream out;
01691
01692                         out << "input stream" << reader.get_position() << " " << reader.get_error_string();
01693
01694                         _last_error = reader.get_error_code();
01695                         _last_error_msg = out.str();
01696                 }
01697
01698                 return status != XML_STATUS_ERROR;
01699         }

Here is the call graph for this function:

bool XMLStorage::XMLDoc::read ( LPCTSTR path ) [inline]

Definition at line 1671 of file xmlstorage.h.

01672         {
01673                 tifstream in(path);
01674                 XMLReader reader(this, in);
01675
01676 //#if defined(_STRING_DEFINED) && !defined(XS_STRING_UTF8)
01677 //              return read(reader, std::string(ANS(path)));
01678 //#else
01679                 return read(reader, XS_String(path));
01680 //#endif
01681         }

std::istream& XMLStorage::XMLDoc::read ( std::istream & in ) [inline]

Definition at line 1662 of file xmlstorage.h.

Referenced by Favorites::read(), and ExplorerGlobals::read_persistent().

01663         {
01664                 XMLReader reader(this, in);
01665
01666                 read(reader);
01667
01668                 return in;
01669         }

void XMLStorage::XMLDoc::write | ( | LPCTSTR | path,
 |  | WRITE_MODE | mode = FORMAT_SMART
 | ) | const [inline]

Definition at line 1736 of file xmlstorage.h.

01737         {
01738                 tofstream out(path);
01739
01740                 write(out, mode);
01741         }

std::ostream& XMLStorage::XMLDoc::write | ( | std::ostream & | out,
 |  | WRITE_MODE | mode = FORMAT_SMART
 | ) | const [inline]

write XML stream preserving previous white space and comments

Definition at line 1720 of file xmlstorage.h.

Referenced by Favorites::write(), and ExplorerGlobals::write_persistent().

01721         {
01722                 _header.print(out);
01723
01724                 if (!_children.empty())
01725                         _children.front()->write(out);
01726
01727                 return out;
01728         }

void XMLStorage::XMLDoc::write_formating ( LPCTSTR path ) const [inline]

Definition at line 1743 of file xmlstorage.h.

01744         {
01745                 tofstream out(path);
01746
01747                 write_formating(out);
01748         }

std::ostream& XMLStorage::XMLDoc::write_formating ( std::ostream & out ) const [inline]

write XML stream with formating

Definition at line 1731 of file xmlstorage.h.

01732         {
01733                 return write(out, FORMAT_PRETTY);
01734         }

Member Data Documentation

XMLHeader XMLStorage::XMLDoc::_header

Definition at line 1750 of file xmlstorage.h.

Referenced by Favorites::write().

XML_Error XMLStorage::XMLDoc::_last_error

Definition at line 1751 of file xmlstorage.h.

Referenced by Favorites::read(), and ExplorerGlobals::read_persistent().

std::string XMLStorage::XMLDoc::_last_error_msg

Definition at line 1752 of file xmlstorage.h.

Referenced by Favorites::read(), and ExplorerGlobals::read_persistent().

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLDoc Member List

This is the complete list of members for XMLStorage::XMLDoc, including all inherited members.

_attributes | XMLStorage::XMLNode | [protected]
_children | XMLStorage::XMLNode | [protected]
_content | XMLStorage::XMLNode | [protected]
_end_leading | XMLStorage::XMLNode | [protected]
_header | XMLStorage::XMLDoc |
_last_error | XMLStorage::XMLDoc |
_last_error_msg | XMLStorage::XMLDoc |
_leading | XMLStorage::XMLNode | [protected]
_trailing | XMLStorage::XMLNode | [protected]
add_child(XMLNode *child) | XMLStorage::XMLNode | [inline]
appendf(LPCXSSTR fmt,...) | XMLStorage::XS_String | [inline]
assign(LPCWSTR s) | XMLStorage::XS_String | [inline]
assign(LPCWSTR s, size_t l) | XMLStorage::XS_String | [inline]
assign(LPCXSSTR s) | XMLStorage::XS_String | [inline]
assign(LPCXSSTR s, size_t l) | XMLStorage::XS_String | [inline]
AttributeMap typedef | XMLStorage::XMLNode |
clear() | XMLStorage::XMLNode | [inline]
const_XMLPos | XMLStorage::XMLNode | [friend]
create_relative(const char *path) | XMLStorage::XMLNode | [protected]
find(const XS_String &name, int n=0) const | XMLStorage::XMLNode | [inline, protected]
find(const XS_String &name, const XS_String &attr_name, const XS_String &attr_value, int n=0) const | XMLStorage::XMLNode | [inline, protected]
find_relative(const char *path) const | XMLStorage::XMLNode | [protected]
find_relative(const char *path) | XMLStorage::XMLNode | [inline, protected]
FORMAT_ORIGINAL enum value | XMLStorage::XMLNode |
FORMAT_PRETTY enum value | XMLStorage::XMLNode |
FORMAT_SMART enum value | XMLStorage::XMLNode |
get(const T &attr_name) const | XMLStorage::XMLNode | [inline]
get_children() const | XMLStorage::XMLNode | [inline]
get_children() | XMLStorage::XMLNode | [inline]
get_content() const | XMLStorage::XMLNode | [inline]
get_first_child() const | XMLStorage::XMLNode | [inline, protected]
operator LPCXSSTR() const | XMLStorage::XS_String | [inline]
operator std::wstring() const | XMLStorage::XS_String | [inline]
operator=(const XMLNode &other) | XMLStorage::XMLNode | [inline]
XMLStorage::XS_String::operator=(LPCWSTR s) | XMLStorage::XS_String | [inline]
XMLStorage::XS_String::operator=(LPCXSSTR s) | XMLStorage::XS_String | [inline]
XMLStorage::XS_String::operator=(const super &s) | XMLStorage::XS_String | [inline]
operator[](const XS_String &attr_name) | XMLStorage::XMLNode | [inline]
pretty_write_worker(std::ostream &out, int indent) const | XMLStorage::XMLNode | [protected]
printf(LPCXSSTR fmt,...) | XMLStorage::XS_String | [inline]
put(const XS_String &attr_name, const XS_String &value) | XMLStorage::XMLNode | [inline]
read(std::istream &in) | XMLStorage::XMLDoc | [inline]
read(LPCTSTR path) | XMLStorage::XMLDoc | [inline]
read(XMLReaderBase &reader) | XMLStorage::XMLDoc | [inline]
read(XMLReaderBase &reader, const std::string &display_path) | XMLStorage::XMLDoc | [inline]
set_content(const XS_String &s) | XMLStorage::XMLNode | [inline]
smart_write_worker(std::ostream &out, int indent) const | XMLStorage::XMLNode | [protected]
subvalue(const XS_String &name, const XS_String &attr_name, int n=0) const | XMLStorage::XMLNode | [inline]
subvalue(const XS_String &name, const XS_String &attr_name, int n=0) | XMLStorage::XMLNode | [inline]
super typedef | XMLStorage::XS_String |
vappendf(LPCXSSTR fmt, va_list l) | XMLStorage::XS_String | [inline]
vprintf(LPCXSSTR fmt, va_list l) | XMLStorage::XS_String | [inline]
write(std::ostream &out, WRITE_MODE mode=FORMAT_SMART) const | XMLStorage::XMLDoc | [inline]
write(LPCTSTR path, WRITE_MODE mode=FORMAT_SMART) const | XMLStorage::XMLDoc | [inline]
XMLStorage::XMLNode::write(std::ostream &out, WRITE_MODE mode=FORMAT_SMART, int indent=0) const | XMLStorage::XMLNode | [inline]
write_formating(std::ostream &out) const | XMLStorage::XMLDoc | [inline]
write_formating(LPCTSTR path) const | XMLStorage::XMLDoc | [inline]
WRITE_MODE enum name | XMLStorage::XMLNode |
write_worker(std::ostream &out, int indent) const | XMLStorage::XMLNode | [protected]
XMLDoc() | XMLStorage::XMLDoc | [inline]
XMLDoc(LPCTSTR path) | XMLStorage::XMLDoc | [inline]
XMLNode(const XS_String &name) | XMLStorage::XMLNode | [inline]
XMLNode(const XS_String &name, const std::string &leading) | XMLStorage::XMLNode | [inline]
XMLNode(const XMLNode &other) | XMLStorage::XMLNode | [inline]
XMLPos | XMLStorage::XMLNode | [friend]
XMLReaderBase | XMLStorage::XMLNode | [friend]
XS_String() | XMLStorage::XS_String | [inline]
XS_String(LPCXSSTR s) | XMLStorage::XS_String | [inline]
XS_String(LPCXSSTR s, size_t l) | XMLStorage::XS_String | [inline]
XS_String(const super &other) | XMLStorage::XS_String | [inline]
XS_String(const XS_String &other) | XMLStorage::XS_String | [inline]
XS_String(LPCWSTR s) | XMLStorage::XS_String | [inline]
XS_String(LPCWSTR s, size_t l) | XMLStorage::XS_String | [inline]
XS_String(const std::wstring &other) | XMLStorage::XS_String | [inline]
~XMLNode() | XMLStorage::XMLNode | [inline]


ROS Explorer: XMLStorage::XMLHeader Struct Reference

XMLStorage::XMLHeader

XMLStorage::XMLHeader Struct Reference

management of XML file headers More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLHeader:

[legend]
List of all members.

Public Member Functions

XMLHeader (const std::string &xml_version="1.0", const std::string &encoding="UTF-8", const std::string &doctype="")
void | print (std::ostream &out, bool pretty=true) const

Public Attributes

std::string | _version
std::string | _encoding
std::string | _doctype
std::string | _additional

Detailed Description

management of XML file headers

Definition at line 1616 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLHeader::XMLHeader | ( | const std::string & | xml_version = "1.0",
 |  | const std::string & | encoding = "UTF-8",
 |  | const std::string & | doctype = ""
 | ) | [inline]

Definition at line 1618 of file xmlstorage.h.

01619          :      _version(xml_version),
01620                 _encoding(encoding),
01621                 _doctype(doctype)
01622         {
01623         }

Member Function Documentation

void XMLStorage::XMLHeader::print | ( | std::ostream & | out,
 |  | bool | pretty = true
 | ) | const [inline]

Definition at line 1625 of file xmlstorage.h.

01626         {
01627                 out << "<?xml version=\"" << _version << "\" encoding=\"" << _encoding << "\"?>";
01628
01629                 if (pretty)
01630                         out << std::endl;
01631
01632                 if (!_doctype.empty())
01633                         out << _doctype << '\n';
01634
01635                 if (!_additional.empty())
01636                         out << _additional << '\n';
01637         }

Member Data Documentation

std::string XMLStorage::XMLHeader::_additional

Definition at line 1642 of file xmlstorage.h.

std::string XMLStorage::XMLHeader::_doctype

Definition at line 1641 of file xmlstorage.h.

Referenced by Favorites::write().

std::string XMLStorage::XMLHeader::_encoding

Definition at line 1640 of file xmlstorage.h.

std::string XMLStorage::XMLHeader::_version

Definition at line 1639 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLHeader Member List

This is the complete list of members for XMLStorage::XMLHeader, including all inherited members.

_additional | XMLStorage::XMLHeader |
_doctype | XMLStorage::XMLHeader |
_encoding | XMLStorage::XMLHeader |
_version | XMLStorage::XMLHeader |
print(std::ostream &out, bool pretty=true) const | XMLStorage::XMLHeader | [inline]
XMLHeader(const std::string &xml_version="1.0", const std::string &encoding="UTF-8", const std::string &doctype="") | XMLStorage::XMLHeader | [inline]


ROS Explorer: XMLStorage::XMLInt Struct Reference

XMLStorage::XMLInt

XMLStorage::XMLInt Struct Reference

type converter for integer data More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLInt:

[legend]
List of all members.

Public Member Functions

XMLInt (int value)
XMLInt (LPCXSSTR value, int def=0)
XMLInt (const XMLNode *node, const XS_String &attr_name, int def=0)
operator int () const
operator XS_String () const

Protected Attributes

int _value

Detailed Description

type converter for integer data

Definition at line 1350 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLInt::XMLInt ( int value ) [inline]

Definition at line 1352 of file xmlstorage.h.

01353          :      _value(value)
01354         {
01355         }

XMLStorage::XMLInt::XMLInt | ( | LPCXSSTR | value,
 |  | int | def = 0
 | ) | [inline]

Definition at line 1357 of file xmlstorage.h.

References XS_toi.

01358         {
01359                 if (value && *value)
01360                         _value = XS_toi(value);
01361                 else
01362                         _value = def;
01363         }

XMLStorage::XMLInt::XMLInt | ( | const XMLNode * | node,
 |  | const XS_String & | attr_name,
 |  | int | def = 0
 | ) | [inline]

Definition at line 1365 of file xmlstorage.h.

References XMLStorage::XMLNode::get(), and XS_toi.

01366         {
01367                 const XS_String& value = node->get(attr_name);
01368
01369                 if (!value.empty())
01370                         _value = XS_toi(value.c_str());
01371                 else
01372                         _value = def;
01373         }

Here is the call graph for this function:

Member Function Documentation

XMLStorage::XMLInt::operator int ( ) const [inline]

Definition at line 1375 of file xmlstorage.h.

01376         {
01377                 return _value;
01378         }

XMLStorage::XMLInt::operator XS_String ( ) const [inline]

Definition at line 1380 of file xmlstorage.h.

References COUNTOF, XS_CHAR, XS_NUMBERFMT, and XS_snprintf.

01381         {
01382                 XS_CHAR buffer[32];
01383                 XS_snprintf(buffer, COUNTOF(buffer), XS_NUMBERFMT, _value);
01384                 return buffer;
01385         }

Member Data Documentation

int XMLStorage::XMLInt::_value [protected]

Definition at line 1388 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLInt Member List

This is the complete list of members for XMLStorage::XMLInt, including all inherited members.

_value | XMLStorage::XMLInt | [protected]
operator int() const | XMLStorage::XMLInt | [inline]
operator XS_String() const | XMLStorage::XMLInt | [inline]
XMLInt(int value) | XMLStorage::XMLInt | [inline]
XMLInt(LPCXSSTR value, int def=0) | XMLStorage::XMLInt | [inline]
XMLInt(const XMLNode *node, const XS_String &attr_name, int def=0) | XMLStorage::XMLInt | [inline]


ROS Explorer: XMLStorage::XMLIntRef Struct Reference

XMLStorage::XMLIntRef

XMLStorage::XMLIntRef Struct Reference

type converter for integer data with write access More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLIntRef:

[legend]
List of all members.

Public Member Functions

XMLIntRef (XMLNode *node, const XS_String &attr_name, int def=0)
XMLIntRef & | operator= (int value)
operator int () const
void | assign (int value)

Protected Attributes

XS_String & _ref

Detailed Description

type converter for integer data with write access

Definition at line 1395 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLIntRef::XMLIntRef | ( | XMLNode * | node,
 |  | const XS_String & | attr_name,
 |  | int | def = 0
 | ) | [inline]

Definition at line 1397 of file xmlstorage.h.

01398          :      _ref((*node)[attr_name])
01399         {
01400                 if (_ref.empty())
01401                         assign(def);
01402         }

Member Function Documentation

void XMLStorage::XMLIntRef::assign ( int value ) [inline]

Definition at line 1416 of file xmlstorage.h.

References COUNTOF, XS_CHAR, XS_NUMBERFMT, and XS_snprintf.

01417         {
01418                 XS_CHAR buffer[32];
01419                 XS_snprintf(buffer, COUNTOF(buffer), XS_NUMBERFMT, value);
01420                 _ref.assign(buffer);
01421         }

XMLStorage::XMLIntRef::operator int ( ) const [inline]

Definition at line 1411 of file xmlstorage.h.

References XS_toi.

01412         {
01413                 return XS_toi(_ref.c_str());
01414         }

XMLIntRef& XMLStorage::XMLIntRef::operator= ( int value ) [inline]

Definition at line 1404 of file xmlstorage.h.

01405         {
01406                 assign(value);
01407
01408                 return *this;
01409         }

Member Data Documentation

XS_String& XMLStorage::XMLIntRef::_ref [protected]

Definition at line 1424 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLIntRef Member List

This is the complete list of members for XMLStorage::XMLIntRef, including all inherited members.

_ref | XMLStorage::XMLIntRef | [protected]
assign(int value) | XMLStorage::XMLIntRef | [inline]
operator int() const | XMLStorage::XMLIntRef | [inline]
operator=(int value) | XMLStorage::XMLIntRef | [inline]
XMLIntRef(XMLNode *node, const XS_String &attr_name, int def=0) | XMLStorage::XMLIntRef | [inline]


ROS Explorer: XMLStorage::XMLMessage Struct Reference

XMLStorage::XMLMessage

XMLStorage::XMLMessage Struct Reference

XML message wrapper. More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::XMLMessage:

[legend]
Collaboration diagram for XMLStorage::XMLMessage:

[legend]
List of all members.

Public Member Functions

XMLMessage (const char *name)

Public Attributes

XMLPos _pos

Detailed Description

XML message wrapper.

Definition at line 1757 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLMessage::XMLMessage ( const char * name ) [inline]

Definition at line 1759 of file xmlstorage.h.

01760          :      _pos(this)
01761         {
01762                 _pos.create(name);
01763         }

Member Data Documentation

XMLPos XMLStorage::XMLMessage::_pos

Definition at line 1765 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLMessage Member List

This is the complete list of members for XMLStorage::XMLMessage, including all inherited members.

_attributes | XMLStorage::XMLNode | [protected]
_children | XMLStorage::XMLNode | [protected]
_content | XMLStorage::XMLNode | [protected]
_end_leading | XMLStorage::XMLNode | [protected]
_header | XMLStorage::XMLDoc |
_last_error | XMLStorage::XMLDoc |
_last_error_msg | XMLStorage::XMLDoc |
_leading | XMLStorage::XMLNode | [protected]
_pos | XMLStorage::XMLMessage |
_trailing | XMLStorage::XMLNode | [protected]
add_child(XMLNode *child) | XMLStorage::XMLNode | [inline]
appendf(LPCXSSTR fmt,...) | XMLStorage::XS_String | [inline]
assign(LPCWSTR s) | XMLStorage::XS_String | [inline]
assign(LPCWSTR s, size_t l) | XMLStorage::XS_String | [inline]
assign(LPCXSSTR s) | XMLStorage::XS_String | [inline]
assign(LPCXSSTR s, size_t l) | XMLStorage::XS_String | [inline]
AttributeMap typedef | XMLStorage::XMLNode |
clear() | XMLStorage::XMLNode | [inline]
const_XMLPos | XMLStorage::XMLNode | [friend]
create_relative(const char *path) | XMLStorage::XMLNode | [protected]
find(const XS_String &name, int n=0) const | XMLStorage::XMLNode | [inline, protected]
find(const XS_String &name, const XS_String &attr_name, const XS_String &attr_value, int n=0) const | XMLStorage::XMLNode | [inline, protected]
find_relative(const char *path) const | XMLStorage::XMLNode | [protected]
find_relative(const char *path) | XMLStorage::XMLNode | [inline, protected]
FORMAT_ORIGINAL enum value | XMLStorage::XMLNode |
FORMAT_PRETTY enum value | XMLStorage::XMLNode |
FORMAT_SMART enum value | XMLStorage::XMLNode |
get(const T &attr_name) const | XMLStorage::XMLNode | [inline]
get_children() const | XMLStorage::XMLNode | [inline]
get_children() | XMLStorage::XMLNode | [inline]
get_content() const | XMLStorage::XMLNode | [inline]
get_first_child() const | XMLStorage::XMLNode | [inline, protected]
operator LPCXSSTR() const | XMLStorage::XS_String | [inline]
operator std::wstring() const | XMLStorage::XS_String | [inline]
operator=(const XMLNode &other) | XMLStorage::XMLNode | [inline]
XMLStorage::XS_String::operator=(LPCWSTR s) | XMLStorage::XS_String | [inline]
XMLStorage::XS_String::operator=(LPCXSSTR s) | XMLStorage::XS_String | [inline]
XMLStorage::XS_String::operator=(const super &s) | XMLStorage::XS_String | [inline]
operator[](const XS_String &attr_name) | XMLStorage::XMLNode | [inline]
pretty_write_worker(std::ostream &out, int indent) const | XMLStorage::XMLNode | [protected]
printf(LPCXSSTR fmt,...) | XMLStorage::XS_String | [inline]
put(const XS_String &attr_name, const XS_String &value) | XMLStorage::XMLNode | [inline]
read(std::istream &in) | XMLStorage::XMLDoc | [inline]
read(LPCTSTR path) | XMLStorage::XMLDoc | [inline]
read(XMLReaderBase &reader) | XMLStorage::XMLDoc | [inline]
read(XMLReaderBase &reader, const std::string &display_path) | XMLStorage::XMLDoc | [inline]
set_content(const XS_String &s) | XMLStorage::XMLNode | [inline]
smart_write_worker(std::ostream &out, int indent) const | XMLStorage::XMLNode | [protected]
subvalue(const XS_String &name, const XS_String &attr_name, int n=0) const | XMLStorage::XMLNode | [inline]
subvalue(const XS_String &name, const XS_String &attr_name, int n=0) | XMLStorage::XMLNode | [inline]
super typedef | XMLStorage::XS_String |
vappendf(LPCXSSTR fmt, va_list l) | XMLStorage::XS_String | [inline]
vprintf(LPCXSSTR fmt, va_list l) | XMLStorage::XS_String | [inline]
write(std::ostream &out, WRITE_MODE mode=FORMAT_SMART) const | XMLStorage::XMLDoc | [inline]
write(LPCTSTR path, WRITE_MODE mode=FORMAT_SMART) const | XMLStorage::XMLDoc | [inline]
XMLStorage::XMLNode::write(std::ostream &out, WRITE_MODE mode=FORMAT_SMART, int indent=0) const | XMLStorage::XMLNode | [inline]
write_formating(std::ostream &out) const | XMLStorage::XMLDoc | [inline]
write_formating(LPCTSTR path) const | XMLStorage::XMLDoc | [inline]
WRITE_MODE enum name | XMLStorage::XMLNode |
write_worker(std::ostream &out, int indent) const | XMLStorage::XMLNode | [protected]
XMLDoc() | XMLStorage::XMLDoc | [inline]
XMLDoc(LPCTSTR path) | XMLStorage::XMLDoc | [inline]
XMLMessage(const char *name) | XMLStorage::XMLMessage | [inline]
XMLNode(const XS_String &name) | XMLStorage::XMLNode | [inline]
XMLNode(const XS_String &name, const std::string &leading) | XMLStorage::XMLNode | [inline]
XMLNode(const XMLNode &other) | XMLStorage::XMLNode | [inline]
XMLPos | XMLStorage::XMLNode | [friend]
XMLReaderBase | XMLStorage::XMLNode | [friend]
XS_String() | XMLStorage::XS_String | [inline]
XS_String(LPCXSSTR s) | XMLStorage::XS_String | [inline]
XS_String(LPCXSSTR s, size_t l) | XMLStorage::XS_String | [inline]
XS_String(const super &other) | XMLStorage::XS_String | [inline]
XS_String(const XS_String &other) | XMLStorage::XS_String | [inline]
XS_String(LPCWSTR s) | XMLStorage::XS_String | [inline]
XS_String(LPCWSTR s, size_t l) | XMLStorage::XS_String | [inline]
XS_String(const std::wstring &other) | XMLStorage::XS_String | [inline]
~XMLNode() | XMLStorage::XMLNode | [inline]


ROS Explorer: XMLStorage::XMLNode Struct Reference

XMLStorage::XMLNode

XMLStorage::XMLNode Struct Reference

in memory representation of an XML node More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::XMLNode:

[legend]
Collaboration diagram for XMLStorage::XMLNode:

[legend]
List of all members.

Public Types

typedef std::map< XS_String,
XS_String > 		AttributeMap
enum | WRITE_MODE { FORMAT_SMART = 0, FORMAT_ORIGINAL = 1, FORMAT_PRETTY = 2 }

Public Member Functions

XMLNode (const XS_String &name)
XMLNode (const XS_String &name, const std::string &leading)
XMLNode (const XMLNode &other)
~XMLNode ()
void | clear ()
XMLNode & | operator= (const XMLNode &other)
void | add_child (XMLNode *child)
add a new child node
void | put (const XS_String &attr_name, const XS_String &value)
write access to an attribute
XS_String & | operator[] (const XS_String &attr_name)
C++ write access to an attribute.
template<typename T>
XS_String | get (const T &attr_name) const
read only access to an attribute
XS_String | subvalue (const XS_String &name, const XS_String &attr_name, int n=0) const
convenient value access in children node
XS_String & | subvalue (const XS_String &name, const XS_String &attr_name, int n=0)
convenient storage of distinct values in children node
const Children & | get_children () const
Children & get_children ()
XS_String | get_content () const
void | set_content (const XS_String &s)
std::ostream & | write (std::ostream &out, WRITE_MODE mode=FORMAT_SMART, int indent=0) const
write node with children tree to output stream

Protected Member Functions

XMLNode * | get_first_child () const
XMLNode * | find (const XS_String &name, int n=0) const
XMLNode * | find (const XS_String &name, const XS_String &attr_name, const XS_String &attr_value, int n=0) const
const XMLNode * | find_relative (const char *path) const
XPath find function (const).
XMLNode * | find_relative (const char *path)
XPath find function.
XMLNode * | create_relative (const char *path)
relative XPath create function
void | write_worker (std::ostream &out, int indent) const
write node with children tree to output stream using original white space
void | pretty_write_worker (std::ostream &out, int indent) const
pretty print node with children tree to output stream
void | smart_write_worker (std::ostream &out, int indent) const
write node with children tree to output stream using smart formating

Protected Attributes

Children _children
AttributeMap _attributes
std::string | _leading
std::string | _content
std::string | _end_leading
std::string | _trailing

Friends

struct | XMLPos
struct | const_XMLPos
struct | XMLReaderBase

Classes

struct | Children
internal children node list More...

Detailed Description

in memory representation of an XML node

Definition at line 386 of file xmlstorage.h.

Member Typedef Documentation

typedef std::map<XS_String, XS_String> XMLStorage::XMLNode::AttributeMap

Definition at line 414 of file xmlstorage.h.

Member Enumeration Documentation

enum XMLStorage::XMLNode::WRITE_MODE

Enumerator:
FORMAT_SMART
FORMAT_ORIGINAL | preserve original white space and comments if present; pretty print otherwise
FORMAT_PRETTY | write XML stream preserving original white space and comments

Definition at line 608 of file xmlstorage.h.

00608                         {
00609                 FORMAT_SMART    = 0,
00610                 FORMAT_ORIGINAL = 1,
00611                 FORMAT_PRETTY   = 2
00612         };

Constructor & Destructor Documentation

XMLStorage::XMLNode::XMLNode ( const XS_String & name ) [inline]

Definition at line 445 of file xmlstorage.h.

Referenced by XMLStorage::XMLNode::Children::assign(), and create_relative().

00446          :      XS_String(name)
00447         {
00448         }

XMLStorage::XMLNode::XMLNode | ( | const XS_String & | name,
 |  | const std::string & | leading
 | ) | [inline]

Definition at line 450 of file xmlstorage.h.

00451          :      XS_String(name),
00452                 _leading(leading)
00453         {
00454         }

XMLStorage::XMLNode::XMLNode ( const XMLNode & other ) [inline]

Definition at line 456 of file xmlstorage.h.

References _children.

00457          :      _attributes(other._attributes),
00458                 _leading(other._leading),
00459                 _content(other._content),
00460                 _end_leading(other._end_leading),
00461                 _trailing(other._trailing)
00462         {
00463                 for(Children::const_iterator it=other._children.begin(); it!=other._children.end(); ++it)
00464                         _children.push_back(new XMLNode(**it));
00465         }

XMLStorage::XMLNode::~XMLNode ( ) [inline]

Definition at line 467 of file xmlstorage.h.

00468         {
00469                 while(!_children.empty()) {
00470                         delete _children.back();
00471                         _children.pop_back();
00472                 }
00473         }

Member Function Documentation

void XMLStorage::XMLNode::add_child ( XMLNode * child ) [inline]

add a new child node

Definition at line 503 of file xmlstorage.h.

Referenced by create_relative().

00504         {
00505                 _children.push_back(child);
00506         }

void XMLStorage::XMLNode::clear ( ) [inline]

Definition at line 475 of file xmlstorage.h.

00476         {
00477                 _leading.erase();
00478                 _content.erase();
00479                 _end_leading.erase();
00480                 _trailing.erase();
00481
00482                 _attributes.clear();
00483                 _children.clear();
00484
00485                 XS_String::erase();
00486         }

XMLNode * XMLStorage::XMLNode::create_relative ( const char * path ) [protected]

relative XPath create function

Definition at line 197 of file xmlstorage.cpp.

References add_child(), find(), and XMLNode().

00198 {
00199         XMLNode* node = this;
00200
00201          // parse relative path
00202         while(*path) {
00203                 const char* slash = strchr(path, '/');
00204                 if (slash == path)
00205                         return NULL;
00206
00207                 int l = slash? slash-path: strlen(path);
00208                 std::string comp(path, l);
00209                 path += l;
00210
00211                  // look for [n] and [@attr_name="attr_value"] expressions in path components
00212                 const char* bracket = strchr(comp.c_str(), '[');
00213                 l = bracket? bracket-comp.c_str(): comp.length();
00214                 std::string child_name(comp.c_str(), l);
00215                 std::string attr_name, attr_value;
00216
00217                 int n = 0;
00218                 if (bracket) {
00219                         std::string expr = unescape(bracket, '[', ']');
00220                         const char* p = expr.c_str();
00221
00222                         n = atoi(p);    // read index number
00223
00224                         if (n)
00225                                 n = n - 1;      // convert into zero based index
00226
00227                         const char* at = strchr(p, '@');
00228
00229                         if (at) {
00230                                 p = at + 1;
00231                                 const char* equal = strchr(p, '=');
00232
00233                                  // read attribute name and value
00234                                 if (equal) {
00235                                         attr_name = unescape(p, equal-p);
00236                                         attr_value = unescape(equal+1);
00237                                 }
00238                         }
00239                 }
00240
00241                 XMLNode* child;
00242
00243                 if (attr_name.empty())
00244                          // search n.th child node with specified name
00245                         child = node->find(child_name, n);
00246                 else
00247                          // search n.th child node with specified name and matching attribute value
00248                         child = node->find(child_name, attr_name, attr_value, n);
00249
00250                 if (!child) {
00251                         child = new XMLNode(child_name);
00252                         node->add_child(child);
00253
00254                         if (!attr_name.empty())
00255                                 (*node)[attr_name] = attr_value;
00256                 }
00257
00258                 node = child;
00259
00260                 if (*path == '/')
00261                         ++path;
00262         }
00263
00264         return node;
00265 }

Here is the call graph for this function:

XMLNode* XMLStorage::XMLNode::find | ( | const XS_String & | name,
 |  | const XS_String & | attr_name,
 |  | const XS_String & | attr_value,
 |  | int | n = 0
 | ) | const [inline, protected]

Definition at line 660 of file xmlstorage.h.

00661         {
00662                 for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it) {
00663                         const XMLNode& node = **it;
00664
00665                         if (node==name && node.get(attr_name)==attr_value)
00666                                 if (!n--)
00667                                         return *it;
00668                 }
00669
00670                 return NULL;
00671         }

XMLNode* XMLStorage::XMLNode::find | ( | const XS_String & | name,
 |  | int | n = 0
 | ) | const [inline, protected]

Definition at line 650 of file xmlstorage.h.

Referenced by create_relative(), and find_relative().

00651         {
00652                 for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it)
00653                         if (**it == name)
00654                                 if (!n--)
00655                                         return *it;
00656
00657                 return NULL;
00658         }

XMLNode* XMLStorage::XMLNode::find_relative ( const char * path ) [inline, protected]

XPath find function.

Definition at line 703 of file xmlstorage.h.

00704                 {return const_cast<XMLNode*>(const_cast<const XMLNode*>(this)->find_relative(path));}

const XMLNode * XMLStorage::XMLNode::find_relative ( const char * path ) const [protected]

XPath find function (const).

Definition at line 136 of file xmlstorage.cpp.

References find().

Referenced by XMLStorage::const_XMLPos::go(), and XMLStorage::XMLPos::go().

00137 {
00138         const XMLNode* node = this;
00139
00140          // parse relative path
00141         while(*path) {
00142                 const char* slash = strchr(path, '/');
00143                 if (slash == path)
00144                         return NULL;
00145
00146                 int l = slash? slash-path: strlen(path);
00147                 std::string comp(path, l);
00148                 path += l;
00149
00150                  // look for [n] and [@attr_name="attr_value"] expressions in path components
00151                 const char* bracket = strchr(comp.c_str(), '[');
00152                 l = bracket? bracket-comp.c_str(): comp.length();
00153                 std::string child_name(comp.c_str(), l);
00154                 std::string attr_name, attr_value;
00155
00156                 int n = 0;
00157                 if (bracket) {
00158                         std::string expr = unescape(bracket, '[', ']');
00159                         const char* p = expr.c_str();
00160
00161                         n = atoi(p);    // read index number
00162
00163                         if (n)
00164                                 n = n - 1;      // convert into zero based index
00165
00166                         const char* at = strchr(p, '@');
00167
00168                         if (at) {
00169                                 p = at + 1;
00170                                 const char* equal = strchr(p, '=');
00171
00172                                  // read attribute name and value
00173                                 if (equal) {
00174                                         attr_name = unescape(p, equal-p);
00175                                         attr_value = unescape(equal+1);
00176                                 }
00177                         }
00178                 }
00179
00180                 if (attr_name.empty())
00181                          // search n.th child node with specified name
00182                         node = node->find(child_name, n);
00183                 else
00184                          // search n.th child node with specified name and matching attribute value
00185                         node = node->find(child_name, attr_name, attr_value, n);
00186
00187                 if (!node)
00188                         return NULL;
00189
00190                 if (*path == '/')
00191                         ++path;
00192         }
00193
00194         return node;
00195 }

Here is the call graph for this function:

template<typename T>
XS_String XMLStorage::XMLNode::get ( const T & attr_name ) const [inline]

read only access to an attribute

Definition at line 521 of file xmlstorage.h.

Referenced by subvalue(), XMLStorage::XMLBool::XMLBool(), XMLStorage::XMLInt::XMLInt(), and XMLStorage::XMLString::XMLString().

00522         {
00523                 AttributeMap::const_iterator found = _attributes.find(attr_name);
00524
00525                 if (found != _attributes.end())
00526                         return found->second;
00527                 else
00528                         return XS_String();
00529         }

Children& XMLStorage::XMLNode::get_children ( ) [inline]

Definition at line 586 of file xmlstorage.h.

00587         {
00588                 return _children;
00589         }

const Children& XMLStorage::XMLNode::get_children ( ) const [inline]

Definition at line 581 of file xmlstorage.h.

00582         {
00583                 return _children;
00584         }

XS_String XMLStorage::XMLNode::get_content ( ) const [inline]

Definition at line 591 of file xmlstorage.h.

References XMLStorage::assign_utf8(), and XMLStorage::DecodeXMLString().

00592         {
00593 #ifdef XS_STRING_UTF8
00594                 const XS_String& ret = _content;
00595 #else
00596                 XS_String ret;
00597                 assign_utf8(ret, _content.c_str());
00598 #endif
00599
00600                 return DecodeXMLString(ret.c_str());
00601         }

Here is the call graph for this function:

XMLNode* XMLStorage::XMLNode::get_first_child ( ) const [inline, protected]

Definition at line 642 of file xmlstorage.h.

00643         {
00644                 if (!_children.empty())
00645                         return _children.front();
00646                 else
00647                         return NULL;
00648         }

XMLNode& XMLStorage::XMLNode::operator= ( const XMLNode & other ) [inline]

Definition at line 488 of file xmlstorage.h.

References _attributes, _children, _content, _end_leading, _leading, and _trailing.

00489         {
00490                 _children.assign(other._children);
00491
00492                 _attributes = other._attributes;
00493
00494                 _leading = other._leading;
00495                 _content = other._content;
00496                 _end_leading = other._end_leading;
00497                 _trailing = other._trailing;
00498
00499                 return *this;
00500         }

XS_String& XMLStorage::XMLNode::operator[] ( const XS_String & attr_name ) [inline]

C++ write access to an attribute.

Definition at line 515 of file xmlstorage.h.

00516         {
00517                 return _attributes[attr_name];
00518         }

void XMLStorage::XMLNode::pretty_write_worker | ( | std::ostream & | out,
 |  | int | indent
 | ) | const [protected]

pretty print node with children tree to output stream

Definition at line 565 of file xmlstorage.cpp.

References _attributes, _children, _content, XMLStorage::EncodeXMLString(), and XML_INDENT_SPACE.

00566 {
00567         for(int i=indent; i--; )
00568                 out << XML_INDENT_SPACE;
00569
00570         out << '<' << EncodeXMLString(*this);
00571
00572         for(AttributeMap::const_iterator it=_attributes.begin(); it!=_attributes.end(); ++it)
00573                 out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\"";
00574
00575         if (!_children.empty() || !_content.empty()) {
00576                 out << ">\n";
00577
00578                 for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it)
00579                         (*it)->pretty_write_worker(out, indent+1);
00580
00581                 for(int i=indent; i--; )
00582                         out << XML_INDENT_SPACE;
00583
00584                 out << "</" << EncodeXMLString(*this) << ">\n";
00585         } else
00586                 out << "/>\n";
00587 }

Here is the call graph for this function:

void XMLStorage::XMLNode::put | ( | const XS_String & | attr_name,
 |  | const XS_String & | value
 | ) | [inline]

write access to an attribute

Definition at line 509 of file xmlstorage.h.

00510         {
00511                 _attributes[attr_name] = value;
00512         }

void XMLStorage::XMLNode::set_content ( const XS_String & s ) [inline]

Definition at line 603 of file xmlstorage.h.

References XMLStorage::XS_String::assign(), and XMLStorage::EncodeXMLString().

00604         {
00605                 _content.assign(EncodeXMLString(s.c_str()));
00606         }

Here is the call graph for this function:

void XMLStorage::XMLNode::smart_write_worker | ( | std::ostream & | out,
 |  | int | indent
 | ) | const [protected]

write node with children tree to output stream using smart formating

Definition at line 591 of file xmlstorage.cpp.

References _attributes, _children, _content, _end_leading, _leading, XMLStorage::EncodeXMLString(), and XML_INDENT_SPACE.

00592 {
00593         if (_leading.empty())
00594                 for(int i=indent; i--; )
00595                         out << XML_INDENT_SPACE;
00596         else
00597                 out << _leading;
00598
00599         out << '<' << EncodeXMLString(*this);
00600
00601         for(AttributeMap::const_iterator it=_attributes.begin(); it!=_attributes.end(); ++it)
00602                 out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\"";
00603
00604         if (_children.empty() && _content.empty())
00605                 out << "/>";
00606         else {
00607                 out << '>';
00608
00609                 if (_content.empty())
00610                         out << '\n';
00611                 else
00612                         out << _content;
00613
00614                 Children::const_iterator it = _children.begin();
00615
00616                 if (it != _children.end()) {
00617                         for(; it!=_children.end(); ++it)
00618                                 (*it)->smart_write_worker(out, indent+1);
00619
00620                         if (_end_leading.empty())
00621                                 for(int i=indent; i--; )
00622                                         out << XML_INDENT_SPACE;
00623                         else
00624                                 out << _end_leading;
00625                 } else
00626                         out << _end_leading;
00627
00628                 out << "</" << EncodeXMLString(*this) << '>';
00629         }
00630
00631         if (_trailing.empty())
00632                 out << '\n';
00633         else
00634                 out << _trailing;
00635 }

Here is the call graph for this function:

XS_String& XMLStorage::XMLNode::subvalue | ( | const XS_String & | name,
 |  | const XS_String & | attr_name,
 |  | int | n = 0
 | ) | [inline]

convenient storage of distinct values in children node

Definition at line 543 of file xmlstorage.h.

00544         {
00545                 XMLNode* node = find(name, n);
00546
00547                 if (!node) {
00548                         node = new XMLNode(name);
00549                         add_child(node);
00550                 }
00551
00552                 return (*node)[attr_name];
00553         }

XS_String XMLStorage::XMLNode::subvalue | ( | const XS_String & | name,
 |  | const XS_String & | attr_name,
 |  | int | n = 0
 | ) | const [inline]

convenient value access in children node

Definition at line 532 of file xmlstorage.h.

References get().

00533         {
00534                 const XMLNode* node = find(name, n);
00535
00536                 if (node)
00537                         return node->get(attr_name);
00538                 else
00539                         return XS_String();
00540         }

Here is the call graph for this function:

std::ostream& XMLStorage::XMLNode::write | ( | std::ostream & | out,
 |  | WRITE_MODE | mode = FORMAT_SMART,
 |  | int | indent = 0
 | ) | const [inline]

write node with children tree to output stream

Definition at line 615 of file xmlstorage.h.

00616         {
00617                 switch(mode) {
00618                   case FORMAT_PRETTY:
00619                         pretty_write_worker(out, indent);
00620                         break;
00621
00622                   case FORMAT_ORIGINAL:
00623                         write_worker(out, indent);
00624                         break;
00625
00626                 default:         // FORMAT_SMART
00627                         smart_write_worker(out, indent);
00628                 }
00629
00630                 return out;
00631         }

void XMLStorage::XMLNode::write_worker | ( | std::ostream & | out,
 |  | int | indent
 | ) | const [protected]

write node with children tree to output stream using original white space

Definition at line 543 of file xmlstorage.cpp.

References _attributes, _children, _content, _end_leading, _leading, and XMLStorage::EncodeXMLString().

00544 {
00545         out << _leading << '<' << EncodeXMLString(*this);
00546
00547         for(AttributeMap::const_iterator it=_attributes.begin(); it!=_attributes.end(); ++it)
00548                 out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\"";
00549
00550         if (!_children.empty() || !_content.empty()) {
00551                 out << '>' << _content;
00552
00553                 for(Children::const_iterator it=_children.begin(); it!=_children.end(); ++it)
00554                         (*it)->write_worker(out, indent+1);
00555
00556                 out << _end_leading << "</" << EncodeXMLString(*this) << '>';
00557         } else
00558                 out << "/>";
00559
00560         out << _trailing;
00561 }

Here is the call graph for this function:

Friends And Related Function Documentation

friend struct const_XMLPos [friend]

Definition at line 442 of file xmlstorage.h.

friend struct XMLPos [friend]

Definition at line 441 of file xmlstorage.h.

friend struct XMLReaderBase [friend]

Definition at line 443 of file xmlstorage.h.

Member Data Documentation

AttributeMap XMLStorage::XMLNode::_attributes [protected]

Definition at line 635 of file xmlstorage.h.

Referenced by operator=(), pretty_write_worker(), smart_write_worker(), and write_worker().

Children XMLStorage::XMLNode::_children [protected]

Definition at line 634 of file xmlstorage.h.

Referenced by operator=(), pretty_write_worker(), smart_write_worker(), write_worker(), and XMLNode().

std::string XMLStorage::XMLNode::_content [protected]

Definition at line 638 of file xmlstorage.h.

Referenced by operator=(), pretty_write_worker(), smart_write_worker(), and write_worker().

std::string XMLStorage::XMLNode::_end_leading [protected]

Definition at line 639 of file xmlstorage.h.

Referenced by operator=(), smart_write_worker(), and write_worker().

std::string XMLStorage::XMLNode::_leading [protected]

Definition at line 637 of file xmlstorage.h.

Referenced by operator=(), smart_write_worker(), and write_worker().

std::string XMLStorage::XMLNode::_trailing [protected]

Definition at line 640 of file xmlstorage.h.

Referenced by operator=().

The documentation for this struct was generated from the following files:
  • xmlstorage.h
  • xmlstorage.cpp


ROS Explorer: Member List

XMLStorage::XMLNode Member List

This is the complete list of members for XMLStorage::XMLNode, including all inherited members.

_attributes | XMLStorage::XMLNode | [protected]
_children | XMLStorage::XMLNode | [protected]
_content | XMLStorage::XMLNode | [protected]
_end_leading | XMLStorage::XMLNode | [protected]
_leading | XMLStorage::XMLNode | [protected]
_trailing | XMLStorage::XMLNode | [protected]
add_child(XMLNode *child) | XMLStorage::XMLNode | [inline]
appendf(LPCXSSTR fmt,...) | XMLStorage::XS_String | [inline]
assign(LPCWSTR s) | XMLStorage::XS_String | [inline]
assign(LPCWSTR s, size_t l) | XMLStorage::XS_String | [inline]
assign(LPCXSSTR s) | XMLStorage::XS_String | [inline]
assign(LPCXSSTR s, size_t l) | XMLStorage::XS_String | [inline]
AttributeMap typedef | XMLStorage::XMLNode |
clear() | XMLStorage::XMLNode | [inline]
const_XMLPos | XMLStorage::XMLNode | [friend]
create_relative(const char *path) | XMLStorage::XMLNode | [protected]
find(const XS_String &name, int n=0) const | XMLStorage::XMLNode | [inline, protected]
find(const XS_String &name, const XS_String &attr_name, const XS_String &attr_value, int n=0) const | XMLStorage::XMLNode | [inline, protected]
find_relative(const char *path) const | XMLStorage::XMLNode | [protected]
find_relative(const char *path) | XMLStorage::XMLNode | [inline, protected]
FORMAT_ORIGINAL enum value | XMLStorage::XMLNode |
FORMAT_PRETTY enum value | XMLStorage::XMLNode |
FORMAT_SMART enum value | XMLStorage::XMLNode |
get(const T &attr_name) const | XMLStorage::XMLNode | [inline]
get_children() const | XMLStorage::XMLNode | [inline]
get_children() | XMLStorage::XMLNode | [inline]
get_content() const | XMLStorage::XMLNode | [inline]
get_first_child() const | XMLStorage::XMLNode | [inline, protected]
operator LPCXSSTR() const | XMLStorage::XS_String | [inline]
operator std::wstring() const | XMLStorage::XS_String | [inline]
operator=(const XMLNode &other) | XMLStorage::XMLNode | [inline]
XMLStorage::XS_String::operator=(LPCWSTR s) | XMLStorage::XS_String | [inline]
XMLStorage::XS_String::operator=(LPCXSSTR s) | XMLStorage::XS_String | [inline]
XMLStorage::XS_String::operator=(const super &s) | XMLStorage::XS_String | [inline]
operator[](const XS_String &attr_name) | XMLStorage::XMLNode | [inline]
pretty_write_worker(std::ostream &out, int indent) const | XMLStorage::XMLNode | [protected]
printf(LPCXSSTR fmt,...) | XMLStorage::XS_String | [inline]
put(const XS_String &attr_name, const XS_String &value) | XMLStorage::XMLNode | [inline]
set_content(const XS_String &s) | XMLStorage::XMLNode | [inline]
smart_write_worker(std::ostream &out, int indent) const | XMLStorage::XMLNode | [protected]
subvalue(const XS_String &name, const XS_String &attr_name, int n=0) const | XMLStorage::XMLNode | [inline]
subvalue(const XS_String &name, const XS_String &attr_name, int n=0) | XMLStorage::XMLNode | [inline]
super typedef | XMLStorage::XS_String |
vappendf(LPCXSSTR fmt, va_list l) | XMLStorage::XS_String | [inline]
vprintf(LPCXSSTR fmt, va_list l) | XMLStorage::XS_String | [inline]
write(std::ostream &out, WRITE_MODE mode=FORMAT_SMART, int indent=0) const | XMLStorage::XMLNode | [inline]
WRITE_MODE enum name | XMLStorage::XMLNode |
write_worker(std::ostream &out, int indent) const | XMLStorage::XMLNode | [protected]
XMLNode(const XS_String &name) | XMLStorage::XMLNode | [inline]
XMLNode(const XS_String &name, const std::string &leading) | XMLStorage::XMLNode | [inline]
XMLNode(const XMLNode &other) | XMLStorage::XMLNode | [inline]
XMLPos | XMLStorage::XMLNode | [friend]
XMLReaderBase | XMLStorage::XMLNode | [friend]
XS_String() | XMLStorage::XS_String | [inline]
XS_String(LPCXSSTR s) | XMLStorage::XS_String | [inline]
XS_String(LPCXSSTR s, size_t l) | XMLStorage::XS_String | [inline]
XS_String(const super &other) | XMLStorage::XS_String | [inline]
XS_String(const XS_String &other) | XMLStorage::XS_String | [inline]
XS_String(LPCWSTR s) | XMLStorage::XS_String | [inline]
XS_String(LPCWSTR s, size_t l) | XMLStorage::XS_String | [inline]
XS_String(const std::wstring &other) | XMLStorage::XS_String | [inline]
~XMLNode() | XMLStorage::XMLNode | [inline]


ROS Explorer: XMLStorage::XMLNode::Children Struct Reference

XMLStorage::XMLNode::Children

XMLStorage::XMLNode::Children Struct Reference

internal children node list More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::XMLNode::Children:

[legend]
Collaboration diagram for XMLStorage::XMLNode::Children:

[legend]
List of all members.

Public Member Functions

void | assign (const Children &other)
void | clear ()

Detailed Description

internal children node list

Definition at line 418 of file xmlstorage.h.

Member Function Documentation

void XMLStorage::XMLNode::Children::assign ( const Children & other ) [inline]

Definition at line 420 of file xmlstorage.h.

References clear(), and XMLStorage::XMLNode::XMLNode().

00421                 {
00422                         clear();
00423
00424                         for(Children::const_iterator it=other.begin(); it!=other.end(); ++it)
00425                                 push_back(new XMLNode(**it));
00426                 }

Here is the call graph for this function:

void XMLStorage::XMLNode::Children::clear ( ) [inline]

Definition at line 428 of file xmlstorage.h.

Referenced by assign().

00429                 {
00430                         while(!empty()) {
00431                                 XMLNode* node = back();
00432                                 pop_back();
00433
00434                                 node->clear();
00435                                 delete node;
00436                         }
00437                 }

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLNode::Children Member List

This is the complete list of members for XMLStorage::XMLNode::Children, including all inherited members.

assign(const Children &other) | XMLStorage::XMLNode::Children | [inline]
clear() | XMLStorage::XMLNode::Children | [inline]


ROS Explorer: XMLStorage::XMLPos Struct Reference

XMLStorage::XMLPos

XMLStorage::XMLPos Struct Reference

iterator for XML trees More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLPos:

[legend]
List of all members.

Public Member Functions

XMLPos (XMLNode *root)
XMLPos (const XMLPos &other)
XMLPos (XMLNode *node, const XS_String &name)
XMLPos (XMLNode *node, const XS_String &name, const XS_String &attr_name, const XS_String &attr_value)
XMLPos (const XMLPos &other, const XS_String &name)
XMLPos (const XMLPos &other, const XS_String &name, const XS_String &attr_name, const XS_String &attr_value)
XMLNode & cur ()
access to current node
const XMLNode & | cur () const
operator const XMLNode * () const
C++ access to current node.
operator XMLNode * ()
const XMLNode * | operator-> () const
XMLNode * operator-> ()
const XMLNode & | operator * () const
XMLNode & operator * ()
XS_String | get (const XS_String &attr_name) const
attribute access
void | put (const XS_String &attr_name, const XS_String &value)
attribute setting
template<typename T>
XS_String | get (const T &attr_name) const
C++ attribute access.
XS_String & | operator[] (const XS_String &attr_name)
void | add_down (XMLNode *child)
insert children when building tree
bool | back ()
go back to previous position
bool | go_down ()
go down to first child
bool | go_down (const XS_String &name, int n=0)
search for child and go down
bool | go (const char *path)
move XPath like to position in XML tree
bool | create_relative (const char *path)
create child nodes using XPath notation and move to the deepest child
void | create (const XS_String &name)
create node and move to it
void | smart_create (const XS_String &name)
create node if not already existing and move to it
void | smart_create (const XS_String &name, const XS_String &attr_name, const XS_String &attr_value)
search matching child node identified by key name and an attribute value
XS_String & str ()
const XS_String & | str () const

Protected Member Functions

void | go_to (XMLNode *child)
go to specified node

Protected Attributes

XMLNode * _root
XMLNode * _cur
std::stack< XMLNode * > | _stack

Detailed Description

iterator for XML trees

Definition at line 909 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLPos::XMLPos ( XMLNode * root ) [inline]

Definition at line 911 of file xmlstorage.h.

00912          :      _root(root),
00913                 _cur(root)
00914         {
00915         }

XMLStorage::XMLPos::XMLPos ( const XMLPos & other ) [inline]

Definition at line 917 of file xmlstorage.h.

00918          :      _root(other._root),
00919                 _cur(other._cur)
00920         {       // don't copy _stack
00921         }

XMLStorage::XMLPos::XMLPos | ( | XMLNode * | node,
 |  | const XS_String & | name
 | ) | [inline]

Definition at line 923 of file xmlstorage.h.

00924          :      _root(node),
00925                 _cur(node)
00926         {
00927                 smart_create(name);
00928         }

XMLStorage::XMLPos::XMLPos | ( | XMLNode * | node,
 |  | const XS_String & | name,
 |  | const XS_String & | attr_name,
 |  | const XS_String & | attr_value
 | ) | [inline]

Definition at line 930 of file xmlstorage.h.

00931          :      _root(node),
00932                 _cur(node)
00933         {
00934                 smart_create(name, attr_name, attr_value);
00935         }

XMLStorage::XMLPos::XMLPos | ( | const XMLPos & | other,
 |  | const XS_String & | name
 | ) | [inline]

Definition at line 937 of file xmlstorage.h.

00938          :      _root(other._root),
00939                 _cur(other._cur)
00940         {
00941                 smart_create(name);
00942         }

XMLStorage::XMLPos::XMLPos | ( | const XMLPos & | other,
 |  | const XS_String & | name,
 |  | const XS_String & | attr_name,
 |  | const XS_String & | attr_value
 | ) | [inline]

Definition at line 944 of file xmlstorage.h.

00945          :      _root(other._root),
00946                 _cur(other._cur)
00947         {
00948                 smart_create(name, attr_name, attr_value);
00949         }

Member Function Documentation

void XMLStorage::XMLPos::add_down ( XMLNode * child ) [inline]

insert children when building tree

Definition at line 989 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00990         {
00991                 _cur->add_child(child);
00992                 go_to(child);
00993         }

bool XMLStorage::XMLPos::back ( ) [inline]

go back to previous position

Definition at line 996 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

Referenced by NotifyArea::read_config(), Favorites::write(), and NotifyArea::write_config().

00997         {
00998                 if (!_stack.empty()) {
00999                         _cur = _stack.top();
01000                         _stack.pop();
01001                         return true;
01002                 } else
01003                         return false;
01004         }

void XMLStorage::XMLPos::create ( const XS_String & name ) [inline]

create node and move to it

Definition at line 1045 of file xmlstorage.h.

Referenced by Favorites::write().

01046         {
01047                 add_down(new XMLNode(name));
01048         }

bool XMLStorage::XMLPos::create_relative ( const char * path ) [inline]

create child nodes using XPath notation and move to the deepest child

Definition at line 1034 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

Referenced by ExplorerGlobals::get_cfg().

01035         {
01036                 XMLNode* node = _cur->create_relative(path);
01037                 if (!node)
01038                         return false;   // invalid path specified
01039
01040                 go_to(node);
01041                 return true;
01042         }

const XMLNode& XMLStorage::XMLPos::cur ( ) const [inline]

Definition at line 957 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00958         {
00959                 return *_cur;
00960         }

XMLNode& XMLStorage::XMLPos::cur ( ) [inline]

access to current node

Definition at line 952 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00953         {
00954                 return *_cur;
00955         }

template<typename T>
XS_String XMLStorage::XMLPos::get ( const T & attr_name ) const [inline]

C++ attribute access.

Definition at line 985 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00985 {return (*_cur)[attr_name];}

XS_String XMLStorage::XMLPos::get ( const XS_String & attr_name ) const [inline]

attribute access

Definition at line 973 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00974         {
00975                 return _cur->get(attr_name);
00976         }

bool XMLStorage::XMLPos::go ( const char * path )

move XPath like to position in XML tree

Definition at line 96 of file xmlstorage.cpp.

References _cur, _root, XMLStorage::XMLNode::find_relative(), and go_to().

00097 {
00098         XMLNode* node = _cur;
00099
00100          // Is this an absolute path?
00101         if (*path == '/') {
00102                 node = _root;
00103                 ++path;
00104         }
00105
00106         node = node->find_relative(path);
00107
00108         if (node) {
00109                 go_to(node);
00110                 return true;
00111         } else
00112                 return false;
00113 }

Here is the call graph for this function:

bool XMLStorage::XMLPos::go_down | ( | const XS_String & | name,
 |  | int | n = 0
 | ) | [inline]

search for child and go down

Definition at line 1019 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01020         {
01021                 XMLNode* node = _cur->find(name, n);
01022
01023                 if (node) {
01024                         go_to(node);
01025                         return true;
01026                 } else
01027                         return false;
01028         }

bool XMLStorage::XMLPos::go_down ( ) [inline]

go down to first child

Definition at line 1007 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

Referenced by Favorites::read(), and NotifyArea::read_config().

01008         {
01009                 XMLNode* node = _cur->get_first_child();
01010
01011                 if (node) {
01012                         go_to(node);
01013                         return true;
01014                 } else
01015                         return false;
01016         }

void XMLStorage::XMLPos::go_to ( XMLNode * child ) [inline, protected]

go to specified node

Definition at line 1130 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

Referenced by go().

01131         {
01132                 _stack.push(_cur);
01133                 _cur = child;
01134         }

XMLNode& XMLStorage::XMLPos::operator * ( ) [inline]

Definition at line 970 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00970 {return *_cur;}

const XMLNode& XMLStorage::XMLPos::operator * ( ) const [inline]

Definition at line 969 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00969 {return *_cur;}

XMLStorage::XMLPos::operator const XMLNode * ( ) const [inline]

C++ access to current node.

Definition at line 963 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00963 {return _cur;}

XMLStorage::XMLPos::operator XMLNode * ( ) [inline]

Definition at line 964 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00964 {return _cur;}

XMLNode* XMLStorage::XMLPos::operator-> ( ) [inline]

Definition at line 967 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00967 {return _cur;}

const XMLNode* XMLStorage::XMLPos::operator-> ( ) const [inline]

Definition at line 966 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00966 {return _cur;}

XS_String& XMLStorage::XMLPos::operator[] ( const XS_String & attr_name ) [inline]

Definition at line 986 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00986 {return (*_cur)[attr_name];}

void XMLStorage::XMLPos::put | ( | const XS_String & | attr_name,
 |  | const XS_String & | value
 | ) | [inline]

attribute setting

Definition at line 979 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

00980         {
00981                 _cur->put(attr_name, value);
00982         }

void XMLStorage::XMLPos::smart_create | ( | const XS_String & | name,
 |  | const XS_String & | attr_name,
 |  | const XS_String & | attr_value
 | ) | [inline]

search matching child node identified by key name and an attribute value

Definition at line 1062 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01063         {
01064                 XMLNode* node = _cur->find(name, attr_name, attr_value);
01065
01066                 if (node)
01067                         go_to(node);
01068                 else {
01069                         node = new XMLNode(name);
01070                         add_down(node);
01071                         (*node)[attr_name] = attr_value;
01072                 }
01073         }

void XMLStorage::XMLPos::smart_create ( const XS_String & name ) [inline]

create node if not already existing and move to it

Definition at line 1051 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

Referenced by ExplorerGlobals::get_cfg(), and NotifyArea::write_config().

01052         {
01053                 XMLNode* node = _cur->find(name);
01054
01055                 if (node)
01056                         go_to(node);
01057                 else
01058                         add_down(new XMLNode(name));
01059         }

const XS_String& XMLStorage::XMLPos::str ( ) const [inline]

Definition at line 1122 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01122 {return *_cur;}

XS_String& XMLStorage::XMLPos::str ( ) [inline]

Definition at line 1121 of file xmlstorage.h.

References XMLStorage::XMLChildrenFilter::iterator::_cur.

01121 {return *_cur;}

Member Data Documentation

XMLNode* XMLStorage::XMLPos::_cur [protected]

Definition at line 1126 of file xmlstorage.h.

Referenced by go().

XMLNode* XMLStorage::XMLPos::_root [protected]

Definition at line 1125 of file xmlstorage.h.

Referenced by go().

std::stack<XMLNode*> XMLStorage::XMLPos::_stack [protected]

Definition at line 1127 of file xmlstorage.h.

The documentation for this struct was generated from the following files:
  • xmlstorage.h
  • xmlstorage.cpp


ROS Explorer: Member List

XMLStorage::XMLPos Member List

This is the complete list of members for XMLStorage::XMLPos, including all inherited members.

_cur | XMLStorage::XMLPos | [protected]
_root | XMLStorage::XMLPos | [protected]
_stack | XMLStorage::XMLPos | [protected]
add_down(XMLNode *child) | XMLStorage::XMLPos | [inline]
back() | XMLStorage::XMLPos | [inline]
create(const XS_String &name) | XMLStorage::XMLPos | [inline]
create_relative(const char *path) | XMLStorage::XMLPos | [inline]
cur() | XMLStorage::XMLPos | [inline]
cur() const | XMLStorage::XMLPos | [inline]
get(const XS_String &attr_name) const | XMLStorage::XMLPos | [inline]
get(const T &attr_name) const | XMLStorage::XMLPos | [inline]
go(const char *path) | XMLStorage::XMLPos |
go_down() | XMLStorage::XMLPos | [inline]
go_down(const XS_String &name, int n=0) | XMLStorage::XMLPos | [inline]
go_to(XMLNode *child) | XMLStorage::XMLPos | [inline, protected]
operator *() const | XMLStorage::XMLPos | [inline]
operator *() | XMLStorage::XMLPos | [inline]
operator const XMLNode *() const | XMLStorage::XMLPos | [inline]
operator XMLNode *() | XMLStorage::XMLPos | [inline]
operator->() const | XMLStorage::XMLPos | [inline]
operator->() | XMLStorage::XMLPos | [inline]
operator[](const XS_String &attr_name) | XMLStorage::XMLPos | [inline]
put(const XS_String &attr_name, const XS_String &value) | XMLStorage::XMLPos | [inline]
smart_create(const XS_String &name) | XMLStorage::XMLPos | [inline]
smart_create(const XS_String &name, const XS_String &attr_name, const XS_String &attr_value) | XMLStorage::XMLPos | [inline]
str() | XMLStorage::XMLPos | [inline]
str() const | XMLStorage::XMLPos | [inline]
XMLPos(XMLNode *root) | XMLStorage::XMLPos | [inline]
XMLPos(const XMLPos &other) | XMLStorage::XMLPos | [inline]
XMLPos(XMLNode *node, const XS_String &name) | XMLStorage::XMLPos | [inline]
XMLPos(XMLNode *node, const XS_String &name, const XS_String &attr_name, const XS_String &attr_value) | XMLStorage::XMLPos | [inline]
XMLPos(const XMLPos &other, const XS_String &name) | XMLStorage::XMLPos | [inline]
XMLPos(const XMLPos &other, const XS_String &name, const XS_String &attr_name, const XS_String &attr_value) | XMLStorage::XMLPos | [inline]


ROS Explorer: XMLStorage::XMLReader Struct Reference

XMLStorage::XMLReader

XMLStorage::XMLReader Struct Reference

XML file reader. More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::XMLReader:

[legend]
Collaboration diagram for XMLStorage::XMLReader:

[legend]
List of all members.

Public Member Functions

XMLReader (XMLNode *node, std::istream &in)
int | read_buffer (char *buffer, int len)
read XML stream into XML tree below _pos

Protected Attributes

std::istream & | _in

Detailed Description

XML file reader.

Definition at line 1591 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLReader::XMLReader | ( | XMLNode * | node,
 |  | std::istream & | in
 | ) | [inline]

Definition at line 1593 of file xmlstorage.h.

01594          :      XMLReaderBase(node),
01595                 _in(in)
01596         {
01597         }

Member Function Documentation

int XMLStorage::XMLReader::read_buffer | ( | char * | buffer,
 |  | int | len
 | ) | [inline, virtual]

read XML stream into XML tree below _pos

Implements XMLStorage::XMLReaderBase.

Definition at line 1600 of file xmlstorage.h.

01601         {
01602                 if (!_in.good())
01603                         return -1;
01604
01605                 _in.read(buffer, len);
01606
01607                 return _in.gcount();
01608         }

Member Data Documentation

std::istream& XMLStorage::XMLReader::_in [protected]

Definition at line 1611 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLReader Member List

This is the complete list of members for XMLStorage::XMLReader, including all inherited members.

_content | XMLStorage::XMLReaderBase | [protected]
_encoding | XMLStorage::XMLReaderBase | [protected]
_in | XMLStorage::XMLReader | [protected]
_instructions | XMLStorage::XMLReaderBase | [protected]
_last_tag | XMLStorage::XMLReaderBase | [protected]
_parser | XMLStorage::XMLReaderBase | [protected]
_pos | XMLStorage::XMLReaderBase | [protected]
_xml_version | XMLStorage::XMLReaderBase | [protected]
get_error_code() | XMLStorage::XMLReaderBase | [inline]
get_error_string() const | XMLStorage::XMLReaderBase |
get_instructions() const | XMLStorage::XMLReaderBase | [inline]
get_position() const | XMLStorage::XMLReaderBase | [inline]
read() | XMLStorage::XMLReaderBase |
read_buffer(char *buffer, int len) | XMLStorage::XMLReader | [inline, virtual]
TAG_END enum value | XMLStorage::XMLReaderBase | [protected]
TAG_NONE enum value | XMLStorage::XMLReaderBase | [protected]
TAG_START enum value | XMLStorage::XMLReaderBase | [protected]
XML_DefaultHandler(void *userData, const XML_Char *s, int len) | XMLStorage::XMLReaderBase | [protected, static]
XML_EndElementHandler(void *userData, const XML_Char *name) | XMLStorage::XMLReaderBase | [protected, static]
XML_StartElementHandler(void *userData, const XML_Char *name, const XML_Char **atts) | XMLStorage::XMLReaderBase | [protected, static]
XML_XmlDeclHandler(void *userData, const XML_Char *version, const XML_Char *encoding, int standalone) | XMLStorage::XMLReaderBase | [protected, static]
XMLReader(XMLNode *node, std::istream &in) | XMLStorage::XMLReader | [inline]
XMLReaderBase(XMLNode *node) | XMLStorage::XMLReaderBase | [inline]
~XMLReaderBase() | XMLStorage::XMLReaderBase | [inline, virtual]


ROS Explorer: XMLStorage::XMLReaderBase Struct Reference

XMLStorage::XMLReaderBase

XMLStorage::XMLReaderBase Struct Reference

XML reader base class. More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::XMLReaderBase:

[legend]
Collaboration diagram for XMLStorage::XMLReaderBase:

[legend]
List of all members.

Public Member Functions

XMLReaderBase (XMLNode *node)
virtual | ~XMLReaderBase ()
XML_Status | read ()
read XML stream into XML tree below _pos
virtual int | read_buffer (char *buffer, int len)=0
std::string | get_position () const
std::string | get_instructions () const
XML_Error | get_error_code ()
std::string | get_error_string () const
return error strings for Expat errors

Protected Types

enum | { TAG_NONE, TAG_START, TAG_END }

Static Protected Member Functions

static void XMLCALL | XML_XmlDeclHandler (void *userData, const XML_Char *version, const XML_Char *encoding, int standalone)
store XML version and encoding into XML reader
static void XMLCALL | XML_StartElementHandler (void *userData, const XML_Char *name, const XML_Char **atts)
notifications about XML start tag
static void XMLCALL | XML_EndElementHandler (void *userData, const XML_Char *name)
notifications about XML end tag
static void XMLCALL | XML_DefaultHandler (void *userData, const XML_Char *s, int len)
store content, white space and comments

Protected Attributes

XMLPos _pos
XML_Parser | _parser
std::string | _xml_version
std::string | _encoding
std::string | _instructions
std::string | _content
enum XMLStorage::XMLReaderBase:: { ... } | _last_tag

Detailed Description

XML reader base class.

Definition at line 1534 of file xmlstorage.h.

Member Enumeration Documentation

anonymous enum [protected]

Enumerator:
TAG_NONE
TAG_START
TAG_END

Definition at line 1581 of file xmlstorage.h.

01581 {TAG_NONE, TAG_START, TAG_END} _last_tag;

Constructor & Destructor Documentation

XMLStorage::XMLReaderBase::XMLReaderBase ( XMLNode * node ) [inline]

Definition at line 1536 of file xmlstorage.h.

01537          :      _pos(node),
01538                 _parser(XML_ParserCreate(NULL))
01539         {
01540                 XML_SetUserData(_parser, this);
01541                 XML_SetXmlDeclHandler(_parser, XML_XmlDeclHandler);
01542                 XML_SetElementHandler(_parser, XML_StartElementHandler, XML_EndElementHandler);
01543                 XML_SetDefaultHandler(_parser, XML_DefaultHandler);
01544
01545                 _last_tag = TAG_NONE;
01546         }

virtual XMLStorage::XMLReaderBase::~XMLReaderBase ( ) [inline, virtual]

Definition at line 1548 of file xmlstorage.h.

01549         {
01550                 XML_ParserFree(_parser);
01551         }

Member Function Documentation

XML_Error XMLStorage::XMLReaderBase::get_error_code ( ) [inline]

Definition at line 1570 of file xmlstorage.h.

Referenced by XMLStorage::XMLDoc::read().

01570 {return XML_GetErrorCode(_parser);}

std::string XMLStorage::XMLReaderBase::get_error_string ( ) const

return error strings for Expat errors

Definition at line 401 of file xmlstorage.cpp.

References _parser.

Referenced by XMLStorage::XMLDoc::read().

00402 {
00403         XML_Error error = XML_GetErrorCode(_parser);
00404
00405         switch(error) {
00406           case XML_ERROR_NONE:                                                          return "XML_ERROR_NONE";
00407           case XML_ERROR_NO_MEMORY:                                                     return "XML_ERROR_NO_MEMORY";
00408           case XML_ERROR_SYNTAX:                                                        return "XML_ERROR_SYNTAX";
00409           case XML_ERROR_NO_ELEMENTS:                                           return "XML_ERROR_NO_ELEMENTS";
00410           case XML_ERROR_INVALID_TOKEN:                                         return "XML_ERROR_INVALID_TOKEN";
00411           case XML_ERROR_UNCLOSED_TOKEN:                                        return "XML_ERROR_UNCLOSED_TOKEN";
00412           case XML_ERROR_PARTIAL_CHAR:                                          return "XML_ERROR_PARTIAL_CHAR";
00413           case XML_ERROR_TAG_MISMATCH:                                          return "XML_ERROR_TAG_MISMATCH";
00414           case XML_ERROR_DUPLICATE_ATTRIBUTE:                           return "XML_ERROR_DUPLICATE_ATTRIBUTE";
00415           case XML_ERROR_JUNK_AFTER_DOC_ELEMENT:                        return "XML_ERROR_JUNK_AFTER_DOC_ELEMENT";
00416           case XML_ERROR_PARAM_ENTITY_REF:                                      return "XML_ERROR_PARAM_ENTITY_REF";
00417           case XML_ERROR_UNDEFINED_ENTITY:                                      return "XML_ERROR_UNDEFINED_ENTITY";
00418           case XML_ERROR_RECURSIVE_ENTITY_REF:                          return "XML_ERROR_RECURSIVE_ENTITY_REF";
00419           case XML_ERROR_ASYNC_ENTITY:                                          return "XML_ERROR_ASYNC_ENTITY";
00420           case XML_ERROR_BAD_CHAR_REF:                                          return "XML_ERROR_BAD_CHAR_REF";
00421           case XML_ERROR_BINARY_ENTITY_REF:                                     return "XML_ERROR_BINARY_ENTITY_REF";
00422           case XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF:         return "XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF";
00423           case XML_ERROR_MISPLACED_XML_PI:                                      return "XML_ERROR_MISPLACED_XML_PI";
00424           case XML_ERROR_UNKNOWN_ENCODING:                                      return "XML_ERROR_UNKNOWN_ENCODING";
00425           case XML_ERROR_INCORRECT_ENCODING:                            return "XML_ERROR_INCORRECT_ENCODING";
00426           case XML_ERROR_UNCLOSED_CDATA_SECTION:                        return "XML_ERROR_UNCLOSED_CDATA_SECTION";
00427           case XML_ERROR_EXTERNAL_ENTITY_HANDLING:                      return "XML_ERROR_EXTERNAL_ENTITY_HANDLING";
00428           case XML_ERROR_NOT_STANDALONE:                                        return "XML_ERROR_NOT_STANDALONE";
00429           case XML_ERROR_UNEXPECTED_STATE:                                      return "XML_ERROR_UNEXPECTED_STATE";
00430           case XML_ERROR_ENTITY_DECLARED_IN_PE:                         return "XML_ERROR_ENTITY_DECLARED_IN_PE";
00431           case XML_ERROR_FEATURE_REQUIRES_XML_DTD:                      return "XML_ERROR_FEATURE_REQUIRES_XML_DTD";
00432           case XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING:      return "XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING";
00433           case XML_ERROR_UNBOUND_PREFIX:                                        return "XML_ERROR_UNBOUND_PREFIX";
00434  // EXPAT version >= 1.95.8
00435 #if XML_MAJOR_VERSION>1 || (XML_MAJOR_VERSION==1 && XML_MINOR_VERSION>95) || (XML_MAJOR_VERSION==1 && XML_MINOR_VERSION==95 && XML_MICRO_VERSION>7)
00436           case XML_ERROR_UNDECLARING_PREFIX:                            return "XML_ERROR_UNDECLARING_PREFIX";
00437           case XML_ERROR_INCOMPLETE_PE:                                         return "XML_ERROR_INCOMPLETE_PE";
00438           case XML_ERROR_XML_DECL:                                                      return "XML_ERROR_XML_DECL";
00439           case XML_ERROR_TEXT_DECL:                                                     return "XML_ERROR_TEXT_DECL";
00440           case XML_ERROR_PUBLICID:                                                      return "XML_ERROR_PUBLICID";
00441           case XML_ERROR_SUSPENDED:                                                     return "XML_ERROR_SUSPENDED";
00442           case XML_ERROR_NOT_SUSPENDED:                                         return "XML_ERROR_NOT_SUSPENDED";
00443           case XML_ERROR_ABORTED:                                                       return "XML_ERROR_ABORTED";
00444           case XML_ERROR_FINISHED:                                                      return "XML_ERROR_FINISHED";
00445           case XML_ERROR_SUSPEND_PE:                                            return "XML_ERROR_SUSPEND_PE";
00446 //#endif
00447 //#if XML_MAJOR_VERSION>=2
00448                 /* Added in 2.0. */
00449           case XML_ERROR_RESERVED_PREFIX_XML:                           return "XML_ERROR_RESERVED_PREFIX_XML";
00450           case XML_ERROR_RESERVED_PREFIX_XMLNS:                         return "XML_ERROR_RESERVED_PREFIX_XMLNS";
00451           case XML_ERROR_RESERVED_NAMESPACE_URI:                        return "XML_ERROR_RESERVED_NAMESPACE_URI";
00452 #endif
00453         }
00454
00455         std::ostringstream out;
00456
00457         out << "XML parser error #" << error;
00458
00459         return out.str();
00460 }

std::string XMLStorage::XMLReaderBase::get_instructions ( ) const [inline]

Definition at line 1568 of file xmlstorage.h.

Referenced by XMLStorage::XMLDoc::read().

01568 {return _instructions;}

std::string XMLStorage::XMLReaderBase::get_position ( ) const [inline]

Definition at line 1557 of file xmlstorage.h.

Referenced by XMLStorage::XMLDoc::read().

01558         {
01559                 int line = XML_GetCurrentLineNumber(_parser);
01560                 int column = XML_GetCurrentColumnNumber(_parser);
01561
01562                 std::ostringstream out;
01563                 out << "(" << line << ") : [column " << column << "]";
01564
01565                 return out.str();
01566         }

XML_Status XMLStorage::XMLReaderBase::read ( )

read XML stream into XML tree below _pos

Definition at line 269 of file xmlstorage.cpp.

References _parser, BUFFER_LEN, and read_buffer().

Referenced by XMLStorage::XMLDoc::read().

00270 {
00271         XML_Status status = XML_STATUS_OK;
00272
00273         while(status == XML_STATUS_OK) {
00274                 char* buffer = (char*) XML_GetBuffer(_parser, BUFFER_LEN);
00275
00276                 int l = read_buffer(buffer, BUFFER_LEN);
00277                 if (l < 0)
00278                         break;
00279
00280                 status = XML_ParseBuffer(_parser, l, false);
00281         }
00282
00283         if (status != XML_STATUS_ERROR)
00284                 status = XML_ParseBuffer(_parser, 0, true);
00285
00286         if (_pos->_children.empty())
00287                 _pos->_trailing.append(_content);
00288         else
00289                 _pos->_children.back()->_trailing.append(_content);
00290
00291         _content.erase();
00292
00293         return status;
00294 }

Here is the call graph for this function:

virtual int XMLStorage::XMLReaderBase::read_buffer | ( | char * | buffer,
 |  | int | len
 | ) | [pure virtual]

Implemented in XMLStorage::XMLReader.

Referenced by read().

void XMLCALL XMLStorage::XMLReaderBase::XML_DefaultHandler | ( | void * | userData,
 |  | const XML_Char * | s,
 |  | int | len
 | ) | [static, protected]

store content, white space and comments

Definition at line 392 of file xmlstorage.cpp.

References _content.

00393 {
00394         XMLReaderBase* pReader = (XMLReaderBase*) userData;
00395
00396         pReader->_content.append(s, len);
00397 }

void XMLCALL XMLStorage::XMLReaderBase::XML_EndElementHandler | ( | void * | userData,
 |  | const XML_Char * | name
 | ) | [static, protected]

notifications about XML end tag

Definition at line 357 of file xmlstorage.cpp.

References _content, _last_tag, _pos, TAG_END, and TAG_START.

00358 {
00359         XMLReaderBase* pReader = (XMLReaderBase*) userData;
00360         XMLPos& pos = pReader->_pos;
00361
00362          // search for end of first line
00363         const char* s = pReader->_content.c_str();
00364         const char* p = s;
00365         const char* e = p + pReader->_content.length();
00366
00367         for(; p<e; ++p)
00368                 if (*p == '\n') {
00369                         ++p;
00370                         break;
00371                 }
00372
00373         if (p != s)
00374                 if (pos->_children.empty())     // no children in current node?
00375                         pos->_content.append(s, p-s);
00376                 else
00377                         if (pReader->_last_tag == TAG_START)
00378                                 pos->_content.append(s, p-s);
00379                         else
00380                                 pos->_children.back()->_trailing.append(s, p-s);
00381
00382         if (p != e)
00383                 pos->_end_leading.assign(p, e-p);
00384
00385         pos.back();
00386
00387         pReader->_last_tag = TAG_END;
00388         pReader->_content.erase();
00389 }

void XMLCALL XMLStorage::XMLReaderBase::XML_StartElementHandler | ( | void * | userData,
 |  | const XML_Char * | name,
 |  | const XML_Char ** | atts
 | ) | [static, protected]

notifications about XML start tag

Definition at line 310 of file xmlstorage.cpp.

References _content, _last_tag, _pos, TAG_END, and TAG_START.

00311 {
00312         XMLReaderBase* pReader = (XMLReaderBase*) userData;
00313         XMLPos& pos = pReader->_pos;
00314
00315          // search for end of first line
00316         const char* s = pReader->_content.c_str();
00317         const char* p = s;
00318         const char* e = p + pReader->_content.length();
00319
00320         for(; p<e; ++p)
00321                 if (*p == '\n') {
00322                         ++p;
00323                         break;
00324                 }
00325
00326         if (p != s)
00327                 if (pos->_children.empty()) {   // no children in last node?
00328                         if (pReader->_last_tag == TAG_START)
00329                                 pos->_content.append(s, p-s);
00330                         else if (pReader->_last_tag == TAG_END)
00331                                 pos->_trailing.append(s, p-s);
00332                         // else TAG_NONE -> don't store white space in root node
00333                 } else
00334                         pos->_children.back()->_trailing.append(s, p-s);
00335
00336         std::string leading;
00337
00338         if (p != e)
00339                 leading.assign(p, e-p);
00340
00341         XMLNode* node = new XMLNode(String_from_XML_Char(name), leading);
00342
00343         pos.add_down(node);
00344
00345         while(*atts) {
00346                 const XML_Char* attr_name = *atts++;
00347                 const XML_Char* attr_value = *atts++;
00348
00349                 (*node)[String_from_XML_Char(attr_name)] = String_from_XML_Char(attr_value);
00350         }
00351
00352         pReader->_last_tag = TAG_START;
00353         pReader->_content.erase();
00354 }

void XMLCALL XMLStorage::XMLReaderBase::XML_XmlDeclHandler | ( | void * | userData,
 |  | const XML_Char * | version,
 |  | const XML_Char * | encoding,
 |  | int | standalone
 | ) | [static, protected]

store XML version and encoding into XML reader

Definition at line 298 of file xmlstorage.cpp.

References _encoding, and _xml_version.

00299 {
00300         XMLReaderBase* pReader = (XMLReaderBase*) userData;
00301
00302         if (version)
00303                 pReader->_xml_version = version;
00304
00305         if (encoding)
00306                 pReader->_encoding = encoding;
00307 }

Member Data Documentation

std::string XMLStorage::XMLReaderBase::_content [protected]

Definition at line 1580 of file xmlstorage.h.

Referenced by XML_DefaultHandler(), XML_EndElementHandler(), and XML_StartElementHandler().

std::string XMLStorage::XMLReaderBase::_encoding [protected]

Definition at line 1577 of file xmlstorage.h.

Referenced by XML_XmlDeclHandler().

std::string XMLStorage::XMLReaderBase::_instructions [protected]

Definition at line 1578 of file xmlstorage.h.

enum { ... } XMLStorage::XMLReaderBase::_last_tag [protected]

Referenced by XML_EndElementHandler(), and XML_StartElementHandler().

XML_Parser XMLStorage::XMLReaderBase::_parser [protected]

Definition at line 1575 of file xmlstorage.h.

Referenced by get_error_string(), and read().

XMLPos XMLStorage::XMLReaderBase::_pos [protected]

Definition at line 1574 of file xmlstorage.h.

Referenced by XML_EndElementHandler(), and XML_StartElementHandler().

std::string XMLStorage::XMLReaderBase::_xml_version [protected]

Definition at line 1576 of file xmlstorage.h.

Referenced by XML_XmlDeclHandler().

The documentation for this struct was generated from the following files:
  • xmlstorage.h
  • xmlstorage.cpp


ROS Explorer: Member List

XMLStorage::XMLReaderBase Member List

This is the complete list of members for XMLStorage::XMLReaderBase, including all inherited members.

_content | XMLStorage::XMLReaderBase | [protected]
_encoding | XMLStorage::XMLReaderBase | [protected]
_instructions | XMLStorage::XMLReaderBase | [protected]
_last_tag | XMLStorage::XMLReaderBase | [protected]
_parser | XMLStorage::XMLReaderBase | [protected]
_pos | XMLStorage::XMLReaderBase | [protected]
_xml_version | XMLStorage::XMLReaderBase | [protected]
get_error_code() | XMLStorage::XMLReaderBase | [inline]
get_error_string() const | XMLStorage::XMLReaderBase |
get_instructions() const | XMLStorage::XMLReaderBase | [inline]
get_position() const | XMLStorage::XMLReaderBase | [inline]
read() | XMLStorage::XMLReaderBase |
read_buffer(char *buffer, int len)=0 | XMLStorage::XMLReaderBase | [pure virtual]
TAG_END enum value | XMLStorage::XMLReaderBase | [protected]
TAG_NONE enum value | XMLStorage::XMLReaderBase | [protected]
TAG_START enum value | XMLStorage::XMLReaderBase | [protected]
XML_DefaultHandler(void *userData, const XML_Char *s, int len) | XMLStorage::XMLReaderBase | [protected, static]
XML_EndElementHandler(void *userData, const XML_Char *name) | XMLStorage::XMLReaderBase | [protected, static]
XML_StartElementHandler(void *userData, const XML_Char *name, const XML_Char **atts) | XMLStorage::XMLReaderBase | [protected, static]
XML_XmlDeclHandler(void *userData, const XML_Char *version, const XML_Char *encoding, int standalone) | XMLStorage::XMLReaderBase | [protected, static]
XMLReaderBase(XMLNode *node) | XMLStorage::XMLReaderBase | [inline]
~XMLReaderBase() | XMLStorage::XMLReaderBase | [inline, virtual]


ROS Explorer: XMLStorage::XMLString Struct Reference

XMLStorage::XMLString

XMLStorage::XMLString Struct Reference

type converter for string data More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLString:

[legend]
List of all members.

Public Member Functions

XMLString (const XS_String &value)
XMLString (LPCXSSTR value, LPCXSSTR def=XS_TEXT(""))
XMLString (const XMLNode *node, const XS_String &attr_name, LPCXSSTR def=XS_TEXT(""))
operator const XS_String & () const
const XS_String & c_str () const

Protected Attributes

XS_String _value

Detailed Description

type converter for string data

Definition at line 1429 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLString::XMLString ( const XS_String & value ) [inline]

Definition at line 1431 of file xmlstorage.h.

01432          :      _value(value)
01433         {
01434         }

XMLStorage::XMLString::XMLString | ( | LPCXSSTR | value,
 |  | LPCXSSTR | def = XS_TEXT("")
 | ) | [inline]

Definition at line 1436 of file xmlstorage.h.

01437         {
01438                 if (value && *value)
01439                         _value = value;
01440                 else
01441                         _value = def;
01442         }

XMLStorage::XMLString::XMLString | ( | const XMLNode * | node,
 |  | const XS_String & | attr_name,
 |  | LPCXSSTR | def = XS_TEXT("")
 | ) | [inline]

Definition at line 1444 of file xmlstorage.h.

References XMLStorage::XMLNode::get().

01445         {
01446                 const XS_String& value = node->get(attr_name);
01447
01448                 if (!value.empty())
01449                         _value = value;
01450                 else
01451                         _value = def;
01452         }

Here is the call graph for this function:

Member Function Documentation

const XS_String& XMLStorage::XMLString::c_str ( ) const [inline]

Definition at line 1459 of file xmlstorage.h.

01460         {
01461                 return _value;
01462         }

XMLStorage::XMLString::operator const XS_String & ( ) const [inline]

Definition at line 1454 of file xmlstorage.h.

01455         {
01456                 return _value;
01457         }

Member Data Documentation

XS_String XMLStorage::XMLString::_value [protected]

Definition at line 1465 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLString Member List

This is the complete list of members for XMLStorage::XMLString, including all inherited members.

_value | XMLStorage::XMLString | [protected]
c_str() const | XMLStorage::XMLString | [inline]
operator const XS_String &() const | XMLStorage::XMLString | [inline]
XMLString(const XS_String &value) | XMLStorage::XMLString | [inline]
XMLString(LPCXSSTR value, LPCXSSTR def=XS_TEXT("")) | XMLStorage::XMLString | [inline]
XMLString(const XMLNode *node, const XS_String &attr_name, LPCXSSTR def=XS_TEXT("")) | XMLStorage::XMLString | [inline]


ROS Explorer: XMLStorage::XMLWriter Struct Reference

XMLStorage::XMLWriter

XMLStorage::XMLWriter Struct Reference

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLWriter:

[legend]
List of all members.

Public Types

enum | WRITESTATE { NOTHING, ATTRIBUTES, PRE_CLOSED, POST }

Public Member Functions

XMLWriter (std::ostream &out, PRETTY_FLAGS pretty=PRETTY_INDENT, const XMLHeader &header=XMLHeader())
XMLWriter (LPCTSTR path, PRETTY_FLAGS pretty=PRETTY_INDENT, const XMLHeader &header=XMLHeader())
~XMLWriter ()
void | create (const XS_String &name)
create node and move to it
bool | back ()
go back to previous position
void | put (const XS_String &attr_name, const XS_String &value)
attribute setting
XS_String & | operator[] (const XS_String &attr_name)
C++ write access to an attribute.
void | set_content (const XS_String &s)

Protected Types

typedef XMLNode::AttributeMap | AttrMap

Protected Member Functions

void | close_pre (StackEntry &entry)
void | write_pre (StackEntry &entry)
void | write_attributes (StackEntry &entry)
void | write_post (StackEntry &entry)

Protected Attributes

tofstream * _pofstream
std::ostream & | _out
PRETTY_FLAGS _pretty
std::stack< StackEntry > | _stack

Static Protected Attributes

static XS_String | s_empty_attr

Classes

struct | StackEntry

Detailed Description

Definition at line 1775 of file xmlstorage.h.

Member Typedef Documentation

typedef XMLNode::AttributeMap XMLStorage::XMLWriter::AttrMap [protected]

Definition at line 1864 of file xmlstorage.h.

Member Enumeration Documentation

enum XMLStorage::XMLWriter::WRITESTATE

Enumerator:
NOTHING
ATTRIBUTES
PRE_CLOSED
POST

Definition at line 1855 of file xmlstorage.h.

01855                         {
01856                 NOTHING, /*PRE,*/ ATTRIBUTES, PRE_CLOSED, /*CONTENT,*/ POST
01857         };

Constructor & Destructor Documentation

XMLStorage::XMLWriter::XMLWriter | ( | std::ostream & | out,
 |  | PRETTY_FLAGS | pretty = PRETTY_INDENT,
 |  | const XMLHeader & | header = XMLHeader()
 | ) | [inline]

Definition at line 1777 of file xmlstorage.h.

01778          :      _pofstream(NULL),
01779                 _out(out),
01780                 _pretty(pretty)
01781         {
01782                 header.print(_out, false);
01783         }

XMLStorage::XMLWriter::XMLWriter | ( | LPCTSTR | path,
 |  | PRETTY_FLAGS | pretty = PRETTY_INDENT,
 |  | const XMLHeader & | header = XMLHeader()
 | ) | [inline]

Definition at line 1785 of file xmlstorage.h.

01786          :      _pofstream(new tofstream(path)),
01787                 _out(*_pofstream),
01788                 _pretty(pretty)
01789         {
01790                 header.print(_out, false);
01791         }

XMLStorage::XMLWriter::~XMLWriter ( ) [inline]

Definition at line 1793 of file xmlstorage.h.

01794         {
01795                 _out << std::endl;
01796                 delete _pofstream;
01797         }

Member Function Documentation

bool XMLStorage::XMLWriter::back ( ) [inline]

go back to previous position

Definition at line 1821 of file xmlstorage.h.

01822         {
01823                 if (!_stack.empty()) {
01824                         write_post(_stack.top());
01825
01826                         _stack.pop();
01827                         return true;
01828                 } else
01829                         return false;
01830         }

void XMLStorage::XMLWriter::close_pre ( StackEntry & entry ) [inline, protected]

Definition at line 1880 of file xmlstorage.h.

References XMLStorage::XMLWriter::StackEntry::_state.

01881         {
01882                 _out << '>';
01883
01884                 entry._state = PRE_CLOSED;
01885         }

void XMLStorage::XMLWriter::create ( const XS_String & name ) [inline]

create node and move to it

Definition at line 1800 of file xmlstorage.h.

01801         {
01802                 if (!_stack.empty()) {
01803                         StackEntry& last = _stack.top();
01804
01805                         if (last._state < PRE_CLOSED) {
01806                                 write_attributes(last);
01807                                 close_pre(last);
01808                         }
01809
01810                         ++last._children;
01811                 }
01812
01813                 StackEntry entry;
01814                 entry._node_name = name;
01815                 _stack.push(entry);
01816
01817                 write_pre(entry);
01818         }

XS_String& XMLStorage::XMLWriter::operator[] ( const XS_String & attr_name ) [inline]

C++ write access to an attribute.

Definition at line 1840 of file xmlstorage.h.

01841         {
01842                 if (_stack.empty())
01843                         return s_empty_attr;
01844
01845                 return _stack.top()._attributes[attr_name];
01846         }

void XMLStorage::XMLWriter::put | ( | const XS_String & | attr_name,
 |  | const XS_String & | value
 | ) | [inline]

attribute setting

Definition at line 1833 of file xmlstorage.h.

01834         {
01835                 if (!_stack.empty())
01836                         _stack.top()._attributes[attr_name] = value;
01837         }

void XMLStorage::XMLWriter::set_content ( const XS_String & s ) [inline]

Definition at line 1848 of file xmlstorage.h.

01849         {
01850                 if (!_stack.empty())
01851                         _stack.top()._content = s;
01852         }

void XMLStorage::XMLWriter::write_attributes ( StackEntry & entry ) [inline, protected]

Definition at line 1900 of file xmlstorage.h.

References XMLStorage::XMLWriter::StackEntry::_attributes, XMLStorage::XMLWriter::StackEntry::_state, and XMLStorage::EncodeXMLString().

01901         {
01902                 for(AttrMap::const_iterator it=entry._attributes.begin(); it!=entry._attributes.end(); ++it)
01903                         _out << ' ' << EncodeXMLString(it->first) << "=\"" << EncodeXMLString(it->second) << "\"";
01904
01905                 entry._state = ATTRIBUTES;
01906         }

Here is the call graph for this function:

void XMLStorage::XMLWriter::write_post ( StackEntry & entry ) [inline, protected]

Definition at line 1908 of file xmlstorage.h.

References XMLStorage::XMLWriter::StackEntry::_state, XMLStorage::EncodeXMLString(), XMLStorage::PRETTY_INDENT, XMLStorage::PRETTY_LINEFEED, and XML_INDENT_SPACE.

01909         {
01910                 if (entry._state < ATTRIBUTES)
01911                         write_attributes(entry);
01912
01913                 if (entry._children || !entry._content.empty()) {
01914                         if (entry._state < PRE_CLOSED)
01915                                 close_pre(entry);
01916
01917                         _out << entry._content;
01918                         //entry._state = CONTENT;
01919
01920                         if (_pretty>=PRETTY_LINEFEED && entry._content.empty())
01921                                 _out << std::endl;
01922
01923                         if (_pretty==PRETTY_INDENT && entry._content.empty())
01924                                 for(int i=_stack.size(); --i>0; )
01925                                         _out << XML_INDENT_SPACE;
01926
01927                         _out << "</" << EncodeXMLString(entry._node_name) << ">";
01928                 } else {
01929                         _out << "/>";
01930                 }
01931
01932                 entry._state = POST;
01933         }

Here is the call graph for this function:

void XMLStorage::XMLWriter::write_pre ( StackEntry & entry ) [inline, protected]

Definition at line 1887 of file xmlstorage.h.

References XMLStorage::XMLWriter::StackEntry::_node_name, XMLStorage::EncodeXMLString(), XMLStorage::PRETTY_INDENT, XMLStorage::PRETTY_LINEFEED, and XML_INDENT_SPACE.

01888         {
01889                 if (_pretty >= PRETTY_LINEFEED)
01890                         _out << std::endl;
01891
01892                 if (_pretty == PRETTY_INDENT)
01893                         for(int i=_stack.size(); --i>0; )
01894                                 _out << XML_INDENT_SPACE;
01895
01896                 _out << '<' << EncodeXMLString(entry._node_name);
01897                 //entry._state = PRE;
01898         }

Here is the call graph for this function:

Member Data Documentation

std::ostream& XMLStorage::XMLWriter::_out [protected]

Definition at line 1861 of file xmlstorage.h.

tofstream* XMLStorage::XMLWriter::_pofstream [protected]

Definition at line 1860 of file xmlstorage.h.

PRETTY_FLAGS XMLStorage::XMLWriter::_pretty [protected]

Definition at line 1862 of file xmlstorage.h.

std::stack<StackEntry> XMLStorage::XMLWriter::_stack [protected]

Definition at line 1876 of file xmlstorage.h.

XS_String XMLStorage::XMLWriter::s_empty_attr [static, protected]

Definition at line 1878 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLWriter Member List

This is the complete list of members for XMLStorage::XMLWriter, including all inherited members.

_out | XMLStorage::XMLWriter | [protected]
_pofstream | XMLStorage::XMLWriter | [protected]
_pretty | XMLStorage::XMLWriter | [protected]
_stack | XMLStorage::XMLWriter | [protected]
ATTRIBUTES enum value | XMLStorage::XMLWriter |
AttrMap typedef | XMLStorage::XMLWriter | [protected]
back() | XMLStorage::XMLWriter | [inline]
close_pre(StackEntry &entry) | XMLStorage::XMLWriter | [inline, protected]
create(const XS_String &name) | XMLStorage::XMLWriter | [inline]
NOTHING enum value | XMLStorage::XMLWriter |
operator[](const XS_String &attr_name) | XMLStorage::XMLWriter | [inline]
POST enum value | XMLStorage::XMLWriter |
PRE_CLOSED enum value | XMLStorage::XMLWriter |
put(const XS_String &attr_name, const XS_String &value) | XMLStorage::XMLWriter | [inline]
s_empty_attr | XMLStorage::XMLWriter | [protected, static]
set_content(const XS_String &s) | XMLStorage::XMLWriter | [inline]
write_attributes(StackEntry &entry) | XMLStorage::XMLWriter | [inline, protected]
write_post(StackEntry &entry) | XMLStorage::XMLWriter | [inline, protected]
write_pre(StackEntry &entry) | XMLStorage::XMLWriter | [inline, protected]
WRITESTATE enum name | XMLStorage::XMLWriter |
XMLWriter(std::ostream &out, PRETTY_FLAGS pretty=PRETTY_INDENT, const XMLHeader &header=XMLHeader()) | XMLStorage::XMLWriter | [inline]
XMLWriter(LPCTSTR path, PRETTY_FLAGS pretty=PRETTY_INDENT, const XMLHeader &header=XMLHeader()) | XMLStorage::XMLWriter | [inline]
~XMLWriter() | XMLStorage::XMLWriter | [inline]


ROS Explorer: XMLStorage::XMLWriter::StackEntry Struct Reference

XMLStorage::XMLWriter::StackEntry

XMLStorage::XMLWriter::StackEntry Struct Reference

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLWriter::StackEntry:

[legend]
List of all members.

Public Member Functions

StackEntry ()

Public Attributes

XS_String _node_name
AttrMap _attributes
std::string | _content
WRITESTATE _state
bool | _children

Detailed Description

Definition at line 1866 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMLWriter::StackEntry::StackEntry ( ) [inline]

Definition at line 1873 of file xmlstorage.h.

01873 : _state(NOTHING), _children(false) {}

Member Data Documentation

AttrMap XMLStorage::XMLWriter::StackEntry::_attributes

Definition at line 1868 of file xmlstorage.h.

Referenced by XMLStorage::XMLWriter::write_attributes().

bool XMLStorage::XMLWriter::StackEntry::_children

Definition at line 1871 of file xmlstorage.h.

std::string XMLStorage::XMLWriter::StackEntry::_content

Definition at line 1869 of file xmlstorage.h.

XS_String XMLStorage::XMLWriter::StackEntry::_node_name

Definition at line 1867 of file xmlstorage.h.

Referenced by XMLStorage::XMLWriter::write_pre().

WRITESTATE XMLStorage::XMLWriter::StackEntry::_state

Definition at line 1870 of file xmlstorage.h.

Referenced by XMLStorage::XMLWriter::close_pre(), XMLStorage::XMLWriter::write_attributes(), and XMLStorage::XMLWriter::write_post().

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMLWriter::StackEntry Member List

This is the complete list of members for XMLStorage::XMLWriter::StackEntry, including all inherited members.

_attributes | XMLStorage::XMLWriter::StackEntry |
_children | XMLStorage::XMLWriter::StackEntry |
_content | XMLStorage::XMLWriter::StackEntry |
_node_name | XMLStorage::XMLWriter::StackEntry |
_state | XMLStorage::XMLWriter::StackEntry |
StackEntry() | XMLStorage::XMLWriter::StackEntry | [inline]


ROS Explorer: XMLStorage::XMStringRef Struct Reference

XMLStorage::XMStringRef

XMLStorage::XMStringRef Struct Reference

type converter for string data with write access More...

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMStringRef:

[legend]
List of all members.

Public Member Functions

XMStringRef (XMLNode *node, const XS_String &attr_name, LPCXSSTR def=XS_TEXT(""))
XMStringRef (XMLNode *node, const XS_String &node_name, const XS_String &attr_name, LPCXSSTR def=XS_TEXT(""))
XMStringRef & | operator= (const XS_String &value)
operator const XS_String & () const
void | assign (const XS_String &value)

Protected Attributes

XS_String & _ref

Detailed Description

type converter for string data with write access

Definition at line 1472 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XMStringRef::XMStringRef | ( | XMLNode * | node,
 |  | const XS_String & | attr_name,
 |  | LPCXSSTR | def = XS_TEXT("")
 | ) | [inline]

Definition at line 1474 of file xmlstorage.h.

01475          :      _ref((*node)[attr_name])
01476         {
01477                 if (_ref.empty())
01478                         assign(def);
01479         }

XMLStorage::XMStringRef::XMStringRef | ( | XMLNode * | node,
 |  | const XS_String & | node_name,
 |  | const XS_String & | attr_name,
 |  | LPCXSSTR | def = XS_TEXT("")
 | ) | [inline]

Definition at line 1481 of file xmlstorage.h.

01482          :      _ref(node->subvalue(node_name, attr_name))
01483         {
01484                 if (_ref.empty())
01485                         assign(def);
01486         }

Member Function Documentation

void XMLStorage::XMStringRef::assign ( const XS_String & value ) [inline]

Definition at line 1500 of file xmlstorage.h.

01501         {
01502                 _ref.assign(value);
01503         }

XMLStorage::XMStringRef::operator const XS_String & ( ) const [inline]

Definition at line 1495 of file xmlstorage.h.

01496         {
01497                 return _ref;
01498         }

XMStringRef& XMLStorage::XMStringRef::operator= ( const XS_String & value ) [inline]

Definition at line 1488 of file xmlstorage.h.

01489         {
01490                 assign(value);
01491
01492                 return *this;
01493         }

Member Data Documentation

XS_String& XMLStorage::XMStringRef::_ref [protected]

Definition at line 1506 of file xmlstorage.h.

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XMStringRef Member List

This is the complete list of members for XMLStorage::XMStringRef, including all inherited members.

_ref | XMLStorage::XMStringRef | [protected]
assign(const XS_String &value) | XMLStorage::XMStringRef | [inline]
operator const XS_String &() const | XMLStorage::XMStringRef | [inline]
operator=(const XS_String &value) | XMLStorage::XMStringRef | [inline]
XMStringRef(XMLNode *node, const XS_String &attr_name, LPCXSSTR def=XS_TEXT("")) | XMLStorage::XMStringRef | [inline]
XMStringRef(XMLNode *node, const XS_String &node_name, const XS_String &attr_name, LPCXSSTR def=XS_TEXT("")) | XMLStorage::XMStringRef | [inline]


ROS Explorer: XMLStorage::XS_String Struct Reference

XMLStorage::XS_String

XMLStorage::XS_String Struct Reference

string class for TCHAR strings More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::XS_String:

[legend]
Collaboration diagram for XMLStorage::XS_String:

[legend]
List of all members.

Public Types

typedef std::string | super

Public Member Functions

XS_String ()
XS_String (LPCXSSTR s)
XS_String (LPCXSSTR s, size_t l)
XS_String (const super &other)
XS_String (const XS_String &other)
XS_String (LPCWSTR s)
XS_String (LPCWSTR s, size_t l)
XS_String (const std::wstring &other)
XS_String & | operator= (LPCWSTR s)
void | assign (LPCWSTR s)
void | assign (LPCWSTR s, size_t l)
XS_String & | operator= (LPCXSSTR s)
XS_String & | operator= (const super &s)
void | assign (LPCXSSTR s)
void | assign (LPCXSSTR s, size_t l)
operator LPCXSSTR () const
operator std::wstring () const
XS_String & | printf (LPCXSSTR fmt,...)
XS_String & | vprintf (LPCXSSTR fmt, va_list l)
XS_String & | appendf (LPCXSSTR fmt,...)
XS_String & | vappendf (LPCXSSTR fmt, va_list l)

Detailed Description

string class for TCHAR strings

Definition at line 112 of file xmlstorage.h.

Member Typedef Documentation

typedef std::string XMLStorage::XS_String::super

Definition at line 122 of file xmlstorage.h.

Constructor & Destructor Documentation

XMLStorage::XS_String::XS_String ( ) [inline]

Definition at line 125 of file xmlstorage.h.

00125 {}

XMLStorage::XS_String::XS_String ( LPCXSSTR s ) [inline]

Definition at line 127 of file xmlstorage.h.

00127 {if (s) super::assign(s);}

XMLStorage::XS_String::XS_String | ( | LPCXSSTR | s,
 |  | size_t | l
 | ) | [inline]

Definition at line 128 of file xmlstorage.h.

00128 : super(s, l) {}

XMLStorage::XS_String::XS_String ( const super & other ) [inline]

Definition at line 130 of file xmlstorage.h.

00130 : super(other) {}

XMLStorage::XS_String::XS_String ( const XS_String & other ) [inline]

Definition at line 131 of file xmlstorage.h.

00131 : super(other) {}

XMLStorage::XS_String::XS_String ( LPCWSTR s ) [inline]

Definition at line 141 of file xmlstorage.h.

00141 {assign(s);}

XMLStorage::XS_String::XS_String | ( | LPCWSTR | s,
 |  | size_t | l
 | ) | [inline]

Definition at line 142 of file xmlstorage.h.

00142 {assign(s, l);}

XMLStorage::XS_String::XS_String ( const std::wstring & other ) [inline]

Definition at line 143 of file xmlstorage.h.

00143 {assign(other.c_str());}

Member Function Documentation

XS_String& XMLStorage::XS_String::appendf | ( | LPCXSSTR | fmt,
 |  |  | ...
 | ) | [inline]

Definition at line 191 of file xmlstorage.h.

References BUFFER_LEN, COUNTOF, XS_CHAR, and XS_vsnprintf.

00192         {
00193                 va_list l;
00194                 XS_CHAR b[BUFFER_LEN];
00195
00196                 va_start(l, fmt);
00197                 super::append(b, XS_vsnprintf(b, COUNTOF(b), fmt, l));
00198                 va_end(l);
00199
00200                 return *this;
00201         }

void XMLStorage::XS_String::assign | ( | LPCXSSTR | s,
 |  | size_t | l
 | ) | [inline]

Definition at line 158 of file xmlstorage.h.

00158 {super::assign(s, l);}

void XMLStorage::XS_String::assign ( LPCXSSTR s ) [inline]

Definition at line 157 of file xmlstorage.h.

00157 {super::assign(s);}

void XMLStorage::XS_String::assign | ( | LPCWSTR | s,
 |  | size_t | l
 | ) | [inline]

Definition at line 151 of file xmlstorage.h.

00151 {size_t bl=l; if (s) {LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, (int)l, b, (int)bl, 0, 0));} else erase();}

void XMLStorage::XS_String::assign ( LPCWSTR s ) [inline]

Definition at line 150 of file xmlstorage.h.

Referenced by XMLStorage::assign_utf8(), and XMLStorage::XMLNode::set_content().

00150 {if (s) {size_t bl=wcslen(s); LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, (int)bl, b, (int)bl, 0, 0));} else erase();}

XMLStorage::XS_String::operator LPCXSSTR ( ) const [inline]

Definition at line 160 of file xmlstorage.h.

00160 {return c_str();}

XMLStorage::XS_String::operator std::wstring ( ) const [inline]

Definition at line 167 of file xmlstorage.h.

00167 {size_t bl=length(); LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); return std::wstring(b, MultiByteToWideChar(CP_ACP, 0, c_str(), (int)bl, b, (int)bl));}

XS_String& XMLStorage::XS_String::operator= ( const super & s ) [inline]

Definition at line 156 of file xmlstorage.h.

00156 {super::assign(s); return *this;}

XS_String& XMLStorage::XS_String::operator= ( LPCXSSTR s ) [inline]

Definition at line 155 of file xmlstorage.h.

00155 {if (s) super::assign(s); else erase(); return *this;}

XS_String& XMLStorage::XS_String::operator= ( LPCWSTR s ) [inline]

Definition at line 144 of file xmlstorage.h.

00144 {assign(s); return *this;}

XS_String& XMLStorage::XS_String::printf | ( | LPCXSSTR | fmt,
 |  |  | ...
 | ) | [inline]

Definition at line 170 of file xmlstorage.h.

References BUFFER_LEN, COUNTOF, XS_CHAR, and XS_vsnprintf.

00171         {
00172                 va_list l;
00173                 XS_CHAR b[BUFFER_LEN];
00174
00175                 va_start(l, fmt);
00176                 super::assign(b, XS_vsnprintf(b, COUNTOF(b), fmt, l));
00177                 va_end(l);
00178
00179                 return *this;
00180         }

XS_String& XMLStorage::XS_String::vappendf | ( | LPCXSSTR | fmt,
 |  | va_list | l
 | ) | [inline]

Definition at line 203 of file xmlstorage.h.

References BUFFER_LEN, COUNTOF, XS_CHAR, and XS_vsnprintf.

00204         {
00205                 XS_CHAR b[BUFFER_LEN];
00206
00207                 super::append(b, XS_vsnprintf(b, COUNTOF(b), fmt, l));
00208
00209                 return *this;
00210         }

XS_String& XMLStorage::XS_String::vprintf | ( | LPCXSSTR | fmt,
 |  | va_list | l
 | ) | [inline]

Definition at line 182 of file xmlstorage.h.

References BUFFER_LEN, COUNTOF, XS_CHAR, and XS_vsnprintf.

00183         {
00184                 XS_CHAR b[BUFFER_LEN];
00185
00186                 super::assign(b, XS_vsnprintf(b, COUNTOF(b), fmt, l));
00187
00188                 return *this;
00189         }

The documentation for this struct was generated from the following file:
  • xmlstorage.h


ROS Explorer: Member List

XMLStorage::XS_String Member List

This is the complete list of members for XMLStorage::XS_String, including all inherited members.

appendf(LPCXSSTR fmt,...) | XMLStorage::XS_String | [inline]
assign(LPCWSTR s) | XMLStorage::XS_String | [inline]
assign(LPCWSTR s, size_t l) | XMLStorage::XS_String | [inline]
assign(LPCXSSTR s) | XMLStorage::XS_String | [inline]
assign(LPCXSSTR s, size_t l) | XMLStorage::XS_String | [inline]
operator LPCXSSTR() const | XMLStorage::XS_String | [inline]
operator std::wstring() const | XMLStorage::XS_String | [inline]
operator=(LPCWSTR s) | XMLStorage::XS_String | [inline]
operator=(LPCXSSTR s) | XMLStorage::XS_String | [inline]
operator=(const super &s) | XMLStorage::XS_String | [inline]
printf(LPCXSSTR fmt,...) | XMLStorage::XS_String | [inline]
super typedef | XMLStorage::XS_String |
vappendf(LPCXSSTR fmt, va_list l) | XMLStorage::XS_String | [inline]
vprintf(LPCXSSTR fmt, va_list l) | XMLStorage::XS_String | [inline]
XS_String() | XMLStorage::XS_String | [inline]
XS_String(LPCXSSTR s) | XMLStorage::XS_String | [inline]
XS_String(LPCXSSTR s, size_t l) | XMLStorage::XS_String | [inline]
XS_String(const super &other) | XMLStorage::XS_String | [inline]
XS_String(const XS_String &other) | XMLStorage::XS_String | [inline]
XS_String(LPCWSTR s) | XMLStorage::XS_String | [inline]
XS_String(LPCWSTR s, size_t l) | XMLStorage::XS_String | [inline]
XS_String(const std::wstring &other) | XMLStorage::XS_String | [inline]


ROS Explorer: Hierarchical Index

ROS Explorer Class Hierarchy

Go to the graphical class hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:

  • BitmapSelection
  • BkMode
  • Bookmark
  • BookmarkFolder
  • BookmarkNode
  • BootSector
  • BootSector32
  • BrowserCallback
    • ShellBrowserChildT< BASE >
    • ShellBrowserChildT< ChildWindow >
      • ExtContextMenuHandlerT< ShellBrowserChildT< ChildWindow > >
        • MDIShellBrowserChild
    • ShellBrowserChildT< MainFrameBase >
      • ExtContextMenuHandlerT< ShellBrowserChildT< MainFrameBase > >
        • SDIMainFrame
  • BrowserNavigator
  • BrushSelection
  • BStr
  • Buffer
  • Cache
  • Canvas
    • MemCanvas
      • BufferCanvas
        • BufferedCanvas
          • BufferedPaintCanvas
    • WindowCanvas
  • ChildWndInfo
    • FileChildWndInfo
      • FATChildWndInfo
      • NtObjChildWndInfo
      • RegistryChildWndInfo
      • ShellChildWndInfo
      • WebChildWndInfo
  • ClientRect
  • COMExceptionBase
    • COMException
  • ComInit
  • CommonControlInit
  • CommonDesktop
  • CommonShellMalloc
  • ComSrvObject
    • SimpleComObject
      • DWebBrowserEvents2Impl
        • WebChildWindow
      • EnumFormatEtcImpl
      • IDataObjectImpl
      • IDropSourceImpl
      • OleInPlaceClient
      • ShellBrowser
  • XMLStorage::const_XMLChildrenFilter
  • XMLStorage::const_XMLChildrenFilter::const_iterator
  • XMLStorage::const_XMLPos
  • Context
  • CRITICAL_SECTION
    • CritSect
  • CtxMenuInterfaces
  • DataStorage
  • DEntry
  • DEntry_E
  • Desktop
  • Desktops
  • Directory
    • FATDirectory
      • FATDrive
    • NtObjDirectory
    • RegDirectory
    • RegistryRoot
    • ShellDirectory
    • WinDirectory
  • dirent
  • dirsecz
  • DragSourceHelper
  • dskrwblk
  • DWebBrowserEvents2IF
    • DWebBrowserEvents2Impl
  • DynamicFct< FCT >
  • DynamicLoadLibFct< FCT >
  • Entry
    • FATEntry
      • FATDirectory
    • NtObjEntry
      • NtObjDirectory
    • RegEntry
      • RegDirectory
      • RegistryRoot
    • ShellEntry
      • ShellDirectory
    • WinEntry
      • WinDirectory
  • EventConnection
    • EventConnector
  • ExecuteDialog
  • ExplorerCmd
  • ExplorerGlobals
  • FAT_attribute
  • fattr
  • fdate
  • XMLStorage::FileHolder
    • XMLStorage::tifstream
    • XMLStorage::tofstream
  • FileTypeInfo
  • FixedDWebBrowserEvents2
    • IComSrvQI< FixedDWebBrowserEvents2 >
      • IComSrvBase< FixedDWebBrowserEvents2, DWebBrowserEvents2Impl >
        • DWebBrowserEvents2Impl
  • FontSelection
  • FPDEntry
  • ftime
  • FullScreenParameters
  • ICommDlgBrowser
    • IShellBrowserImpl
      • DesktopWindow
      • ShellBrowser
  • Icon
    • SysCacheIcon
  • IconCache
  • IDataObject
    • IComSrvQI< IDataObject >
      • IComSrvBase< IDataObject, IDataObjectImpl >
        • IDataObjectImpl
  • IDropSource
    • IComSrvQI< IDropSource >
      • IComSrvBase< IDropSource, IDropSourceImpl >
        • IDropSourceImpl
  • IDropTarget
    • IDropTargetImpl
      • DesktopDropTarget
      • TreeDropTarget
  • IEnumFORMATETC
    • IComSrvQI< IEnumFORMATETC >
      • IComSrvBase< IEnumFORMATETC, EnumFormatEtcImpl >
        • EnumFormatEtcImpl
  • IOleClientSite
    • OleInPlaceClient
  • IOleCommandTarget
    • IShellBrowserImpl
  • IOleInPlaceSite
    • OleInPlaceClient
  • IServiceProvider
    • IShellBrowserImpl
  • IShellBrowser
    • IShellBrowserImpl
  • IShellFolderViewCB
    • IComSrvQI< IShellFolderViewCB >
      • IComSrvBase< IShellFolderViewCB, ShellBrowser >
        • ShellBrowser
  • istream
    • XMLStorage::tifstream
  • IUnknown
    • IComSrvQI< IUnknown >
  • Kette
  • list
    • BookmarkList
      • Favorites
  • list
    • ResizeManager
    • XMLStorage::XMLNode::Children
  • Lock
  • map
    • FileTypeManager
    • QuickLaunchMap
    • TaskBarMap
  • MenuInfo
  • NotifyHook
  • NotifyIconConfig
    • NotifyIconDlgInfo
    • NotifyInfo
  • NotifyIconIndex
    • NotifyInfo
  • NTDLL
  • NtObject
  • NtObjectInfo
  • OleInit
  • OpenStruct
  • ostream
    • XMLStorage::tofstream
  • OutputWorker
  • PAINTSTRUCT
    • PaintCanvas
      • BufferedPaintCanvas
  • PIDList
  • Point
  • PopupMenu
  • PROPSHEETHEADER
    • PropertySheetDialog
  • PROPSHEETPAGE
    • PropSheetPage
  • QuickLaunchEntry
  • ResBitmap
  • ResIcon
  • ResIconEx
  • ResizeEntry
  • Root
  • RtlAnsiString
  • RtlUnicodeString
    • UnicodeString
  • SelectedBitmap
  • ShellMalloc
  • ShellPathInfo
  • SIfacePtr< T >
    • ConnectionPoint< T >
  • SIfacePtr< IEnumIDList >
    • ShellItemEnumerator
  • SIfacePtr< IOleInPlaceObject >
  • SIfacePtr< IShellFolder >
    • ShellFolder
      • DesktopFolder
      • SpecialFolder
  • SIfacePtr< IShellLink >
    • ShellLinkPtr
  • SIfacePtr< IWebBrowser2 >
  • SmallIcon
  • SMBtnInfo
  • SpecialFolderFSPath
  • SShellPtr< T >
  • SShellPtr< ITEMIDLIST >
    • ShellPath
      • FileSysShellPath
        • FolderBrowser
      • SpecialFolderPath
        • DesktopFolderPath
  • StartMenuCreateInfo
  • StartMenuDirectory
  • StartMenuEntry
  • string
    • XMLStorage::XS_String
      • XMLStorage::String_from_XML_Char
      • XMLStorage::XMLNode
        • XMLStorage::XMLDoc
          • XMLStorage::XMLMessage
  • string
    • String
      • FmtString
      • ResString
  • STRRET
    • StrRetA
    • StrRetW
  • TaskBarEntry
  • TextColor
  • Thread
    • CollectProgramsThread
  • TrayIcon
  • TrayNotifyCDS
  • TypeCheck< CLASS >
  • UNC
  • VARIANT
    • Variant
  • WaitCursor
  • Window::StaticWindowData
  • WindowCreator< WND_CLASS >
  • WindowCreatorInfo< WND_CLASS, INFO_CLASS >
  • WindowHandle
    • Button
    • HiddenWindow
    • ListSort
    • Static
    • ToolTip
    • Window
      • ChildWindow
        • ExtContextMenuHandlerT< ChildWindow >
          • FileChildWindow
        • IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >
          • WebChildWindow
        • ShellBrowserChildT< ChildWindow >
      • ClockWindow
      • DesktopWindow
      • Dialog
        • OwnerDrawParent< Dialog >
          • CtlColorParent< OwnerDrawParent< Dialog > >
            • ExplorerAboutDlg
        • PropSheetPageDlg
          • OwnerDrawParent< PropSheetPageDlg >
            • DesktopSettingsDlg
          • StartmenuSettingsDlg
          • TaskbarSettingsDlg
        • ResizeController< Dialog >
          • FindProgramDlg
          • MdiSdiDlg
          • TrayNotifyDlg
      • DialogWindow
      • NotifyArea
      • OwnerDrawParent< Window >
        • DesktopBar
        • ExtContextMenuHandlerT< OwnerDrawParent< Window > >
          • StartMenu
            • FavoritesMenu
            • RecentStartMenu
            • StartMenuHandler
              • BrowseMenu
              • SearchMenu
              • SettingsMenu
              • StartMenuRoot
      • PreTranslateWindow
        • MainFrameBase
          • MDIMainFrame
          • ShellBrowserChildT< MainFrameBase >
      • SubclassedWindow
        • BackgroundWindow
        • ColorStatic
        • EditController
        • ExtContextMenuHandlerT< SubclassedWindow >
          • DesktopShellView
          • QuickLaunchBar
        • HyperlinkCtrl
        • OwnerdrawnButton
          • FlatButton
          • PictureButton
            • StartButton
        • Pane
      • TaskBar
  • WindowRect
  • WNDCLASSEX
    • WindowClass
      • BtnWindowClass
      • IconWindowClass
  • XMLStorage::XMLBool
  • XMLStorage::XMLBoolRef
  • XMLStorage::XMLChildrenFilter
  • XMLStorage::XMLChildrenFilter::iterator
  • XMLStorage::XMLHeader
  • XMLStorage::XMLInt
  • XMLStorage::XMLIntRef
  • XMLStorage::XMLPos
  • XMLStorage::XMLReaderBase
    • XMLStorage::XMLReader
  • XMLStorage::XMLString
  • XMLStorage::XMLWriter
  • XMLStorage::XMLWriter::StackEntry
  • XMLStorage::XMStringRef
  • auto_ptr< ShellBrowser >
  • BASE
    • CtlColorParent< BASE >
    • ExtContextMenuHandlerT< BASE >
    • IComSrvQI< BASE >
      • IComSrvBase< BASE, OBJ >
    • IPCtrlWindow< BASE, SMARTPTR >
    • OwnerDrawParent< BASE >
    • ResizeController< BASE >
    • ShellBrowserChildT< BASE >
    • TrayIconControllerTemplate< BASE >
  • IEnumIDList *
  • IOleInPlaceObject *
  • IShellFolder *
  • IShellLink *
  • ITEMIDLIST *
  • IWebBrowser2 *
  • REFIID


ROS Explorer: auto_ptr< ShellBrowser > Class Reference

auto_ptr< ShellBrowser > Class Reference

The documentation for this class was generated from the following files:


ROS Explorer: BASE Class Reference

BASE Class Reference

Inheritance diagram for BASE:

[legend]
The documentation for this class was generated from the following file:
  • window.h


ROS Explorer: IEnumIDList * Class Reference

IEnumIDList * Class Reference

The documentation for this class was generated from the following files:


ROS Explorer: IOleInPlaceObject * Class Reference

IOleInPlaceObject * Class Reference

The documentation for this class was generated from the following files:


ROS Explorer: IShellFolder * Class Reference

IShellFolder * Class Reference

The documentation for this class was generated from the following files:


ROS Explorer: IShellLink * Class Reference

IShellLink * Class Reference

The documentation for this class was generated from the following files:


ROS Explorer: ITEMIDLIST * Class Reference

ITEMIDLIST * Class Reference

The documentation for this class was generated from the following files:


ROS Explorer: IWebBrowser2 * Class Reference

IWebBrowser2 * Class Reference

The documentation for this class was generated from the following files:


ROS Explorer: REFIID Class Reference

REFIID Class Reference

The documentation for this class was generated from the following files:


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- _ -

  • _0 : NtObject
  • _1 : NtObject, OpenStruct
  • _3 : OpenStruct
  • _4 : NtObject, OpenStruct
  • _5 : NtObject, OpenStruct
  • _6 : NtObject
  • _7 : NtObject
  • _8 : NtObject
  • _9 : NtObject
  • _A : NtObject
  • _active : FlatButton
  • _activeColor : FlatButton
  • _additional : XMLStorage::XMLHeader
  • _alignment_cur : DesktopSettingsDlg
  • _alignment_tmp : DesktopSettingsDlg
  • _alive : Thread
  • _alloc : FATDirectory
  • _arrow_btns : StartMenu
  • _atomClass : WindowClass
  • _attributes : XMLStorage::XMLWriter::StackEntry, XMLStorage::XMLNode
  • _B : NtObject
  • _begin : XMLStorage::const_XMLChildrenFilter, XMLStorage::XMLChildrenFilter
  • _bhfi : Entry
  • _bhfi_valid : Entry
  • _bmp : BufferCanvas
  • _bmp0 : DesktopSettingsDlg
  • _bmp1 : DesktopSettingsDlg
  • _bmp10 : DesktopSettingsDlg
  • _bmp2 : DesktopSettingsDlg
  • _bmp3 : DesktopSettingsDlg
  • _bmp4 : DesktopSettingsDlg
  • _bmp5 : DesktopSettingsDlg
  • _bmp6 : DesktopSettingsDlg
  • _bmp7 : DesktopSettingsDlg
  • _bmp8 : DesktopSettingsDlg
  • _bmp9 : DesktopSettingsDlg
  • _bmp_idx : TaskBarEntry
  • _bookmarks : FavoritesMenu, BookmarkFolder
  • _boot_sector : FATDrive
  • _border_left : StartMenu
  • _border_top : StartMenu, StartMenuCreateInfo
  • _bottom_max : StartMenu
  • _browser : BrowserNavigator
  • _browser_initialized : BrowserNavigator
  • _btn_dist : QuickLaunchBar
  • _btn_idx : TaskBarEntry
  • _buf : XMLStorage::tofstream, XMLStorage::tifstream
  • _bufents : FATDrive
  • _bufl : FATDrive
  • _buttons : StartMenu
  • _cache : FindProgramDlg
  • _cache_empty : FATDrive
  • _cache_valid : CollectProgramsThread
  • _CacheCnt : FATDrive
  • _CacheCount : FATDrive
  • _CacheDty : FATDrive
  • _Caches : FATDrive
  • _CacheSec : FATDrive
  • _callback : DWebBrowserEvents2Impl, ShellBrowser, CollectProgramsThread
  • _cfg : NotifyArea, ExplorerGlobals
  • _cfg_dir : ExplorerGlobals
  • _cfg_org : TrayNotifyDlg, TaskbarSettingsDlg
  • _cfg_path : ExplorerGlobals
  • _cfStrFName : ExplorerGlobals
  • _children : XMLStorage::XMLWriter::StackEntry, XMLStorage::XMLNode
  • _classname : FileTypeInfo
  • _client_side : IPCtrlWindow< BASE, SMARTPTR >
  • _clnt_rect : SDIMainFrame
  • _clock_width : NotifyArea
  • _clrCompressed : Pane
  • _cluster : FATEntry
  • _cm_ifs : ExtContextMenuHandlerT< BASE >, ShellBrowser
  • _cmd : HyperlinkCtrl
  • _cmdShow : ExplorerCmd
  • _colorVisited : HyperlinkCtrl
  • _common_programs : FindProgramDlg
  • _compare_fct : ListSort
  • _connectionpoint : EventConnection
  • _connector : WebChildWindow
  • _content : XMLStorage::XMLWriter::StackEntry, XMLStorage::XMLReaderBase, XMLStorage::XMLNode, Entry
  • _context : COMException
  • _control : IPCtrlWindow< BASE, SMARTPTR >
  • _cookie : EventConnection
  • _create_crit_sect : Window::StaticWindowData
  • _create_info : StartMenu, MDIShellBrowserChild, ShellBrowser
  • _creator : StartMenuCreateInfo
  • _crit_sect : Thread, Lock
  • _crsr_link : HyperlinkCtrl
  • _ctx : Context
  • _cur : XMLStorage::const_XMLPos, XMLStorage::XMLPos, XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator, Pane
  • _cur_bufs : FATDirectory
  • _cur_dir : ShellBrowser
  • _current_desktop : Desktops
  • _cx : PictureButton
  • _cy : PictureButton
  • _data : Entry
  • _description : BookmarkFolder, Bookmark
  • _desktop : CommonDesktop
  • _desktop_mode : ExplorerGlobals
  • _desktopBar : DesktopWindow
  • _desktops : ExplorerGlobals
  • _destroy : Thread
  • _dir : StartMenuDirectory, QuickLaunchBar, FATDirectory
  • _direction : ListSort
  • _dirs : StartMenu, CollectProgramsThread
  • _display_name : Entry
  • _display_version : BackgroundWindow
  • _display_version_org : DesktopSettingsDlg
  • _displayname : FileTypeInfo
  • _dlg_creator : PropSheetPage
  • _doctype : XMLStorage::XMLHeader
  • _down : Entry
  • _drive : FATDirectory
  • _drive_type : Root
  • _drives : MDIMainFrame
  • _dwRef : IShellBrowserImpl
  • _dwState : NotifyInfo
  • _enabled : SMBtnInfo
  • _encoding : XMLStorage::XMLHeader, XMLStorage::XMLReaderBase
  • _end : XMLStorage::const_XMLChildrenFilter, XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter, XMLStorage::XMLChildrenFilter::iterator
  • _end_leading : XMLStorage::XMLNode
  • _entries : FavoritesMenu, StartMenu, StartMenuEntry, QuickLaunchBar
  • _entry : QuickLaunchEntry, Root, FPDEntry
  • _ents : FATDirectory
  • _etype : FileChildWndInfo, Entry
  • _evtFinish : Thread
  • _expanded : Entry
  • _FATCache : FATDrive
  • _favorites : ExplorerGlobals
  • _favorites_path : ExplorerGlobals
  • _fct : DynamicLoadLibFct< FCT >, DynamicFct< FCT >
  • _file : COMException
  • _filter : StartMenuCreateInfo
  • _filter_name : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • _flags : ResizeEntry, ExplorerCmd
  • _flat : PictureButton
  • _floating_btn : StartMenu
  • _focus_pane : ChildWindow
  • _folder : ShellDirectory, ShellBrowser
  • _folders : StartMenuCreateInfo
  • _format : DataStorage
  • _fs : Root
  • _fs_flags : Root
  • _fsState : TaskBarEntry
  • _ftype_mgr : ExplorerGlobals
  • _fullpath : SpecialFolderFSPath
  • _fullscreen : MainFrameBase
  • _h : BufferCanvas
  • _hAccel : MainFrameBase
  • _haccel : TrayNotifyDlg, FindProgramDlg
  • _haddressedit : MainFrameBase
  • _hasSubmenu : SMBtnInfo
  • _hbmp : TaskBarEntry, QuickLaunchEntry
  • _hBmp : PictureButton, ResBitmap
  • _hBrush : PictureButton
  • _hbrush_bkgnd : ColorStatic
  • _hcommandedit : MainFrameBase
  • _hdc : BrushSelection, BitmapSelection, FontSelection, BkMode, TextColor, SelectedBitmap, Canvas
  • _hdctarg : BufferCanvas
  • _hDrive : FATDrive
  • _hdrivebar : MDIMainFrame
  • _header : XMLStorage::XMLDoc
  • _header_wdths_ok : FileChildWindow
  • _hextrabar : MDIMainFrame
  • _hfont : HyperlinkCtrl, ColorStatic, OutputWorker, ExplorerAboutDlg
  • _hframeClass : ExplorerGlobals
  • _hIcon : PictureButton, NotifyInfo
  • _hicon : ResIconEx, SmallIcon, ResIcon, Icon
  • _hide_inactive : NotifyArea
  • _himl : TrayNotifyDlg, ShellBrowser, Pane, MainFrameBase
  • _himl_old : ShellBrowser, MainFrameBase
  • _himlSys_small : IconCache
  • _hInstance : ExplorerGlobals
  • _hitemConfig : TrayNotifyDlg
  • _hitemCurrent : TrayNotifyDlg
  • _hitemCurrent_hidden : TrayNotifyDlg
  • _hitemCurrent_visible : TrayNotifyDlg
  • _hKeyRoot : RegDirectory
  • _hMainWnd : ExplorerGlobals
  • _hmdiclient : ChildWndInfo, MDIMainFrame
  • _hmenu : PopupMenu
  • _hMenuFrame : MainFrameBase
  • _hMenuView : MenuInfo
  • _hMenuWindow : MainFrameBase
  • _hModule : DynamicLoadLibFct< FCT >
  • _hook : NotifyArea
  • _hparent : TrayIcon
  • _hr : COMExceptionBase
  • _hsidebar : MainFrameBase
  • _hstatusbar : MainFrameBase
  • _hThread : Thread
  • _htoolbar : TaskBar, MainFrameBase
  • _hWnd : NotifyIconIndex
  • _hwnd : ResizeManager, PropertySheetDialog, WindowCanvas, PaintCanvas, WindowHandle, OleInPlaceClient, ShellDirectory, ShellBrowser, CollectProgramsThread
  • _hwndClock : NotifyArea
  • _hwndDesktop : ExplorerGlobals
  • _hwndDesktopBar : ExplorerGlobals
  • _hwndForeground : Desktop
  • _hWndFrame : ShellBrowser
  • _hwndFrame : ChildWindow
  • _hwndHeader : Pane
  • _hwndListView : DesktopShellView
  • _hwndNotify : DesktopBar
  • _hwndQuickLaunch : DesktopBar
  • _hwndrebar : DesktopBar, MainFrameBase
  • _hwndShellView : ExplorerGlobals
  • _hwndTaskBar : DesktopBar
  • _icon_algo : DesktopShellView
  • _icon_cache : ExplorerGlobals
  • _icon_id : SMBtnInfo, StartMenuEntry, Entry
  • _icon_idx : Bookmark
  • _icon_map : NotifyArea
  • _icon_path : Bookmark
  • _icon_states_org : TrayNotifyDlg
  • _icons : IconCache
  • _id : TrayIcon, ResizeEntry, TaskBarEntry, SMBtnInfo, Icon
  • _idx : NotifyInfo
  • _idxCache : IconCache
  • _idxIcon : FPDEntry
  • _ignore : StartMenuDirectory
  • _image_map : ShellBrowser
  • _in : XMLStorage::XMLReader
  • _in_place_object : IPCtrlWindow< BASE, SMARTPTR >
  • _info : TrayNotifyDlg, StartMenuCreateInfo
  • _instructions : XMLStorage::XMLReaderBase
  • _invisible_lines : StartMenu
  • _itype : Icon
  • _large_icons : StartMenu
  • _last : Context
  • _last_btn_width : TaskBar
  • _last_error : XMLStorage::XMLDoc
  • _last_error_msg : XMLStorage::XMLDoc
  • _last_foreground_wnd : TaskBar
  • _last_icon_count : NotifyArea
  • _last_mouse_pos : StartMenu
  • _last_pos : StartMenu
  • _last_sel : ShellBrowser
  • _last_size : ResizeManager
  • _last_split : ChildWindow, SDIMainFrame
  • _last_tag : XMLStorage::XMLReaderBase
  • _lastChange : NotifyIconDlgInfo, NotifyInfo
  • _leading : XMLStorage::XMLNode
  • _left : FileChildWindow
  • _left_hwnd : ChildWindow, ShellBrowser, SDIMainFrame
  • _level : Entry
  • _line : COMException
  • _list_ctrl : FindProgramDlg
  • _log : ExplorerGlobals
  • _logo_size : StartMenuRoot
  • _lwr_filter : FindProgramDlg
  • _malloc : SShellPtr< T >
  • _map : TaskBar
  • _map_crit_sect : Window::StaticWindowData
  • _mdi : ExplorerCmd
  • _medium : DataStorage
  • _menu_info : ChildWindow, MainFrameBase
  • _menu_path : FPDEntry
  • _min_wnd_size : ResizeManager
  • _minimized : Desktop
  • _mmMetrics_org : TaskBar
  • _mode : BufferedCanvas, FullScreenParameters, NotifyIconConfig
  • _modulePath : NotifyIconConfig
  • _msg : COMExceptionBase
  • _name : NotifyIconConfig, BookmarkFolder, Bookmark
  • _navigator : WebChildWindow, DWebBrowserEvents2Impl
  • _neverShowExt : FileTypeInfo
  • _new_html_txt : BrowserNavigator
  • _new_url : BrowserNavigator
  • _next : Entry
  • _next_id : TaskBar, StartMenu, QuickLaunchBar
  • _next_idx : NotifyArea
  • _node_name : XMLStorage::XMLWriter::StackEntry
  • _num_sep : OutputWorker
  • _obj : Context
  • _ObjectOpenFunctions : NTDLL
  • _old_bkmode : BkMode
  • _old_color : TextColor
  • _old_cursor : WaitCursor
  • _old_hbmp : SelectedBitmap
  • _old_hBmp : BitmapSelection
  • _old_hBrush : BrushSelection
  • _old_hFont : FontSelection
  • _open_mode : ShellPathInfo, FileChildWndInfo
  • _orgPos : FullScreenParameters
  • _orgWndProc : SubclassedWindow
  • _out : XMLStorage::XMLWriter
  • _out_wrkr : Pane
  • _p : BStr, SIfacePtr< T >, SShellPtr< T >, CommonShellMalloc
  • _pages : PropertySheetDialog
  • _para : CollectProgramsThread
  • _parser : XMLStorage::XMLReaderBase
  • _path : FileChildWindow, FileChildWndInfo, Root, Directory, FPDEntry, ExplorerCmd
  • _pathCache : IconCache
  • _pbookmark : BookmarkNode
  • _pctxmenu2 : CtxMenuInterfaces
  • _pctxmenu3 : CtxMenuInterfaces
  • _pDropTarget : ShellBrowser, DesktopShellView
  • _pfile : XMLStorage::FileHolder
  • _pfolder : BookmarkNode
  • _pidl : ShellEntry
  • _pIDList : PIDList
  • _pNotifyArea : TrayNotifyDlg
  • _pofstream : XMLStorage::XMLWriter
  • _pos : XMLStorage::XMLMessage, XMLStorage::XMLReaderBase, FileChildWndInfo
  • _positions : Pane
  • _prescan_nodes : ExplorerGlobals
  • _pretty : XMLStorage::XMLWriter
  • _pShellView : ShellBrowser, DesktopShellView, DesktopWindow
  • _read_ahead : FATDrive
  • _ref : XMLStorage::XMStringRef, XMLStorage::XMLIntRef, XMLStorage::XMLBoolRef, ComSrvObject
  • _resize_mgr : ResizeController< BASE >
  • _right : FileChildWindow
  • _right_hwnd : ChildWindow, ShellBrowser, SDIMainFrame
  • _root : XMLStorage::const_XMLPos, XMLStorage::XMLPos, ShellBrowser, Pane, FileChildWindow
  • _root_shell_path : ShellPathInfo, ShellChildWndInfo
  • _scanned : Entry
  • _SClus : FATDrive
  • _scroll_mode : StartMenu
  • _scroll_pos : StartMenu
  • _secarr : FATDirectory
  • _selected_id : StartMenu
  • _selectedItem : TrayNotifyDlg
  • _shell_attribs : Entry
  • _shell_path : ShellPathInfo, ShellChildWndInfo
  • _shellBrowser : ShellBrowserChildT< BASE >
  • _shellpath_info : MDIShellBrowserChild, SDIMainFrame
  • _show_button : NotifyArea
  • _show_hidden : NotifyArea
  • _show_hidden_org : TrayNotifyDlg
  • _size : QuickLaunchBar
  • _sort : FindProgramDlg
  • _sort_crit : ListSort
  • _sort_order : Root
  • _sorted_icons : NotifyArea
  • _spaceSize : OutputWorker
  • _split_pos : ChildWindow, SDIMainFrame
  • _stack : XMLStorage::XMLWriter, XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • _startMenuRoot : DesktopBar
  • _state : XMLStorage::XMLWriter::StackEntry
  • _statusText : ChildWindow
  • _stgm : PIDList
  • _str : UNC
  • _submenu : StartMenu
  • _submenu_id : StartMenu
  • _sys_idx : Icon
  • _taskbar_pos : DesktopBar
  • _textColor : HyperlinkCtrl, ColorStatic, FlatButton
  • _thread : FindProgramDlg
  • _time : ClockWindow
  • _tipText : NotifyIconConfig
  • _title : TaskBarEntry, SMBtnInfo, StartMenuCreateInfo, StartMenuEntry, QuickLaunchEntry
  • _tooltip : ClockWindow, NotifyArea
  • _trailing : XMLStorage::XMLNode
  • _tree_ctrl : TrayNotifyDlg
  • _treePane : Pane
  • _type : BookmarkNode, NtObjEntry
  • _type_name : Entry
  • _uCallbackMessage : NotifyInfo
  • _uID : NotifyIconIndex
  • _up : Entry
  • _url : ChildWindow, Bookmark, SDIMainFrame
  • _url_history : ChildWindow
  • _used : TaskBarEntry
  • _user_programs : FindProgramDlg
  • _usingCOM : IPCtrlWindow< BASE, SMARTPTR >
  • _uuid_base : IComSrvQI< BASE >
  • _valid_path : ExplorerCmd
  • _value : XMLStorage::XMLString, XMLStorage::XMLInt, XMLStorage::XMLBool
  • _version : XMLStorage::XMLHeader, NotifyInfo
  • _visible_cols : Pane
  • _volname : Root
  • _w : BufferCanvas
  • _wasZoomed : FullScreenParameters
  • _widths : Pane
  • _window_modules : NotifyArea
  • _windows : Desktop
  • _windowTitle : NotifyIconConfig
  • _work_area_org : DesktopBar
  • _x : BufferCanvas
  • _xml_version : XMLStorage::XMLReaderBase
  • _y : BufferCanvas


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- j -

  • jmp : BootSector32, BootSector
  • jump_to() : ShellBrowser, SDIMainFrame
  • jump_to_int() : ChildWindow, WebChildWindow, MDIShellBrowserChild, FileChildWindow
  • jump_to_pidl() : ShellBrowser
  • JumpToNextShortcut() : StartMenu


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- l -

  • Label : BootSector
  • launch_entry() : ShellEntry, RegEntry, NtObjEntry, Entry
  • LaunchLink() : HyperlinkCtrl
  • LaunchSelected() : FindProgramDlg
  • length() : BStr
  • ListSort() : ListSort
  • Lock() : Lock


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- m -

  • m_bDropped : IDropSourceImpl
  • m_hTargetWnd : IDropTargetImpl
  • MainFrameBase() : MainFrameBase
  • match() : NotifyIconConfig
  • MDICBTHookProc() : Window
  • MDIMainFrame() : MDIMainFrame
  • MdiSdiDlg() : MdiSdiDlg
  • MDIShellBrowserChild() : MDIShellBrowserChild
  • MediaDescr : BootSector32, BootSector
  • MemCanvas() : MemCanvas
  • MessageLoop() : Window
  • MessageSFVCB() : ShellBrowser
  • min : ftime
  • Modify() : TrayIcon
  • modify() : NotifyInfo
  • ModulePathCopyData() : NotifyHook
  • month : fdate


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- n -

  • name : NtObjectInfo, DEntry_E
  • Navigate() : StartMenu
  • NavigateComplete2() : WebChildWindow, DWebBrowserEvents2Impl, DWebBrowserEvents2IF
  • navigated() : BrowserNavigator
  • NavigateError() : WebChildWindow, DWebBrowserEvents2IF
  • NewWindow2() : WebChildWindow, DWebBrowserEvents2IF
  • Next() : EnumFormatEtcImpl
  • nicon_data : TrayNotifyCDS
  • NOTHING : XMLStorage::XMLWriter
  • Notify() : SubclassedWindow, Window, ClockWindow, TrayNotifyDlg, NotifyArea, TaskBar, QuickLaunchBar, DesktopBar, ShellBrowserChildT< BASE >, Pane, MainFrameBase, FileChildWindow, TaskbarSettingsDlg, DesktopSettingsDlg, FindProgramDlg, DesktopShellView
  • notify_code : TrayNotifyCDS
  • NotifyArea() : NotifyArea
  • NotifyHook() : NotifyHook
  • NotifyIconConfig() : NotifyIconConfig
  • NotifyIconDlgInfo() : NotifyIconDlgInfo
  • NotifyIconIndex() : NotifyIconIndex
  • NotifyInfo() : NotifyInfo
  • NtClose : NTDLL
  • NTDLL() : NTDLL
  • NtObjChildWndInfo() : NtObjChildWndInfo
  • NtObjDirectory() : NtObjDirectory
  • NtObjEntry() : NtObjEntry
  • NtOpenDirectoryObject : NTDLL
  • NtOpenEvent : NTDLL
  • NtOpenEventPair : NTDLL
  • NtOpenFile : NTDLL
  • NtOpenIoCompletion : NTDLL
  • NtOpenKey : NTDLL
  • NtOpenMutant : NTDLL
  • NtOpenProcess : NTDLL
  • NtOpenSection : NTDLL
  • NtOpenSemaphore : NTDLL
  • NtOpenSymbolicLinkObject : NTDLL
  • NtOpenThread : NTDLL
  • NtOpenTimer : NTDLL
  • NtQueryDirectoryObject : NTDLL
  • NtQueryObject : NTDLL
  • NtQuerySymbolicLinkObject : NTDLL
  • NumberFATs : BootSector32, BootSector


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- o -

  • OEM : BootSector32, BootSector
  • OleInit() : OleInit
  • OleInPlaceClient() : OleInPlaceClient
  • OnAddressbar() : WebChildWindow, DWebBrowserEvents2IF
  • OnDefaultCommand() : IShellBrowserImpl, ShellBrowser, DesktopWindow
  • OnDrop() : TreeDropTarget, IDropTargetImpl, DesktopDropTarget
  • OnFullscreen() : WebChildWindow, DWebBrowserEvents2IF
  • OnInPlaceActivate() : OleInPlaceClient
  • OnInPlaceDeactivate() : OleInPlaceClient
  • OnMenubar() : WebChildWindow, DWebBrowserEvents2IF
  • OnPosRectChange() : OleInPlaceClient
  • OnQuit() : WebChildWindow, DWebBrowserEvents2IF
  • OnShowWindow() : OleInPlaceClient
  • OnStateChange() : IShellBrowserImpl
  • OnStatusbar() : WebChildWindow, DWebBrowserEvents2IF
  • OnTheatermode() : WebChildWindow, DWebBrowserEvents2IF
  • OnToolbar() : WebChildWindow, DWebBrowserEvents2IF
  • OnTreeGetDispInfo() : ShellBrowser
  • OnTreeItemExpanding() : ShellBrowser
  • OnTreeItemRClick() : ShellBrowser
  • OnTreeItemSelected() : ShellBrowser
  • OnUIActivate() : OleInPlaceClient
  • OnUIDeactivate() : OleInPlaceClient
  • OnViewWindowActive() : IShellBrowserImpl
  • OnVisible() : WebChildWindow, DWebBrowserEvents2IF
  • OpenShellFolders() : MainFrameBase
  • OpenSubmenu() : StartMenu
  • operator &() : WindowHandle, SIfacePtr< T >
  • operator *() : XMLStorage::const_XMLPos, XMLStorage::XMLPos, XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator, DynamicLoadLibFct< FCT >, DynamicFct< FCT >, SShellPtr< T >
  • operator ATOM() : WindowClass
  • operator BaseIterator() : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • operator bool() : XMLStorage::XMLBoolRef, XMLStorage::XMLBool, DynamicLoadLibFct< FCT >, DynamicFct< FCT >, Variant
  • operator BSTR() : BStr
  • operator const XMLNode *() : XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • operator const XS_String &() : XMLStorage::XMStringRef, XMLStorage::XMLString
  • operator HBITMAP() : ResBitmap
  • operator HDC() : BufferedPaintCanvas, Canvas, PaintCanvas
  • operator HICON() : ResIconEx, SmallIcon, ResIcon
  • operator HMENU() : PopupMenu
  • operator HWND() : WindowHandle
  • operator ICON_ID() : Icon
  • operator IDispatch *() : Variant
  • operator IMalloc *() : CommonShellMalloc
  • operator int() : XMLStorage::XMLIntRef, XMLStorage::XMLInt
  • operator long() : Variant
  • operator LPCTSTR() : WindowClass, String, SpecialFolderFSPath, FileSysShellPath
  • operator LPCWSTR() : UNC, UnicodeString
  • operator LPCXSSTR() : XMLStorage::XMLBool, XMLStorage::XS_String
  • operator LPIDA() : PIDList
  • operator LPPOINT() : Point
  • operator LPRECT() : WindowRect, ClientRect
  • operator ShellFolder &() : CommonDesktop
  • operator std::wstring() : XMLStorage::XS_String
  • operator T *() : SIfacePtr< T >
  • operator T const *() : SShellPtr< T >
  • operator VARIANT_BOOL() : Variant
  • operator wstring() : String
  • operator XMLNode *() : XMLStorage::XMLPos
  • operator XS_String() : XMLStorage::XMLInt
  • operator!() : XMLStorage::XMLBoolRef, XMLStorage::XMLBool
  • operator!=() : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • operator++() : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • operator+=() : ShellPath
  • operator->() : XMLStorage::const_XMLPos, XMLStorage::XMLPos, SIfacePtr< T >, SShellPtr< T >, ShellMalloc
  • operator< : NotifyInfo, NotifyIconIndex
  • operator=() : XMLStorage::XMStringRef, XMLStorage::XMLIntRef, XMLStorage::XMLBoolRef, XMLStorage::XMLNode, XMLStorage::XS_String, String, ShellPath, SIfacePtr< T >, BookmarkNode
  • operator==() : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • operator[]() : XMLStorage::XMLWriter, XMLStorage::XMLPos, XMLStorage::XMLNode, FileTypeManager
  • output_number() : OutputWorker
  • output_tabbed_text() : OutputWorker
  • output_text() : OutputWorker
  • OutputWorker() : OutputWorker
  • OwnerdrawnButton() : OwnerdrawnButton
  • OwnerDrawParent() : OwnerDrawParent< BASE >


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- ~ -

  • ~BitmapSelection() : BitmapSelection
  • ~BkMode() : BkMode
  • ~BookmarkNode() : BookmarkNode
  • ~BrowserCallback() : BrowserCallback
  • ~BrushSelection() : BrushSelection
  • ~BStr() : BStr
  • ~BufferedCanvas() : BufferedCanvas
  • ~CollectProgramsThread() : CollectProgramsThread
  • ~ComInit() : ComInit
  • ~CommonDesktop() : CommonDesktop
  • ~CommonShellMalloc() : CommonShellMalloc
  • ~ComSrvObject() : ComSrvObject
  • ~Context() : Context
  • ~CritSect() : CritSect
  • ~DesktopBar() : DesktopBar
  • ~Desktops() : Desktops
  • ~DesktopWindow() : DesktopWindow
  • ~Dialog() : Dialog
  • ~DialogWindow() : DialogWindow
  • ~Directory() : Directory
  • ~DragSourceHelper() : DragSourceHelper
  • ~DWebBrowserEvents2IF() : DWebBrowserEvents2IF
  • ~DynamicLoadLibFct() : DynamicLoadLibFct< FCT >
  • ~Entry() : Entry
  • ~EnumFormatEtcImpl() : EnumFormatEtcImpl
  • ~EventConnection() : EventConnection
  • ~ExplorerAboutDlg() : ExplorerAboutDlg
  • ~FATDirectory() : FATDirectory
  • ~FATDrive() : FATDrive
  • ~FileHolder() : XMLStorage::FileHolder
  • ~FindProgramDlg() : FindProgramDlg
  • ~FontSelection() : FontSelection
  • ~HiddenWindow() : HiddenWindow
  • ~HyperlinkCtrl() : HyperlinkCtrl
  • ~IComSrvQI() : IComSrvQI< IUnknown >, IComSrvQI< BASE >
  • ~IDataObjectImpl() : IDataObjectImpl
  • ~IDropSourceImpl() : IDropSourceImpl
  • ~IDropTargetImpl() : IDropTargetImpl
  • ~IShellBrowserImpl() : IShellBrowserImpl
  • ~Lock() : Lock
  • ~MainFrameBase() : MainFrameBase
  • ~MemCanvas() : MemCanvas
  • ~NotifyArea() : NotifyArea
  • ~NotifyHook() : NotifyHook
  • ~NtObjDirectory() : NtObjDirectory
  • ~OleInit() : OleInit
  • ~PaintCanvas() : PaintCanvas
  • ~Pane() : Pane
  • ~PIDList() : PIDList
  • ~PreTranslateWindow() : PreTranslateWindow
  • ~QuickLaunchBar() : QuickLaunchBar
  • ~QuickLaunchMap() : QuickLaunchMap
  • ~RegDirectory() : RegDirectory
  • ~RegistryRoot() : RegistryRoot
  • ~ResBitmap() : ResBitmap
  • ~Root() : Root
  • ~SelectedBitmap() : SelectedBitmap
  • ~ShellBrowser() : ShellBrowser
  • ~ShellDirectory() : ShellDirectory
  • ~SIfacePtr() : SIfacePtr< T >
  • ~SShellPtr() : SShellPtr< T >
  • ~StartMenu() : StartMenu
  • ~StartMenuDirectory() : StartMenuDirectory
  • ~StrRetA() : StrRetA
  • ~StrRetW() : StrRetW
  • ~TaskBar() : TaskBar
  • ~TaskBarMap() : TaskBarMap
  • ~TextColor() : TextColor
  • ~Thread() : Thread
  • ~tofstream() : XMLStorage::tofstream
  • ~TrayIcon() : TrayIcon
  • ~TrayNotifyDlg() : TrayNotifyDlg
  • ~UNC() : UNC
  • ~Variant() : Variant
  • ~WaitCursor() : WaitCursor
  • ~WinDirectory() : WinDirectory
  • ~Window() : Window
  • ~WindowCanvas() : WindowCanvas
  • ~XMLNode() : XMLStorage::XMLNode
  • ~XMLReaderBase() : XMLStorage::XMLReaderBase
  • ~XMLWriter() : XMLStorage::XMLWriter


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- a -

  • a : FAT_attribute
  • activate() : ToolTip
  • activate_child_window() : MDIMainFrame
  • activate_drive_window() : MDIMainFrame
  • activate_entry() : FileChildWindow
  • ActivateApp() : TaskBar
  • ActivateEntry() : StartMenu
  • add() : ToolTip, PropertySheetDialog, IconCache
  • Add() : TrayIcon, ResizeManager
  • add_child() : XMLStorage::XMLNode
  • add_down() : XMLStorage::XMLPos
  • add_entry() : FindProgramDlg
  • add_to_imagelist() : Icon
  • AddButton() : StartMenu, QuickLaunchBar
  • AddEntries() : FavoritesMenu, RecentStartMenu, SearchMenu, BrowseMenu, SettingsMenu, StartMenuRoot, StartMenu
  • AddEntry() : StartMenu
  • AddRef() : IShellBrowserImpl, IDropTargetImpl
  • AddSeparator() : StartMenu
  • AddShellEntries() : StartMenu
  • AddShortcuts() : QuickLaunchBar
  • AddSuportedFormat() : IDropTargetImpl
  • AddTrayIcons() : TrayIconControllerTemplate< BASE >
  • alloc_len : RtlUnicodeString, RtlAnsiString
  • anz : dskrwblk
  • Append() : PopupMenu
  • appendf() : XMLStorage::XS_String, String
  • archived : fattr
  • assign() : XMLStorage::XMStringRef, XMLStorage::XMLIntRef, XMLStorage::XMLBoolRef, XMLStorage::XMLNode::Children, XMLStorage::XS_String, String, BStr, ShellPath
  • attach() : ShellFolder, BrowserNavigator, OleInPlaceClient
  • attach_control() : OleInPlaceClient
  • attr : DEntry_E
  • AttributeMap : XMLStorage::XMLNode
  • ATTRIBUTES : XMLStorage::XMLWriter
  • AttrMap : XMLStorage::XMLWriter


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- b -

  • b : FAT_attribute
  • B : DEntry
  • back() : XMLStorage::XMLWriter, XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • BackgroundWindow() : BackgroundWindow
  • BaseIterator : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • BeforeNavigate2() : WebChildWindow, DWebBrowserEvents2IF
  • begin() : XMLStorage::const_XMLChildrenFilter, XMLStorage::XMLChildrenFilter
  • BitmapSelection() : BitmapSelection
  • BkMode() : BkMode
  • BMNT_BOOKMARK : BookmarkNode
  • BMNT_FOLDER : BookmarkNode
  • BMNT_NONE : BookmarkNode
  • Bookmark() : Bookmark
  • BookmarkNode() : BookmarkNode
  • BOOKMARKNODE_TYPE : BookmarkNode
  • BootCode : BootSector32, BootSector
  • BootSignature : BootSector32, BootSector
  • BrowseMenu() : BrowseMenu
  • BrowseObject() : IShellBrowserImpl
  • BrowserNavigator() : BrowserNavigator
  • BrushSelection() : BrushSelection
  • BStr() : BStr
  • BtnWindowClass() : BtnWindowClass
  • buf : dskrwblk
  • BufferCanvas() : BufferCanvas
  • BufferedCanvas() : BufferedCanvas
  • BufferedPaintCanvas() : BufferedPaintCanvas
  • Button() : Button
  • ButtonHitTest() : StartMenu
  • BytesPerSector : BootSector32, BootSector


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- c -

  • c_str() : XMLStorage::XMLString
  • CacheKey : IconCache
  • calc_single_width() : Pane
  • calc_tabbed_width() : Pane
  • calc_width() : Pane
  • calc_widths() : Pane
  • CancelModes() : Window, NotifyArea
  • CanInPlaceActivate() : OleInPlaceClient
  • Canvas() : Canvas
  • CheckEntries() : FindProgramDlg
  • ChildWindow() : ChildWindow
  • ChildWndInfo() : ChildWndInfo
  • clear() : XMLStorage::XMLNode, XMLStorage::XMLNode::Children, BookmarkNode
  • ClientRect() : ClientRect
  • ClientToHostWindow() : WebChildWindow, DWebBrowserEvents2IF
  • ClockWindow() : ClockWindow
  • Clone() : EnumFormatEtcImpl
  • close_pre() : XMLStorage::XMLWriter
  • CloseOtherSubmenus() : StartMenu
  • CloseStartMenu() : StartMenuRoot, StartMenu
  • CloseSubmenus() : StartMenu
  • cmd : ExecuteDialog
  • cmdshow : ExecuteDialog
  • collapse_entry() : FileChildWindow
  • collect_programs() : CollectProgramsThread
  • collect_programs_callback() : FindProgramDlg
  • CollectProgramsThread() : CollectProgramsThread
  • ColorStatic() : ColorStatic
  • COMException() : COMException
  • COMExceptionBase() : COMExceptionBase
  • ComInit() : ComInit
  • Command() : PropSheetPageDlg, Dialog, SubclassedWindow, Window, TrayNotifyDlg, NotifyArea, TaskBar, FavoritesMenu, StartMenuHandler, StartMenu, QuickLaunchBar, DesktopBar, SDIMainFrame, MDIMainFrame, MainFrameBase, FileChildWindow, MdiSdiDlg, StartmenuSettingsDlg, TaskbarSettingsDlg, DesktopSettingsDlg, FindProgramDlg, DesktopShellView
  • command() : Pane
  • CommandStateChange() : WebChildWindow, DWebBrowserEvents2IF
  • CommonControlInit() : CommonControlInit
  • CommonDesktop() : CommonDesktop
  • CommonShellMalloc() : CommonShellMalloc
  • CompareFunc() : ListSort, FindProgramDlg
  • ComSrvObject() : ComSrvObject
  • ConnectionPoint() : ConnectionPoint< T >
  • const_iterator() : XMLStorage::const_XMLChildrenFilter::const_iterator
  • const_XMLChildrenFilter() : XMLStorage::const_XMLChildrenFilter
  • const_XMLPos : XMLStorage::const_XMLPos, XMLStorage::XMLNode
  • Context() : Context
  • ContextSensitiveHelp() : IShellBrowserImpl, OleInPlaceClient
  • ControlResize() : DesktopBar
  • cookie : TrayNotifyCDS
  • CopyMedium() : IDataObjectImpl
  • Create() : Window, ClockWindow, NotifyArea, TaskBar, StartMenuRoot, StartMenu, QuickLaunchBar, DesktopBar, SDIMainFrame, MDIMainFrame, MainFrameBase, DesktopWindow
  • create() : XMLStorage::XMLWriter, XMLStorage::XMLPos, ChildWindow, WebChildWindow, MDIShellBrowserChild, FileChildWindow
  • create_absolute_pidl() : ShellPath, WinEntry, ShellEntry, FATEntry, Entry
  • create_bitmap() : Icon
  • create_control() : IPCtrlWindow< BASE, SMARTPTR >
  • create_controller() : Window
  • create_header() : Pane
  • create_mdi_child() : Window
  • create_name() : NotifyIconConfig
  • create_relative() : XMLStorage::XMLPos, XMLStorage::XMLNode
  • CreateChild() : MDIMainFrame
  • CreateInstance() : SIfacePtr< T >
  • CreateSubmenu() : StartMenu
  • creation_time : NtObject
  • CREATORFUNC : Window
  • CREATORFUNC_INFO : Window
  • CritSect() : CritSect
  • CtlColorParent() : CtlColorParent< BASE >
  • CtxMenuInterfaces() : CtxMenuInterfaces
  • cur() : XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • current() : Context


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- d -

  • DAdvise() : IDataObjectImpl
  • dat : Cache, Buffer
  • date : DEntry_E
  • day : fdate
  • DeactivateAndUndo() : OleInPlaceClient
  • DecRef() : SimpleComObject
  • deleted : fattr
  • DesktopBar() : DesktopBar
  • DesktopDropTarget() : DesktopDropTarget
  • DesktopFolderPath() : DesktopFolderPath
  • Desktops() : Desktops
  • DesktopSettingsDlg() : DesktopSettingsDlg
  • DesktopShellView() : DesktopShellView
  • DesktopWindow() : DesktopWindow
  • destroy() : Icon
  • detach() : OleInPlaceClient
  • DetermineHideState() : NotifyArea
  • Dialog() : Dialog
  • DialogProc() : PropSheetPageDlg, Window
  • DialogWindow() : DialogWindow
  • directory : fattr
  • Directory() : Directory
  • DiscardUndoState() : OleInPlaceClient
  • dispatch_dialog_msg() : Window
  • do_context_menu() : ShellEntry, Entry
  • DoContextMenu() : DesktopShellView
  • DocumentComplete() : WebChildWindow, DWebBrowserEvents2IF
  • DoDesktopContextMenu() : DesktopShellView
  • DoModal() : PropertySheetDialog, Dialog
  • DownloadBegin() : WebChildWindow, DWebBrowserEvents2IF
  • DownloadComplete() : DWebBrowserEvents2IF
  • DragEnter() : IDropTargetImpl
  • DragLeave() : TreeDropTarget, IDropTargetImpl, DesktopDropTarget
  • DragOver() : TreeDropTarget, IDropTargetImpl, DesktopDropTarget
  • DragSourceHelper() : DragSourceHelper
  • draw() : Icon
  • draw_item() : Pane
  • DrawArrows() : StartMenu
  • DrawDesktopBkgnd() : BackgroundWindow
  • DrawFloatingButton() : StartMenu
  • DrawItem() : PictureButton, FlatButton, OwnerdrawnButton
  • DriveUnit : BootSector
  • Drop() : IDropTargetImpl
  • DUnadvise() : IDataObjectImpl
  • DWebBrowserEvents2Impl() : DWebBrowserEvents2Impl
  • DWORD() : ExplorerGlobals
  • dyn_cast() : TypeCheck< CLASS >
  • DynamicFct() : DynamicFct< FCT >
  • DynamicLoadLibFct() : DynamicLoadLibFct< FCT >


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- e -

  • E : DEntry
  • EditController() : EditController
  • empty() : SIfacePtr< T >
  • EnableModelessSB() : IShellBrowserImpl
  • end() : XMLStorage::const_XMLChildrenFilter, XMLStorage::XMLChildrenFilter
  • ent : dirent
  • Ent : Kette
  • Entry() : Entry
  • entry_selected() : MDIShellBrowserChild, BrowserCallback, SDIMainFrame
  • EnumDAdvise() : IDataObjectImpl
  • EnumFormatEtc() : IDataObjectImpl
  • EnumFormatEtcImpl() : EnumFormatEtcImpl
  • EnumWndProc() : TaskBar
  • Error() : COMExceptionBase
  • ErrorMessage() : COMExceptionBase
  • EvaluateOption() : ExplorerCmd
  • EventConnection() : EventConnection
  • EventConnector() : EventConnector
  • Exec() : IShellBrowserImpl
  • ExecuteCommandbar() : MainFrameBase
  • expand_entry() : FileChildWindow
  • ExplorerAboutDlg() : ExplorerAboutDlg
  • ExplorerCmd() : ExplorerCmd
  • ExplorerGlobals() : ExplorerGlobals
  • ext : DEntry_E
  • ExtBootFlag : BootSector
  • ExtContextMenuHandlerT() : ExtContextMenuHandlerT< BASE >
  • extract() : IconCache
  • extract_icon() : Entry
  • extract_icons() : ShellDirectory


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- f -

  • FATChildWndInfo() : FATChildWndInfo
  • FATDirectory() : FATDirectory
  • FATDrive() : FATDrive
  • FATEntry() : FATEntry
  • FavoritesMenu() : FavoritesMenu
  • fclus : DEntry_E
  • FileChildWindow() : FileChildWindow
  • FileChildWndInfo() : FileChildWndInfo
  • FileDownload() : WebChildWindow, DWebBrowserEvents2IF
  • FileHolder() : XMLStorage::FileHolder
  • FileSysShellPath() : FileSysShellPath
  • FileSystem : BootSector32, BootSector
  • fill_tree() : BookmarkList
  • fill_w32fdata_shell() : ShellDirectory
  • FillBookmarks() : MainFrameBase
  • find() : XMLStorage::XMLNode
  • find_entry() : WinDirectory, ShellDirectory, RegDirectory, NtObjDirectory, FATDirectory, Entry
  • find_id() : TaskBarMap
  • find_relative() : XMLStorage::XMLNode
  • FindProgramDlg() : FindProgramDlg
  • FlatButton() : FlatButton
  • FmtString() : FmtString
  • FolderBrowser() : FolderBrowser
  • FontSelection() : FontSelection
  • FORMAT_ORIGINAL : XMLStorage::XMLNode
  • FORMAT_PRETTY : XMLStorage::XMLNode
  • FORMAT_SMART : XMLStorage::XMLNode
  • FormatTime() : ClockWindow
  • frame_get_clientspace() : MDIMainFrame, MainFrameBase
  • FrameBeforeNavigate() : WebChildWindow, DWebBrowserEvents2IF
  • FrameNavigateComplete() : WebChildWindow, DWebBrowserEvents2IF
  • FrameNewWindow() : WebChildWindow, DWebBrowserEvents2IF
  • Free() : SIfacePtr< T >, SShellPtr< T >
  • free_dirs() : CollectProgramsThread
  • free_icon() : IconCache
  • free_subentries() : Entry
  • fullscreen_move() : MainFrameBase
  • FullScreenParameters() : FullScreenParameters


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- g -

  • get() : XMLStorage::const_XMLPos, XMLStorage::XMLPos, XMLStorage::XMLNode, SIfacePtr< T >
  • get_browser() : BrowserNavigator
  • get_cache_buffer() : FATDrive
  • get_cfg() : ExplorerGlobals
  • get_children() : XMLStorage::XMLNode
  • get_content() : XMLStorage::XMLNode
  • get_error_code() : XMLStorage::XMLReaderBase
  • get_error_string() : XMLStorage::XMLReaderBase
  • get_first_child() : XMLStorage::XMLNode
  • get_folder() : ShellPath
  • get_frame() : Pane
  • get_hicon() : Icon
  • get_icon() : IconCache
  • get_image_idx() : ShellBrowser
  • get_instructions() : XMLStorage::XMLReaderBase
  • get_name() : ShellFolder
  • get_next_path_component() : WinDirectory, ShellDirectory, RegDirectory, FATDirectory, Entry
  • get_parent_folder() : ShellEntry
  • get_path() : WinEntry, ShellDirectory, ShellEntry, RegEntry, NtObjEntry, FATEntry, Entry
  • get_path_base() : Entry
  • get_position() : XMLStorage::XMLReaderBase
  • get_root() : ShellBrowser, FileChildWindow
  • get_sys_imagelist() : IconCache
  • get_sysiml_idx() : Icon
  • get_window() : Window
  • GetArrowButtonRects() : StartMenu
  • GetButtonInfo() : StartMenu
  • GetButtonRect() : StartMenu
  • GetCanonicalFormatEtc() : IDataObjectImpl
  • GetClientSpace() : ResizeController< BASE >
  • GetContainer() : OleInPlaceClient
  • GetControlWindow() : ShellBrowser, DesktopWindow
  • GetCurrentPage() : PropertySheetDialog
  • GetData() : PIDList, IDataObjectImpl
  • GetDataHere() : IDataObjectImpl
  • GetDisplayName() : FolderBrowser
  • GetFloatingButtonRect() : StartMenu
  • GetIDsOfNames : DWebBrowserEvents2Impl
  • GetLogoResId() : StartMenuRoot
  • GetModulePath() : NotifyHook
  • GetMoniker() : OleInPlaceClient
  • GetSelectionIndex() : StartMenu
  • getStackTrace() : Context
  • GetStaticWindowData() : Window
  • GetString() : StrRetW, StrRetA
  • GetTypeInfo : DWebBrowserEvents2Impl
  • GetTypeInfoCount : DWebBrowserEvents2Impl
  • GetUIObjectOf() : ShellPath, ShellEntry, Entry
  • GetViewStateStream() : IShellBrowserImpl
  • GetWindow() : OleInPlaceClient, ShellBrowser, DesktopWindow
  • GetWindowContext() : OleInPlaceClient
  • GetWndClasss() : StartMenu
  • GiveFeedback() : IDropSourceImpl
  • go() : XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • go_down() : XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • go_to() : XMLStorage::const_XMLPos, XMLStorage::XMLPos, ChildWindow, MDIMainFrame, MainFrameBase
  • goto_url() : BrowserNavigator


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- h -

  • handle_count : NtObject
  • HandleMenuMsg() : CtxMenuInterfaces
  • HandleSize() : ResizeManager
  • Heads : BootSector32, BootSector
  • hidden : fattr
  • HiddenSectors : BootSector32, BootSector
  • HiddenWindow() : HiddenWindow
  • hour : ftime
  • HyperlinkCtrl() : HyperlinkCtrl


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- i -

  • IComSrvBase() : IComSrvBase< BASE, OBJ >
  • IComSrvQI() : IComSrvQI< IUnknown >, IComSrvQI< BASE >
  • Icon() : Icon
  • IconCache() : IconCache
  • IconHitTest() : NotifyArea
  • IconMap : IconCache
  • IconStateMap : TrayNotifyDlg
  • IconStatePair : TrayNotifyDlg
  • IconWindowClass() : IconWindowClass
  • IDataObjectImpl() : IDataObjectImpl
  • IDropSourceImpl() : IDropSourceImpl
  • IDropTargetImpl() : IDropTargetImpl
  • IdxCacheKey : IconCache
  • IdxCacheMap : IconCache
  • import_IE_favorites() : Favorites, BookmarkList
  • IncludeObject() : IShellBrowserImpl
  • IncRef() : SimpleComObject
  • Init() : Window, NotifyArea, TaskBar, StartMenuRoot, StartMenu, DesktopBar, MDIShellBrowserChild, ShellBrowser, DesktopWindow
  • init() : HyperlinkCtrl, PropSheetPage, CommonDesktop, CommonShellMalloc, Pane, ExplorerGlobals, Desktops, IconCache
  • init_output() : OutputWorker
  • InitDragDrop() : ShellBrowser, DesktopShellView
  • InitializeFromBitmap() : DragSourceHelper
  • InitializeFromWindow() : DragSourceHelper
  • InitializeTree() : ShellBrowser
  • insert_entries() : Pane
  • InsertItem() : TrayNotifyDlg
  • InsertMenusSB() : IShellBrowserImpl
  • InsertSubitems() : ShellBrowser
  • invalidate_cache() : ShellBrowser
  • InvalidateSelection() : StartMenu
  • Invoke : DWebBrowserEvents2Impl
  • IPCtrlWindow() : IPCtrlWindow< BASE, SMARTPTR >
  • is_alive() : Thread
  • is_exe_file() : FileTypeManager
  • IShellBrowserImpl() : IShellBrowserImpl
  • IsOK() : FolderBrowser
  • IsValidPath() : ExplorerCmd
  • iterator() : XMLStorage::XMLChildrenFilter::iterator


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- p -

  • padding : NtObjectInfo
  • Paint() : ClockWindow, NotifyArea, StartMenuRoot, StartMenu, ExplorerAboutDlg
  • PaintCanvas() : PaintCanvas
  • Pane() : Pane
  • ParseCmdLine() : ExplorerCmd
  • PathCacheMap : IconCache
  • PictureButton() : PictureButton
  • PIDList() : PIDList
  • Point() : Point
  • PopupContextMenu() : PopupMenu
  • PopupMenu() : PopupMenu
  • pos() : WindowRect, ClientRect
  • PositionIcons() : DesktopShellView
  • POST : XMLStorage::XMLWriter
  • PostParent() : Window
  • PRE_CLOSED : XMLStorage::XMLWriter
  • pretranslate_msg() : Window
  • PreTranslateWindow() : PreTranslateWindow
  • pretty_write_worker() : XMLStorage::XMLNode
  • print() : XMLStorage::XMLHeader
  • printf() : XMLStorage::XS_String, String
  • PrivacyImpactedStateChange() : WebChildWindow, DWebBrowserEvents2IF
  • ProcessCopyData() : DesktopBar
  • ProcessHotKey() : DesktopBar
  • ProcessKey() : StartMenuRoot, StartMenu
  • ProcessMessage() : MainFrameBase
  • ProcessTrayNotification() : NotifyArea
  • ProgressChange() : WebChildWindow, DWebBrowserEvents2IF
  • PropertyChange() : WebChildWindow, DWebBrowserEvents2IF
  • PropertySheetDialog : PropertySheetDialog, PropSheetPageDlg
  • PropSheetCBTHookProc() : Window
  • PropSheetPage : PropSheetPage, PropSheetPageDlg
  • PropSheetPageDlg : PropSheetPageDlg, PropSheetPage
  • put() : XMLStorage::XMLWriter, XMLStorage::XMLPos, XMLStorage::XMLNode


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- q -

  • query_interfaces() : CtxMenuInterfaces
  • QueryActiveShellView() : ShellBrowser, DesktopWindow
  • QueryContinueDrag() : IDropSourceImpl
  • QueryDrop() : IDropTargetImpl
  • QueryGetData() : IDataObjectImpl
  • QueryInterface() : IComSrvQI< IUnknown >, IComSrvQI< BASE >, SIfacePtr< T >, IShellBrowserImpl, IDropTargetImpl, OleInPlaceClient
  • QueryService() : IShellBrowserImpl
  • QueryStatus() : IShellBrowserImpl
  • QuickLaunchBar() : QuickLaunchBar
  • QuickLaunchEntry() : QuickLaunchEntry


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- r -

  • read() : XMLStorage::XMLDoc, XMLStorage::XMLReaderBase, Favorites, BookmarkFolder, BookmarkList, Bookmark
  • read_buffer() : XMLStorage::XMLReader, XMLStorage::XMLReaderBase
  • read_cache() : FATDrive
  • read_config() : NotifyArea
  • read_dir() : FATDirectory
  • read_directory() : WinDirectory, ShellDirectory, RegistryRoot, RegDirectory, NtObjDirectory, FATDirectory, Entry
  • read_directory_base() : Entry
  • read_FAT() : FATDrive
  • read_persistent() : ExplorerGlobals
  • read_sector() : FATDrive
  • read_tree() : Root, Entry
  • read_url() : Bookmark
  • ReadLogoSize() : StartMenuRoot
  • readonly : fattr
  • RecentStartMenu() : RecentStartMenu
  • reference_count : NtObject
  • Refresh() : TrayNotifyDlg, NotifyArea, TaskBar, FindProgramDlg
  • RefreshProperties() : TrayNotifyDlg
  • RegDirectory() : RegDirectory
  • RegEntry() : RegEntry
  • Register() : WindowClass
  • register_dialog() : Window
  • register_pretranslate() : Window
  • RegisterHotkeys() : DesktopBar
  • RegistryChildWndInfo() : RegistryChildWndInfo
  • RegistryRoot() : RegistryRoot
  • Release() : IShellBrowserImpl, IDropTargetImpl
  • remove() : ToolTip
  • Remove() : TrayIcon
  • RemoveMenusSB() : IShellBrowserImpl
  • RequestNewObjectLayout() : OleInPlaceClient
  • ResBitmap() : ResBitmap
  • reserved1 : BootSector32
  • reserved2 : BootSector32
  • ReservedSectors : BootSector32, BootSector
  • Reset() : EnumFormatEtcImpl
  • reset() : CtxMenuInterfaces
  • reset_cache() : FATDrive
  • ResIcon() : ResIcon
  • ResIconEx() : ResIconEx
  • Resize() : ResizeManager, DesktopBar
  • resize_children() : ChildWindow, SDIMainFrame, FileChildWindow
  • resize_frame() : SDIMainFrame, MDIMainFrame, MainFrameBase
  • resize_frame_client() : MainFrameBase
  • ResizeButtons() : TaskBar, StartMenu
  • ResizeController() : ResizeController< BASE >
  • ResizeEntry() : ResizeEntry
  • ResizeManager() : ResizeManager
  • ResizeToButtons() : StartMenu
  • ResString() : ResString
  • Root() : Root
  • RootEntries : BootSector
  • RootSectors : BootSector32
  • rsrvd : DEntry_E
  • RtlAnsiStringToUnicodeString : NTDLL
  • RtlFreeAnsiString : NTDLL
  • RtlFreeUnicodeString : NTDLL
  • RtlInitAnsiString : NTDLL
  • RtlInitUnicodeString : NTDLL
  • RtlUnicodeStringToAnsiString : NTDLL
  • Rueck : Kette
  • Run() : Thread, CollectProgramsThread


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- s -

  • s : dirsecz
  • s_cmn_shell_malloc : ShellMalloc
  • s_current : Context
  • s_def_creator : StartMenu
  • s_dialogs : Window
  • s_empty_attr : XMLStorage::XMLWriter
  • s_hcbtHook : Window
  • s_main : Context
  • s_new_info : Window
  • s_next_id : IconCache
  • s_ObjectTypes : NTDLL
  • s_pretranslate_windows : Window
  • s_window_creator : Window
  • s_wnd_map : Window
  • safe_extract_icon() : Entry
  • SaveObject() : OleInPlaceClient
  • scan_entry() : FileChildWindow
  • Scroll() : OleInPlaceClient
  • SCROLL_DOWN : StartMenu
  • SCROLL_MODE : StartMenu
  • SCROLL_NOT : StartMenu
  • SCROLL_UP : StartMenu
  • SDIMainFrame() : SDIMainFrame
  • search_next() : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • SearchMenu() : SearchMenu
  • sec : dskrwblk
  • sec2 : ftime
  • Sectors16 : BootSector32, BootSector
  • Sectors32 : BootSector32, BootSector
  • SectorsPerCluster : BootSector32, BootSector
  • SectorsPerFAT : BootSector
  • SectorsPerFAT32 : BootSector32
  • SectorsPerTrack : BootSector32, BootSector
  • select_entry() : ShellBrowser
  • SelectButton() : StartMenu
  • SelectButtonIndex() : StartMenu
  • SelectedBitmap() : SelectedBitmap
  • SendControlMsg() : ShellBrowser, DesktopWindow
  • SendParent() : Window
  • SerialNr : BootSector
  • Set() : TrayIcon
  • set_content() : XMLStorage::XMLWriter, XMLStorage::XMLNode
  • set_curdir() : FileChildWindow
  • set_focus_pane() : FileChildWindow
  • set_header() : Pane
  • set_html_page() : BrowserNavigator
  • set_type() : FileTypeManager
  • set_url() : ChildWindow, SDIMainFrame
  • SetData() : IDataObjectImpl
  • SetIconMode() : TrayNotifyDlg
  • SetMenuSB() : IShellBrowserImpl
  • SetMinMaxInfo() : ResizeManager
  • SetSecureLockIcon() : WebChildWindow, DWebBrowserEvents2IF
  • SetStatusTextSB() : IShellBrowserImpl
  • SettingsMenu() : SettingsMenu
  • SetToolbarItems() : IShellBrowserImpl
  • ShellBrowser() : ShellBrowser
  • ShellBrowserChildT() : ShellBrowserChildT< BASE >
  • ShellChildWndInfo() : ShellChildWndInfo
  • ShellDirectory() : ShellDirectory
  • ShellEntry() : ShellEntry
  • ShellFolder() : ShellFolder
  • ShellItemEnumerator() : ShellItemEnumerator
  • ShellLinkPtr() : ShellLinkPtr
  • ShellMalloc() : ShellMalloc
  • ShellPath() : ShellPath
  • ShellPathInfo() : ShellPathInfo
  • show_clock() : NotifyArea
  • ShowAppSystemMenu() : TaskBar
  • ShowLaunchDialog() : StartMenuHandler
  • ShowLogoffDialog() : StartMenuHandler
  • ShowObject() : OleInPlaceClient
  • ShowSearchComputer() : StartMenuHandler
  • ShowSearchDialog() : StartMenuHandler
  • ShowStartMenu() : DesktopBar
  • SIfacePtr() : SIfacePtr< T >
  • size : OpenStruct, DEntry_E
  • Skip() : EnumFormatEtcImpl
  • small_cache() : FATDrive
  • SmallIcon() : SmallIcon
  • smart_create() : XMLStorage::XMLPos
  • smart_scan() : Entry
  • smart_write_worker() : XMLStorage::XMLNode
  • SMBtnInfo() : SMBtnInfo
  • sort() : ListSort
  • sort_directory() : Entry
  • SpecialFolder() : SpecialFolder
  • SpecialFolderFSPath() : SpecialFolderFSPath
  • SpecialFolderPath() : SpecialFolderPath
  • split() : ShellPath
  • SShellPtr() : SShellPtr< T >
  • StackEntry() : XMLStorage::XMLWriter::StackEntry
  • Start() : Thread
  • StartButton() : StartButton
  • StartMenu() : StartMenu
  • StartMenuCreateInfo() : StartMenuCreateInfo
  • StartMenuDirectory() : StartMenuDirectory
  • StartMenuEntry() : StartMenuEntry
  • StartMenuHandler() : StartMenuHandler
  • StartMenuRoot() : StartMenuRoot
  • StartmenuSettingsDlg() : StartmenuSettingsDlg
  • Static() : Static
  • StatusTextChange() : WebChildWindow, DWebBrowserEvents2IF
  • STDMETHODIMP_() : IComSrvBase< BASE, OBJ >, OleInPlaceClient
  • Stop() : Thread
  • str() : XMLStorage::const_XMLPos, XMLStorage::XMLPos, String
  • string : OpenStruct
  • String() : String
  • String_from_XML_Char() : XMLStorage::String_from_XML_Char
  • string_len : RtlUnicodeString, RtlAnsiString
  • string_ptr : RtlUnicodeString, RtlAnsiString
  • SubclassedWindow() : SubclassedWindow
  • SubclassedWndProc() : SubclassedWindow
  • subvalue() : XMLStorage::XMLNode
  • super : XMLStorage::tofstream, XMLStorage::tifstream, XMLStorage::XS_String, EditController, TrayIconControllerTemplate< BASE >, ToolTip, HyperlinkCtrl, ColorStatic, PictureButton, FlatButton, OwnerdrawnButton, OwnerDrawParent< BASE >, CtlColorParent< BASE >, ResizeController< BASE >, ResizeManager, PropSheetPageDlg, Dialog, DialogWindow, PreTranslateWindow, ChildWindow, SubclassedWindow, String, ExtContextMenuHandlerT< BASE >, ShellPath, ShellLinkPtr, ShellFolder, COMException, ClockWindow, TrayNotifyDlg, NotifyIconDlgInfo, NotifyArea, TaskBar, FavoritesMenu, RecentStartMenu, SearchMenu, BrowseMenu, SettingsMenu, StartMenuRoot, StartMenuHandler, StartMenu, QuickLaunchBar, Favorites, StartButton, DesktopBar, WebChildWindow, DWebBrowserEvents2Impl, IPCtrlWindow< BASE, SMARTPTR >, MDIShellBrowserChild, ShellBrowserChildT< BASE >, ShellBrowser, Pane, SDIMainFrame, MDIMainFrame, MainFrameBase, FileChildWindow, WebChildWndInfo, FATChildWndInfo, RegistryChildWndInfo, NtObjChildWndInfo, ShellChildWndInfo, FileChildWndInfo, MdiSdiDlg, StartmenuSettingsDlg, TaskbarSettingsDlg, DesktopSettingsDlg, FindProgramDlg, DesktopShellView, DesktopWindow, BackgroundWindow, FileTypeManager, ExplorerAboutDlg
  • switch_focus_pane() : FileChildWindow
  • SwitchToDesktop() : Desktops
  • SysCacheIcon() : SysCacheIcon
  • system : fattr


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- t -

  • TAG_END : XMLStorage::XMLReaderBase
  • TAG_NONE : XMLStorage::XMLReaderBase
  • TAG_START : XMLStorage::XMLReaderBase
  • TaskBar() : TaskBar
  • TaskBarEntry() : TaskBarEntry
  • TaskbarSettingsDlg() : TaskbarSettingsDlg
  • TextColor() : TextColor
  • Thread() : Thread
  • ThreadProc() : Thread
  • tifstream() : XMLStorage::tifstream
  • time : DEntry_E
  • TimerTick() : ClockWindow
  • TitleChange() : WebChildWindow, DWebBrowserEvents2IF
  • TitleIconChange() : WebChildWindow, DWebBrowserEvents2IF
  • tofstream() : XMLStorage::tofstream
  • toggle() : XMLStorage::XMLBoolRef
  • toggle_child() : MainFrameBase
  • toggle_fullscreen() : MainFrameBase
  • toggle_sort() : ListSort
  • ToggleMinimize() : Desktops
  • toLower() : String
  • ToolTip() : ToolTip
  • toString() : Context, COMException
  • TrackPopupMenu() : PopupMenu
  • TrackPopupMenuAtCursor() : PopupMenu
  • TrackPopupMenuAtPos() : PopupMenu
  • TrackStartmenu() : StartMenuRoot
  • TranslateAcceleratorSB() : IShellBrowserImpl
  • TranslateMsg() : MDIMainFrame, MainFrameBase
  • TrayClick() : TrayIconControllerTemplate< BASE >
  • TrayDblClick() : TrayIconControllerTemplate< BASE >
  • TrayIcon() : TrayIcon
  • TrayIconControllerTemplate() : TrayIconControllerTemplate< BASE >
  • TrayMouseOver() : TrayIconControllerTemplate< BASE >
  • TrayNotifyDlg : TrayNotifyDlg, NotifyArea
  • TreeDropTarget() : TreeDropTarget
  • type : NtObjectInfo


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- u -

  • UNC() : UNC
  • UnicodeString() : UnicodeString
  • unknown1 : BootSector32
  • unknown2 : BootSector32
  • unregister_dialog() : Window
  • unregister_pretranslate() : Window
  • update_clnt_rect() : SDIMainFrame
  • update_shell_browser() : MDIShellBrowserChild, SDIMainFrame
  • UpdateDesktopButtons() : QuickLaunchBar
  • UpdateFolderView() : ShellBrowser
  • UpdateIcons() : NotifyArea, StartMenu


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- v -

  • vappendf() : XMLStorage::XS_String, String
  • Variant() : Variant
  • Vector : PropertySheetDialog
  • volume : fattr
  • Vorw : Kette
  • vprintf() : XMLStorage::XS_String, String


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- w -

  • WaitCursor() : WaitCursor
  • web_super : WebChildWindow
  • WebChildWindow() : WebChildWindow
  • WebChildWndInfo() : WebChildWndInfo
  • WinDirectory() : WinDirectory
  • Window() : Window
  • window_creator() : WindowCreatorInfo< WND_CLASS, INFO_CLASS >, WindowCreator< WND_CLASS >
  • WindowActivate() : WebChildWindow, DWebBrowserEvents2IF
  • WindowCanvas() : WindowCanvas
  • WindowClass() : WindowClass
  • WindowClosing() : WebChildWindow, DWebBrowserEvents2IF
  • WindowHandle() : WindowHandle
  • WindowMap : Window
  • WindowMove() : WebChildWindow, DWebBrowserEvents2IF
  • WindowRect() : WindowRect
  • WindowResize() : WebChildWindow, DWebBrowserEvents2IF
  • WindowSetHeight() : WebChildWindow, DWebBrowserEvents2IF
  • WindowSetLeft() : WebChildWindow, DWebBrowserEvents2IF
  • WindowSetResizable() : WebChildWindow, DWebBrowserEvents2IF
  • WindowSetTop() : WebChildWindow, DWebBrowserEvents2IF
  • WindowSetWidth() : WebChildWindow, DWebBrowserEvents2IF
  • WindowWndProc() : Window
  • WinEntry() : WinEntry
  • WM_GETMODULEPATH : NotifyHook
  • WM_SHELLHOOK : TaskBar
  • WM_TASKBARCREATED : TrayIconControllerTemplate< BASE >, DesktopBar
  • WndProc() : EditController, TrayIconControllerTemplate< BASE >, HyperlinkCtrl, ColorStatic, FlatButton, OwnerdrawnButton, OwnerDrawParent< BASE >, CtlColorParent< BASE >, ResizeController< BASE >, Dialog, ChildWindow, SubclassedWindow, Window, ExtContextMenuHandlerT< BASE >, ClockWindow, TrayNotifyDlg, NotifyArea, TaskBar, StartMenuRoot, StartMenu, QuickLaunchBar, StartButton, DesktopBar, WebChildWindow, IPCtrlWindow< BASE, SMARTPTR >, MDIShellBrowserChild, ShellBrowserChildT< BASE >, Pane, SDIMainFrame, MDIMainFrame, MainFrameBase, ExecuteDialog, FileChildWindow, FindProgramDlg, DesktopShellView, DesktopWindow, BackgroundWindow, ExplorerAboutDlg
  • write() : XMLStorage::XMLDoc, XMLStorage::XMLNode, Favorites, BookmarkFolder, BookmarkList, Bookmark
  • write_attributes() : XMLStorage::XMLWriter
  • write_config() : NotifyArea
  • write_formating() : XMLStorage::XMLDoc
  • WRITE_MODE : XMLStorage::XMLNode
  • write_persistent() : ExplorerGlobals
  • write_post() : XMLStorage::XMLWriter
  • write_pre() : XMLStorage::XMLWriter
  • write_worker() : XMLStorage::XMLNode
  • WRITESTATE : XMLStorage::XMLWriter


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- x -

  • XML_DefaultHandler() : XMLStorage::XMLReaderBase
  • XML_EndElementHandler() : XMLStorage::XMLReaderBase
  • XML_StartElementHandler() : XMLStorage::XMLReaderBase
  • XML_XmlDeclHandler() : XMLStorage::XMLReaderBase
  • XMLBool() : XMLStorage::XMLBool
  • XMLBoolRef() : XMLStorage::XMLBoolRef
  • XMLChildrenFilter() : XMLStorage::XMLChildrenFilter
  • XMLDoc() : XMLStorage::XMLDoc
  • XMLHeader() : XMLStorage::XMLHeader
  • XMLInt() : XMLStorage::XMLInt
  • XMLIntRef() : XMLStorage::XMLIntRef
  • XMLMessage() : XMLStorage::XMLMessage
  • XMLNode() : XMLStorage::XMLNode
  • XMLPos : XMLStorage::XMLPos, XMLStorage::XMLNode
  • XMLReader() : XMLStorage::XMLReader
  • XMLReaderBase : XMLStorage::XMLReaderBase, XMLStorage::XMLNode
  • XMLString() : XMLStorage::XMLString
  • XMLWriter() : XMLStorage::XMLWriter
  • XMStringRef() : XMLStorage::XMStringRef
  • XS_String() : XMLStorage::XS_String


ROS Explorer: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • ~

Here is a list of all class members with links to the classes they belong to:

- y -

  • year : fdate


ROS Explorer: Class Members - Enumerations

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions

  • BOOKMARKNODE_TYPE : BookmarkNode
  • SCROLL_MODE : StartMenu
  • WRITE_MODE : XMLStorage::XMLNode
  • WRITESTATE : XMLStorage::XMLWriter


ROS Explorer: Class Members - Enumerator

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions

  • ATTRIBUTES : XMLStorage::XMLWriter
  • BMNT_BOOKMARK : BookmarkNode
  • BMNT_FOLDER : BookmarkNode
  • BMNT_NONE : BookmarkNode
  • FORMAT_ORIGINAL : XMLStorage::XMLNode
  • FORMAT_PRETTY : XMLStorage::XMLNode
  • FORMAT_SMART : XMLStorage::XMLNode
  • NOTHING : XMLStorage::XMLWriter
  • POST : XMLStorage::XMLWriter
  • PRE_CLOSED : XMLStorage::XMLWriter
  • SCROLL_DOWN : StartMenu
  • SCROLL_NOT : StartMenu
  • SCROLL_UP : StartMenu
  • TAG_END : XMLStorage::XMLReaderBase
  • TAG_NONE : XMLStorage::XMLReaderBase
  • TAG_START : XMLStorage::XMLReaderBase


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- a -

  • activate() : ToolTip
  • activate_child_window() : MDIMainFrame
  • activate_drive_window() : MDIMainFrame
  • activate_entry() : FileChildWindow
  • ActivateApp() : TaskBar
  • ActivateEntry() : StartMenu
  • add() : ToolTip, PropertySheetDialog, IconCache
  • Add() : TrayIcon, ResizeManager
  • add_child() : XMLStorage::XMLNode
  • add_down() : XMLStorage::XMLPos
  • add_entry() : FindProgramDlg
  • add_to_imagelist() : Icon
  • AddButton() : StartMenu, QuickLaunchBar
  • AddEntries() : FavoritesMenu, RecentStartMenu, SearchMenu, BrowseMenu, SettingsMenu, StartMenuRoot, StartMenu
  • AddEntry() : StartMenu
  • AddRef() : IShellBrowserImpl, IDropTargetImpl
  • AddSeparator() : StartMenu
  • AddShellEntries() : StartMenu
  • AddShortcuts() : QuickLaunchBar
  • AddSuportedFormat() : IDropTargetImpl
  • AddTrayIcons() : TrayIconControllerTemplate< BASE >
  • Append() : PopupMenu
  • appendf() : XMLStorage::XS_String, String
  • assign() : XMLStorage::XMStringRef, XMLStorage::XMLIntRef, XMLStorage::XMLBoolRef, XMLStorage::XMLNode::Children, XMLStorage::XS_String, String, BStr, ShellPath
  • attach() : ShellFolder, BrowserNavigator, OleInPlaceClient
  • attach_control() : OleInPlaceClient


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- j -

  • jump_to() : ShellBrowser, SDIMainFrame
  • jump_to_int() : ChildWindow, WebChildWindow, MDIShellBrowserChild, FileChildWindow
  • jump_to_pidl() : ShellBrowser
  • JumpToNextShortcut() : StartMenu


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- l -

  • launch_entry() : ShellEntry, RegEntry, NtObjEntry, Entry
  • LaunchLink() : HyperlinkCtrl
  • LaunchSelected() : FindProgramDlg
  • length() : BStr
  • ListSort() : ListSort
  • Lock() : Lock


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- m -

  • MainFrameBase() : MainFrameBase
  • match() : NotifyIconConfig
  • MDICBTHookProc() : Window
  • MDIMainFrame() : MDIMainFrame
  • MdiSdiDlg() : MdiSdiDlg
  • MDIShellBrowserChild() : MDIShellBrowserChild
  • MemCanvas() : MemCanvas
  • MessageLoop() : Window
  • MessageSFVCB() : ShellBrowser
  • Modify() : TrayIcon
  • modify() : NotifyInfo
  • ModulePathCopyData() : NotifyHook


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- n -

  • Navigate() : StartMenu
  • NavigateComplete2() : WebChildWindow, DWebBrowserEvents2Impl, DWebBrowserEvents2IF
  • navigated() : BrowserNavigator
  • NavigateError() : WebChildWindow, DWebBrowserEvents2IF
  • NewWindow2() : WebChildWindow, DWebBrowserEvents2IF
  • Next() : EnumFormatEtcImpl
  • Notify() : SubclassedWindow, Window, ClockWindow, TrayNotifyDlg, NotifyArea, TaskBar, QuickLaunchBar, DesktopBar, ShellBrowserChildT< BASE >, Pane, MainFrameBase, FileChildWindow, TaskbarSettingsDlg, DesktopSettingsDlg, FindProgramDlg, DesktopShellView
  • NotifyArea() : NotifyArea
  • NotifyHook() : NotifyHook
  • NotifyIconConfig() : NotifyIconConfig
  • NotifyIconDlgInfo() : NotifyIconDlgInfo
  • NotifyIconIndex() : NotifyIconIndex
  • NotifyInfo() : NotifyInfo
  • NTDLL() : NTDLL
  • NtObjChildWndInfo() : NtObjChildWndInfo
  • NtObjDirectory() : NtObjDirectory
  • NtObjEntry() : NtObjEntry


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- o -

  • OleInit() : OleInit
  • OleInPlaceClient() : OleInPlaceClient
  • OnAddressbar() : WebChildWindow, DWebBrowserEvents2IF
  • OnDefaultCommand() : IShellBrowserImpl, ShellBrowser, DesktopWindow
  • OnDrop() : TreeDropTarget, IDropTargetImpl, DesktopDropTarget
  • OnFullscreen() : WebChildWindow, DWebBrowserEvents2IF
  • OnInPlaceActivate() : OleInPlaceClient
  • OnInPlaceDeactivate() : OleInPlaceClient
  • OnMenubar() : WebChildWindow, DWebBrowserEvents2IF
  • OnPosRectChange() : OleInPlaceClient
  • OnQuit() : WebChildWindow, DWebBrowserEvents2IF
  • OnShowWindow() : OleInPlaceClient
  • OnStateChange() : IShellBrowserImpl
  • OnStatusbar() : WebChildWindow, DWebBrowserEvents2IF
  • OnTheatermode() : WebChildWindow, DWebBrowserEvents2IF
  • OnToolbar() : WebChildWindow, DWebBrowserEvents2IF
  • OnTreeGetDispInfo() : ShellBrowser
  • OnTreeItemExpanding() : ShellBrowser
  • OnTreeItemRClick() : ShellBrowser
  • OnTreeItemSelected() : ShellBrowser
  • OnUIActivate() : OleInPlaceClient
  • OnUIDeactivate() : OleInPlaceClient
  • OnViewWindowActive() : IShellBrowserImpl
  • OnVisible() : WebChildWindow, DWebBrowserEvents2IF
  • OpenShellFolders() : MainFrameBase
  • OpenSubmenu() : StartMenu
  • operator &() : WindowHandle, SIfacePtr< T >
  • operator *() : XMLStorage::const_XMLPos, XMLStorage::XMLPos, XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator, DynamicLoadLibFct< FCT >, DynamicFct< FCT >, SShellPtr< T >
  • operator ATOM() : WindowClass
  • operator BaseIterator() : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • operator bool() : XMLStorage::XMLBoolRef, XMLStorage::XMLBool, DynamicLoadLibFct< FCT >, DynamicFct< FCT >, Variant
  • operator BSTR() : BStr
  • operator const XMLNode *() : XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • operator const XS_String &() : XMLStorage::XMStringRef, XMLStorage::XMLString
  • operator HBITMAP() : ResBitmap
  • operator HDC() : BufferedPaintCanvas, Canvas, PaintCanvas
  • operator HICON() : ResIconEx, SmallIcon, ResIcon
  • operator HMENU() : PopupMenu
  • operator HWND() : WindowHandle
  • operator ICON_ID() : Icon
  • operator IDispatch *() : Variant
  • operator IMalloc *() : CommonShellMalloc
  • operator int() : XMLStorage::XMLIntRef, XMLStorage::XMLInt
  • operator long() : Variant
  • operator LPCTSTR() : WindowClass, String, SpecialFolderFSPath, FileSysShellPath
  • operator LPCWSTR() : UNC, UnicodeString
  • operator LPCXSSTR() : XMLStorage::XMLBool, XMLStorage::XS_String
  • operator LPIDA() : PIDList
  • operator LPPOINT() : Point
  • operator LPRECT() : WindowRect, ClientRect
  • operator ShellFolder &() : CommonDesktop
  • operator std::wstring() : XMLStorage::XS_String
  • operator T *() : SIfacePtr< T >
  • operator T const *() : SShellPtr< T >
  • operator VARIANT_BOOL() : Variant
  • operator wstring() : String
  • operator XMLNode *() : XMLStorage::XMLPos
  • operator XS_String() : XMLStorage::XMLInt
  • operator!() : XMLStorage::XMLBoolRef, XMLStorage::XMLBool
  • operator!=() : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • operator++() : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • operator+=() : ShellPath
  • operator->() : XMLStorage::const_XMLPos, XMLStorage::XMLPos, SIfacePtr< T >, SShellPtr< T >, ShellMalloc
  • operator=() : XMLStorage::XMStringRef, XMLStorage::XMLIntRef, XMLStorage::XMLBoolRef, XMLStorage::XMLNode, XMLStorage::XS_String, String, ShellPath, SIfacePtr< T >, BookmarkNode
  • operator==() : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • operator[]() : XMLStorage::XMLWriter, XMLStorage::XMLPos, XMLStorage::XMLNode, FileTypeManager
  • output_number() : OutputWorker
  • output_tabbed_text() : OutputWorker
  • output_text() : OutputWorker
  • OutputWorker() : OutputWorker
  • OwnerdrawnButton() : OwnerdrawnButton
  • OwnerDrawParent() : OwnerDrawParent< BASE >


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- ~ -

  • ~BitmapSelection() : BitmapSelection
  • ~BkMode() : BkMode
  • ~BookmarkNode() : BookmarkNode
  • ~BrowserCallback() : BrowserCallback
  • ~BrushSelection() : BrushSelection
  • ~BStr() : BStr
  • ~BufferedCanvas() : BufferedCanvas
  • ~CollectProgramsThread() : CollectProgramsThread
  • ~ComInit() : ComInit
  • ~CommonDesktop() : CommonDesktop
  • ~CommonShellMalloc() : CommonShellMalloc
  • ~ComSrvObject() : ComSrvObject
  • ~Context() : Context
  • ~CritSect() : CritSect
  • ~DesktopBar() : DesktopBar
  • ~Desktops() : Desktops
  • ~DesktopWindow() : DesktopWindow
  • ~Dialog() : Dialog
  • ~DialogWindow() : DialogWindow
  • ~Directory() : Directory
  • ~DragSourceHelper() : DragSourceHelper
  • ~DWebBrowserEvents2IF() : DWebBrowserEvents2IF
  • ~DynamicLoadLibFct() : DynamicLoadLibFct< FCT >
  • ~Entry() : Entry
  • ~EnumFormatEtcImpl() : EnumFormatEtcImpl
  • ~EventConnection() : EventConnection
  • ~ExplorerAboutDlg() : ExplorerAboutDlg
  • ~FATDirectory() : FATDirectory
  • ~FATDrive() : FATDrive
  • ~FileHolder() : XMLStorage::FileHolder
  • ~FindProgramDlg() : FindProgramDlg
  • ~FontSelection() : FontSelection
  • ~HiddenWindow() : HiddenWindow
  • ~HyperlinkCtrl() : HyperlinkCtrl
  • ~IComSrvQI() : IComSrvQI< IUnknown >, IComSrvQI< BASE >
  • ~IDataObjectImpl() : IDataObjectImpl
  • ~IDropSourceImpl() : IDropSourceImpl
  • ~IDropTargetImpl() : IDropTargetImpl
  • ~IShellBrowserImpl() : IShellBrowserImpl
  • ~Lock() : Lock
  • ~MainFrameBase() : MainFrameBase
  • ~MemCanvas() : MemCanvas
  • ~NotifyArea() : NotifyArea
  • ~NotifyHook() : NotifyHook
  • ~NtObjDirectory() : NtObjDirectory
  • ~OleInit() : OleInit
  • ~PaintCanvas() : PaintCanvas
  • ~Pane() : Pane
  • ~PIDList() : PIDList
  • ~PreTranslateWindow() : PreTranslateWindow
  • ~QuickLaunchBar() : QuickLaunchBar
  • ~QuickLaunchMap() : QuickLaunchMap
  • ~RegDirectory() : RegDirectory
  • ~RegistryRoot() : RegistryRoot
  • ~ResBitmap() : ResBitmap
  • ~Root() : Root
  • ~SelectedBitmap() : SelectedBitmap
  • ~ShellBrowser() : ShellBrowser
  • ~ShellDirectory() : ShellDirectory
  • ~SIfacePtr() : SIfacePtr< T >
  • ~SShellPtr() : SShellPtr< T >
  • ~StartMenu() : StartMenu
  • ~StartMenuDirectory() : StartMenuDirectory
  • ~StrRetA() : StrRetA
  • ~StrRetW() : StrRetW
  • ~TaskBar() : TaskBar
  • ~TaskBarMap() : TaskBarMap
  • ~TextColor() : TextColor
  • ~Thread() : Thread
  • ~tofstream() : XMLStorage::tofstream
  • ~TrayIcon() : TrayIcon
  • ~TrayNotifyDlg() : TrayNotifyDlg
  • ~UNC() : UNC
  • ~Variant() : Variant
  • ~WaitCursor() : WaitCursor
  • ~WinDirectory() : WinDirectory
  • ~Window() : Window
  • ~WindowCanvas() : WindowCanvas
  • ~XMLNode() : XMLStorage::XMLNode
  • ~XMLReaderBase() : XMLStorage::XMLReaderBase
  • ~XMLWriter() : XMLStorage::XMLWriter


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- b -

  • back() : XMLStorage::XMLWriter, XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • BackgroundWindow() : BackgroundWindow
  • BeforeNavigate2() : WebChildWindow, DWebBrowserEvents2IF
  • begin() : XMLStorage::const_XMLChildrenFilter, XMLStorage::XMLChildrenFilter
  • BitmapSelection() : BitmapSelection
  • BkMode() : BkMode
  • Bookmark() : Bookmark
  • BookmarkNode() : BookmarkNode
  • BrowseMenu() : BrowseMenu
  • BrowseObject() : IShellBrowserImpl
  • BrowserNavigator() : BrowserNavigator
  • BrushSelection() : BrushSelection
  • BStr() : BStr
  • BtnWindowClass() : BtnWindowClass
  • BufferCanvas() : BufferCanvas
  • BufferedCanvas() : BufferedCanvas
  • BufferedPaintCanvas() : BufferedPaintCanvas
  • Button() : Button
  • ButtonHitTest() : StartMenu


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- c -

  • c_str() : XMLStorage::XMLString
  • calc_single_width() : Pane
  • calc_tabbed_width() : Pane
  • calc_width() : Pane
  • calc_widths() : Pane
  • CancelModes() : Window, NotifyArea
  • CanInPlaceActivate() : OleInPlaceClient
  • Canvas() : Canvas
  • CheckEntries() : FindProgramDlg
  • ChildWindow() : ChildWindow
  • ChildWndInfo() : ChildWndInfo
  • clear() : XMLStorage::XMLNode, XMLStorage::XMLNode::Children, BookmarkNode
  • ClientRect() : ClientRect
  • ClientToHostWindow() : WebChildWindow, DWebBrowserEvents2IF
  • ClockWindow() : ClockWindow
  • Clone() : EnumFormatEtcImpl
  • close_pre() : XMLStorage::XMLWriter
  • CloseOtherSubmenus() : StartMenu
  • CloseStartMenu() : StartMenuRoot, StartMenu
  • CloseSubmenus() : StartMenu
  • collapse_entry() : FileChildWindow
  • collect_programs() : CollectProgramsThread
  • collect_programs_callback() : FindProgramDlg
  • CollectProgramsThread() : CollectProgramsThread
  • ColorStatic() : ColorStatic
  • COMException() : COMException
  • COMExceptionBase() : COMExceptionBase
  • ComInit() : ComInit
  • Command() : PropSheetPageDlg, Dialog, SubclassedWindow, Window, TrayNotifyDlg, NotifyArea, TaskBar, FavoritesMenu, StartMenuHandler, StartMenu, QuickLaunchBar, DesktopBar, SDIMainFrame, MDIMainFrame, MainFrameBase, FileChildWindow, MdiSdiDlg, StartmenuSettingsDlg, TaskbarSettingsDlg, DesktopSettingsDlg, FindProgramDlg, DesktopShellView
  • command() : Pane
  • CommandStateChange() : WebChildWindow, DWebBrowserEvents2IF
  • CommonControlInit() : CommonControlInit
  • CommonDesktop() : CommonDesktop
  • CommonShellMalloc() : CommonShellMalloc
  • CompareFunc() : ListSort, FindProgramDlg
  • ComSrvObject() : ComSrvObject
  • ConnectionPoint() : ConnectionPoint< T >
  • const_iterator() : XMLStorage::const_XMLChildrenFilter::const_iterator
  • const_XMLChildrenFilter() : XMLStorage::const_XMLChildrenFilter
  • const_XMLPos() : XMLStorage::const_XMLPos, XMLStorage::XMLNode
  • Context() : Context
  • ContextSensitiveHelp() : IShellBrowserImpl, OleInPlaceClient
  • ControlResize() : DesktopBar
  • CopyMedium() : IDataObjectImpl
  • Create() : Window, ClockWindow, NotifyArea, TaskBar, StartMenuRoot, StartMenu, QuickLaunchBar, DesktopBar, SDIMainFrame, MDIMainFrame, MainFrameBase, DesktopWindow
  • create() : XMLStorage::XMLWriter, XMLStorage::XMLPos, ChildWindow, WebChildWindow, MDIShellBrowserChild, FileChildWindow
  • create_absolute_pidl() : ShellPath, WinEntry, ShellEntry, FATEntry, Entry
  • create_bitmap() : Icon
  • create_control() : IPCtrlWindow< BASE, SMARTPTR >
  • create_controller() : Window
  • create_header() : Pane
  • create_mdi_child() : Window
  • create_name() : NotifyIconConfig
  • create_relative() : XMLStorage::XMLPos, XMLStorage::XMLNode
  • CreateChild() : MDIMainFrame
  • CreateInstance() : SIfacePtr< T >
  • CreateSubmenu() : StartMenu
  • CritSect() : CritSect
  • CtlColorParent() : CtlColorParent< BASE >
  • CtxMenuInterfaces() : CtxMenuInterfaces
  • cur() : XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • current() : Context


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- d -

  • DAdvise() : IDataObjectImpl
  • DeactivateAndUndo() : OleInPlaceClient
  • DecRef() : SimpleComObject
  • DesktopBar() : DesktopBar
  • DesktopDropTarget() : DesktopDropTarget
  • DesktopFolderPath() : DesktopFolderPath
  • Desktops() : Desktops
  • DesktopSettingsDlg() : DesktopSettingsDlg
  • DesktopShellView() : DesktopShellView
  • DesktopWindow() : DesktopWindow
  • destroy() : Icon
  • detach() : OleInPlaceClient
  • DetermineHideState() : NotifyArea
  • Dialog() : Dialog
  • DialogProc() : PropSheetPageDlg, Window
  • DialogWindow() : DialogWindow
  • Directory() : Directory
  • DiscardUndoState() : OleInPlaceClient
  • dispatch_dialog_msg() : Window
  • do_context_menu() : ShellEntry, Entry
  • DoContextMenu() : DesktopShellView
  • DocumentComplete() : WebChildWindow, DWebBrowserEvents2IF
  • DoDesktopContextMenu() : DesktopShellView
  • DoModal() : PropertySheetDialog, Dialog
  • DownloadBegin() : WebChildWindow, DWebBrowserEvents2IF
  • DownloadComplete() : DWebBrowserEvents2IF
  • DragEnter() : IDropTargetImpl
  • DragLeave() : TreeDropTarget, IDropTargetImpl, DesktopDropTarget
  • DragOver() : TreeDropTarget, IDropTargetImpl, DesktopDropTarget
  • DragSourceHelper() : DragSourceHelper
  • draw() : Icon
  • draw_item() : Pane
  • DrawArrows() : StartMenu
  • DrawDesktopBkgnd() : BackgroundWindow
  • DrawFloatingButton() : StartMenu
  • DrawItem() : PictureButton, FlatButton, OwnerdrawnButton
  • Drop() : IDropTargetImpl
  • DUnadvise() : IDataObjectImpl
  • DWebBrowserEvents2Impl() : DWebBrowserEvents2Impl
  • DWORD() : ExplorerGlobals
  • dyn_cast() : TypeCheck< CLASS >
  • DynamicFct() : DynamicFct< FCT >
  • DynamicLoadLibFct() : DynamicLoadLibFct< FCT >


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- e -

  • EditController() : EditController
  • empty() : SIfacePtr< T >
  • EnableModelessSB() : IShellBrowserImpl
  • end() : XMLStorage::const_XMLChildrenFilter, XMLStorage::XMLChildrenFilter
  • Entry() : Entry
  • entry_selected() : MDIShellBrowserChild, BrowserCallback, SDIMainFrame
  • EnumDAdvise() : IDataObjectImpl
  • EnumFormatEtc() : IDataObjectImpl
  • EnumFormatEtcImpl() : EnumFormatEtcImpl
  • EnumWndProc() : TaskBar
  • Error() : COMExceptionBase
  • ErrorMessage() : COMExceptionBase
  • EvaluateOption() : ExplorerCmd
  • EventConnection() : EventConnection
  • EventConnector() : EventConnector
  • Exec() : IShellBrowserImpl
  • ExecuteCommandbar() : MainFrameBase
  • expand_entry() : FileChildWindow
  • ExplorerAboutDlg() : ExplorerAboutDlg
  • ExplorerCmd() : ExplorerCmd
  • ExplorerGlobals() : ExplorerGlobals
  • ExtContextMenuHandlerT() : ExtContextMenuHandlerT< BASE >
  • extract() : IconCache
  • extract_icon() : Entry
  • extract_icons() : ShellDirectory


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- f -

  • FATChildWndInfo() : FATChildWndInfo
  • FATDirectory() : FATDirectory
  • FATDrive() : FATDrive
  • FATEntry() : FATEntry
  • FavoritesMenu() : FavoritesMenu
  • FileChildWindow() : FileChildWindow
  • FileChildWndInfo() : FileChildWndInfo
  • FileDownload() : WebChildWindow, DWebBrowserEvents2IF
  • FileHolder() : XMLStorage::FileHolder
  • FileSysShellPath() : FileSysShellPath
  • fill_tree() : BookmarkList
  • fill_w32fdata_shell() : ShellDirectory
  • FillBookmarks() : MainFrameBase
  • find() : XMLStorage::XMLNode
  • find_entry() : WinDirectory, ShellDirectory, RegDirectory, NtObjDirectory, FATDirectory, Entry
  • find_id() : TaskBarMap
  • find_relative() : XMLStorage::XMLNode
  • FindProgramDlg() : FindProgramDlg
  • FlatButton() : FlatButton
  • FmtString() : FmtString
  • FolderBrowser() : FolderBrowser
  • FontSelection() : FontSelection
  • FormatTime() : ClockWindow
  • frame_get_clientspace() : MDIMainFrame, MainFrameBase
  • FrameBeforeNavigate() : WebChildWindow, DWebBrowserEvents2IF
  • FrameNavigateComplete() : WebChildWindow, DWebBrowserEvents2IF
  • FrameNewWindow() : WebChildWindow, DWebBrowserEvents2IF
  • Free() : SIfacePtr< T >, SShellPtr< T >
  • free_dirs() : CollectProgramsThread
  • free_icon() : IconCache
  • free_subentries() : Entry
  • fullscreen_move() : MainFrameBase
  • FullScreenParameters() : FullScreenParameters


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- g -

  • get() : XMLStorage::const_XMLPos, XMLStorage::XMLPos, XMLStorage::XMLNode, SIfacePtr< T >
  • get_browser() : BrowserNavigator
  • get_cache_buffer() : FATDrive
  • get_cfg() : ExplorerGlobals
  • get_children() : XMLStorage::XMLNode
  • get_content() : XMLStorage::XMLNode
  • get_error_code() : XMLStorage::XMLReaderBase
  • get_error_string() : XMLStorage::XMLReaderBase
  • get_first_child() : XMLStorage::XMLNode
  • get_folder() : ShellPath
  • get_frame() : Pane
  • get_hicon() : Icon
  • get_icon() : IconCache
  • get_image_idx() : ShellBrowser
  • get_instructions() : XMLStorage::XMLReaderBase
  • get_name() : ShellFolder
  • get_next_path_component() : WinDirectory, ShellDirectory, RegDirectory, FATDirectory, Entry
  • get_parent_folder() : ShellEntry
  • get_path() : WinEntry, ShellDirectory, ShellEntry, RegEntry, NtObjEntry, FATEntry, Entry
  • get_path_base() : Entry
  • get_position() : XMLStorage::XMLReaderBase
  • get_root() : ShellBrowser, FileChildWindow
  • get_sys_imagelist() : IconCache
  • get_sysiml_idx() : Icon
  • get_window() : Window
  • GetArrowButtonRects() : StartMenu
  • GetButtonInfo() : StartMenu
  • GetButtonRect() : StartMenu
  • GetCanonicalFormatEtc() : IDataObjectImpl
  • GetClientSpace() : ResizeController< BASE >
  • GetContainer() : OleInPlaceClient
  • GetControlWindow() : ShellBrowser, DesktopWindow
  • GetCurrentPage() : PropertySheetDialog
  • GetData() : PIDList, IDataObjectImpl
  • GetDataHere() : IDataObjectImpl
  • GetDisplayName() : FolderBrowser
  • GetFloatingButtonRect() : StartMenu
  • GetLogoResId() : StartMenuRoot
  • GetModulePath() : NotifyHook
  • GetMoniker() : OleInPlaceClient
  • GetSelectionIndex() : StartMenu
  • getStackTrace() : Context
  • GetStaticWindowData() : Window
  • GetString() : StrRetW, StrRetA
  • GetUIObjectOf() : ShellPath, ShellEntry, Entry
  • GetViewStateStream() : IShellBrowserImpl
  • GetWindow() : OleInPlaceClient, ShellBrowser, DesktopWindow
  • GetWindowContext() : OleInPlaceClient
  • GetWndClasss() : StartMenu
  • GiveFeedback() : IDropSourceImpl
  • go() : XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • go_down() : XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • go_to() : XMLStorage::const_XMLPos, XMLStorage::XMLPos, ChildWindow, MDIMainFrame, MainFrameBase
  • goto_url() : BrowserNavigator


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- h -

  • HandleMenuMsg() : CtxMenuInterfaces
  • HandleSize() : ResizeManager
  • HiddenWindow() : HiddenWindow
  • HyperlinkCtrl() : HyperlinkCtrl


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- i -

  • IComSrvBase() : IComSrvBase< BASE, OBJ >
  • IComSrvQI() : IComSrvQI< IUnknown >, IComSrvQI< BASE >
  • Icon() : Icon
  • IconCache() : IconCache
  • IconHitTest() : NotifyArea
  • IconWindowClass() : IconWindowClass
  • IDataObjectImpl() : IDataObjectImpl
  • IDropSourceImpl() : IDropSourceImpl
  • IDropTargetImpl() : IDropTargetImpl
  • import_IE_favorites() : Favorites, BookmarkList
  • IncludeObject() : IShellBrowserImpl
  • IncRef() : SimpleComObject
  • Init() : Window, NotifyArea, TaskBar, StartMenuRoot, StartMenu, DesktopBar, MDIShellBrowserChild, ShellBrowser, DesktopWindow
  • init() : HyperlinkCtrl, PropSheetPage, CommonDesktop, CommonShellMalloc, Pane, ExplorerGlobals, Desktops, IconCache
  • init_output() : OutputWorker
  • InitDragDrop() : ShellBrowser, DesktopShellView
  • InitializeFromBitmap() : DragSourceHelper
  • InitializeFromWindow() : DragSourceHelper
  • InitializeTree() : ShellBrowser
  • insert_entries() : Pane
  • InsertItem() : TrayNotifyDlg
  • InsertMenusSB() : IShellBrowserImpl
  • InsertSubitems() : ShellBrowser
  • invalidate_cache() : ShellBrowser
  • InvalidateSelection() : StartMenu
  • IPCtrlWindow() : IPCtrlWindow< BASE, SMARTPTR >
  • is_alive() : Thread
  • is_exe_file() : FileTypeManager
  • IShellBrowserImpl() : IShellBrowserImpl
  • IsOK() : FolderBrowser
  • IsValidPath() : ExplorerCmd
  • iterator() : XMLStorage::XMLChildrenFilter::iterator


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- p -

  • Paint() : ClockWindow, NotifyArea, StartMenuRoot, StartMenu, ExplorerAboutDlg
  • PaintCanvas() : PaintCanvas
  • Pane() : Pane
  • ParseCmdLine() : ExplorerCmd
  • PictureButton() : PictureButton
  • PIDList() : PIDList
  • Point() : Point
  • PopupContextMenu() : PopupMenu
  • PopupMenu() : PopupMenu
  • pos() : WindowRect, ClientRect
  • PositionIcons() : DesktopShellView
  • PostParent() : Window
  • pretranslate_msg() : Window
  • PreTranslateWindow() : PreTranslateWindow
  • pretty_write_worker() : XMLStorage::XMLNode
  • print() : XMLStorage::XMLHeader
  • printf() : XMLStorage::XS_String, String
  • PrivacyImpactedStateChange() : WebChildWindow, DWebBrowserEvents2IF
  • ProcessCopyData() : DesktopBar
  • ProcessHotKey() : DesktopBar
  • ProcessKey() : StartMenuRoot, StartMenu
  • ProcessMessage() : MainFrameBase
  • ProcessTrayNotification() : NotifyArea
  • ProgressChange() : WebChildWindow, DWebBrowserEvents2IF
  • PropertyChange() : WebChildWindow, DWebBrowserEvents2IF
  • PropertySheetDialog() : PropertySheetDialog, PropSheetPageDlg
  • PropSheetCBTHookProc() : Window
  • PropSheetPage() : PropSheetPage, PropSheetPageDlg
  • PropSheetPageDlg() : PropSheetPageDlg, PropSheetPage
  • put() : XMLStorage::XMLWriter, XMLStorage::XMLPos, XMLStorage::XMLNode


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- q -

  • query_interfaces() : CtxMenuInterfaces
  • QueryActiveShellView() : ShellBrowser, DesktopWindow
  • QueryContinueDrag() : IDropSourceImpl
  • QueryDrop() : IDropTargetImpl
  • QueryGetData() : IDataObjectImpl
  • QueryInterface() : IComSrvQI< IUnknown >, IComSrvQI< BASE >, SIfacePtr< T >, IShellBrowserImpl, IDropTargetImpl, OleInPlaceClient
  • QueryService() : IShellBrowserImpl
  • QueryStatus() : IShellBrowserImpl
  • QuickLaunchBar() : QuickLaunchBar
  • QuickLaunchEntry() : QuickLaunchEntry


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- r -

  • read() : XMLStorage::XMLDoc, XMLStorage::XMLReaderBase, Favorites, BookmarkFolder, BookmarkList, Bookmark
  • read_buffer() : XMLStorage::XMLReader, XMLStorage::XMLReaderBase
  • read_cache() : FATDrive
  • read_config() : NotifyArea
  • read_dir() : FATDirectory
  • read_directory() : WinDirectory, ShellDirectory, RegistryRoot, RegDirectory, NtObjDirectory, FATDirectory, Entry
  • read_directory_base() : Entry
  • read_FAT() : FATDrive
  • read_persistent() : ExplorerGlobals
  • read_sector() : FATDrive
  • read_tree() : Root, Entry
  • read_url() : Bookmark
  • ReadLogoSize() : StartMenuRoot
  • RecentStartMenu() : RecentStartMenu
  • Refresh() : TrayNotifyDlg, NotifyArea, TaskBar, FindProgramDlg
  • RefreshProperties() : TrayNotifyDlg
  • RegDirectory() : RegDirectory
  • RegEntry() : RegEntry
  • Register() : WindowClass
  • register_dialog() : Window
  • register_pretranslate() : Window
  • RegisterHotkeys() : DesktopBar
  • RegistryChildWndInfo() : RegistryChildWndInfo
  • RegistryRoot() : RegistryRoot
  • Release() : IShellBrowserImpl, IDropTargetImpl
  • remove() : ToolTip
  • Remove() : TrayIcon
  • RemoveMenusSB() : IShellBrowserImpl
  • RequestNewObjectLayout() : OleInPlaceClient
  • ResBitmap() : ResBitmap
  • Reset() : EnumFormatEtcImpl
  • reset() : CtxMenuInterfaces
  • reset_cache() : FATDrive
  • ResIcon() : ResIcon
  • ResIconEx() : ResIconEx
  • Resize() : ResizeManager, DesktopBar
  • resize_children() : ChildWindow, SDIMainFrame, FileChildWindow
  • resize_frame() : SDIMainFrame, MDIMainFrame, MainFrameBase
  • resize_frame_client() : MainFrameBase
  • ResizeButtons() : TaskBar, StartMenu
  • ResizeController() : ResizeController< BASE >
  • ResizeEntry() : ResizeEntry
  • ResizeManager() : ResizeManager
  • ResizeToButtons() : StartMenu
  • ResString() : ResString
  • Root() : Root
  • Run() : Thread, CollectProgramsThread


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- s -

  • safe_extract_icon() : Entry
  • SaveObject() : OleInPlaceClient
  • scan_entry() : FileChildWindow
  • Scroll() : OleInPlaceClient
  • SDIMainFrame() : SDIMainFrame
  • search_next() : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • SearchMenu() : SearchMenu
  • select_entry() : ShellBrowser
  • SelectButton() : StartMenu
  • SelectButtonIndex() : StartMenu
  • SelectedBitmap() : SelectedBitmap
  • SendControlMsg() : ShellBrowser, DesktopWindow
  • SendParent() : Window
  • Set() : TrayIcon
  • set_content() : XMLStorage::XMLWriter, XMLStorage::XMLNode
  • set_curdir() : FileChildWindow
  • set_focus_pane() : FileChildWindow
  • set_header() : Pane
  • set_html_page() : BrowserNavigator
  • set_type() : FileTypeManager
  • set_url() : ChildWindow, SDIMainFrame
  • SetData() : IDataObjectImpl
  • SetIconMode() : TrayNotifyDlg
  • SetMenuSB() : IShellBrowserImpl
  • SetMinMaxInfo() : ResizeManager
  • SetSecureLockIcon() : WebChildWindow, DWebBrowserEvents2IF
  • SetStatusTextSB() : IShellBrowserImpl
  • SettingsMenu() : SettingsMenu
  • SetToolbarItems() : IShellBrowserImpl
  • ShellBrowser() : ShellBrowser
  • ShellBrowserChildT() : ShellBrowserChildT< BASE >
  • ShellChildWndInfo() : ShellChildWndInfo
  • ShellDirectory() : ShellDirectory
  • ShellEntry() : ShellEntry
  • ShellFolder() : ShellFolder
  • ShellItemEnumerator() : ShellItemEnumerator
  • ShellLinkPtr() : ShellLinkPtr
  • ShellMalloc() : ShellMalloc
  • ShellPath() : ShellPath
  • ShellPathInfo() : ShellPathInfo
  • show_clock() : NotifyArea
  • ShowAppSystemMenu() : TaskBar
  • ShowLaunchDialog() : StartMenuHandler
  • ShowLogoffDialog() : StartMenuHandler
  • ShowObject() : OleInPlaceClient
  • ShowSearchComputer() : StartMenuHandler
  • ShowSearchDialog() : StartMenuHandler
  • ShowStartMenu() : DesktopBar
  • SIfacePtr() : SIfacePtr< T >
  • Skip() : EnumFormatEtcImpl
  • small_cache() : FATDrive
  • SmallIcon() : SmallIcon
  • smart_create() : XMLStorage::XMLPos
  • smart_scan() : Entry
  • smart_write_worker() : XMLStorage::XMLNode
  • SMBtnInfo() : SMBtnInfo
  • sort() : ListSort
  • sort_directory() : Entry
  • SpecialFolder() : SpecialFolder
  • SpecialFolderFSPath() : SpecialFolderFSPath
  • SpecialFolderPath() : SpecialFolderPath
  • split() : ShellPath
  • SShellPtr() : SShellPtr< T >
  • StackEntry() : XMLStorage::XMLWriter::StackEntry
  • Start() : Thread
  • StartButton() : StartButton
  • StartMenu() : StartMenu
  • StartMenuCreateInfo() : StartMenuCreateInfo
  • StartMenuDirectory() : StartMenuDirectory
  • StartMenuEntry() : StartMenuEntry
  • StartMenuHandler() : StartMenuHandler
  • StartMenuRoot() : StartMenuRoot
  • StartmenuSettingsDlg() : StartmenuSettingsDlg
  • Static() : Static
  • StatusTextChange() : WebChildWindow, DWebBrowserEvents2IF
  • STDMETHODIMP_() : IComSrvBase< BASE, OBJ >, OleInPlaceClient
  • Stop() : Thread
  • str() : XMLStorage::const_XMLPos, XMLStorage::XMLPos, String
  • String() : String
  • String_from_XML_Char() : XMLStorage::String_from_XML_Char
  • SubclassedWindow() : SubclassedWindow
  • SubclassedWndProc() : SubclassedWindow
  • subvalue() : XMLStorage::XMLNode
  • switch_focus_pane() : FileChildWindow
  • SwitchToDesktop() : Desktops
  • SysCacheIcon() : SysCacheIcon


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- t -

  • TaskBar() : TaskBar
  • TaskBarEntry() : TaskBarEntry
  • TaskbarSettingsDlg() : TaskbarSettingsDlg
  • TextColor() : TextColor
  • Thread() : Thread
  • ThreadProc() : Thread
  • tifstream() : XMLStorage::tifstream
  • TimerTick() : ClockWindow
  • TitleChange() : WebChildWindow, DWebBrowserEvents2IF
  • TitleIconChange() : WebChildWindow, DWebBrowserEvents2IF
  • tofstream() : XMLStorage::tofstream
  • toggle() : XMLStorage::XMLBoolRef
  • toggle_child() : MainFrameBase
  • toggle_fullscreen() : MainFrameBase
  • toggle_sort() : ListSort
  • ToggleMinimize() : Desktops
  • toLower() : String
  • ToolTip() : ToolTip
  • toString() : Context, COMException
  • TrackPopupMenu() : PopupMenu
  • TrackPopupMenuAtCursor() : PopupMenu
  • TrackPopupMenuAtPos() : PopupMenu
  • TrackStartmenu() : StartMenuRoot
  • TranslateAcceleratorSB() : IShellBrowserImpl
  • TranslateMsg() : MDIMainFrame, MainFrameBase
  • TrayClick() : TrayIconControllerTemplate< BASE >
  • TrayDblClick() : TrayIconControllerTemplate< BASE >
  • TrayIcon() : TrayIcon
  • TrayIconControllerTemplate() : TrayIconControllerTemplate< BASE >
  • TrayMouseOver() : TrayIconControllerTemplate< BASE >
  • TrayNotifyDlg() : TrayNotifyDlg, NotifyArea
  • TreeDropTarget() : TreeDropTarget


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- u -

  • UNC() : UNC
  • UnicodeString() : UnicodeString
  • unregister_dialog() : Window
  • unregister_pretranslate() : Window
  • update_clnt_rect() : SDIMainFrame
  • update_shell_browser() : MDIShellBrowserChild, SDIMainFrame
  • UpdateDesktopButtons() : QuickLaunchBar
  • UpdateFolderView() : ShellBrowser
  • UpdateIcons() : NotifyArea, StartMenu


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- v -

  • vappendf() : XMLStorage::XS_String, String
  • Variant() : Variant
  • vprintf() : XMLStorage::XS_String, String


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- w -

  • WaitCursor() : WaitCursor
  • WebChildWindow() : WebChildWindow
  • WebChildWndInfo() : WebChildWndInfo
  • WinDirectory() : WinDirectory
  • Window() : Window
  • window_creator() : WindowCreatorInfo< WND_CLASS, INFO_CLASS >, WindowCreator< WND_CLASS >
  • WindowActivate() : WebChildWindow, DWebBrowserEvents2IF
  • WindowCanvas() : WindowCanvas
  • WindowClass() : WindowClass
  • WindowClosing() : WebChildWindow, DWebBrowserEvents2IF
  • WindowHandle() : WindowHandle
  • WindowMove() : WebChildWindow, DWebBrowserEvents2IF
  • WindowRect() : WindowRect
  • WindowResize() : WebChildWindow, DWebBrowserEvents2IF
  • WindowSetHeight() : WebChildWindow, DWebBrowserEvents2IF
  • WindowSetLeft() : WebChildWindow, DWebBrowserEvents2IF
  • WindowSetResizable() : WebChildWindow, DWebBrowserEvents2IF
  • WindowSetTop() : WebChildWindow, DWebBrowserEvents2IF
  • WindowSetWidth() : WebChildWindow, DWebBrowserEvents2IF
  • WindowWndProc() : Window
  • WinEntry() : WinEntry
  • WndProc() : EditController, TrayIconControllerTemplate< BASE >, HyperlinkCtrl, ColorStatic, FlatButton, OwnerdrawnButton, OwnerDrawParent< BASE >, CtlColorParent< BASE >, ResizeController< BASE >, Dialog, ChildWindow, SubclassedWindow, Window, ExtContextMenuHandlerT< BASE >, ClockWindow, TrayNotifyDlg, NotifyArea, TaskBar, StartMenuRoot, StartMenu, QuickLaunchBar, StartButton, DesktopBar, WebChildWindow, IPCtrlWindow< BASE, SMARTPTR >, MDIShellBrowserChild, ShellBrowserChildT< BASE >, Pane, SDIMainFrame, MDIMainFrame, MainFrameBase, ExecuteDialog, FileChildWindow, FindProgramDlg, DesktopShellView, DesktopWindow, BackgroundWindow, ExplorerAboutDlg
  • write() : XMLStorage::XMLDoc, XMLStorage::XMLNode, Favorites, BookmarkFolder, BookmarkList, Bookmark
  • write_attributes() : XMLStorage::XMLWriter
  • write_config() : NotifyArea
  • write_formating() : XMLStorage::XMLDoc
  • write_persistent() : ExplorerGlobals
  • write_post() : XMLStorage::XMLWriter
  • write_pre() : XMLStorage::XMLWriter
  • write_worker() : XMLStorage::XMLNode


ROS Explorer: Class Members - Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • ~

- x -

  • XML_DefaultHandler() : XMLStorage::XMLReaderBase
  • XML_EndElementHandler() : XMLStorage::XMLReaderBase
  • XML_StartElementHandler() : XMLStorage::XMLReaderBase
  • XML_XmlDeclHandler() : XMLStorage::XMLReaderBase
  • XMLBool() : XMLStorage::XMLBool
  • XMLBoolRef() : XMLStorage::XMLBoolRef
  • XMLChildrenFilter() : XMLStorage::XMLChildrenFilter
  • XMLDoc() : XMLStorage::XMLDoc
  • XMLHeader() : XMLStorage::XMLHeader
  • XMLInt() : XMLStorage::XMLInt
  • XMLIntRef() : XMLStorage::XMLIntRef
  • XMLMessage() : XMLStorage::XMLMessage
  • XMLNode() : XMLStorage::XMLNode
  • XMLPos() : XMLStorage::XMLPos, XMLStorage::XMLNode
  • XMLReader() : XMLStorage::XMLReader
  • XMLReaderBase() : XMLStorage::XMLReaderBase, XMLStorage::XMLNode
  • XMLString() : XMLStorage::XMLString
  • XMLWriter() : XMLStorage::XMLWriter
  • XMStringRef() : XMLStorage::XMStringRef
  • XS_String() : XMLStorage::XS_String


ROS Explorer: Class Members - Related Functions

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions

  • const_XMLPos : XMLStorage::const_XMLPos, XMLStorage::XMLNode
  • operator< : NotifyInfo, NotifyIconIndex
  • PropertySheetDialog : PropertySheetDialog, PropSheetPageDlg
  • PropSheetPage : PropSheetPage, PropSheetPageDlg
  • PropSheetPageDlg : PropSheetPageDlg, PropSheetPage
  • TrayNotifyDlg : TrayNotifyDlg, NotifyArea
  • XMLPos : XMLStorage::XMLPos, XMLStorage::XMLNode
  • XMLReaderBase : XMLStorage::XMLReaderBase, XMLStorage::XMLNode


ROS Explorer: Class Members - Typedefs

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions

  • AttributeMap : XMLStorage::XMLNode
  • AttrMap : XMLStorage::XMLWriter
  • BaseIterator : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • CacheKey : IconCache
  • CREATORFUNC : Window
  • CREATORFUNC_INFO : Window
  • IconMap : IconCache
  • IconStateMap : TrayNotifyDlg
  • IconStatePair : TrayNotifyDlg
  • IdxCacheKey : IconCache
  • IdxCacheMap : IconCache
  • PathCacheMap : IconCache
  • super : XMLStorage::tofstream, XMLStorage::tifstream, XMLStorage::XS_String, EditController, TrayIconControllerTemplate< BASE >, ToolTip, HyperlinkCtrl, ColorStatic, PictureButton, FlatButton, OwnerdrawnButton, OwnerDrawParent< BASE >, CtlColorParent< BASE >, ResizeController< BASE >, ResizeManager, PropSheetPageDlg, Dialog, DialogWindow, PreTranslateWindow, ChildWindow, SubclassedWindow, String, ExtContextMenuHandlerT< BASE >, ShellPath, ShellLinkPtr, ShellFolder, COMException, ClockWindow, TrayNotifyDlg, NotifyIconDlgInfo, NotifyArea, TaskBar, FavoritesMenu, RecentStartMenu, SearchMenu, BrowseMenu, SettingsMenu, StartMenuRoot, StartMenuHandler, StartMenu, QuickLaunchBar, Favorites, StartButton, DesktopBar, WebChildWindow, DWebBrowserEvents2Impl, IPCtrlWindow< BASE, SMARTPTR >, MDIShellBrowserChild, ShellBrowserChildT< BASE >, ShellBrowser, Pane, SDIMainFrame, MDIMainFrame, MainFrameBase, FileChildWindow, WebChildWndInfo, FATChildWndInfo, RegistryChildWndInfo, NtObjChildWndInfo, ShellChildWndInfo, FileChildWndInfo, MdiSdiDlg, StartmenuSettingsDlg, TaskbarSettingsDlg, DesktopSettingsDlg, FindProgramDlg, DesktopShellView, DesktopWindow, BackgroundWindow, FileTypeManager, ExplorerAboutDlg
  • Vector : PropertySheetDialog
  • web_super : WebChildWindow
  • WindowMap : Window


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- _ -

  • _0 : NtObject
  • _1 : NtObject, OpenStruct
  • _3 : OpenStruct
  • _4 : NtObject, OpenStruct
  • _5 : NtObject, OpenStruct
  • _6 : NtObject
  • _7 : NtObject
  • _8 : NtObject
  • _9 : NtObject
  • _A : NtObject
  • _active : FlatButton
  • _activeColor : FlatButton
  • _additional : XMLStorage::XMLHeader
  • _alignment_cur : DesktopSettingsDlg
  • _alignment_tmp : DesktopSettingsDlg
  • _alive : Thread
  • _alloc : FATDirectory
  • _arrow_btns : StartMenu
  • _atomClass : WindowClass
  • _attributes : XMLStorage::XMLWriter::StackEntry, XMLStorage::XMLNode
  • _B : NtObject
  • _begin : XMLStorage::const_XMLChildrenFilter, XMLStorage::XMLChildrenFilter
  • _bhfi : Entry
  • _bhfi_valid : Entry
  • _bmp : BufferCanvas
  • _bmp0 : DesktopSettingsDlg
  • _bmp1 : DesktopSettingsDlg
  • _bmp10 : DesktopSettingsDlg
  • _bmp2 : DesktopSettingsDlg
  • _bmp3 : DesktopSettingsDlg
  • _bmp4 : DesktopSettingsDlg
  • _bmp5 : DesktopSettingsDlg
  • _bmp6 : DesktopSettingsDlg
  • _bmp7 : DesktopSettingsDlg
  • _bmp8 : DesktopSettingsDlg
  • _bmp9 : DesktopSettingsDlg
  • _bmp_idx : TaskBarEntry
  • _bookmarks : FavoritesMenu, BookmarkFolder
  • _boot_sector : FATDrive
  • _border_left : StartMenu
  • _border_top : StartMenu, StartMenuCreateInfo
  • _bottom_max : StartMenu
  • _browser : BrowserNavigator
  • _browser_initialized : BrowserNavigator
  • _btn_dist : QuickLaunchBar
  • _btn_idx : TaskBarEntry
  • _buf : XMLStorage::tofstream, XMLStorage::tifstream
  • _bufents : FATDrive
  • _bufl : FATDrive
  • _buttons : StartMenu
  • _cache : FindProgramDlg
  • _cache_empty : FATDrive
  • _cache_valid : CollectProgramsThread
  • _CacheCnt : FATDrive
  • _CacheCount : FATDrive
  • _CacheDty : FATDrive
  • _Caches : FATDrive
  • _CacheSec : FATDrive
  • _callback : DWebBrowserEvents2Impl, ShellBrowser, CollectProgramsThread
  • _cfg : NotifyArea, ExplorerGlobals
  • _cfg_dir : ExplorerGlobals
  • _cfg_org : TrayNotifyDlg, TaskbarSettingsDlg
  • _cfg_path : ExplorerGlobals
  • _cfStrFName : ExplorerGlobals
  • _children : XMLStorage::XMLWriter::StackEntry, XMLStorage::XMLNode
  • _classname : FileTypeInfo
  • _client_side : IPCtrlWindow< BASE, SMARTPTR >
  • _clnt_rect : SDIMainFrame
  • _clock_width : NotifyArea
  • _clrCompressed : Pane
  • _cluster : FATEntry
  • _cm_ifs : ExtContextMenuHandlerT< BASE >, ShellBrowser
  • _cmd : HyperlinkCtrl
  • _cmdShow : ExplorerCmd
  • _colorVisited : HyperlinkCtrl
  • _common_programs : FindProgramDlg
  • _compare_fct : ListSort
  • _connectionpoint : EventConnection
  • _connector : WebChildWindow
  • _content : XMLStorage::XMLWriter::StackEntry, XMLStorage::XMLReaderBase, XMLStorage::XMLNode, Entry
  • _context : COMException
  • _control : IPCtrlWindow< BASE, SMARTPTR >
  • _cookie : EventConnection
  • _create_crit_sect : Window::StaticWindowData
  • _create_info : StartMenu, MDIShellBrowserChild, ShellBrowser
  • _creator : StartMenuCreateInfo
  • _crit_sect : Thread, Lock
  • _crsr_link : HyperlinkCtrl
  • _ctx : Context
  • _cur : XMLStorage::const_XMLPos, XMLStorage::XMLPos, XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator, Pane
  • _cur_bufs : FATDirectory
  • _cur_dir : ShellBrowser
  • _current_desktop : Desktops
  • _cx : PictureButton
  • _cy : PictureButton
  • _data : Entry
  • _description : BookmarkFolder, Bookmark
  • _desktop : CommonDesktop
  • _desktop_mode : ExplorerGlobals
  • _desktopBar : DesktopWindow
  • _desktops : ExplorerGlobals
  • _destroy : Thread
  • _dir : StartMenuDirectory, QuickLaunchBar, FATDirectory
  • _direction : ListSort
  • _dirs : StartMenu, CollectProgramsThread
  • _display_name : Entry
  • _display_version : BackgroundWindow
  • _display_version_org : DesktopSettingsDlg
  • _displayname : FileTypeInfo
  • _dlg_creator : PropSheetPage
  • _doctype : XMLStorage::XMLHeader
  • _down : Entry
  • _drive : FATDirectory
  • _drive_type : Root
  • _drives : MDIMainFrame
  • _dwRef : IShellBrowserImpl
  • _dwState : NotifyInfo
  • _enabled : SMBtnInfo
  • _encoding : XMLStorage::XMLHeader, XMLStorage::XMLReaderBase
  • _end : XMLStorage::const_XMLChildrenFilter, XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter, XMLStorage::XMLChildrenFilter::iterator
  • _end_leading : XMLStorage::XMLNode
  • _entries : FavoritesMenu, StartMenu, StartMenuEntry, QuickLaunchBar
  • _entry : QuickLaunchEntry, Root, FPDEntry
  • _ents : FATDirectory
  • _etype : FileChildWndInfo, Entry
  • _evtFinish : Thread
  • _expanded : Entry
  • _FATCache : FATDrive
  • _favorites : ExplorerGlobals
  • _favorites_path : ExplorerGlobals
  • _fct : DynamicLoadLibFct< FCT >, DynamicFct< FCT >
  • _file : COMException
  • _filter : StartMenuCreateInfo
  • _filter_name : XMLStorage::const_XMLChildrenFilter::const_iterator, XMLStorage::XMLChildrenFilter::iterator
  • _flags : ResizeEntry, ExplorerCmd
  • _flat : PictureButton
  • _floating_btn : StartMenu
  • _focus_pane : ChildWindow
  • _folder : ShellDirectory, ShellBrowser
  • _folders : StartMenuCreateInfo
  • _format : DataStorage
  • _fs : Root
  • _fs_flags : Root
  • _fsState : TaskBarEntry
  • _ftype_mgr : ExplorerGlobals
  • _fullpath : SpecialFolderFSPath
  • _fullscreen : MainFrameBase
  • _h : BufferCanvas
  • _hAccel : MainFrameBase
  • _haccel : TrayNotifyDlg, FindProgramDlg
  • _haddressedit : MainFrameBase
  • _hasSubmenu : SMBtnInfo
  • _hbmp : TaskBarEntry, QuickLaunchEntry
  • _hBmp : PictureButton, ResBitmap
  • _hBrush : PictureButton
  • _hbrush_bkgnd : ColorStatic
  • _hcommandedit : MainFrameBase
  • _hdc : BrushSelection, BitmapSelection, FontSelection, BkMode, TextColor, SelectedBitmap, Canvas
  • _hdctarg : BufferCanvas
  • _hDrive : FATDrive
  • _hdrivebar : MDIMainFrame
  • _header : XMLStorage::XMLDoc
  • _header_wdths_ok : FileChildWindow
  • _hextrabar : MDIMainFrame
  • _hfont : HyperlinkCtrl, ColorStatic, OutputWorker, ExplorerAboutDlg
  • _hframeClass : ExplorerGlobals
  • _hIcon : PictureButton, NotifyInfo
  • _hicon : ResIconEx, SmallIcon, ResIcon, Icon
  • _hide_inactive : NotifyArea
  • _himl : TrayNotifyDlg, ShellBrowser, Pane, MainFrameBase
  • _himl_old : ShellBrowser, MainFrameBase
  • _himlSys_small : IconCache
  • _hInstance : ExplorerGlobals
  • _hitemConfig : TrayNotifyDlg
  • _hitemCurrent : TrayNotifyDlg
  • _hitemCurrent_hidden : TrayNotifyDlg
  • _hitemCurrent_visible : TrayNotifyDlg
  • _hKeyRoot : RegDirectory
  • _hMainWnd : ExplorerGlobals
  • _hmdiclient : ChildWndInfo, MDIMainFrame
  • _hmenu : PopupMenu
  • _hMenuFrame : MainFrameBase
  • _hMenuView : MenuInfo
  • _hMenuWindow : MainFrameBase
  • _hModule : DynamicLoadLibFct< FCT >
  • _hook : NotifyArea
  • _hparent : TrayIcon
  • _hr : COMExceptionBase
  • _hsidebar : MainFrameBase
  • _hstatusbar : MainFrameBase
  • _hThread : Thread
  • _htoolbar : TaskBar, MainFrameBase
  • _hWnd : NotifyIconIndex
  • _hwnd : ResizeManager, PropertySheetDialog, WindowCanvas, PaintCanvas, WindowHandle, OleInPlaceClient, ShellDirectory, ShellBrowser, CollectProgramsThread
  • _hwndClock : NotifyArea
  • _hwndDesktop : ExplorerGlobals
  • _hwndDesktopBar : ExplorerGlobals
  • _hwndForeground : Desktop
  • _hWndFrame : ShellBrowser
  • _hwndFrame : ChildWindow
  • _hwndHeader : Pane
  • _hwndListView : DesktopShellView
  • _hwndNotify : DesktopBar
  • _hwndQuickLaunch : DesktopBar
  • _hwndrebar : DesktopBar, MainFrameBase
  • _hwndShellView : ExplorerGlobals
  • _hwndTaskBar : DesktopBar
  • _icon_algo : DesktopShellView
  • _icon_cache : ExplorerGlobals
  • _icon_id : SMBtnInfo, StartMenuEntry, Entry
  • _icon_idx : Bookmark
  • _icon_map : NotifyArea
  • _icon_path : Bookmark
  • _icon_states_org : TrayNotifyDlg
  • _icons : IconCache
  • _id : TrayIcon, ResizeEntry, TaskBarEntry, SMBtnInfo, Icon
  • _idx : NotifyInfo
  • _idxCache : IconCache
  • _idxIcon : FPDEntry
  • _ignore : StartMenuDirectory
  • _image_map : ShellBrowser
  • _in : XMLStorage::XMLReader
  • _in_place_object : IPCtrlWindow< BASE, SMARTPTR >
  • _info : TrayNotifyDlg, StartMenuCreateInfo
  • _instructions : XMLStorage::XMLReaderBase
  • _invisible_lines : StartMenu
  • _itype : Icon
  • _large_icons : StartMenu
  • _last : Context
  • _last_btn_width : TaskBar
  • _last_error : XMLStorage::XMLDoc
  • _last_error_msg : XMLStorage::XMLDoc
  • _last_foreground_wnd : TaskBar
  • _last_icon_count : NotifyArea
  • _last_mouse_pos : StartMenu
  • _last_pos : StartMenu
  • _last_sel : ShellBrowser
  • _last_size : ResizeManager
  • _last_split : ChildWindow, SDIMainFrame
  • _last_tag : XMLStorage::XMLReaderBase
  • _lastChange : NotifyIconDlgInfo, NotifyInfo
  • _leading : XMLStorage::XMLNode
  • _left : FileChildWindow
  • _left_hwnd : ChildWindow, ShellBrowser, SDIMainFrame
  • _level : Entry
  • _line : COMException
  • _list_ctrl : FindProgramDlg
  • _log : ExplorerGlobals
  • _logo_size : StartMenuRoot
  • _lwr_filter : FindProgramDlg
  • _malloc : SShellPtr< T >
  • _map : TaskBar
  • _map_crit_sect : Window::StaticWindowData
  • _mdi : ExplorerCmd
  • _medium : DataStorage
  • _menu_info : ChildWindow, MainFrameBase
  • _menu_path : FPDEntry
  • _min_wnd_size : ResizeManager
  • _minimized : Desktop
  • _mmMetrics_org : TaskBar
  • _mode : BufferedCanvas, FullScreenParameters, NotifyIconConfig
  • _modulePath : NotifyIconConfig
  • _msg : COMExceptionBase
  • _name : NotifyIconConfig, BookmarkFolder, Bookmark
  • _navigator : WebChildWindow, DWebBrowserEvents2Impl
  • _neverShowExt : FileTypeInfo
  • _new_html_txt : BrowserNavigator
  • _new_url : BrowserNavigator
  • _next : Entry
  • _next_id : TaskBar, StartMenu, QuickLaunchBar
  • _next_idx : NotifyArea
  • _node_name : XMLStorage::XMLWriter::StackEntry
  • _num_sep : OutputWorker
  • _obj : Context
  • _ObjectOpenFunctions : NTDLL
  • _old_bkmode : BkMode
  • _old_color : TextColor
  • _old_cursor : WaitCursor
  • _old_hbmp : SelectedBitmap
  • _old_hBmp : BitmapSelection
  • _old_hBrush : BrushSelection
  • _old_hFont : FontSelection
  • _open_mode : ShellPathInfo, FileChildWndInfo
  • _orgPos : FullScreenParameters
  • _orgWndProc : SubclassedWindow
  • _out : XMLStorage::XMLWriter
  • _out_wrkr : Pane
  • _p : BStr, SIfacePtr< T >, SShellPtr< T >, CommonShellMalloc
  • _pages : PropertySheetDialog
  • _para : CollectProgramsThread
  • _parser : XMLStorage::XMLReaderBase
  • _path : FileChildWindow, FileChildWndInfo, Root, Directory, FPDEntry, ExplorerCmd
  • _pathCache : IconCache
  • _pbookmark : BookmarkNode
  • _pctxmenu2 : CtxMenuInterfaces
  • _pctxmenu3 : CtxMenuInterfaces
  • _pDropTarget : ShellBrowser, DesktopShellView
  • _pfile : XMLStorage::FileHolder
  • _pfolder : BookmarkNode
  • _pidl : ShellEntry
  • _pIDList : PIDList
  • _pNotifyArea : TrayNotifyDlg
  • _pofstream : XMLStorage::XMLWriter
  • _pos : XMLStorage::XMLMessage, XMLStorage::XMLReaderBase, FileChildWndInfo
  • _positions : Pane
  • _prescan_nodes : ExplorerGlobals
  • _pretty : XMLStorage::XMLWriter
  • _pShellView : ShellBrowser, DesktopShellView, DesktopWindow
  • _read_ahead : FATDrive
  • _ref : XMLStorage::XMStringRef, XMLStorage::XMLIntRef, XMLStorage::XMLBoolRef, ComSrvObject
  • _resize_mgr : ResizeController< BASE >
  • _right : FileChildWindow
  • _right_hwnd : ChildWindow, ShellBrowser, SDIMainFrame
  • _root : XMLStorage::const_XMLPos, XMLStorage::XMLPos, ShellBrowser, Pane, FileChildWindow
  • _root_shell_path : ShellPathInfo, ShellChildWndInfo
  • _scanned : Entry
  • _SClus : FATDrive
  • _scroll_mode : StartMenu
  • _scroll_pos : StartMenu
  • _secarr : FATDirectory
  • _selected_id : StartMenu
  • _selectedItem : TrayNotifyDlg
  • _shell_attribs : Entry
  • _shell_path : ShellPathInfo, ShellChildWndInfo
  • _shellBrowser : ShellBrowserChildT< BASE >
  • _shellpath_info : MDIShellBrowserChild, SDIMainFrame
  • _show_button : NotifyArea
  • _show_hidden : NotifyArea
  • _show_hidden_org : TrayNotifyDlg
  • _size : QuickLaunchBar
  • _sort : FindProgramDlg
  • _sort_crit : ListSort
  • _sort_order : Root
  • _sorted_icons : NotifyArea
  • _spaceSize : OutputWorker
  • _split_pos : ChildWindow, SDIMainFrame
  • _stack : XMLStorage::XMLWriter, XMLStorage::const_XMLPos, XMLStorage::XMLPos
  • _startMenuRoot : DesktopBar
  • _state : XMLStorage::XMLWriter::StackEntry
  • _statusText : ChildWindow
  • _stgm : PIDList
  • _str : UNC
  • _submenu : StartMenu
  • _submenu_id : StartMenu
  • _sys_idx : Icon
  • _taskbar_pos : DesktopBar
  • _textColor : HyperlinkCtrl, ColorStatic, FlatButton
  • _thread : FindProgramDlg
  • _time : ClockWindow
  • _tipText : NotifyIconConfig
  • _title : TaskBarEntry, SMBtnInfo, StartMenuCreateInfo, StartMenuEntry, QuickLaunchEntry
  • _tooltip : ClockWindow, NotifyArea
  • _trailing : XMLStorage::XMLNode
  • _tree_ctrl : TrayNotifyDlg
  • _treePane : Pane
  • _type : BookmarkNode, NtObjEntry
  • _type_name : Entry
  • _uCallbackMessage : NotifyInfo
  • _uID : NotifyIconIndex
  • _up : Entry
  • _url : ChildWindow, Bookmark, SDIMainFrame
  • _url_history : ChildWindow
  • _used : TaskBarEntry
  • _user_programs : FindProgramDlg
  • _usingCOM : IPCtrlWindow< BASE, SMARTPTR >
  • _uuid_base : IComSrvQI< BASE >
  • _valid_path : ExplorerCmd
  • _value : XMLStorage::XMLString, XMLStorage::XMLInt, XMLStorage::XMLBool
  • _version : XMLStorage::XMLHeader, NotifyInfo
  • _visible_cols : Pane
  • _volname : Root
  • _w : BufferCanvas
  • _wasZoomed : FullScreenParameters
  • _widths : Pane
  • _window_modules : NotifyArea
  • _windows : Desktop
  • _windowTitle : NotifyIconConfig
  • _work_area_org : DesktopBar
  • _x : BufferCanvas
  • _xml_version : XMLStorage::XMLReaderBase
  • _y : BufferCanvas


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- j -

  • jmp : BootSector32, BootSector


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- l -

  • Label : BootSector


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- m -

  • m_bDropped : IDropSourceImpl
  • m_hTargetWnd : IDropTargetImpl
  • MediaDescr : BootSector32, BootSector
  • min : ftime
  • month : fdate


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- n -

  • name : NtObjectInfo, DEntry_E
  • nicon_data : TrayNotifyCDS
  • notify_code : TrayNotifyCDS
  • NtClose : NTDLL
  • NtOpenDirectoryObject : NTDLL
  • NtOpenEvent : NTDLL
  • NtOpenEventPair : NTDLL
  • NtOpenFile : NTDLL
  • NtOpenIoCompletion : NTDLL
  • NtOpenKey : NTDLL
  • NtOpenMutant : NTDLL
  • NtOpenProcess : NTDLL
  • NtOpenSection : NTDLL
  • NtOpenSemaphore : NTDLL
  • NtOpenSymbolicLinkObject : NTDLL
  • NtOpenThread : NTDLL
  • NtOpenTimer : NTDLL
  • NtQueryDirectoryObject : NTDLL
  • NtQueryObject : NTDLL
  • NtQuerySymbolicLinkObject : NTDLL
  • NumberFATs : BootSector32, BootSector


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- o -

  • OEM : BootSector32, BootSector


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- a -

  • a : FAT_attribute
  • alloc_len : RtlUnicodeString, RtlAnsiString
  • anz : dskrwblk
  • archived : fattr
  • attr : DEntry_E


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- b -

  • b : FAT_attribute
  • B : DEntry
  • BootCode : BootSector32, BootSector
  • BootSignature : BootSector32, BootSector
  • buf : dskrwblk
  • BytesPerSector : BootSector32, BootSector


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- c -

  • cmd : ExecuteDialog
  • cmdshow : ExecuteDialog
  • cookie : TrayNotifyCDS
  • creation_time : NtObject


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- d -

  • dat : Cache, Buffer
  • date : DEntry_E
  • day : fdate
  • deleted : fattr
  • directory : fattr
  • DriveUnit : BootSector


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- e -

  • E : DEntry
  • ent : dirent
  • Ent : Kette
  • ext : DEntry_E
  • ExtBootFlag : BootSector


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- f -

  • fclus : DEntry_E
  • FileSystem : BootSector32, BootSector


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- g -

  • GetIDsOfNames : DWebBrowserEvents2Impl
  • GetTypeInfo : DWebBrowserEvents2Impl
  • GetTypeInfoCount : DWebBrowserEvents2Impl


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- h -

  • handle_count : NtObject
  • Heads : BootSector32, BootSector
  • hidden : fattr
  • HiddenSectors : BootSector32, BootSector
  • hour : ftime


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- i -

  • Invoke : DWebBrowserEvents2Impl


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- p -

  • padding : NtObjectInfo


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- r -

  • readonly : fattr
  • reference_count : NtObject
  • reserved1 : BootSector32
  • reserved2 : BootSector32
  • ReservedSectors : BootSector32, BootSector
  • RootEntries : BootSector
  • RootSectors : BootSector32
  • rsrvd : DEntry_E
  • RtlAnsiStringToUnicodeString : NTDLL
  • RtlFreeAnsiString : NTDLL
  • RtlFreeUnicodeString : NTDLL
  • RtlInitAnsiString : NTDLL
  • RtlInitUnicodeString : NTDLL
  • RtlUnicodeStringToAnsiString : NTDLL
  • Rueck : Kette


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- s -

  • s : dirsecz
  • s_cmn_shell_malloc : ShellMalloc
  • s_current : Context
  • s_def_creator : StartMenu
  • s_dialogs : Window
  • s_empty_attr : XMLStorage::XMLWriter
  • s_hcbtHook : Window
  • s_main : Context
  • s_new_info : Window
  • s_next_id : IconCache
  • s_ObjectTypes : NTDLL
  • s_pretranslate_windows : Window
  • s_window_creator : Window
  • s_wnd_map : Window
  • sec : dskrwblk
  • sec2 : ftime
  • Sectors16 : BootSector32, BootSector
  • Sectors32 : BootSector32, BootSector
  • SectorsPerCluster : BootSector32, BootSector
  • SectorsPerFAT : BootSector
  • SectorsPerFAT32 : BootSector32
  • SectorsPerTrack : BootSector32, BootSector
  • SerialNr : BootSector
  • size : OpenStruct, DEntry_E
  • string : OpenStruct
  • string_len : RtlUnicodeString, RtlAnsiString
  • string_ptr : RtlUnicodeString, RtlAnsiString
  • system : fattr


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- t -

  • time : DEntry_E
  • type : NtObjectInfo


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- u -

  • unknown1 : BootSector32
  • unknown2 : BootSector32


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- v -

  • volume : fattr
  • Vorw : Kette


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- w -

  • WM_GETMODULEPATH : NotifyHook
  • WM_SHELLHOOK : TaskBar
  • WM_TASKBARCREATED : TrayIconControllerTemplate< BASE >, DesktopBar


ROS Explorer: Class Members - Variables

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • y

- y -

  • year : fdate


ROS Explorer: Namespace Index

  • Namespace List
  • Namespace Members

ROS Explorer Namespace List

Here is a list of all namespaces with brief descriptions:
std
XMLStorage


ROS Explorer: std Namespace Reference

  • Namespace List
  • Namespace Members

std Namespace Reference

ROS Explorer Source Code Documentation
generated on 21.11.2004 by doxygen

ROS Explorer Homepage


ROS Explorer: XMLStorage Namespace Reference

  • Namespace List
  • Namespace Members

XMLStorage Namespace Reference

Classes

struct | XS_String
string class for TCHAR strings More...
struct | FileHolder
struct | tifstream
input file stream with ANSI/UNICODE file names More...
struct | tofstream
output file stream with ANSI/UNICODE file names More...
struct | String_from_XML_Char
converter from Expat strings to XMLStorage internal strings More...
struct | XMLNode
in memory representation of an XML node More...
struct | XMLChildrenFilter
iterator access to children nodes with name filtering More...
struct | const_XMLChildrenFilter
read only iterator access to children nodes with name filtering More...
struct | XMLPos
iterator for XML trees More...
struct | const_XMLPos
iterator for XML trees More...
struct | XMLBool
type converter for boolean data More...
struct | XMLBoolRef
type converter for boolean data with write access More...
struct | XMLInt
type converter for integer data More...
struct | XMLIntRef
type converter for integer data with write access More...
struct | XMLString
type converter for string data More...
struct | XMStringRef
type converter for string data with write access More...
struct | XMLReaderBase
XML reader base class. More...
struct | XMLReader
XML file reader. More...
struct | XMLHeader
management of XML file headers More...
struct | XMLDoc
XML document holder. More...
struct | XMLMessage
XML message wrapper. More...
struct | XMLWriter

Typedefs

typedef std::filebuf | STDIO_FILEBUF

Enumerations

enum | PRETTY_FLAGS { PRETTY_PLAIN = 0, PRETTY_LINEFEED = 1, PRETTY_INDENT = 2 }

Functions

std::string | EncodeXMLString (const XS_String &str)
encode XML string literals
XS_String | DecodeXMLString (const XS_String &str)
decode XML string literals
void | assign_utf8 (XS_String &s, const char *str)
std::string | get_utf8 (LPCTSTR s, size_t l)
std::string | get_utf8 (const XS_String &s)
template<typename T>
void | read_option (T &var, const_XMLPos &cfg, LPCXSSTR key)
template<>
void | read_option (int &var, const_XMLPos &cfg, LPCXSSTR key)

Typedef Documentation

typedef std::filebuf XMLStorage::STDIO_FILEBUF

Definition at line 269 of file xmlstorage.h.

Enumeration Type Documentation

enum XMLStorage::PRETTY_FLAGS

Enumerator:
PRETTY_PLAIN
PRETTY_LINEFEED
PRETTY_INDENT

Definition at line 1769 of file xmlstorage.h.

01769                   {
01770         PRETTY_PLAIN    = 0,
01771         PRETTY_LINEFEED = 1,
01772         PRETTY_INDENT   = 2
01773 };

Function Documentation

void XMLStorage::assign_utf8 | ( | XS_String & | s,
 |  | const char * | str
 | ) | [inline]

Definition at line 220 of file xmlstorage.h.

References XMLStorage::XS_String::assign().

Referenced by XMLStorage::XMLNode::get_content(), and XMLStorage::String_from_XML_Char::String_from_XML_Char().

00221 {
00222         int lutf8 = (int)strlen(str);
00223
00224 #ifdef UNICODE
00225         LPTSTR buffer = (LPTSTR)alloca(sizeof(TCHAR)*lutf8);
00226         int l = MultiByteToWideChar(CP_UTF8, 0, str, lutf8, buffer, lutf8);
00227 #else
00228         LPWSTR wbuffer = (LPWSTR)alloca(sizeof(WCHAR)*lutf8);
00229         int l = MultiByteToWideChar(CP_UTF8, 0, str, lutf8, wbuffer, lutf8);
00230
00231         int bl=2*l; LPSTR buffer = (LPSTR)alloca(bl);
00232         l = WideCharToMultiByte(CP_ACP, 0, wbuffer, l, buffer, bl, 0, 0);
00233 #endif
00234
00235         s.assign(buffer, l);
00236 }

Here is the call graph for this function:

XS_String XMLStorage::DecodeXMLString ( const XS_String & str )

decode XML string literals

Definition at line 510 of file xmlstorage.cpp.

References LPCXSSTR, LPXSSTR, XS_len, XS_nicmp, and XS_TEXT.

Referenced by XMLStorage::XMLNode::get_content(), get_utf8(), and BookmarkList::import_IE_favorites().

00511 {
00512         LPCXSSTR s = str.c_str();
00513         LPXSSTR buffer = (LPXSSTR)alloca(sizeof(XS_CHAR)*XS_len(s));
00514         LPXSSTR o = buffer;
00515
00516         for(LPCXSSTR p=s; *p; ++p)
00517                 if (*p == '&') {
00518                         if (!XS_nicmp(p+1, XS_TEXT("lt;"), 3)) {
00519                                 *o++ = '<';
00520                                 p += 3;
00521                         } else if (!XS_nicmp(p+1, XS_TEXT("gt;"), 3)) {
00522                                 *o++ = '>';
00523                                 p += 3;
00524                         } else if (!XS_nicmp(p+1, XS_TEXT("amp;"), 4)) {
00525                                 *o++ = '&';
00526                                 p += 4;
00527                         } else if (!XS_nicmp(p+1, XS_TEXT("quot;"), 5)) {
00528                                 *o++ = '"';
00529                                 p += 5;
00530                         } else if (!XS_nicmp(p+1, XS_TEXT("apos;"), 5)) {
00531                                 *o++ = '\'';
00532                                 p += 5;
00533                         } else
00534                                 *o++ = *p;
00535                 } else
00536                         *o++ = *p;
00537
00538         return XS_String(buffer, o-buffer);
00539 }

std::string XMLStorage::EncodeXMLString ( const XS_String & str )

encode XML string literals

Definition at line 464 of file xmlstorage.cpp.

References get_utf8(), LPCXSSTR, LPXSSTR, XS_CHAR, and XS_len.

Referenced by get_utf8(), XMLStorage::XMLNode::pretty_write_worker(), XMLStorage::XMLNode::set_content(), XMLStorage::XMLNode::smart_write_worker(), XMLStorage::XMLWriter::write_attributes(), XMLStorage::XMLWriter::write_post(), XMLStorage::XMLWriter::write_pre(), and XMLStorage::XMLNode::write_worker().

00465 {
00466         LPCXSSTR s = str.c_str();
00467         LPXSSTR buffer = (LPXSSTR)alloca(6*sizeof(XS_CHAR)*XS_len(s));  // worst case "&quot;" / "&apos;"
00468         LPXSSTR o = buffer;
00469
00470         for(LPCXSSTR p=s; *p; ++p)
00471                 switch(*p) {
00472                   case '&':
00473                         *o++ = '&';     *o++ = 'a';     *o++ = 'm';     *o++ = 'p';     *o++ = ';';
00474                         break;
00475
00476                   case '<':
00477                         *o++ = '&';     *o++ = 'l'; *o++ = 't'; *o++ = ';';
00478                         break;
00479
00480                   case '>':
00481                         *o++ = '&';     *o++ = 'g'; *o++ = 't'; *o++ = ';';
00482                         break;
00483
00484                   case '"':
00485                         *o++ = '&';     *o++ = 'q'; *o++ = 'u'; *o++ = 'o'; *o++ = 't'; *o++ = ';';
00486                         break;
00487
00488                   case '\'':
00489                         *o++ = '&';     *o++ = 'a'; *o++ = 'p'; *o++ = 'o'; *o++ = 's'; *o++ = ';';
00490                         break;
00491
00492                   default:
00493                         if ((unsigned)*p<20 && *p!='\t' && *p!='\r' && *p!='\n') {
00494                                 char b[16];
00495                                 sprintf(b, "&%d;", (unsigned)*p);
00496                                 for(const char*q=b; *q; )
00497                                         *o++ = *q++;
00498                         } else
00499                                 *o++ = *p;
00500                 }
00501
00502 #ifdef XS_STRING_UTF8
00503         return XS_String(buffer, o-buffer);
00504 #else
00505         return get_utf8(buffer, o-buffer);
00506 #endif
00507 }

Here is the call graph for this function:

std::string XMLStorage::get_utf8 ( const XS_String & s ) [inline]

Definition at line 254 of file xmlstorage.h.

References DecodeXMLString(), EncodeXMLString(), and get_utf8().

00255 {
00256         return get_utf8(s.c_str(), s.length());
00257 }

Here is the call graph for this function:

std::string XMLStorage::get_utf8 | ( | LPCTSTR | s,
 |  | size_t | l
 | ) | [inline]

Definition at line 238 of file xmlstorage.h.

Referenced by EncodeXMLString(), and get_utf8().

00239 {
00240 #ifdef UNICODE
00241         size_t bl=2*l; LPSTR buffer = (LPSTR)alloca(bl);
00242         l = WideCharToMultiByte(CP_UTF8, 0, s, (int)l, buffer, (int)bl, 0, 0);
00243 #else
00244         LPWSTR wbuffer = (LPWSTR)alloca(sizeof(WCHAR)*l);
00245         l = MultiByteToWideChar(CP_ACP, 0, s, (int)l, wbuffer, (int)l);
00246
00247         size_t bl=2*l; LPSTR buffer = (LPSTR)alloca(bl);
00248         l = WideCharToMultiByte(CP_UTF8, 0, wbuffer, (int)l, buffer, (int)bl, 0, 0);
00249 #endif
00250
00251         return std::string(buffer, l);
00252 }

template<>
void XMLStorage::read_option | ( | int & | var,
 |  | const_XMLPos & | cfg,
 |  | LPCXSSTR | key
 | ) | [inline]

Definition at line 1520 of file xmlstorage.h.

References XMLStorage::const_XMLPos::get(), and XS_toi.

01521         {
01522                 const XS_String& val = cfg.get(key);
01523
01524                 if (!val.empty())
01525                         var = XS_toi(val.c_str());
01526         }

Here is the call graph for this function:

template<typename T>
void XMLStorage::read_option | ( | T & | var,
 |  | const_XMLPos & | cfg,
 |  | LPCXSSTR | key
 | ) | [inline]

Definition at line 1511 of file xmlstorage.h.

References XMLStorage::const_XMLPos::get().

01512         {
01513                 const XS_String& val = cfg.get(key);
01514
01515                 if (!val.empty())
01516                         var = val;
01517         }

Here is the call graph for this function:


ROS Explorer: Directory Hierarchy

ROS Explorer Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • desktop
  • dialogs
  • shell
  • taskbar
  • utility


ROS Explorer: desktop/ Directory Reference

desktop

desktop Directory Reference

Files

file | desktop.cpp [code]
file | desktop.h [code]


ROS Explorer: dialogs/ Directory Reference

dialogs

dialogs Directory Reference

Files

file | searchprogram.cpp [code]
file | searchprogram.h [code]
file | settings.cpp [code]
file | settings.h [code]


ROS Explorer: shell/ Directory Reference

shell

shell Directory Reference

Files

file | entries.cpp [code]
file | entries.h [code]
file | fatfs.cpp [code]
file | fatfs.h [code]
file | filechild.cpp [code]
file | filechild.h [code]
file | mainframe.cpp [code]
file | mainframe.h [code]
file | ntobjfs.cpp [code]
file | ntobjfs.h [code]
file | pane.cpp [code]
file | pane.h [code]
file | regfs.cpp [code]
file | regfs.h [code]
file | shellbrowser.cpp [code]
file | shellbrowser.h [code]
file | shellfs.cpp [code]
file | shellfs.h [code]
file | unixfs.cpp [code]
file | unixfs.h [code]
file | webchild.cpp [code]
file | webchild.h [code]
file | winfs.cpp [code]
file | winfs.h [code]


ROS Explorer: taskbar/ Directory Reference

taskbar

taskbar Directory Reference

Files

file | desktopbar.cpp [code]
file | desktopbar.h [code]
file | favorites.cpp [code]
file | favorites.h [code]
file | quicklaunch.cpp [code]
file | quicklaunch.h [code]
file | startmenu.cpp [code]
file | startmenu.h [code]
file | taskbar.cpp [code]
file | taskbar.h [code]
file | traynotify.cpp [code]
file | traynotify.h [code]


ROS Explorer: utility/ Directory Reference

utility

utility Directory Reference

Files

file | dragdropimpl.cpp [code]
file | dragdropimpl.h [code]
file | shellbrowserimpl.cpp [code]
file | shellbrowserimpl.h [code]
file | shellclasses.cpp [code]
file | shellclasses.h [code]
file | shelltests.cpp [code]
file | splitpath.c [code]
file | treedroptarget.h [code]
file | utility.cpp [code]
file | utility.h [code]
file | window.cpp [code]
file | window.h [code]
file | xmlstorage.cpp [code]
file | xmlstorage.h [code]


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- _ -

  • _A_DELETED : fatfs.h
  • _A_ILLEGAL : fatfs.h
  • _catchException0() : i386-stub-win32.c
  • _catchException1() : i386-stub-win32.c
  • _catchException10() : i386-stub-win32.c
  • _catchException11() : i386-stub-win32.c
  • _catchException12() : i386-stub-win32.c
  • _catchException13() : i386-stub-win32.c
  • _catchException14() : i386-stub-win32.c
  • _catchException16() : i386-stub-win32.c
  • _catchException3() : i386-stub-win32.c
  • _catchException4() : i386-stub-win32.c
  • _catchException5() : i386-stub-win32.c
  • _catchException6() : i386-stub-win32.c
  • _catchException7() : i386-stub-win32.c
  • _catchException8() : i386-stub-win32.c
  • _catchException9() : i386-stub-win32.c
  • _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES : precomp.h
  • _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT : precomp.h
  • _LAZY_ICONEXTRACT : startmenu.h
  • _LIGHT_STARTMENU : startmenu.h
  • _log_() : utility.h, explorer.cpp
  • _MAX_DIR : utility.h
  • _MAX_DRIVE : utility.h
  • _MAX_EXT : utility.h
  • _MAX_FNAME : utility.h
  • _MAX_PATH : utility.h
  • _NO_COMMENT : xmlstorage.cpp
  • _returnFromException() : i386-stub-win32.c
  • _SINGLE_ICONEXTRACT : startmenu.h
  • _splitpath() : splitpath.c
  • _stprintf : utility.h
  • _stprintf_s1 : utility.h
  • _stprintf_s2 : utility.h
  • _STRING_DEFINED : utility.h
  • _tcscpy_s : utility.h
  • _tcsrchr : utility.h
  • _tsplitpath_s : utility.h
  • _tWinMain() : explorer.cpp
  • _XMLSTORAGE_H : xmlstorage.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- k -

  • KEY_OBJECT : ntobjfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- l -

  • launch_cpanel() : utility.h, utility.cpp
  • launch_file() : utility.h, utility.cpp
  • launch_fileA : utility.h
  • ListView_FindItemPara() : window.h
  • ListView_GetFocusedItem() : window.h
  • ListView_GetItemData() : window.h
  • LOG : utility.h
  • LOGOFFWINDOWSDIALOG : startmenu.h
  • LONGLONGARG : utility.h
  • LPCXSSTR : xmlstorage.h
  • LPXSSTR : xmlstorage.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- m -

  • main() : shelltests.cpp
  • MANIFEST_RESOURCE_ID : resource.h
  • mem2hex() : i386-stub-win32.c
  • MinimizeStruct : globals.h
  • MK_LONG : fatfs.h
  • MK_P : fatfs.h
  • MOVE : window.h
  • MOVE_BOTTOM : window.h
  • MOVE_LEFT : window.h
  • MOVE_RIGHT : window.h
  • MOVE_TOP : window.h
  • MOVE_X : window.h
  • MOVE_Y : window.h
  • MoveVisible() : utility.h, utility.cpp
  • MUTANT_OBJECT : ntobjfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- n -

  • name_from_pidl() : shellclasses.h, shellclasses.cpp
  • NFR_CURRENT : window.h
  • NID_SIZE_A3 : traynotify.cpp
  • NID_SIZE_A5 : traynotify.cpp
  • NID_SIZE_A6 : traynotify.cpp
  • NID_SIZE_W3 : traynotify.cpp
  • NID_SIZE_W5 : traynotify.cpp
  • NID_SIZE_W6 : traynotify.cpp
  • NIM_AUTO : traynotify.h
  • NIM_HIDE : traynotify.h
  • NIM_SHOW : traynotify.h
  • NOTIFYAREA_SPACE : traynotify.h
  • NOTIFYAREA_WIDTH_DEF : traynotify.h
  • NOTIFYICON_DIST : traynotify.h
  • NOTIFYICON_SIZE : traynotify.h
  • NOTIFYICON_X : traynotify.h
  • NOTIFYICON_Y : traynotify.h
  • NotifyIconCfgList : traynotify.h
  • NotifyIconDlgInfoMap : traynotify.h
  • NotifyIconMap : traynotify.h
  • NOTIFYICONMODE : traynotify.h
  • NotifyIconSet : traynotify.h
  • NOVTABLE : shellclasses.h
  • NTOBJECTOPENFUNCTIONS : ntobjfs.cpp
  • NUMREGBYTES : i386-stub-win32.c
  • NUMREGS : i386-stub-win32.c


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- o -

  • OBJ_CONTEXT : utility.h
  • OBJECT_TYPE : ntobjfs.h
  • OPEN_WINDOW_MODE : mainframe.h
  • OWM_DETAILS : mainframe.h
  • OWM_EXPLORE : mainframe.h
  • OWM_PIDL : mainframe.h
  • OWM_ROOTED : mainframe.h
  • OWM_SEPARATE : mainframe.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- a -

  • A2nU : utility.h
  • A2U : utility.h
  • ADAPTER_OBJECT : ntobjfs.h
  • AddP : fatfs.h
  • ANS : utility.h
  • ANSUNC : shellclasses.h
  • ARCHIVE : fatfs.h
  • ARRANGE_BORDER_DOWN : desktop.cpp
  • ARRANGE_BORDER_HV : desktop.cpp
  • ARRANGE_ROUNDABOUT : desktop.cpp
  • asm() : i386-stub-win32.c
  • assign_utf8() : xmlstorage.h
  • ATTRIBUTE_ERASED : entries.h
  • ATTRIBUTE_EXECUTABLE : entries.h
  • ATTRIBUTE_LONGNAME : entries.h
  • ATTRIBUTE_SYMBOLIC_LINK : entries.h
  • ATTRIBUTE_VOLNAME : entries.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- b -

  • BookmarkMap : startmenu.h
  • BREAKPOINT : i386-stub-win32.c
  • breakpoint() : i386-stub-win32.c
  • BUFFER_LEN : xmlstorage.h, utility.h
  • BufLen : fatfs.h
  • BUFMAX : i386-stub-win32.c


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- c -

  • C_DRIVE : shellbrowser.h
  • C_DRIVE_STR : shellbrowser.h
  • CACHE_SIZE_LOW : fatfs.h
  • CALL_HOOK : i386-stub-win32.c
  • CenterWindow() : utility.h, utility.cpp
  • CHECK_FAULT : i386-stub-win32.c
  • CheckError() : shellclasses.h
  • CHECKERROR : shellclasses.h
  • CLASSNAME_CHILDWND : explorer.h
  • CLASSNAME_CLOCKWINDOW : traynotify.h
  • CLASSNAME_EXPLORERBAR : desktopbar.h
  • CLASSNAME_FRAME : explorer.h
  • CLASSNAME_STARTMENU : startmenu.h
  • CLASSNAME_TASKBAR : taskbar.h
  • CLASSNAME_TRAYNOTIFY : traynotify.h
  • CLASSNAME_WINEFILETREE : explorer.h
  • ClientToScreen() : utility.h
  • COL_ALL : pane.h
  • COL_ATTRIBUTES : pane.h
  • COL_CONTENT : pane.h
  • COL_DATE : pane.h
  • COL_DOSNAMES : pane.h
  • COL_INDEX : pane.h
  • COL_LINKS : pane.h
  • COL_SIZE : pane.h
  • COL_TIME : pane.h
  • COL_TYPE : pane.h
  • COLLECT_CALLBACK : searchprogram.h
  • COLOR_SPLITBAR : window.h
  • COLUMN_FLAGS : pane.h
  • COLUMNS : pane.h
  • computeSignal() : i386-stub-win32.c
  • CONSTRUCT_NTDLLFCT : ntobjfs.cpp
  • CONTEXT : utility.h
  • CONTEXT_OBJ : utility.h
  • CONTROL_RUNDLL : utility.cpp
  • CONTROLLER_OBJECT : ntobjfs.h
  • COUNTOF : xmlstorage.h, utility.h
  • create_bitmap_from_icon() : globals.h, explorer.cpp
  • create_small_bitmap_from_icon() : explorer.cpp
  • create_webchildwindow() : webchild.cpp, mainframe.cpp
  • CS : i386-stub-win32.c
  • CSIDL_FLAG_CREATE : shellclasses.cpp
  • CURRENT_CONTEXT : utility.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- d -

  • debug_error() : i386-stub-win32.c
  • DecodeURLString() : favorites.h, favorites.cpp
  • DecodeXMLString() : xmlstorage.cpp
  • DEFAULT_SPLIT_POS : window.h
  • DESKTOP_COUNT : globals.h
  • DESKTOP_OBJECT : ntobjfs.h
  • DESKTOPBARBAR_HEIGHT : desktopbar.h
  • DesktopRef : globals.h
  • DEVICE_OBJECT : ntobjfs.h
  • DIRECTORY_OBJECT : ntobjfs.h
  • DIRENT : fatfs.h
  • DISPID_BEFORENAVIGATE : webchild.h
  • DISPID_CLIENTTOHOSTWINDOW : webchild.h
  • DISPID_COMMANDSTATECHANGE : webchild.h
  • DISPID_DOCUMENTCOMPLETE : webchild.h
  • DISPID_DOWNLOADBEGIN : webchild.h
  • DISPID_DOWNLOADCOMPLETE : webchild.h
  • DISPID_FILEDOWNLOAD : webchild.h
  • DISPID_FRAMEBEFORENAVIGATE : webchild.h
  • DISPID_FRAMENAVIGATECOMPLETE : webchild.h
  • DISPID_FRAMENEWWINDOW : webchild.h
  • DISPID_NAVIGATECOMPLETE : webchild.h
  • DISPID_NAVIGATECOMPLETE2 : webchild.h
  • DISPID_NAVIGATEERROR : webchild.h
  • DISPID_NEWWINDOW : webchild.h
  • DISPID_ONADDRESSBAR : webchild.h
  • DISPID_ONFULLSCREEN : webchild.h
  • DISPID_ONMENUBAR : webchild.h
  • DISPID_ONQUIT : webchild.h
  • DISPID_ONSTATUSBAR : webchild.h
  • DISPID_ONTHEATERMODE : webchild.h
  • DISPID_ONTOOLBAR : webchild.h
  • DISPID_ONVISIBLE : webchild.h
  • DISPID_PRIVACYIMPACTEDSTATECHANGE : webchild.h
  • DISPID_PROGRESSCHANGE : webchild.h
  • DISPID_PROPERTYCHANGE : webchild.h
  • DISPID_QUIT : webchild.h
  • DISPID_SETSECURELOCKICON : webchild.h
  • DISPID_STATUSTEXTCHANGE : webchild.h
  • DISPID_TITLECHANGE : webchild.h
  • DISPID_TITLEICONCHANGE : webchild.h
  • DISPID_WINDOWACTIVATE : webchild.h
  • DISPID_WINDOWCLOSING : webchild.h
  • DISPID_WINDOWMOVE : webchild.h
  • DISPID_WINDOWRESIZE : webchild.h
  • DISPID_WINDOWSETHEIGHT : webchild.h
  • DISPID_WINDOWSETLEFT : webchild.h
  • DISPID_WINDOWSETRESIZABLE : webchild.h
  • DISPID_WINDOWSETTOP : webchild.h
  • DISPID_WINDOWSETWIDTH : webchild.h
  • display_error() : utility.h, utility.cpp
  • dpeek : fatfs.h
  • dpoke : fatfs.h
  • DrawGrayText() : window.h, window.cpp
  • DrawStartMenuButton() : startmenu.h, startmenu.cpp
  • DRIVER_OBJECT : ntobjfs.h
  • DS : i386-stub-win32.c


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- e -

  • EAX : i386-stub-win32.c
  • EBP : i386-stub-win32.c
  • EBX : i386-stub-win32.c
  • ECX : i386-stub-win32.c
  • EDI : i386-stub-win32.c
  • EDX : i386-stub-win32.c
  • EncodeXMLString() : xmlstorage.cpp
  • ENTRY_TYPE : entries.h
  • ES : i386-stub-win32.c
  • ESI : i386-stub-win32.c
  • ESP : i386-stub-win32.c
  • ET_FAT : entries.h
  • ET_NTOBJS : entries.h
  • ET_REGISTRY : entries.h
  • ET_SHELL : entries.h
  • ET_UNKNOWN : entries.h
  • ET_WEB : entries.h
  • ET_WINDOWS : entries.h
  • EVENT_OBJECT : ntobjfs.h
  • EVENTPAIR_OBJECT : ntobjfs.h
  • exceptionHandler() : i386-stub-win32.c
  • exists_path() : utility.h, utility.cpp
  • EXITWINDOWSDLG : startmenu.h
  • explorer_about() : externals.h, explorer.cpp
  • explorer_main() : externals.h, explorer.cpp
  • explorer_show_frame() : externals.h, explorer.cpp
  • ExplorerPropertySheet() : settings.h, settings.cpp


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- f -

  • FAT_DEL_CHAR : fatfs.h
  • FETCH_ITEM_COUNT : shellfs.cpp
  • FILE_ATTRIBUTE_ENCRYPTED : utility.h
  • FILE_ATTRIBUTE_NOT_CONTENT_INDEXED : utility.h
  • FILE_ATTRIBUTE_REPARSE_POINT : utility.h
  • FILE_ATTRIBUTE_SPARSE_FILE : utility.h
  • FILE_OBJECT : ntobjfs.h
  • find_window_class() : utility.h, utility.cpp
  • for : utility.h
  • FormatArray : dragdropimpl.h
  • FPDCache : searchprogram.h
  • Frame_CalcFrameClient : window.h
  • Frame_GetMenuInfo : window.h
  • FS : i386-stub-win32.c


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- g -

  • g_DeregisterShellHookWindow : taskbar.cpp
  • g_Globals : globals.h, explorer.cpp
  • g_NTDLL : ntobjfs.cpp
  • g_RegisterShellHookWindow : taskbar.cpp
  • g_SetTaskmanWindow : taskbar.cpp
  • g_SHDOCVW_ShellDDEInit : explorer.cpp
  • gdb_i386errcode : i386-stub-win32.c
  • gdb_i386vector : i386-stub-win32.c
  • get_char() : i386-stub-win32.c
  • get_utf8() : xmlstorage.h
  • GET_WINDOW : window.h
  • get_window_icon_big() : taskbar.cpp, globals.h
  • get_window_icon_small() : taskbar.cpp, globals.h
  • get_windows_version_str() : utility.h, utility.cpp
  • getDebugChar() : i386-stub-win32.c
  • GetDesktopFolder() : shellclasses.h, shellclasses.cpp
  • getpacket() : i386-stub-win32.c
  • GetStartMenuBtnTextWidth() : startmenu.h, startmenu.cpp
  • GS : i386-stub-win32.c


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- h -

  • handle_exception() : i386-stub-win32.c
  • HandleException() : shellclasses.h, shellclasses.cpp
  • hex() : i386-stub-win32.c
  • hex2mem() : i386-stub-win32.c
  • hexToInt() : i386-stub-win32.c
  • HIDDEN : fatfs.h
  • HWND : desktop.cpp


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- i -

  • ICF_HICON : entries.h
  • ICF_LARGE : entries.h
  • ICF_NORMAL : entries.h
  • ICF_OPEN : entries.h
  • ICF_OVERLAYS : entries.h
  • ICF_SYSCACHE : entries.h
  • ICID_ACTION : globals.h
  • ICID_APP : globals.h
  • ICID_APPS : globals.h
  • ICID_BOOKMARK : globals.h
  • ICID_COMPUTER : globals.h
  • ICID_CONFIG : globals.h
  • ICID_DOCUMENTS : globals.h
  • ICID_DYNAMIC : globals.h
  • ICID_EXPLORER : globals.h
  • ICID_FAVORITES : globals.h
  • ICID_FOLDER : globals.h
  • ICID_INFO : globals.h
  • ICID_LOGOFF : globals.h
  • ICID_NETWORK : globals.h
  • ICID_NONE : globals.h
  • ICID_PRINTER : globals.h
  • ICID_SEARCH : globals.h
  • ICID_SEARCH_DOC : globals.h
  • ICID_UNKNOWN : globals.h
  • ICON_AUTOHIDE_SECONDS : traynotify.h
  • ICON_ID : globals.h
  • ICON_SIZE_X : globals.h
  • ICON_SIZE_Y : globals.h
  • ICON_TYPE : globals.h
  • ICONCACHE_FLAGS : entries.h
  • IconMap : desktop.cpp
  • IconPos : desktop.cpp
  • ID_ABOUT_EXPLORER : resource.h
  • ID_ABOUT_WINDOWS : resource.h
  • ID_ACTIVATE : resource.h
  • ID_CONFIG_NOTIFYAREA : resource.h
  • ID_CONFIG_TIME : resource.h
  • ID_DESKTOP_VERSION : resource.h
  • ID_DESKTOPBAR_SETTINGS : resource.h
  • ID_DRIVE_DESKTOP : resource.h
  • ID_DRIVE_FAT : resource.h
  • ID_DRIVE_FIRST : resource.h
  • ID_DRIVE_NTOBJ_NS : resource.h
  • ID_DRIVE_REGISTRY : resource.h
  • ID_DRIVE_SHELL_NS : resource.h
  • ID_DRIVE_UNIX_FS : resource.h
  • ID_EDIT_PROPERTIES : resource.h
  • ID_EXECUTE : resource.h
  • ID_EXPLORE : resource.h
  • ID_EXPLORER_FAQ : resource.h
  • ID_FILE_EXIT : resource.h
  • ID_GO_BACK : resource.h
  • ID_GO_FORWARD : resource.h
  • ID_GO_HOME : resource.h
  • ID_GO_SEARCH : resource.h
  • ID_GO_UP : resource.h
  • ID_HELP : resource.h
  • ID_HELP_USING : resource.h
  • ID_HIDE_INACTIVE_ICONS : resource.h
  • ID_MINIMIZE_ALL : resource.h
  • ID_PREFERED_SIZES : resource.h
  • ID_REFRESH : resource.h
  • ID_SHOW_CLOCK : resource.h
  • ID_SHOW_HIDDEN_ICONS : resource.h
  • ID_SHOW_ICON_BUTTON : resource.h
  • ID_STOP : resource.h
  • ID_SWITCH_DESKTOP_1 : resource.h
  • ID_TASKMGR : resource.h
  • ID_TOOLS_OPTIONS : resource.h
  • ID_TRAY_VOLUME : resource.h
  • ID_VIEW_ALL_ATTRIBUTES : resource.h
  • ID_VIEW_DRIVE_BAR : resource.h
  • ID_VIEW_EXTRA_BAR : resource.h
  • ID_VIEW_FULLSCREEN : resource.h
  • ID_VIEW_MDI : resource.h
  • ID_VIEW_NAME : resource.h
  • ID_VIEW_SDI : resource.h
  • ID_VIEW_SELECTED_ATTRIBUTES : resource.h
  • ID_VIEW_SIDE_BAR : resource.h
  • ID_VIEW_STATUSBAR : resource.h
  • ID_VIEW_TOOL_BAR : resource.h
  • ID_VOLUME_PROPERTIES : resource.h
  • ID_WEB_WINDOW : resource.h
  • ID_WINDOW_ARRANGE : resource.h
  • ID_WINDOW_AUTOSORT : resource.h
  • ID_WINDOW_CASCADE : resource.h
  • ID_WINDOW_NEW : resource.h
  • ID_WINDOW_SPLIT : resource.h
  • ID_WINDOW_TILE_HORZ : resource.h
  • ID_WINDOW_TILE_VERT : resource.h
  • IDA_EXPLORER : resource.h
  • IDA_SEARCH_PROGRAM : resource.h
  • IDA_TRAYNOTIFY : resource.h
  • IDB_DRIVEBAR : resource.h
  • IDB_ICON_ALIGN_0 : resource.h
  • IDB_ICON_ALIGN_1 : resource.h
  • IDB_ICON_ALIGN_10 : resource.h
  • IDB_ICON_ALIGN_2 : resource.h
  • IDB_ICON_ALIGN_3 : resource.h
  • IDB_ICON_ALIGN_4 : resource.h
  • IDB_ICON_ALIGN_5 : resource.h
  • IDB_ICON_ALIGN_6 : resource.h
  • IDB_ICON_ALIGN_7 : resource.h
  • IDB_ICON_ALIGN_8 : resource.h
  • IDB_ICON_ALIGN_9 : resource.h
  • IDB_IMAGES : resource.h
  • IDB_LOGOV : resource.h
  • IDB_LOGOV16 : resource.h
  • IDB_LOGOV256 : resource.h
  • IDB_MDI : resource.h
  • IDB_SDI : resource.h
  • IDB_TOOLBAR : resource.h
  • IDC_ADMIN : desktopbar.h
  • IDC_BROWSE : desktopbar.h
  • IDC_BUTTON1 : resource.h
  • IDC_CHECK_ENTRIES : resource.h
  • IDC_CONNECTIONS : desktopbar.h
  • IDC_CONTROL_PANEL : desktopbar.h
  • IDC_DOCUMENTS : desktopbar.h
  • IDC_DRIVES : desktopbar.h
  • IDC_EXPLORE : desktopbar.h
  • IDC_FAVORITES : desktopbar.h
  • IDC_FILETREE : resource.h
  • IDC_FILTER : resource.h
  • IDC_FIRST_APP : taskbar.h
  • IDC_FIRST_MENU : desktopbar.h
  • IDC_FIRST_QUICK_ID : quicklaunch.h
  • IDC_ICON_ALIGN_0 : resource.h
  • IDC_ICON_ALIGN_1 : resource.h
  • IDC_ICON_ALIGN_10 : resource.h
  • IDC_ICON_ALIGN_11 : resource.h
  • IDC_ICON_ALIGN_2 : resource.h
  • IDC_ICON_ALIGN_3 : resource.h
  • IDC_ICON_ALIGN_4 : resource.h
  • IDC_ICON_ALIGN_5 : resource.h
  • IDC_ICON_ALIGN_6 : resource.h
  • IDC_ICON_ALIGN_7 : resource.h
  • IDC_ICON_ALIGN_8 : resource.h
  • IDC_ICON_ALIGN_9 : resource.h
  • IDC_LABEL1 : resource.h
  • IDC_LABEL2 : resource.h
  • IDC_LABEL3 : resource.h
  • IDC_LABEL4 : resource.h
  • IDC_LABEL6 : resource.h
  • IDC_LAST_CHANGE : resource.h
  • IDC_LAUNCH : desktopbar.h
  • IDC_LOGOFF : desktopbar.h
  • IDC_MDI : resource.h
  • IDC_NETWORK : desktopbar.h
  • IDC_NOTIFY_AUTOHIDE : resource.h
  • IDC_NOTIFY_HIDE : resource.h
  • IDC_NOTIFY_ICONS : resource.h
  • IDC_NOTIFY_MODULE : resource.h
  • IDC_NOTIFY_SHOW : resource.h
  • IDC_NOTIFY_TITLE : resource.h
  • IDC_NOTIFY_TOOLTIP : resource.h
  • IDC_PICTURE : resource.h
  • IDC_PRINTERS : desktopbar.h
  • IDC_PRINTERS_MENU : desktopbar.h
  • IDC_PROGRAMS : desktopbar.h
  • IDC_PROGRAMS_FOUND : resource.h
  • IDC_RECENT : desktopbar.h
  • IDC_ROS_EXPLORER : resource.h
  • IDC_SDI : resource.h
  • IDC_SEARCH : desktopbar.h
  • IDC_SEARCH_COMPUTER : desktopbar.h
  • IDC_SEARCH_FILES : desktopbar.h
  • IDC_SEARCH_PROGRAM : desktopbar.h
  • IDC_SEPARATE_SUBFOLDERS : resource.h
  • IDC_SETTINGS : desktopbar.h
  • IDC_SETTINGS_MENU : desktopbar.h
  • IDC_SHUTDOWN : desktopbar.h
  • IDC_START : desktopbar.h
  • IDC_START_HELP : desktopbar.h
  • IDC_STATIC : resource.h
  • IDC_TERMINATE : desktopbar.h
  • IDC_VERSION_TXT : resource.h
  • IDC_WIN_VERSION : resource.h
  • IDC_WWW : resource.h
  • IDD_ABOUT_EXPLORER : resource.h
  • IDD_DESKBAR_DESKTOP : resource.h
  • IDD_DESKBAR_STARTMENU : resource.h
  • IDD_DESKBAR_TASKBAR : resource.h
  • IDD_EXECUTE : resource.h
  • IDD_MDI_SDI : resource.h
  • IDD_NOTIFYAREA : resource.h
  • IDD_SEARCH_PROGRAM : resource.h
  • IDI_ACTION : resource.h
  • IDI_APPICON : resource.h
  • IDI_APPS : resource.h
  • IDI_ARROW : resource.h
  • IDI_ARROW_DOWN : resource.h
  • IDI_ARROW_SELECTED : resource.h
  • IDI_ARROW_UP : resource.h
  • IDI_COMPUTER : resource.h
  • IDI_CONFIG : resource.h
  • IDI_DOCUMENTS : resource.h
  • IDI_DOT : resource.h
  • IDI_DOT_RED : resource.h
  • IDI_DOT_TRANS : resource.h
  • IDI_EXPLORER : resource.h
  • IDI_FAVORITES : resource.h
  • IDI_FLOATING : resource.h
  • IDI_FOLDER : resource.h
  • IDI_FOLDERARROW : resource.h
  • IDI_INFO : resource.h
  • IDI_LOGOFF : resource.h
  • IDI_NETWORK : resource.h
  • IDI_NOTIFY_L : resource.h
  • IDI_NOTIFY_R : resource.h
  • IDI_PRINTER : resource.h
  • IDI_REACTOS : resource.h
  • IDI_REACTOS_BIG : resource.h
  • IDI_SEARCH : resource.h
  • IDI_SEARCH_DOC : resource.h
  • IDI_SPEAKER : resource.h
  • IDI_STARTMENU : resource.h
  • IDM_DESKTOPBAR : resource.h
  • IDM_MDIFRAME : resource.h
  • IDM_NOTIFYAREA : resource.h
  • IDM_SDIFRAME : resource.h
  • IDM_VOLUME : resource.h
  • IDR_MAINFRAME : resource.h
  • IDS_ABOUT_EXPLORER : resource.h
  • IDS_ADMIN : resource.h
  • IDS_ALL_USERS : resource.h
  • IDS_BROWSE : resource.h
  • IDS_CONNECTIONS : resource.h
  • IDS_CONTROL_PANEL : resource.h
  • IDS_DESKTOP : resource.h
  • IDS_DESKTOP_NUM : resource.h
  • IDS_DESKTOPBAR_SETTINGS : resource.h
  • IDS_DOCUMENTS : resource.h
  • IDS_DRIVES : resource.h
  • IDS_EMPTY : resource.h
  • IDS_EXPLORE : resource.h
  • IDS_EXPLORER_VERSION_STR : resource.h
  • IDS_FAVORITES : resource.h
  • IDS_HIDE_ICONS : resource.h
  • IDS_ITEMS_CONFIGURED : resource.h
  • IDS_ITEMS_CUR : resource.h
  • IDS_ITEMS_HIDDEN : resource.h
  • IDS_ITEMS_VISIBLE : resource.h
  • IDS_LAUNCH : resource.h
  • IDS_LAUNCH_MANY_PROGRAMS : resource.h
  • IDS_LOGOFF : resource.h
  • IDS_MINIMIZE_ALL : resource.h
  • IDS_NETWORK : resource.h
  • IDS_NOTIFY_AUTOHIDE : resource.h
  • IDS_NOTIFY_HIDE : resource.h
  • IDS_NOTIFY_SHOW : resource.h
  • IDS_PRINTERS : resource.h
  • IDS_PROGRAMS : resource.h
  • IDS_RECENT : resource.h
  • IDS_SEARCH : resource.h
  • IDS_SEARCH_COMPUTER : resource.h
  • IDS_SEARCH_FILES : resource.h
  • IDS_SEARCH_PRG : resource.h
  • IDS_SETTINGS : resource.h
  • IDS_SETTINGS_MENU : resource.h
  • IDS_SHOW_HIDDEN_ICONS : resource.h
  • IDS_SHUTDOWN : resource.h
  • IDS_START : resource.h
  • IDS_START_HELP : resource.h
  • IDS_STARTMENU : resource.h
  • IDS_TASKBAR : resource.h
  • IDS_TERMINATE : resource.h
  • IDS_TITLE : resource.h
  • IDS_VERSION_STR : resource.h
  • IDS_VOLUME : resource.h
  • IDW_ADDRESSBAR : explorer.h
  • IDW_COMMANDBAR : explorer.h
  • IDW_DRIVEBAR : explorer.h
  • IDW_EXTRABAR : explorer.h
  • IDW_FIRST_CHILD : explorer.h
  • IDW_HEADER_LEFT : pane.h
  • IDW_HEADER_RIGHT : pane.h
  • IDW_QUICKLAUNCHBAR : quicklaunch.h
  • IDW_SIDEBAR : explorer.h
  • IDW_STATUSBAR : explorer.h
  • IDW_TASKTOOLBAR : taskbar.h
  • IDW_TOOLBAR : explorer.h
  • IDW_TREE_LEFT : pane.h
  • IDW_TREE_RIGHT : pane.h
  • ILGetSize : shellclasses.h
  • ILGetSize_local() : shellclasses.h, shellclasses.cpp
  • IMAGE : pane.cpp
  • IMAGE_HEIGHT : pane.cpp
  • IMAGE_WIDTH : pane.cpp
  • ImageList_AddAlphaIcon() : globals.h, explorer.cpp
  • IMG_DOCUMENT : pane.cpp
  • IMG_EXECUTABLE : pane.cpp
  • IMG_FILE : pane.cpp
  • IMG_FOLDER : pane.cpp
  • IMG_FOLDER_CUR : pane.cpp
  • IMG_FOLDER_PLUS : pane.cpp
  • IMG_FOLDER_UP : pane.cpp
  • IMG_NONE : pane.cpp
  • IMG_OPEN_FOLDER : pane.cpp
  • IMG_OPEN_MINUS : pane.cpp
  • IMG_OPEN_PLUS : pane.cpp
  • initialize_gdb_stub() : explorer.cpp
  • IOCOMPLETITION_OBJECT : ntobjfs.h
  • IS_LNAME : fatfs.h
  • IsAnyDesktopRunning() : desktop.cpp, externals.h
  • IT_CACHED : globals.h
  • IT_DYNAMIC : globals.h
  • IT_STATIC : globals.h
  • IT_SYSCACHE : globals.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- p -

  • path_from_pidl : shellclasses.h
  • path_from_pidlA() : shellclasses.h, shellclasses.cpp
  • path_from_pidlW() : shellclasses.h, shellclasses.cpp
  • PC : i386-stub-win32.c
  • PM_DISPATCH_COMMAND : window.h
  • PM_DISPATCH_CTLCOLOR : window.h
  • PM_DISPATCH_DRAWITEM : window.h
  • PM_DISPLAY_VERSION : desktop.h
  • PM_FRM_CALC_CLIENT : window.h
  • PM_FRM_GET_MENUINFO : window.h
  • PM_GET_CONTROLWINDOW : explorer.h
  • PM_GET_FILEWND_PTR : explorer.h
  • PM_GET_ICON_ALGORITHM : desktop.h
  • PM_GET_LAST_ACTIVE : taskbar.h
  • PM_GET_NOTIFYAREA : traynotify.h
  • PM_GET_SHELLBROWSER_PTR : explorer.h
  • PM_GET_WIDTH : explorer.h
  • PM_GETMODULEPATH_CB : traynotify.h
  • PM_JUMP_TO_URL : window.h
  • PM_OPEN_WINDOW : mainframe.h
  • PM_REFRESH : explorer.h
  • PM_REFRESH_CONFIG : explorer.h
  • PM_RESIZE_CHILDREN : explorer.h
  • PM_SELECT_ENTRY : startmenu.h
  • PM_SET_ICON_ALGORITHM : desktop.h
  • PM_SETSTATUSTEXT : window.h
  • PM_STARTENTRY_LAUNCHED : startmenu.h
  • PM_STARTMENU_CLOSED : startmenu.h
  • PM_TRANSLATE_MSG : window.h
  • PM_TRAYICON : window.h
  • PM_UPDATE_DESKTOP : quicklaunch.h
  • PM_UPDATE_ICONS : startmenu.h
  • PM_URL_CHANGED : window.h
  • PORT_OBJECT : ntobjfs.h
  • PRETTY_FLAGS : xmlstorage.h
  • PRETTY_INDENT : xmlstorage.h
  • PRETTY_LINEFEED : xmlstorage.h
  • PRETTY_PLAIN : xmlstorage.h
  • PROCESS_OBJECT : ntobjfs.h
  • PROFILE_OBJECT : ntobjfs.h
  • PropSheet_GetResult : window.cpp
  • PS : i386-stub-win32.c
  • PSM_GETRESULT : window.cpp
  • PSN_QUERYINITIALFOCUS : settings.cpp
  • putDebugChar() : i386-stub-win32.c
  • putpacket() : i386-stub-win32.c


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- q -

  • QUICKLAUNCH_FOLDER : quicklaunch.h
  • QUICKLAUNCH_WIDTH_DEF : quicklaunch.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- r -

  • RBBS_HIDETITLE : desktopbar.cpp, mainframe.cpp
  • read_option() : xmlstorage.h
  • REBARBAND_HEIGHT : desktopbar.h
  • RECENT_DOCS_COUNT : startmenu.h
  • RecursiveCreateDirectory() : utility.h, utility.cpp
  • RegGetDWORDValue() : utility.h, utility.cpp
  • registers : i386-stub-win32.c
  • regnames : i386-stub-win32.c
  • RegSetDWORDValue() : utility.h, utility.cpp
  • remcomStack : i386-stub-win32.c
  • remote_debug : i386-stub-win32.c
  • RESIZE : window.h
  • RESIZE_FLAGS : window.h
  • RESIZE_X : window.h
  • RESIZE_Y : window.h
  • RESTARTWINDOWSDLG : startmenu.h
  • RESTARTWINDOWSDLGEX : startmenu.h
  • return_to_prog() : i386-stub-win32.c
  • RFF_CALCDIRECTORY : startmenu.h
  • RFF_NOBROWSE : startmenu.h
  • RFF_NODEFAULT : startmenu.h
  • RFF_NOLABEL : startmenu.h
  • RFF_NOSEPARATEMEM : startmenu.h
  • RONLY : fatfs.h
  • RunDLL() : utility.h, utility.cpp
  • RUNDLLPROC : utility.cpp
  • RUNFILEDLG : startmenu.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- s -

  • SAVE_ERRCODE : i386-stub-win32.c
  • SAVE_REGISTERS1 : i386-stub-win32.c
  • SAVE_REGISTERS2 : i386-stub-win32.c
  • SCAN_ALL : entries.h
  • SCAN_DO_ACCESS : entries.h
  • SCAN_FILESYSTEM : entries.h
  • SCAN_FLAGS : entries.h
  • ScanNTFSStreams() : winfs.h, winfs.cpp
  • ScreenToClient() : utility.h
  • SECTION_OBJECT : ntobjfs.h
  • SEMAPHORE_OBJECT : ntobjfs.h
  • set_char() : i386-stub-win32.c
  • set_debug_traps() : i386-stub-win32.c
  • set_mem_err() : i386-stub-win32.c
  • SetDlgCtrlID : utility.h
  • SetWindowExStyle : utility.h
  • SetWindowIcon() : globals.h, explorer.cpp
  • SetWindowStyle : utility.h
  • ShellDirectoryStack : searchprogram.h
  • ShellEntryMap : startmenu.h
  • ShellEntrySet : startmenu.h
  • ShellFolderContextMenu() : shellclasses.h, shellclasses.cpp
  • SHELLPATH_CONTROL_PANEL : startmenu.cpp
  • SHELLPATH_NET_CONNECTIONS : startmenu.cpp
  • SHELLPATH_PRINTERS : startmenu.cpp
  • SHFINDCOMPUTER : startmenu.h
  • SHFINDFILES : startmenu.h
  • SHGFI_ADDOVERLAYS : entries.h
  • ShowExitWindowsDialog() : startmenu.cpp, externals.h
  • SMBtnVector : startmenu.h
  • SORT_DATE : entries.h
  • SORT_EXT : entries.h
  • SORT_NAME : entries.h
  • SORT_NONE : entries.h
  • SORT_ORDER : entries.h
  • SORT_SIZE : entries.h
  • speek : fatfs.h
  • SPLIT_WIDTH : window.h
  • SplitFileSysURL() : utility.h, utility.cpp
  • spoke : fatfs.h
  • SS : i386-stub-win32.c
  • STACKSIZE : i386-stub-win32.c
  • STARTMENU_CREATOR : startmenu.h
  • STARTMENU_LINE_HEIGHT : startmenu.h
  • STARTMENU_SEP_HEIGHT : startmenu.h
  • STARTMENU_TOP_BTN_SPACE : startmenu.h
  • STARTMENU_WIDTH_MIN : startmenu.h
  • StartMenuFolders : startmenu.h
  • StartMenuShellDirs : startmenu.h
  • STDIO_FILEBUF : xmlstorage.h
  • StorageArray : dragdropimpl.h
  • strcpy_s : utility.h
  • string_from_mode() : traynotify.h, traynotify.cpp
  • StrRet : shellclasses.h
  • SYMBOLICLINK_OBJECT : ntobjfs.h
  • SYSTEM : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- t -

  • T2nA_binary() : webchild.cpp
  • TASKBUTTONWIDTH_MAX : taskbar.h
  • TASKBUTTONWIDTH_MIN : taskbar.h
  • THREAD_OBJECT : ntobjfs.h
  • THROW_EXCEPTION : shellclasses.h
  • time_to_filetime() : utility.h, utility.cpp
  • TIMER_OBJECT : ntobjfs.h
  • TITLE_EXPLORERBAR : desktopbar.h
  • TITLE_STARTMENU : startmenu.h
  • TITLE_TASKBAR : taskbar.h
  • TITLE_TRAYNOTIFY : traynotify.h
  • TOKEN_OBJECT : ntobjfs.h
  • TRAYBUTTON_LEFT : window.h
  • TRAYBUTTON_MIDDLE : window.h
  • TRAYBUTTON_RIGHT : window.h
  • TreeView_GetItemData() : window.h
  • TYPE_OBJECT : ntobjfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- u -

  • U2A : utility.h
  • U2nA : utility.h
  • UNION_MEMBER : shellclasses.h
  • UNKNOWN_OBJECT_TYPE : ntobjfs.h
  • USE_MY_SHBINDTOPARENT : entries.cpp


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- v -

  • V_INT : webchild.h
  • VOLUME : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- w -

  • W_VER_NT : utility.h
  • wcsncpy_s : utility.h
  • WIN32_EXTRA_LEAN : utility.h
  • WIN32_LEAN_AND_MEAN : utility.h
  • WINDOW_CREATOR : window.h
  • WINDOW_CREATOR_INFO : window.h
  • WINDOW_DYNAMIC_CAST : window.h
  • Window_SetIcon : utility.h
  • WindowSet : window.h
  • WINDOWSTATION_OBJECT : ntobjfs.h
  • WINMSG_SHELLHOOK : window.h
  • WINMSG_TASKBARCREATED : window.h
  • WM_GETISHELLBROWSER : shellbrowserimpl.h
  • wpeek : fatfs.h
  • wpoke : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

Here is a list of all file members with links to the files they belong to:

- x -

  • XML_INDENT_SPACE : xmlstorage.h
  • XS_CHAR : xmlstorage.h
  • XS_FALSE : xmlstorage.h
  • XS_FALSE_STR : xmlstorage.h
  • XS_icmp : xmlstorage.h
  • XS_len : xmlstorage.h
  • XS_nicmp : xmlstorage.h
  • XS_NUMBERFMT : xmlstorage.h
  • XS_NUMBERFMT_STR : xmlstorage.h
  • XS_snprintf : xmlstorage.h
  • XS_TEXT : xmlstorage.h
  • XS_toi : xmlstorage.h
  • XS_TRUE : xmlstorage.h
  • XS_TRUE_STR : xmlstorage.h
  • XS_vsnprintf : xmlstorage.h


ROS Explorer: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
Here is a list of all namespace members with links to the namespace documentation for each member:

  • assign_utf8() : XMLStorage
  • DecodeXMLString() : XMLStorage
  • EncodeXMLString() : XMLStorage
  • get_utf8() : XMLStorage
  • PRETTY_FLAGS : XMLStorage
  • PRETTY_INDENT : XMLStorage
  • PRETTY_LINEFEED : XMLStorage
  • PRETTY_PLAIN : XMLStorage
  • read_option() : XMLStorage
  • STDIO_FILEBUF : XMLStorage


ROS Explorer: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator

  • PRETTY_FLAGS : XMLStorage


ROS Explorer: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator

  • PRETTY_INDENT : XMLStorage
  • PRETTY_LINEFEED : XMLStorage
  • PRETTY_PLAIN : XMLStorage


ROS Explorer: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator

  • assign_utf8() : XMLStorage
  • DecodeXMLString() : XMLStorage
  • EncodeXMLString() : XMLStorage
  • get_utf8() : XMLStorage
  • read_option() : XMLStorage


ROS Explorer: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator

  • STDIO_FILEBUF : XMLStorage


ROS Explorer: Page Index

ROS Explorer Related Pages

Here is a list of all related documentation pages:
  • Todo List


ROS Explorer: Todo List

Todo List

Member BackgroundWindow::WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
Changing the PaintDesktopVersion-Flag needs a restart of the shell -> display a message box

Member BookmarkList::import_IE_favorites (struct ShellDirectory &dir, HWND hwnd)
read shell links

Member BrowserNavigator::navigated (LPCTSTR url)
move this into DocumentComplete() ?

Member ChildWindow::WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Member Context::s_main
use TLS

Member DesktopBar::ControlResize (WPARAM wparam, LPARAM lparam)
write code for taskbar being at sides or top.

Member DesktopBar::ProcessHotKey (int id_hotkey)
implement all common hotkeys

Member DesktopBar::RegisterHotkeys ()
register all common hotkeys

Member DesktopBar::Resize (int cx, int cy)
general children resizing algorithm

Member DesktopBar::WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
read desktop bar settings

Member DesktopDropTarget::OnDrop (FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)
Add the code to handle Copy

Member DesktopDropTarget::OnDrop (FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)
Add the code to handle Move

Member DesktopShellView::PositionIcons (int dir=1)

Member DesktopWindow::Init (LPCREATESTRUCT pcs)
use IShellBrowser::GetViewStateStream() to restore previous view state -> see SHOpenRegStream()

Member DesktopWindow::WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
use IShellBrowser::GetViewStateStream() and _pShellView->SaveViewState() to store view state

Member Dialog::DoModal (UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0)
call Window::pretranslate_msg()

Member Dialog::DoModal (UINT nid, CREATORFUNC creator, HWND hwndParent=0)
call Window::pretranslate_msg()

Member Entry::smart_scan (SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL)
We could use IShellFolder2::GetDefaultColumn to determine sort order.

Member ExecuteDialog::cmd [MAX_PATH]
use class Dialog

Member FATDrive::get_cache_buffer ()
enable write back if (CacheDty[j]) // Dirty-Flag gesetzt? if (writesec(_CacheSec[j], (Buffer*) &_FATCache[j], 1)) FPara = _CacheSec[j], Frag(SecWriteErr);

Member FATDrive::read_FAT (DWORD Clus, bool &ok)
cache result

Member FileChildWindow::FileChildWindow (HWND hwnd, const FileChildWndInfo &info)
use OWM_ROOTED flag

Member FileChildWindow::FileChildWindow (HWND hwnd, const FileChildWndInfo &info)
Is not-explore-mode for FileChildWindow completely implemented?

Member FileChildWindow::activate_entry (Pane *pane)
enable using RETURN key accelerator

Member FileChildWindow::jump_to_int (LPCTSTR url)
use fname

Member FileChildWindow::scan_entry (Entry *entry)
use modifyable sort order instead of fixed file system default

Member FileChildWindow::set_curdir (Entry *entry)
make configurable (This call takes really _very_ long compared to all other processing!)

Member FindProgramDlg::CheckEntries ()
check all entries for existing targets, display a list of not working entries and ask the user for permission to delete them

Member IconCache::extract (LPCTSTR path, int idx, ICONCACHE_FLAGS flags=ICF_HICON)
retreive "http://.../favicon.ico" format icons

Member IconCache::extract (LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL)
limit cache size

Member IconCache::extract (LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL)
limit cache size

Member IShellBrowserImpl::Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
implement IOleCommandTarget

Member IShellBrowserImpl::QueryService (REFGUID guidService, REFIID riid, void **ppvObject)
use guidService

Member IShellBrowserImpl::QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
implement IOleCommandTarget

Member MainFrameBase::ExecuteCommandbar (LPCTSTR dir)
use SHGetFileInfo() with SHGFI_EXETYPE flag to determine EXE type and open console window

Member MainFrameBase::go_to (LPCTSTR url, bool new_window)
SDI implementation

Member MainFrameBase::resize_frame (int cx, int cy)
use split bar

Member MDIMainFrame::Command (int id, int code)
store last directory per drive

Member MDIMainFrame::Command (int id, int code)
prompt for image file

Member MDIMainFrame::Command (int id, int code)
There are even more menu items!

Member MDIMainFrame::resize_frame (int cx, int cy)
use split bar

Member MDIMainFrame::WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
read paths and window placements from registry

Member MDIShellBrowserChild::jump_to_int (LPCTSTR url)
use fname

Member MDIShellBrowserChild::update_shell_browser ()
use OWM_ROOTED flag

Member NotifyArea::ProcessTrayNotification (int notify_code, NOTIFYICONDATA *pnid)
This is a fix for Windows Task Manager.

Member NotifyArea::ProcessTrayNotification (int notify_code, NOTIFYICONDATA *pnid)
call only if really changes occurred

Member NotifyArea::read_config ()
read default setting from registry

Member NotifyArea::read_config ()
read default setting from registry

Member NotifyInfo::modify (NOTIFYICONDATA *pnid)
compare icon

Member Pane::draw_item (LPDRAWITEMSTRUCT dis, Entry *entry, int calcWidthCol=-1)
not in every case time enough

Member QuickLaunchBar::AddShortcuts ()
perhaps also look into CSIDL_COMMON_APPDATA ?

Member RecentStartMenu::AddEntries ()
read max. count of entries from registry

Member RegDirectory::read_directory (int scan_flags=SCAN_ALL)
This can also be done in the RegEnumValue() call if we dynamically adjust the return buffer size.

Member SDIMainFrame::resize_frame (int cx, int cy)
use split bar

Member SDIMainFrame::update_shell_browser ()
use OWM_ROOTED flag

Member SDIMainFrame::WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
read paths and window placements from registry

Member SDIMainFrame::_split_pos
focus handling for TAB switching int _focus_pane; // 0: left 1: right

Member StartMenu::ActivateEntry (int id, const ShellEntrySet &entries)
If the user explicitly clicked on a submenu, display this folder as floating start menu.

Member StartMenu::ActivateEntry (int id, const ShellEntrySet &entries)
launch in the background; specify correct HWND for error message box titles

Member StartMenu::AddEntry (const String &title, ICON_ID icon_id, Entry *entry)
speed up by using a map indexed by name

Member StartMenu::WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
do something similar to StartMenuRoot::TrackStartmenu() in order to automatically close submenus when clicking on the desktop background

Member StartMenu::WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
handle context menu for more than one entry

Member StartMenuHandler::Command (int id, int code)
use printer start menu folder per default and allow opening "printers" cabinet window using the context menu

Member StartMenuHandler::Command (int id, int code)
to be removed when network browsing will be implemented in shell namespace

Member StartMenuHandler::Command (int id, int code)
exclude removable drives

Member StartMenuHandler::ShowLaunchDialog (HWND hwndOwner)
All text phrases should be put into the resources.

Member StartMenuHandler::ShowSearchComputer ()
to be removed when SHFindComputer() will be implemented in shell32.dll

Member StartMenuHandler::ShowSearchDialog ()
to be removed when SHFindFiles() will be implemented in shell32.dll

Member ToolTip::add (HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
Why is it neccesary to try both TTM_ADDTOOLW and TTM_ADDTOOLW ?!

Member TrayNotifyDlg::Refresh ()
refresh incrementally

Member TrayNotifyDlg::SetIconMode (NOTIFYICONMODE mode)
select treeview item at new position in tree view -> refresh HTREEITEM in _selectedItem

Member TreeDropTarget::OnDrop (FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)
Add the code to handle Copy

Member TreeDropTarget::OnDrop (FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)
Add the code to handle Move

Class WaitCursor
integrate with WM_SETCURSOR to enable multithreaded background tasks as program launching

Member WebChildWindow::WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Member _tWinMain
save previous shell application in config file

Member _tWinMain
save previous shell application in config file


ROS Explorer: Graphical Class Hierarchy

ROS Explorer Graphical Class Hierarchy

Go to the textual class hierarchy


ROS Explorer: Alphabetical List

ROS Explorer Class Index

B | C | D | E | F | H | I | K | L | M | N | O | P | Q | R | S | T | U | V | W | X

B
Directory IDropTargetImpl PropSheetPageDlg StrRetW
BackgroundWindow dirent IEnumFORMATETC
Q
SubclassedWindow
BitmapSelection dirsecz IOleClientSite QuickLaunchBar SysCacheIcon
BkMode DragSourceHelper IOleCommandTarget QuickLaunchEntry
T
Bookmark dskrwblk IOleInPlaceSite QuickLaunchMap TaskBar
BookmarkFolder DWebBrowserEvents2IF IPCtrlWindow
R
TaskBarEntry
BookmarkList DWebBrowserEvents2Impl IServiceProvider RecentStartMenu TaskBarMap
BookmarkNode DynamicFct IShellBrowser RegDirectory TaskbarSettingsDlg
BootSector DynamicLoadLibFct IShellBrowserImpl RegEntry TextColor
BootSector32
E
IShellFolderViewCB RegistryChildWndInfo Thread
BrowseMenu EditController istream (std) RegistryRoot tifstream (XMLStorage)
BrowserCallback Entry IUnknown ResBitmap tofstream (XMLStorage)
BrowserNavigator EnumFormatEtcImpl
K
ResIcon ToolTip
BrushSelection EventConnection Kette ResIconEx TrayIcon
BStr EventConnector
L
ResizeController TrayIconControllerTemplate
BtnWindowClass ExecuteDialog list (std) ResizeEntry TrayNotifyCDS
Buffer ExplorerAboutDlg list ResizeManager TrayNotifyDlg
BufferCanvas ExplorerCmd ListSort ResString TreeDropTarget
BufferedCanvas ExplorerGlobals Lock Root TypeCheck
BufferedPaintCanvas ExtContextMenuHandlerT
M
RtlAnsiString
U
Button
F
MainFrameBase RtlUnicodeString UNC
C
FAT_attribute map
S
UnicodeString
Cache FATChildWndInfo MDIMainFrame SDIMainFrame
V
Canvas FATDirectory MdiSdiDlg SearchMenu VARIANT
ChildWindow FATDrive MDIShellBrowserChild SelectedBitmap Variant
ChildWndInfo FATEntry MemCanvas SettingsMenu
W
ClientRect fattr MenuInfo ShellBrowser WaitCursor
ClockWindow Favorites
N
ShellBrowserChildT WebChildWindow
CollectProgramsThread FavoritesMenu NotifyArea ShellChildWndInfo WebChildWndInfo
ColorStatic fdate NotifyHook ShellDirectory WinDirectory
COMException FileChildWindow NotifyIconConfig ShellEntry Window
COMExceptionBase FileChildWndInfo NotifyIconDlgInfo ShellFolder Window::StaticWindowData
ComInit FileHolder (XMLStorage) NotifyIconIndex ShellItemEnumerator WindowCanvas
CommonControlInit FileSysShellPath NotifyInfo ShellLinkPtr WindowClass
CommonDesktop FileTypeInfo NTDLL ShellMalloc WindowCreator
CommonShellMalloc FileTypeManager NtObjChildWndInfo ShellPath WindowCreatorInfo
ComSrvObject FindProgramDlg NtObjDirectory ShellPathInfo WindowHandle
ConnectionPoint FixedDWebBrowserEvents2 NtObject SIfacePtr WindowRect
const_XMLChildrenFilter (XMLStorage) FlatButton NtObjectInfo SimpleComObject WinEntry
const_XMLChildrenFilter::const_iterator (XMLStorage) FmtString NtObjEntry SmallIcon WNDCLASSEX
const_XMLPos (XMLStorage) FolderBrowser
O
SMBtnInfo
X
Context FontSelection OleInit SpecialFolder XMLBool (XMLStorage)
CRITICAL_SECTION FPDEntry OleInPlaceClient SpecialFolderFSPath XMLBoolRef (XMLStorage)
CritSect ftime OpenStruct SpecialFolderPath XMLChildrenFilter (XMLStorage)
CtlColorParent FullScreenParameters ostream (std) SShellPtr XMLChildrenFilter::iterator (XMLStorage)
CtxMenuInterfaces
H
OutputWorker StartButton XMLDoc (XMLStorage)
D
HiddenWindow OwnerdrawnButton StartMenu XMLHeader (XMLStorage)
DataStorage HyperlinkCtrl OwnerDrawParent StartMenuCreateInfo XMLInt (XMLStorage)
DEntry
I
P
StartMenuDirectory XMLIntRef (XMLStorage)
DEntry_E ICommDlgBrowser PaintCanvas StartMenuEntry XMLMessage (XMLStorage)
Desktop IComSrvBase PAINTSTRUCT StartMenuHandler XMLNode (XMLStorage)
DesktopBar IComSrvQI Pane StartMenuRoot XMLNode::Children (XMLStorage)
DesktopDropTarget IComSrvQI< IUnknown > PictureButton StartmenuSettingsDlg XMLPos (XMLStorage)
DesktopFolder Icon PIDList Static XMLReader (XMLStorage)
DesktopFolderPath IconCache Point String XMLReaderBase (XMLStorage)
Desktops IconWindowClass PopupMenu string XMLString (XMLStorage)
DesktopSettingsDlg IDataObject PreTranslateWindow string (std) XMLWriter (XMLStorage)
DesktopShellView IDataObjectImpl PropertySheetDialog String_from_XML_Char (XMLStorage) XMLWriter::StackEntry (XMLStorage)
DesktopWindow IDropSource PROPSHEETHEADER STRRET XMStringRef (XMLStorage)
Dialog IDropSourceImpl PropSheetPage StrRetA XS_String (XMLStorage)
DialogWindow IDropTarget PROPSHEETPAGE

B | C | D | E | F | H | I | K | L | M | N | O | P | Q | R | S | T | U | V | W | X


ROS Explorer: desktop/ -> taskbar Relation

desktop

desktop → taskbar Relation

File in desktop | Includes file in taskbar
desktop.cpp | desktopbar.h
desktop.cpp | taskbar.h


ROS Explorer: taskbar/ -> dialogs Relation

taskbar

taskbar → dialogs Relation

File in taskbar | Includes file in dialogs
desktopbar.cpp | settings.h
startmenu.cpp | searchprogram.h
startmenu.cpp | settings.h


ROS Explorer: shell/ -> utility Relation

shell

shell → utility Relation

File in shell | Includes file in utility
shellbrowser.h | shellbrowserimpl.h
shellbrowser.h | treedroptarget.h


ROS Explorer: shell/ -> dialogs Relation

shell

shell → dialogs Relation

File in shell | Includes file in dialogs
mainframe.cpp | settings.h


ROS Explorer: dialogs/ -> taskbar Relation

dialogs

dialogs → taskbar Relation

File in dialogs | Includes file in taskbar
settings.cpp | traynotify.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- _ -

  • _A_DELETED : fatfs.h
  • _A_ILLEGAL : fatfs.h
  • _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES : precomp.h
  • _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT : precomp.h
  • _LAZY_ICONEXTRACT : startmenu.h
  • _LIGHT_STARTMENU : startmenu.h
  • _MAX_DIR : utility.h
  • _MAX_DRIVE : utility.h
  • _MAX_EXT : utility.h
  • _MAX_FNAME : utility.h
  • _MAX_PATH : utility.h
  • _NO_COMMENT : xmlstorage.cpp
  • _SINGLE_ICONEXTRACT : startmenu.h
  • _stprintf : utility.h
  • _stprintf_s1 : utility.h
  • _stprintf_s2 : utility.h
  • _STRING_DEFINED : utility.h
  • _tcscpy_s : utility.h
  • _tcsrchr : utility.h
  • _tsplitpath_s : utility.h
  • _XMLSTORAGE_H : xmlstorage.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- l -

  • launch_fileA : utility.h
  • LOG : utility.h
  • LONGLONGARG : utility.h
  • LPCXSSTR : xmlstorage.h
  • LPXSSTR : xmlstorage.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- m -

  • MANIFEST_RESOURCE_ID : resource.h
  • MK_LONG : fatfs.h
  • MK_P : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- n -

  • NFR_CURRENT : window.h
  • NID_SIZE_A3 : traynotify.cpp
  • NID_SIZE_A5 : traynotify.cpp
  • NID_SIZE_A6 : traynotify.cpp
  • NID_SIZE_W3 : traynotify.cpp
  • NID_SIZE_W5 : traynotify.cpp
  • NID_SIZE_W6 : traynotify.cpp
  • NOTIFYAREA_SPACE : traynotify.h
  • NOTIFYAREA_WIDTH_DEF : traynotify.h
  • NOTIFYICON_DIST : traynotify.h
  • NOTIFYICON_SIZE : traynotify.h
  • NOTIFYICON_X : traynotify.h
  • NOTIFYICON_Y : traynotify.h
  • NOVTABLE : shellclasses.h
  • NUMREGBYTES : i386-stub-win32.c
  • NUMREGS : i386-stub-win32.c


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- o -

  • OBJ_CONTEXT : utility.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- a -

  • A2nU : utility.h
  • A2U : utility.h
  • AddP : fatfs.h
  • ANS : utility.h
  • ANSUNC : shellclasses.h
  • ARCHIVE : fatfs.h
  • ARRANGE_BORDER_DOWN : desktop.cpp
  • ARRANGE_BORDER_HV : desktop.cpp
  • ARRANGE_ROUNDABOUT : desktop.cpp
  • ATTRIBUTE_ERASED : entries.h
  • ATTRIBUTE_EXECUTABLE : entries.h
  • ATTRIBUTE_LONGNAME : entries.h
  • ATTRIBUTE_SYMBOLIC_LINK : entries.h
  • ATTRIBUTE_VOLNAME : entries.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- b -

  • BREAKPOINT : i386-stub-win32.c
  • BUFFER_LEN : xmlstorage.h, utility.h
  • BufLen : fatfs.h
  • BUFMAX : i386-stub-win32.c


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- c -

  • C_DRIVE : shellbrowser.h
  • C_DRIVE_STR : shellbrowser.h
  • CACHE_SIZE_LOW : fatfs.h
  • CALL_HOOK : i386-stub-win32.c
  • CHECK_FAULT : i386-stub-win32.c
  • CHECKERROR : shellclasses.h
  • CLASSNAME_CHILDWND : explorer.h
  • CLASSNAME_CLOCKWINDOW : traynotify.h
  • CLASSNAME_EXPLORERBAR : desktopbar.h
  • CLASSNAME_FRAME : explorer.h
  • CLASSNAME_STARTMENU : startmenu.h
  • CLASSNAME_TASKBAR : taskbar.h
  • CLASSNAME_TRAYNOTIFY : traynotify.h
  • CLASSNAME_WINEFILETREE : explorer.h
  • COLOR_SPLITBAR : window.h
  • COLUMNS : pane.h
  • CONSTRUCT_NTDLLFCT : ntobjfs.cpp
  • CONTEXT : utility.h
  • CONTEXT_OBJ : utility.h
  • CONTROL_RUNDLL : utility.cpp
  • COUNTOF : xmlstorage.h, utility.h
  • CSIDL_FLAG_CREATE : shellclasses.cpp
  • CURRENT_CONTEXT : utility.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- d -

  • DEFAULT_SPLIT_POS : window.h
  • DESKTOP_COUNT : globals.h
  • DESKTOPBARBAR_HEIGHT : desktopbar.h
  • DIRENT : fatfs.h
  • DISPID_BEFORENAVIGATE : webchild.h
  • DISPID_CLIENTTOHOSTWINDOW : webchild.h
  • DISPID_COMMANDSTATECHANGE : webchild.h
  • DISPID_DOCUMENTCOMPLETE : webchild.h
  • DISPID_DOWNLOADBEGIN : webchild.h
  • DISPID_DOWNLOADCOMPLETE : webchild.h
  • DISPID_FILEDOWNLOAD : webchild.h
  • DISPID_FRAMEBEFORENAVIGATE : webchild.h
  • DISPID_FRAMENAVIGATECOMPLETE : webchild.h
  • DISPID_FRAMENEWWINDOW : webchild.h
  • DISPID_NAVIGATECOMPLETE : webchild.h
  • DISPID_NAVIGATECOMPLETE2 : webchild.h
  • DISPID_NAVIGATEERROR : webchild.h
  • DISPID_NEWWINDOW : webchild.h
  • DISPID_ONADDRESSBAR : webchild.h
  • DISPID_ONFULLSCREEN : webchild.h
  • DISPID_ONMENUBAR : webchild.h
  • DISPID_ONQUIT : webchild.h
  • DISPID_ONSTATUSBAR : webchild.h
  • DISPID_ONTHEATERMODE : webchild.h
  • DISPID_ONTOOLBAR : webchild.h
  • DISPID_ONVISIBLE : webchild.h
  • DISPID_PRIVACYIMPACTEDSTATECHANGE : webchild.h
  • DISPID_PROGRESSCHANGE : webchild.h
  • DISPID_PROPERTYCHANGE : webchild.h
  • DISPID_QUIT : webchild.h
  • DISPID_SETSECURELOCKICON : webchild.h
  • DISPID_STATUSTEXTCHANGE : webchild.h
  • DISPID_TITLECHANGE : webchild.h
  • DISPID_TITLEICONCHANGE : webchild.h
  • DISPID_WINDOWACTIVATE : webchild.h
  • DISPID_WINDOWCLOSING : webchild.h
  • DISPID_WINDOWMOVE : webchild.h
  • DISPID_WINDOWRESIZE : webchild.h
  • DISPID_WINDOWSETHEIGHT : webchild.h
  • DISPID_WINDOWSETLEFT : webchild.h
  • DISPID_WINDOWSETRESIZABLE : webchild.h
  • DISPID_WINDOWSETTOP : webchild.h
  • DISPID_WINDOWSETWIDTH : webchild.h
  • dpeek : fatfs.h
  • dpoke : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- f -

  • FAT_DEL_CHAR : fatfs.h
  • FETCH_ITEM_COUNT : shellfs.cpp
  • FILE_ATTRIBUTE_ENCRYPTED : utility.h
  • FILE_ATTRIBUTE_NOT_CONTENT_INDEXED : utility.h
  • FILE_ATTRIBUTE_REPARSE_POINT : utility.h
  • FILE_ATTRIBUTE_SPARSE_FILE : utility.h
  • for : utility.h
  • Frame_CalcFrameClient : window.h
  • Frame_GetMenuInfo : window.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- g -

  • GET_WINDOW : window.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- h -

  • HIDDEN : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- i -

  • ICON_AUTOHIDE_SECONDS : traynotify.h
  • ICON_SIZE_X : globals.h
  • ICON_SIZE_Y : globals.h
  • ID_ABOUT_EXPLORER : resource.h
  • ID_ABOUT_WINDOWS : resource.h
  • ID_ACTIVATE : resource.h
  • ID_CONFIG_NOTIFYAREA : resource.h
  • ID_CONFIG_TIME : resource.h
  • ID_DESKTOP_VERSION : resource.h
  • ID_DESKTOPBAR_SETTINGS : resource.h
  • ID_DRIVE_DESKTOP : resource.h
  • ID_DRIVE_FAT : resource.h
  • ID_DRIVE_FIRST : resource.h
  • ID_DRIVE_NTOBJ_NS : resource.h
  • ID_DRIVE_REGISTRY : resource.h
  • ID_DRIVE_SHELL_NS : resource.h
  • ID_DRIVE_UNIX_FS : resource.h
  • ID_EDIT_PROPERTIES : resource.h
  • ID_EXECUTE : resource.h
  • ID_EXPLORE : resource.h
  • ID_EXPLORER_FAQ : resource.h
  • ID_FILE_EXIT : resource.h
  • ID_GO_BACK : resource.h
  • ID_GO_FORWARD : resource.h
  • ID_GO_HOME : resource.h
  • ID_GO_SEARCH : resource.h
  • ID_GO_UP : resource.h
  • ID_HELP : resource.h
  • ID_HELP_USING : resource.h
  • ID_HIDE_INACTIVE_ICONS : resource.h
  • ID_MINIMIZE_ALL : resource.h
  • ID_PREFERED_SIZES : resource.h
  • ID_REFRESH : resource.h
  • ID_SHOW_CLOCK : resource.h
  • ID_SHOW_HIDDEN_ICONS : resource.h
  • ID_SHOW_ICON_BUTTON : resource.h
  • ID_STOP : resource.h
  • ID_SWITCH_DESKTOP_1 : resource.h
  • ID_TASKMGR : resource.h
  • ID_TOOLS_OPTIONS : resource.h
  • ID_TRAY_VOLUME : resource.h
  • ID_VIEW_ALL_ATTRIBUTES : resource.h
  • ID_VIEW_DRIVE_BAR : resource.h
  • ID_VIEW_EXTRA_BAR : resource.h
  • ID_VIEW_FULLSCREEN : resource.h
  • ID_VIEW_MDI : resource.h
  • ID_VIEW_NAME : resource.h
  • ID_VIEW_SDI : resource.h
  • ID_VIEW_SELECTED_ATTRIBUTES : resource.h
  • ID_VIEW_SIDE_BAR : resource.h
  • ID_VIEW_STATUSBAR : resource.h
  • ID_VIEW_TOOL_BAR : resource.h
  • ID_VOLUME_PROPERTIES : resource.h
  • ID_WEB_WINDOW : resource.h
  • ID_WINDOW_ARRANGE : resource.h
  • ID_WINDOW_AUTOSORT : resource.h
  • ID_WINDOW_CASCADE : resource.h
  • ID_WINDOW_NEW : resource.h
  • ID_WINDOW_SPLIT : resource.h
  • ID_WINDOW_TILE_HORZ : resource.h
  • ID_WINDOW_TILE_VERT : resource.h
  • IDA_EXPLORER : resource.h
  • IDA_SEARCH_PROGRAM : resource.h
  • IDA_TRAYNOTIFY : resource.h
  • IDB_DRIVEBAR : resource.h
  • IDB_ICON_ALIGN_0 : resource.h
  • IDB_ICON_ALIGN_1 : resource.h
  • IDB_ICON_ALIGN_10 : resource.h
  • IDB_ICON_ALIGN_2 : resource.h
  • IDB_ICON_ALIGN_3 : resource.h
  • IDB_ICON_ALIGN_4 : resource.h
  • IDB_ICON_ALIGN_5 : resource.h
  • IDB_ICON_ALIGN_6 : resource.h
  • IDB_ICON_ALIGN_7 : resource.h
  • IDB_ICON_ALIGN_8 : resource.h
  • IDB_ICON_ALIGN_9 : resource.h
  • IDB_IMAGES : resource.h
  • IDB_LOGOV : resource.h
  • IDB_LOGOV16 : resource.h
  • IDB_LOGOV256 : resource.h
  • IDB_MDI : resource.h
  • IDB_SDI : resource.h
  • IDB_TOOLBAR : resource.h
  • IDC_ADMIN : desktopbar.h
  • IDC_BROWSE : desktopbar.h
  • IDC_BUTTON1 : resource.h
  • IDC_CHECK_ENTRIES : resource.h
  • IDC_CONNECTIONS : desktopbar.h
  • IDC_CONTROL_PANEL : desktopbar.h
  • IDC_DOCUMENTS : desktopbar.h
  • IDC_DRIVES : desktopbar.h
  • IDC_EXPLORE : desktopbar.h
  • IDC_FAVORITES : desktopbar.h
  • IDC_FILETREE : resource.h
  • IDC_FILTER : resource.h
  • IDC_FIRST_APP : taskbar.h
  • IDC_FIRST_MENU : desktopbar.h
  • IDC_FIRST_QUICK_ID : quicklaunch.h
  • IDC_ICON_ALIGN_0 : resource.h
  • IDC_ICON_ALIGN_1 : resource.h
  • IDC_ICON_ALIGN_10 : resource.h
  • IDC_ICON_ALIGN_11 : resource.h
  • IDC_ICON_ALIGN_2 : resource.h
  • IDC_ICON_ALIGN_3 : resource.h
  • IDC_ICON_ALIGN_4 : resource.h
  • IDC_ICON_ALIGN_5 : resource.h
  • IDC_ICON_ALIGN_6 : resource.h
  • IDC_ICON_ALIGN_7 : resource.h
  • IDC_ICON_ALIGN_8 : resource.h
  • IDC_ICON_ALIGN_9 : resource.h
  • IDC_LABEL1 : resource.h
  • IDC_LABEL2 : resource.h
  • IDC_LABEL3 : resource.h
  • IDC_LABEL4 : resource.h
  • IDC_LABEL6 : resource.h
  • IDC_LAST_CHANGE : resource.h
  • IDC_LAUNCH : desktopbar.h
  • IDC_LOGOFF : desktopbar.h
  • IDC_MDI : resource.h
  • IDC_NETWORK : desktopbar.h
  • IDC_NOTIFY_AUTOHIDE : resource.h
  • IDC_NOTIFY_HIDE : resource.h
  • IDC_NOTIFY_ICONS : resource.h
  • IDC_NOTIFY_MODULE : resource.h
  • IDC_NOTIFY_SHOW : resource.h
  • IDC_NOTIFY_TITLE : resource.h
  • IDC_NOTIFY_TOOLTIP : resource.h
  • IDC_PICTURE : resource.h
  • IDC_PRINTERS : desktopbar.h
  • IDC_PRINTERS_MENU : desktopbar.h
  • IDC_PROGRAMS : desktopbar.h
  • IDC_PROGRAMS_FOUND : resource.h
  • IDC_RECENT : desktopbar.h
  • IDC_ROS_EXPLORER : resource.h
  • IDC_SDI : resource.h
  • IDC_SEARCH : desktopbar.h
  • IDC_SEARCH_COMPUTER : desktopbar.h
  • IDC_SEARCH_FILES : desktopbar.h
  • IDC_SEARCH_PROGRAM : desktopbar.h
  • IDC_SEPARATE_SUBFOLDERS : resource.h
  • IDC_SETTINGS : desktopbar.h
  • IDC_SETTINGS_MENU : desktopbar.h
  • IDC_SHUTDOWN : desktopbar.h
  • IDC_START : desktopbar.h
  • IDC_START_HELP : desktopbar.h
  • IDC_STATIC : resource.h
  • IDC_TERMINATE : desktopbar.h
  • IDC_VERSION_TXT : resource.h
  • IDC_WIN_VERSION : resource.h
  • IDC_WWW : resource.h
  • IDD_ABOUT_EXPLORER : resource.h
  • IDD_DESKBAR_DESKTOP : resource.h
  • IDD_DESKBAR_STARTMENU : resource.h
  • IDD_DESKBAR_TASKBAR : resource.h
  • IDD_EXECUTE : resource.h
  • IDD_MDI_SDI : resource.h
  • IDD_NOTIFYAREA : resource.h
  • IDD_SEARCH_PROGRAM : resource.h
  • IDI_ACTION : resource.h
  • IDI_APPICON : resource.h
  • IDI_APPS : resource.h
  • IDI_ARROW : resource.h
  • IDI_ARROW_DOWN : resource.h
  • IDI_ARROW_SELECTED : resource.h
  • IDI_ARROW_UP : resource.h
  • IDI_COMPUTER : resource.h
  • IDI_CONFIG : resource.h
  • IDI_DOCUMENTS : resource.h
  • IDI_DOT : resource.h
  • IDI_DOT_RED : resource.h
  • IDI_DOT_TRANS : resource.h
  • IDI_EXPLORER : resource.h
  • IDI_FAVORITES : resource.h
  • IDI_FLOATING : resource.h
  • IDI_FOLDER : resource.h
  • IDI_FOLDERARROW : resource.h
  • IDI_INFO : resource.h
  • IDI_LOGOFF : resource.h
  • IDI_NETWORK : resource.h
  • IDI_NOTIFY_L : resource.h
  • IDI_NOTIFY_R : resource.h
  • IDI_PRINTER : resource.h
  • IDI_REACTOS : resource.h
  • IDI_REACTOS_BIG : resource.h
  • IDI_SEARCH : resource.h
  • IDI_SEARCH_DOC : resource.h
  • IDI_SPEAKER : resource.h
  • IDI_STARTMENU : resource.h
  • IDM_DESKTOPBAR : resource.h
  • IDM_MDIFRAME : resource.h
  • IDM_NOTIFYAREA : resource.h
  • IDM_SDIFRAME : resource.h
  • IDM_VOLUME : resource.h
  • IDR_MAINFRAME : resource.h
  • IDS_ABOUT_EXPLORER : resource.h
  • IDS_ADMIN : resource.h
  • IDS_ALL_USERS : resource.h
  • IDS_BROWSE : resource.h
  • IDS_CONNECTIONS : resource.h
  • IDS_CONTROL_PANEL : resource.h
  • IDS_DESKTOP : resource.h
  • IDS_DESKTOP_NUM : resource.h
  • IDS_DESKTOPBAR_SETTINGS : resource.h
  • IDS_DOCUMENTS : resource.h
  • IDS_DRIVES : resource.h
  • IDS_EMPTY : resource.h
  • IDS_EXPLORE : resource.h
  • IDS_EXPLORER_VERSION_STR : resource.h
  • IDS_FAVORITES : resource.h
  • IDS_HIDE_ICONS : resource.h
  • IDS_ITEMS_CONFIGURED : resource.h
  • IDS_ITEMS_CUR : resource.h
  • IDS_ITEMS_HIDDEN : resource.h
  • IDS_ITEMS_VISIBLE : resource.h
  • IDS_LAUNCH : resource.h
  • IDS_LAUNCH_MANY_PROGRAMS : resource.h
  • IDS_LOGOFF : resource.h
  • IDS_MINIMIZE_ALL : resource.h
  • IDS_NETWORK : resource.h
  • IDS_NOTIFY_AUTOHIDE : resource.h
  • IDS_NOTIFY_HIDE : resource.h
  • IDS_NOTIFY_SHOW : resource.h
  • IDS_PRINTERS : resource.h
  • IDS_PROGRAMS : resource.h
  • IDS_RECENT : resource.h
  • IDS_SEARCH : resource.h
  • IDS_SEARCH_COMPUTER : resource.h
  • IDS_SEARCH_FILES : resource.h
  • IDS_SEARCH_PRG : resource.h
  • IDS_SETTINGS : resource.h
  • IDS_SETTINGS_MENU : resource.h
  • IDS_SHOW_HIDDEN_ICONS : resource.h
  • IDS_SHUTDOWN : resource.h
  • IDS_START : resource.h
  • IDS_START_HELP : resource.h
  • IDS_STARTMENU : resource.h
  • IDS_TASKBAR : resource.h
  • IDS_TERMINATE : resource.h
  • IDS_TITLE : resource.h
  • IDS_VERSION_STR : resource.h
  • IDS_VOLUME : resource.h
  • IDW_ADDRESSBAR : explorer.h
  • IDW_COMMANDBAR : explorer.h
  • IDW_DRIVEBAR : explorer.h
  • IDW_EXTRABAR : explorer.h
  • IDW_FIRST_CHILD : explorer.h
  • IDW_HEADER_LEFT : pane.h
  • IDW_HEADER_RIGHT : pane.h
  • IDW_QUICKLAUNCHBAR : quicklaunch.h
  • IDW_SIDEBAR : explorer.h
  • IDW_STATUSBAR : explorer.h
  • IDW_TASKTOOLBAR : taskbar.h
  • IDW_TOOLBAR : explorer.h
  • IDW_TREE_LEFT : pane.h
  • IDW_TREE_RIGHT : pane.h
  • ILGetSize : shellclasses.h
  • IMAGE_HEIGHT : pane.cpp
  • IMAGE_WIDTH : pane.cpp
  • IS_LNAME : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- p -

  • path_from_pidl : shellclasses.h
  • PM_DISPATCH_COMMAND : window.h
  • PM_DISPATCH_CTLCOLOR : window.h
  • PM_DISPATCH_DRAWITEM : window.h
  • PM_DISPLAY_VERSION : desktop.h
  • PM_FRM_CALC_CLIENT : window.h
  • PM_FRM_GET_MENUINFO : window.h
  • PM_GET_CONTROLWINDOW : explorer.h
  • PM_GET_FILEWND_PTR : explorer.h
  • PM_GET_ICON_ALGORITHM : desktop.h
  • PM_GET_LAST_ACTIVE : taskbar.h
  • PM_GET_NOTIFYAREA : traynotify.h
  • PM_GET_SHELLBROWSER_PTR : explorer.h
  • PM_GET_WIDTH : explorer.h
  • PM_GETMODULEPATH_CB : traynotify.h
  • PM_JUMP_TO_URL : window.h
  • PM_OPEN_WINDOW : mainframe.h
  • PM_REFRESH : explorer.h
  • PM_REFRESH_CONFIG : explorer.h
  • PM_RESIZE_CHILDREN : explorer.h
  • PM_SELECT_ENTRY : startmenu.h
  • PM_SET_ICON_ALGORITHM : desktop.h
  • PM_SETSTATUSTEXT : window.h
  • PM_STARTENTRY_LAUNCHED : startmenu.h
  • PM_STARTMENU_CLOSED : startmenu.h
  • PM_TRANSLATE_MSG : window.h
  • PM_TRAYICON : window.h
  • PM_UPDATE_DESKTOP : quicklaunch.h
  • PM_UPDATE_ICONS : startmenu.h
  • PM_URL_CHANGED : window.h
  • PropSheet_GetResult : window.cpp
  • PSM_GETRESULT : window.cpp
  • PSN_QUERYINITIALFOCUS : settings.cpp


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- q -

  • QUICKLAUNCH_FOLDER : quicklaunch.h
  • QUICKLAUNCH_WIDTH_DEF : quicklaunch.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- r -

  • RBBS_HIDETITLE : desktopbar.cpp, mainframe.cpp
  • REBARBAND_HEIGHT : desktopbar.h
  • RECENT_DOCS_COUNT : startmenu.h
  • RFF_CALCDIRECTORY : startmenu.h
  • RFF_NOBROWSE : startmenu.h
  • RFF_NODEFAULT : startmenu.h
  • RFF_NOLABEL : startmenu.h
  • RFF_NOSEPARATEMEM : startmenu.h
  • RONLY : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- s -

  • SAVE_ERRCODE : i386-stub-win32.c
  • SAVE_REGISTERS1 : i386-stub-win32.c
  • SAVE_REGISTERS2 : i386-stub-win32.c
  • SetDlgCtrlID : utility.h
  • SetWindowExStyle : utility.h
  • SetWindowStyle : utility.h
  • SHELLPATH_CONTROL_PANEL : startmenu.cpp
  • SHELLPATH_NET_CONNECTIONS : startmenu.cpp
  • SHELLPATH_PRINTERS : startmenu.cpp
  • SHGFI_ADDOVERLAYS : entries.h
  • speek : fatfs.h
  • SPLIT_WIDTH : window.h
  • spoke : fatfs.h
  • STACKSIZE : i386-stub-win32.c
  • STARTMENU_CREATOR : startmenu.h
  • STARTMENU_LINE_HEIGHT : startmenu.h
  • STARTMENU_SEP_HEIGHT : startmenu.h
  • STARTMENU_TOP_BTN_SPACE : startmenu.h
  • STARTMENU_WIDTH_MIN : startmenu.h
  • strcpy_s : utility.h
  • StrRet : shellclasses.h
  • SYSTEM : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- t -

  • TASKBUTTONWIDTH_MAX : taskbar.h
  • TASKBUTTONWIDTH_MIN : taskbar.h
  • THROW_EXCEPTION : shellclasses.h
  • TITLE_EXPLORERBAR : desktopbar.h
  • TITLE_STARTMENU : startmenu.h
  • TITLE_TASKBAR : taskbar.h
  • TITLE_TRAYNOTIFY : traynotify.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- u -

  • U2A : utility.h
  • U2nA : utility.h
  • UNION_MEMBER : shellclasses.h
  • USE_MY_SHBINDTOPARENT : entries.cpp


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- v -

  • V_INT : webchild.h
  • VOLUME : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- w -

  • W_VER_NT : utility.h
  • wcsncpy_s : utility.h
  • WIN32_EXTRA_LEAN : utility.h
  • WIN32_LEAN_AND_MEAN : utility.h
  • WINDOW_CREATOR : window.h
  • WINDOW_CREATOR_INFO : window.h
  • WINDOW_DYNAMIC_CAST : window.h
  • Window_SetIcon : utility.h
  • WINMSG_SHELLHOOK : window.h
  • WINMSG_TASKBARCREATED : window.h
  • WM_GETISHELLBROWSER : shellbrowserimpl.h
  • wpeek : fatfs.h
  • wpoke : fatfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x

- x -

  • XML_INDENT_SPACE : xmlstorage.h
  • XS_CHAR : xmlstorage.h
  • XS_FALSE : xmlstorage.h
  • XS_FALSE_STR : xmlstorage.h
  • XS_icmp : xmlstorage.h
  • XS_len : xmlstorage.h
  • XS_nicmp : xmlstorage.h
  • XS_NUMBERFMT : xmlstorage.h
  • XS_NUMBERFMT_STR : xmlstorage.h
  • XS_snprintf : xmlstorage.h
  • XS_TEXT : xmlstorage.h
  • XS_toi : xmlstorage.h
  • XS_TRUE : xmlstorage.h
  • XS_TRUE_STR : xmlstorage.h
  • XS_vsnprintf : xmlstorage.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines

  • COLUMN_FLAGS : pane.h
  • ENTRY_TYPE : entries.h
  • ICON_ID : globals.h
  • ICON_TYPE : globals.h
  • ICONCACHE_FLAGS : entries.h
  • IMAGE : pane.cpp
  • NOTIFYICONMODE : traynotify.h
  • OBJECT_TYPE : ntobjfs.h
  • OPEN_WINDOW_MODE : mainframe.h
  • PRETTY_FLAGS : xmlstorage.h
  • regnames : i386-stub-win32.c
  • RESIZE_FLAGS : window.h
  • SCAN_FLAGS : entries.h
  • SORT_ORDER : entries.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • c
  • d
  • e
  • f
  • g
  • i
  • k
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • w

- a -

  • ADAPTER_OBJECT : ntobjfs.h

- c -

  • COL_ALL : pane.h
  • COL_ATTRIBUTES : pane.h
  • COL_CONTENT : pane.h
  • COL_DATE : pane.h
  • COL_DOSNAMES : pane.h
  • COL_INDEX : pane.h
  • COL_LINKS : pane.h
  • COL_SIZE : pane.h
  • COL_TIME : pane.h
  • COL_TYPE : pane.h
  • CONTROLLER_OBJECT : ntobjfs.h
  • CS : i386-stub-win32.c

- d -

  • DESKTOP_OBJECT : ntobjfs.h
  • DEVICE_OBJECT : ntobjfs.h
  • DIRECTORY_OBJECT : ntobjfs.h
  • DRIVER_OBJECT : ntobjfs.h
  • DS : i386-stub-win32.c

- e -

  • EAX : i386-stub-win32.c
  • EBP : i386-stub-win32.c
  • EBX : i386-stub-win32.c
  • ECX : i386-stub-win32.c
  • EDI : i386-stub-win32.c
  • EDX : i386-stub-win32.c
  • ES : i386-stub-win32.c
  • ESI : i386-stub-win32.c
  • ESP : i386-stub-win32.c
  • ET_FAT : entries.h
  • ET_NTOBJS : entries.h
  • ET_REGISTRY : entries.h
  • ET_SHELL : entries.h
  • ET_UNKNOWN : entries.h
  • ET_WEB : entries.h
  • ET_WINDOWS : entries.h
  • EVENT_OBJECT : ntobjfs.h
  • EVENTPAIR_OBJECT : ntobjfs.h

- f -

  • FILE_OBJECT : ntobjfs.h
  • FS : i386-stub-win32.c

- g -

  • GS : i386-stub-win32.c

- i -

  • ICF_HICON : entries.h
  • ICF_LARGE : entries.h
  • ICF_NORMAL : entries.h
  • ICF_OPEN : entries.h
  • ICF_OVERLAYS : entries.h
  • ICF_SYSCACHE : entries.h
  • ICID_ACTION : globals.h
  • ICID_APP : globals.h
  • ICID_APPS : globals.h
  • ICID_BOOKMARK : globals.h
  • ICID_COMPUTER : globals.h
  • ICID_CONFIG : globals.h
  • ICID_DOCUMENTS : globals.h
  • ICID_DYNAMIC : globals.h
  • ICID_EXPLORER : globals.h
  • ICID_FAVORITES : globals.h
  • ICID_FOLDER : globals.h
  • ICID_INFO : globals.h
  • ICID_LOGOFF : globals.h
  • ICID_NETWORK : globals.h
  • ICID_NONE : globals.h
  • ICID_PRINTER : globals.h
  • ICID_SEARCH : globals.h
  • ICID_SEARCH_DOC : globals.h
  • ICID_UNKNOWN : globals.h
  • IMG_DOCUMENT : pane.cpp
  • IMG_EXECUTABLE : pane.cpp
  • IMG_FILE : pane.cpp
  • IMG_FOLDER : pane.cpp
  • IMG_FOLDER_CUR : pane.cpp
  • IMG_FOLDER_PLUS : pane.cpp
  • IMG_FOLDER_UP : pane.cpp
  • IMG_NONE : pane.cpp
  • IMG_OPEN_FOLDER : pane.cpp
  • IMG_OPEN_MINUS : pane.cpp
  • IMG_OPEN_PLUS : pane.cpp
  • IOCOMPLETITION_OBJECT : ntobjfs.h
  • IT_CACHED : globals.h
  • IT_DYNAMIC : globals.h
  • IT_STATIC : globals.h
  • IT_SYSCACHE : globals.h

- k -

  • KEY_OBJECT : ntobjfs.h

- m -

  • MOVE : window.h
  • MOVE_BOTTOM : window.h
  • MOVE_LEFT : window.h
  • MOVE_RIGHT : window.h
  • MOVE_TOP : window.h
  • MOVE_X : window.h
  • MOVE_Y : window.h
  • MUTANT_OBJECT : ntobjfs.h

- n -

  • NIM_AUTO : traynotify.h
  • NIM_HIDE : traynotify.h
  • NIM_SHOW : traynotify.h

- o -

  • OWM_DETAILS : mainframe.h
  • OWM_EXPLORE : mainframe.h
  • OWM_PIDL : mainframe.h
  • OWM_ROOTED : mainframe.h
  • OWM_SEPARATE : mainframe.h

- p -

  • PC : i386-stub-win32.c
  • PORT_OBJECT : ntobjfs.h
  • PRETTY_INDENT : xmlstorage.h
  • PRETTY_LINEFEED : xmlstorage.h
  • PRETTY_PLAIN : xmlstorage.h
  • PROCESS_OBJECT : ntobjfs.h
  • PROFILE_OBJECT : ntobjfs.h
  • PS : i386-stub-win32.c

- r -

  • RESIZE : window.h
  • RESIZE_X : window.h
  • RESIZE_Y : window.h

- s -

  • SCAN_ALL : entries.h
  • SCAN_DO_ACCESS : entries.h
  • SCAN_FILESYSTEM : entries.h
  • SECTION_OBJECT : ntobjfs.h
  • SEMAPHORE_OBJECT : ntobjfs.h
  • SORT_DATE : entries.h
  • SORT_EXT : entries.h
  • SORT_NAME : entries.h
  • SORT_NONE : entries.h
  • SORT_SIZE : entries.h
  • SS : i386-stub-win32.c
  • SYMBOLICLINK_OBJECT : ntobjfs.h

- t -

  • THREAD_OBJECT : ntobjfs.h
  • TIMER_OBJECT : ntobjfs.h
  • TOKEN_OBJECT : ntobjfs.h
  • TRAYBUTTON_LEFT : window.h
  • TRAYBUTTON_MIDDLE : window.h
  • TRAYBUTTON_RIGHT : window.h
  • TYPE_OBJECT : ntobjfs.h

- u -

  • UNKNOWN_OBJECT_TYPE : ntobjfs.h

- w -

  • WINDOWSTATION_OBJECT : ntobjfs.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • p
  • r
  • s
  • t

- _ -

  • _catchException0() : i386-stub-win32.c
  • _catchException1() : i386-stub-win32.c
  • _catchException10() : i386-stub-win32.c
  • _catchException11() : i386-stub-win32.c
  • _catchException12() : i386-stub-win32.c
  • _catchException13() : i386-stub-win32.c
  • _catchException14() : i386-stub-win32.c
  • _catchException16() : i386-stub-win32.c
  • _catchException3() : i386-stub-win32.c
  • _catchException4() : i386-stub-win32.c
  • _catchException5() : i386-stub-win32.c
  • _catchException6() : i386-stub-win32.c
  • _catchException7() : i386-stub-win32.c
  • _catchException8() : i386-stub-win32.c
  • _catchException9() : i386-stub-win32.c
  • _log_() : utility.h, explorer.cpp
  • _returnFromException() : i386-stub-win32.c
  • _splitpath() : splitpath.c
  • _tWinMain() : explorer.cpp

- a -

  • asm() : i386-stub-win32.c
  • assign_utf8() : xmlstorage.h

- b -

  • breakpoint() : i386-stub-win32.c

- c -

  • CenterWindow() : utility.h, utility.cpp
  • CheckError() : shellclasses.h
  • ClientToScreen() : utility.h
  • computeSignal() : i386-stub-win32.c
  • create_bitmap_from_icon() : globals.h, explorer.cpp
  • create_small_bitmap_from_icon() : explorer.cpp
  • create_webchildwindow() : webchild.cpp, mainframe.cpp

- d -

  • debug_error() : i386-stub-win32.c
  • DecodeURLString() : favorites.h, favorites.cpp
  • DecodeXMLString() : xmlstorage.cpp
  • display_error() : utility.h, utility.cpp
  • DrawGrayText() : window.h, window.cpp
  • DrawStartMenuButton() : startmenu.h, startmenu.cpp

- e -

  • EncodeXMLString() : xmlstorage.cpp
  • exceptionHandler() : i386-stub-win32.c
  • exists_path() : utility.h, utility.cpp
  • explorer_about() : externals.h, explorer.cpp
  • explorer_main() : externals.h, explorer.cpp
  • explorer_show_frame() : externals.h, explorer.cpp
  • ExplorerPropertySheet() : settings.h, settings.cpp

- f -

  • find_window_class() : utility.h, utility.cpp

- g -

  • get_char() : i386-stub-win32.c
  • get_utf8() : xmlstorage.h
  • get_window_icon_big() : taskbar.cpp, globals.h
  • get_window_icon_small() : taskbar.cpp, globals.h
  • get_windows_version_str() : utility.h, utility.cpp
  • getDebugChar() : i386-stub-win32.c
  • GetDesktopFolder() : shellclasses.h, shellclasses.cpp
  • getpacket() : i386-stub-win32.c
  • GetStartMenuBtnTextWidth() : startmenu.h, startmenu.cpp

- h -

  • handle_exception() : i386-stub-win32.c
  • HandleException() : shellclasses.h, shellclasses.cpp
  • hex() : i386-stub-win32.c
  • hex2mem() : i386-stub-win32.c
  • hexToInt() : i386-stub-win32.c

- i -

  • ILGetSize_local() : shellclasses.h, shellclasses.cpp
  • ImageList_AddAlphaIcon() : globals.h, explorer.cpp
  • initialize_gdb_stub() : explorer.cpp
  • IsAnyDesktopRunning() : desktop.cpp, externals.h

- l -

  • launch_cpanel() : utility.h, utility.cpp
  • launch_file() : utility.h, utility.cpp
  • ListView_FindItemPara() : window.h
  • ListView_GetFocusedItem() : window.h
  • ListView_GetItemData() : window.h

- m -

  • main() : shelltests.cpp
  • mem2hex() : i386-stub-win32.c
  • MoveVisible() : utility.h, utility.cpp

- n -

  • name_from_pidl() : shellclasses.h, shellclasses.cpp

- p -

  • path_from_pidlA() : shellclasses.h, shellclasses.cpp
  • path_from_pidlW() : shellclasses.h, shellclasses.cpp
  • putDebugChar() : i386-stub-win32.c
  • putpacket() : i386-stub-win32.c

- r -

  • read_option() : xmlstorage.h
  • RecursiveCreateDirectory() : utility.h, utility.cpp
  • RegGetDWORDValue() : utility.h, utility.cpp
  • RegSetDWORDValue() : utility.h, utility.cpp
  • return_to_prog() : i386-stub-win32.c
  • RunDLL() : utility.h, utility.cpp

- s -

  • ScanNTFSStreams() : winfs.h, winfs.cpp
  • ScreenToClient() : utility.h
  • set_char() : i386-stub-win32.c
  • set_debug_traps() : i386-stub-win32.c
  • set_mem_err() : i386-stub-win32.c
  • SetWindowIcon() : globals.h, explorer.cpp
  • ShellFolderContextMenu() : shellclasses.h, shellclasses.cpp
  • ShowExitWindowsDialog() : startmenu.cpp, externals.h
  • SplitFileSysURL() : utility.h, utility.cpp
  • string_from_mode() : traynotify.h, traynotify.cpp

- t -

  • T2nA_binary() : webchild.cpp
  • time_to_filetime() : utility.h, utility.cpp
  • TreeView_GetItemData() : window.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines

  • BookmarkMap : startmenu.h
  • COLLECT_CALLBACK : searchprogram.h
  • DesktopRef : globals.h
  • EXITWINDOWSDLG : startmenu.h
  • FormatArray : dragdropimpl.h
  • FPDCache : searchprogram.h
  • IconMap : desktop.cpp
  • IconPos : desktop.cpp
  • LOGOFFWINDOWSDIALOG : startmenu.h
  • MinimizeStruct : globals.h
  • NotifyIconCfgList : traynotify.h
  • NotifyIconDlgInfoMap : traynotify.h
  • NotifyIconMap : traynotify.h
  • NotifyIconSet : traynotify.h
  • NTOBJECTOPENFUNCTIONS : ntobjfs.cpp
  • RESTARTWINDOWSDLG : startmenu.h
  • RESTARTWINDOWSDLGEX : startmenu.h
  • RUNDLLPROC : utility.cpp
  • RUNFILEDLG : startmenu.h
  • ShellDirectoryStack : searchprogram.h
  • ShellEntryMap : startmenu.h
  • ShellEntrySet : startmenu.h
  • SHFINDCOMPUTER : startmenu.h
  • SHFINDFILES : startmenu.h
  • SMBtnVector : startmenu.h
  • StartMenuFolders : startmenu.h
  • StartMenuShellDirs : startmenu.h
  • STDIO_FILEBUF : xmlstorage.h
  • StorageArray : dragdropimpl.h
  • WindowSet : window.h


ROS Explorer: Class Members

  • File List
  • File Members
  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines

  • g_DeregisterShellHookWindow : taskbar.cpp
  • g_Globals : globals.h, explorer.cpp
  • g_NTDLL : ntobjfs.cpp
  • g_RegisterShellHookWindow : taskbar.cpp
  • g_SetTaskmanWindow : taskbar.cpp
  • g_SHDOCVW_ShellDDEInit : explorer.cpp
  • gdb_i386errcode : i386-stub-win32.c
  • gdb_i386vector : i386-stub-win32.c
  • HWND : desktop.cpp
  • registers : i386-stub-win32.c
  • remcomStack : i386-stub-win32.c
  • remote_debug : i386-stub-win32.c


ROS Explorer: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.


ROS Explorer: Main Page

ROS Explorer Documentation

ROS Explorer Source Code Documentation
generated on 21.11.2004 by doxygen

ROS Explorer Homepage


ROS Explorer: Member List

BootSector Member List

This is the complete list of members for BootSector, including all inherited members.

BootCode | BootSector
BootSignature | BootSector
BytesPerSector | BootSector
DriveUnit | BootSector
ExtBootFlag | BootSector
FileSystem | BootSector
Heads | BootSector
HiddenSectors | BootSector
jmp | BootSector
Label | BootSector
MediaDescr | BootSector
NumberFATs | BootSector
OEM | BootSector
ReservedSectors | BootSector
RootEntries | BootSector
Sectors16 | BootSector
Sectors32 | BootSector
SectorsPerCluster | BootSector
SectorsPerFAT | BootSector
SectorsPerTrack | BootSector
SerialNr | BootSector