summaryrefslogtreecommitdiff
path: root/plugins/Folders/src/folders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Folders/src/folders.cpp')
-rw-r--r--plugins/Folders/src/folders.cpp160
1 files changed, 6 insertions, 154 deletions
diff --git a/plugins/Folders/src/folders.cpp b/plugins/Folders/src/folders.cpp
index 721c43ee5f..3dfa8e4b89 100644
--- a/plugins/Folders/src/folders.cpp
+++ b/plugins/Folders/src/folders.cpp
@@ -33,8 +33,6 @@ int hLangpack;
CFoldersList &lstRegisteredFolders = CFoldersList(10); //the list
-
-
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
__PLUGIN_DISPLAY_NAME,
@@ -45,117 +43,9 @@ PLUGININFOEX pluginInfo = {
__COPYRIGHT,
__AUTHORWEB,
UNICODE_AWARE,
- {0x2f129563, 0x2c7d, 0x4a9a, {0xb9, 0x48, 0x97, 0xdf, 0xcc, 0x0a, 0xfd, 0xd7}} //{2f129563-2c7d-4a9a-b948-97dfcc0afdd7}
-}; //not used
-
-#ifdef _DEBUG
-
-typedef struct{
- int cbSize; //size of struct
- int nUniqueID; //unique id for this path. This ID should be unique for your plugin.
- char szName[FOLDERS_NAME_MAX_SIZE]; //name to show in options
-} FOLDERSDATA_OLD;
-
-INT_PTR TestPlugin(WPARAM wParam, LPARAM lParam)
-{
- char temp[MAX_PATH];
- const int MAX = 20;
- int i;
- HANDLE handles[MAX][2];
-/* FOLDERSDATA caca;
- caca.cbSize = sizeof(caca);
- caca.szFormat = FOLDER_LOGS;*/
- char *section;
- for (i = 0; i < MAX; i++)
- {
- switch (i % 4)
- {
- case 0:
- section = "Section 1";
- break;
- case 1:
- section = "Section 2";
- break;
- case 2:
- section = "Yet another section";
- break;
- case 3:
- section = "Section no 4";
- break;
- default:
- section = "Uhh ohh";
- break;
- }
- //strcpy(caca.szSection, section);
- _itoa(i, temp, 10);
- //strcpy(caca.szName, temp);
-
- handles[i][0] = FoldersRegisterCustomPathT(section, temp, FOLDER_LOGS); //CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &caca);
- }
- //caca.szFormatW = L"%profile_path%\\%current_profile%\\Ø";
- //caca.flags = FF_UNICODE;
- FoldersRegisterCustomPath("Unicode stuff", "non unicode", " %profile_path%\\%current_profile%\\Ø\\\\\\");
- for (i = 0; i < MAX; i++)
- {
- //strcpy(caca.szSection, "Unicode stuff");
- sprintf(temp, "Value %d", i);
- //strcpy(caca.szName, temp);
- handles[i][1] = FoldersRegisterCustomPathW("Unicode stuff", temp, L"%profile_path%\\%current_profile%\\\u1FA6"); //CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &caca);
- }
-/*
- FOLDERSAPPENDDATA data;
- data.hRegisteredPath = handles[0];
- data.szAppendData = "just an appended string";
- char *cacat;
- CallService(MS_FOLDERS_GET_PATH_ALLOC_APPEND, (WPARAM) &data, (LPARAM) &cacat);
- Log("Append function returned : %s", cacat); */
- /*FOLDERSGETDATA data = {0};
- data.cbSize = sizeof(data);
- data.nMaxPathSize = sizeof(temp);
- data.szPath = temp; */
- for (i = 0; i < MAX; i++)
- {
- //CallService(MS_FOLDERS_GET_PATH, handles[i][0], (LPARAM) &data);
- FoldersGetCustomPath((HANDLE) handles[i][0], temp, sizeof(temp), "<not found>");
- Log("Path function[%d] returned : %s", i, temp);
- }
- wchar_t buffer[MAX_PATH];
- //data.szPathW = buffer;
- for (i = 0; i < MAX; i++)
- {
- //CallService(MS_FOLDERS_GET_PATH, handles[i][0], (LPARAM) &data);
- FoldersGetCustomPathW((HANDLE) handles[i][1], buffer, MAX_PATH, L"<not found>");
- Log("Unicode path function[%d] returned: %S", i, buffer);
- }
-// GetPathService(CONFIGURATION_PATH, (LPARAM) temp);
-// GetPathAllocService(AVATARS_PATH, (LPARAM) &caca);
-
-
- for (i = 0; i < MAX; i++)
- {
- FoldersGetCustomPathEx((HANDLE) handles[i][0], temp, sizeof(temp), "<not found>", "test");
- Log("Path function Ex (test) [%d] returned : %s", i, temp);
- FoldersGetCustomPathEx((HANDLE) handles[i][0], temp, sizeof(temp), "<not found>", "");
- Log("Path function Ex () [%d] returned : %s", i, temp);
- FoldersGetCustomPathEx((HANDLE) handles[i][0], temp, sizeof(temp), "<not found>", NULL);
- Log("Path function Ex (NULL) [%d] returned : %s", i, temp);
- }
-
- for (i = 0; i < MAX; i++)
- {
- FoldersGetCustomPathExW((HANDLE) handles[i][1], buffer, MAX_PATH, L"<not found>", L"test");
- Log("Unicode path function Ex (test) [%d] returned : %S", i, buffer);
- FoldersGetCustomPathExW((HANDLE) handles[i][1], buffer, MAX_PATH, L"<not found>", L"");
- Log("Unicode path function Ex () [%d] returned : %S", i, buffer);
- FoldersGetCustomPathExW((HANDLE) handles[i][1], buffer, MAX_PATH, L"<not found>", NULL);
- Log("Unicode path function Ex (NULL) [%d] returned : %S", i, buffer);
- }
-
- return 0;
-}
-
-HANDLE hTestPlugin;
-#endif
+ {0x2f129563, 0x2c7d, 0x4a9a, {0xb9, 0x48, 0x97, 0xdf, 0xcc, 0x0a, 0xfd, 0xd7}}
+ //{2f129563-2c7d-4a9a-b948-97dfcc0afdd7}
+};
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
{
@@ -166,57 +56,20 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_FOLDERS
extern "C" int __declspec(dllexport) Load(void)
{
-#if _MSC_VER >= 1300
- Log("%s", "Entering function " __FUNCTION__);
-#endif
-
mir_getLP(&pluginInfo);
- Log("%s", "Creating service functions ...");
InitServices();
InitEvents();
-
-#ifdef _DEBUG
- hTestPlugin = CreateServiceFunction(MS_FOLDERS_TEST_PLUGIN, TestPlugin);
- CLISTMENUITEM mi = {0};
-
- mi.cbSize=sizeof(mi);
- mi.position=300050000;
- mi.flags=0;
- mi.hIcon=0;
- mi.pszName=Translate("Test folders");
- mi.pszService=MS_FOLDERS_TEST_PLUGIN;
- Menu_AddMainMenuItem(&mi);
-#endif
-#if _MSC_VER >= 1300
- Log("%s", "Hooking events ...");
-#endif
HookEvents();
-#if _MSC_VER >= 1300
- Log("%s", "Leaving function " __FUNCTION__);
-#endif
return 0;
}
extern "C" int __declspec(dllexport) Unload()
{
-#if _MSC_VER >= 1300
- Log("%s", "Entering function " __FUNCTION__);
- Log("%s", "Unhooking events ...");
-
- Log("%s", "Destroying service functions ...");
-#endif
// DestroyServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY);
DestroyServices();
DestroyEvents();
UnhookEvents();
-#ifdef _DEBUG
- DestroyServiceFunction(hTestPlugin);
-#endif
-
-#if _MSC_VER >= 1300
- Log("%s", "Leaving function " __FUNCTION__);
-#endif
return 0;
}
@@ -224,8 +77,7 @@ bool WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
{
hInstance = hinstDLL;
if (fdwReason == DLL_PROCESS_ATTACH)
- {
- DisableThreadLibraryCalls(hinstDLL);
- }
+ DisableThreadLibraryCalls(hinstDLL);
+
return TRUE;
-} \ No newline at end of file
+}