/* * xfobj.idl: * SOM interface description file for the following * XWorkplace classes (in this order): * XFldObject * and the respective metaclasses. * * See src\classes\xfobj.c for details. */ /* * Copyright (C) 1997-2006 Ulrich M”ller. * * This file is part of the XWorkplace source package. * XWorkplace is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation, in version 2 as it comes in the * "COPYING" file of the XWorkplace main distribution. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include // this is SOM for WPObject /* ****************************************************************** * * CLASS: XWPObjList * * CLASS HIERARCHY: * * SOMObject * ÀÄÄ XWPObjList * ********************************************************************/ interface XWPObjList : SOMObject { /* * New instance methods for XWPObjList: * */ VOID SetKeys(in PSZ pszApp, in PSZ pszKey); BOOL Load(); BOOL Write(); BOOL Append(in WPObject pobj); ULONG Count(); BOOL IsIn(in WPObject pobj); BOOL Remove(in WPObject pobj); WPObject Enum(in WPObject pobj); #ifdef __SOMIDL__ implementation { releaseorder: SetKeys, Load, Write, Append, Count, IsIn, Remove, Enum; /* * Class Modifiers: * */ externalprefix = xl_; externalstem = xl; majorversion = 1; minorversion = 2; filestem = xfobj; //# specifies the filestem for sc-generated files //# metaclass = M_XWPObjList; dllname = "xfldr.dll"; callstyle = oidl; //# forget CORBA stuff (*ev and such) /* * Internal instance variables for XWPObjList: * */ BOOL fLoaded; PSZ pszIniApp; PSZ pszIniKey; PVOID pvList; /* * SOMObject methods overridden by XWPObjList: * */ somDefaultInit: override; somDestruct: override; }; #endif }; /* ****************************************************************** * * CLASS: XFldObject * * CLASS HIERARCHY: * * SOMObject * ÀÄÄ WPObject * ÀÄÄ XFldObject * ********************************************************************/ interface M_XFldObject; // forward reference to XFldObject metaclass interface XFldObject : WPObject { /* *@@ WPOBJECTLONGS: * internal data structure for WPObject * settings. We store a pointer to the * instance's structure in _pWPObjectLongs, * which is examined in _wpRestoreData. * *@@added V0.9.1 (2000-01-22) [umoeller] *@@changed V0.9.16 (2001-12-06) [umoeller]: renamed */ struct WPOBJECTLONGS { LONG lDefaultView; ULONG ulHelpPanel; // 0 means default, apparently ULONG ulUnknown3; ULONG ulObjectStyle; ULONG ulMinWin; // MINWIN_DEFAULT=0, MINWIN_HIDDEN=1, MINWIN_VIEWER=2, MINWIN_DESKTOP=3 ULONG ulConcurrent; // CCVIEW_DEFAULT=0, CCVIEW_ON=1, CCVIEW_OFF=2 ULONG ulViewButton; // HIDEBUTTON=1, MINBUTTON=2, DEFAULTBUTTON=3 ULONG ulMenuFlag; // 2? }; typedef WPOBJECTLONGS *PWPOBJECTLONGS; /* *@@ WPOBJECTSTRINGS: * internal data structure for WPObject * strings. We store a pointer to the * instance's structure in _pWPObjectStrings, * which is examined in _wpRestoreData. * *@@added V0.9.16 (2001-12-06) [umoeller] */ struct WPOBJECTSTRINGS { PSZ pszHelpLibrary; // help library PSZ pszObjectID; // object ID PSZ pszViewPos; // strange listing of view positions... what is this? }; typedef WPOBJECTSTRINGS *PWPOBJECTSTRINGS; /* *@@ OBJECTHOTKEY: * definition of an object hotkey. * *@@added V0.9.16 (2001-10-15) [umoeller] */ struct OBJECTHOTKEY { USHORT usFlags; UCHAR ucScanCode; USHORT usKeyCode; }; typedef OBJECTHOTKEY *POBJECTHOTKEY; /* * New instance methods for XFldObject: * */ HOBJECT xwpQueryHandle(in BOOL fCreate); ULONG xwpQueryLocks(); ULONG xwpAddReplacementIconPage(in HWND hwndNotebook, in ULONG ulPageID, in ULONG ulDefaultHelpPanel); ULONG xwpQueryRealDefaultView(); PSZ xwpQueryOriginalObjectID(); BOOL xwpSetTitleOnly(in PSZ pszNewTitle); BOOL xwpQueryDeletion(in CDATE* pcdateDeleted, in CTIME* pctimeDeleted); BOOL xwpSetDeletion(in BOOL fSet); ULONG xwpTrashObjectID(); BOOL xwpSetTrashObject(in WPObject pTrashObject); ULONG xwpQueryFlags(); BOOL xwpModifyFlags(in ULONG flFlags, in ULONG flMask); VOID xwpAddedToList(in XWPObjList pList); VOID xwpRemovedFromList(in XWPObjList pList); PUSEITEM xwpPrepareInsertRecord(in HWND hwndCnr, in PMINIRECORDCORE pmrc, in ULONG flObjectStyle, in BOOL fFirstInsert); ULONG xwpOwnerDrawIcon(in PMINIRECORDCORE pmrc, in HPS hps, in ULONG flOwnerDraw, in PRECTL prcl); VOID xwpLazyLoadIcon(in ULONG flOwnerDraw, in BOOL *pbQuitEarly); VOID xwpForceRepaint(in ULONG flRefresh); BOOL xwpAddWidgetNotify(in HWND hwnd); BOOL xwpRemoveDestroyNotify(in HWND hwnd); BOOL xwpQueryObjectHotkey(in POBJECTHOTKEY pHotkey); BOOL xwpSetObjectHotkey(in POBJECTHOTKEY pHotkey); PSZ xwpQuerySetup(in PULONG pulLength); VOID xwpFreeSetupBuffer(in PSZ pszSetupBuffer); BOOL xwpQuerySetup2(in PVOID pstrSetup); HWND xwpHotkeyOrBorderAction(in ULONG ulView, in ULONG ulCorner); VOID xwpHandleSelfClose(in HWND hwndFrame, in ULONG ulMenuId); WPObject xwpCreateShadow(in WPFolder pFolder, in BOOL fLock); WPObject xwpResolveIfLink(); #ifdef __SOMIDL__ implementation { releaseorder: xwpQueryDeletion, xwpSetDeletion, xwpTrashObjectID, xwpSetTrashObject, xwpQueryObjectHotkey, xwpSetObjectHotkey, xwpQuerySetup, xwpQuerySetup2, xwpQueryFlags, xwpModifyFlags, xwpAddWidgetNotify, xwpRemoveDestroyNotify, xwpQueryRealDefaultView, xwpFreeSetupBuffer, xwpQueryOriginalObjectID, xwpHotkeyOrBorderAction, xwpAddReplacementIconPage, xwpQueryHandle, xwpQueryLocks, xwpSetTitleOnly, xwpHandleSelfClose, xwpAddedToList, xwpRemovedFromList, xwpPrepareInsertRecord, xwpOwnerDrawIcon, xwpLazyLoadIcon, xwpForceRepaint, xwpCreateShadow, xwpResolveIfLink; /* * Class Modifiers: * */ externalprefix = xo_; externalstem = xo; majorversion = 1; minorversion = 2; filestem = xfobj; //# specifies the filestem for sc-generated files metaclass = M_XFldObject; dllname = "xfldr.dll"; callstyle = oidl; //# forget CORBA stuff (*ev and such) /* * The following is forced into the .H file: * */ passthru C_h = "" "/* input flags for xwpOwnerDrawIcon */" "#define OWDRFL_LAZYLOADICON 0x0001" " // in: defer icon loading (lazy icons)" " // (flag is stored in sflOwnerDrawIcons)" "#define OWDRFL_SHADOWOVERLAY 0x0002" " // in: overlay shadow icons with special shadow icon" " // (flag is stored in sflOwnerDrawIcons)" "#define OWDRFL_LAZYLOADTHUMBNAIL 0x0004" " // in: produce thumbnails for XWPImageFile" " // (flag is stored in sflOwnerDrawIcons)" "" "#define OWDRFL_INUSE 0x00010000" " // in: object has a view open" " // (flag is _not_ stored in sflOwnerDrawIcons)" "#define OWDRFL_MINI 0x00020000" " // in: must paint a mini icon" " // (flag is _not_ stored in sflOwnerDrawIcons)" "#define OWDRFL_RGBMODE 0x00040000" " // in/out: owner-draw presentation space is in TGB mode" " // (flag is _not_ stored in sflOwnerDrawIcons)" "" "/* flags for xwpForceRepaint */" "#define REFRESH_RECORDREPAINT 0x0001" "#define REFRESH_RECORDICON 0x0002" "#define REFRESH_RECORDTEXT 0x0004" "#define REFRESH_SHADOWS 0x0008" "#define REFRESH_WINDOWS 0x0010" ""; /* * Internal instance variables for XFldObject: * */ /* trash can deletion; this is only != NULL if the object currently resides in the trash can. We use this extra pointer to avoid having to allocate all the fields with every object, even if it is not in the trash. V0.9.20 (2002-07-25) [umoeller] */ PVOID pvTrashData; // pointer to WPObject instance data // V0.9.18 (2002-03-23) [umoeller] PVOID pvWPObjectData; // IBMOBJECTDATA struct, include\filesys\object.h PSZ pWszOriginalObjectID; // copy of object ID as found with wpRestoreState // WARNING: allocated using wpAllocMem // V0.9.16 (2001-12-06) [umoeller] ULONG flObject; // OBJFL_* and OBJLIST_* flags // combined V0.9.20 (2002-07-25) [umoeller] PVOID pvllWidgetNotifies; // really a PLINKLIST for xwpSetWidgetNotify PVOID pvllLists; // a PLINKLIST of XWPObjList* objects that this // object is currently stored in /* doubly-linked list of awake objects (the root of the list is a global variable in xfobj.c) V0.9.20 (2002-07-25) [umoeller] */ XFldObject pNextAwake; // next object for the list of currently awake objects XFldObject pPreviousAwake; // previous object for the list of currently awake objects /* icon server/client stuff (see icomShareIcon): V0.9.20 (2002-07-25) [umoeller] We implement a linked list here, using object instance data. This looks like the best solution to me since the LARGE majority of awake WPS objects will be data files and thus icon clients. 1) If we are an icon server, pFirstIconClient and pLastIconClient implement a linked list of icon clients, pointing to the first and the last WPObject* client. 2) In each icon client object, pNextClient and pPreviousClient implement the linked list. */ WPObject pFirstIconClient; // if != NULL, we have clients, and this is the // first one (where pFirstClient->pNextClient is // the next etc.) WPObject pLastIconClient; // last item in list (for speedy append) ULONG cIconClients; // total clients count // the object that _we_ took our icon from, or NULL WPObject pobjIconServer; // if != NULL, our icon server XFldObject pNextClient; // next object for pobjIconServer's list of clients XFldObject pPreviousClient; // previous object for pobjIconServer's list of clients /* * WPObject methods overridden by XFldObject: * */ //# 1) init/uninit methods wpInitData: override; wpObjectReady: override; wpSetup: override; wpSetupOnce: override; wpFree: override; wpUnInitData: override; wpSaveDeferred: override; wpSaveImmediate: override; wpSaveState: override; wpRestoreState: override; //# 2) WPObject query/set methods wpSetObjectID: override; wpQueryDefaultHelp: override; //# 3) icon methods wpSetIcon: override; //# 4) class-specific query/set methods wpAddToObjUseList: override; wpDeleteFromObjUseList: override; wpCnrSetEmphasis: override; wpCnrInsertObject: override; //# added V1.0.1 (2003-01-25) [umoeller] wpRequestObjectMutexSem: override; wpAssertObjectMutexSem: override; wpReleaseObjectMutexSem: override; //# 5) menu methods //# wpFilterPopupMenu: override; removed V1.0.0 (2002-08-31) [umoeller] wpFilterMenu: override; //# added V1.0.0 (2002-08-31) [umoeller] //# wpModifyPopupMenu: override; removed V1.0.0 (2002-08-31) [umoeller] wpModifyMenu: override; //# added V1.0.0 (2002-08-31) [umoeller] wpMenuItemSelected: override; wpMenuItemHelpSelected: override; //# 6) open view methods wpDisplayHelp: override; wpSwitchTo: override; //# added V1.0.6 (2006-11-08) [pr] wpAddSettingsPages: override; wpAddObjectGeneralPage: override; //# 7) file operation methods wpSetTitle: override; wpConfirmObjectTitle: override; }; #endif }; //# //# //# Now define Metaclass. //# --------------------- //# interface M_XFldObject : M_WPObject { /* * New class methods for M_XFldObject: * */ BOOL xwpclsRemoveObjectHotkey(in HOBJECT hobj); XWPObjList xwpclsCreateList(in PSZ pcszIniApp, in PSZ pcszIniKey); #ifdef __SOMIDL__ implementation { releaseorder: xwpclsRemoveObjectHotkey, xwpclsCreateList; //# Class Modifiers externalprefix = xoM_; externalstem = xoM; functionprefix = xoM_; majorversion = 1; minorversion = 2; filestem = xfobj; //# specifies the filestem for sc-generated files dllname = "xfldr.dll"; callstyle = oidl; /* * Internal class variables for M_XFldObject: * */ /* * M_WPObject methods overridden by M_XFldObject: * */ wpclsInitData: override; wpclsQueryObject: override; wpclsInsertMultipleObjects: override; //# added V1.0.1 (2003-01-25) [umoeller] wpclsQuerySettingsPageSize: override; wpclsSetIconData: override; }; #endif };