------------------------------------------------------------ revno: 2 committer: poy <p...@123gen.com> branch nick: ExamplePlugin timestamp: Thu 2012-11-15 20:04:18 +0100 message: init from lp:dcplusplus/plugins/Example added: src/ src/Dialog.c src/Dialog.h src/Plugin.c src/Plugin.h src/main.c src/pluginsdk.c src/resource.h src/resource.rc src/stdafx.c src/stdafx.h src/version.h
-- lp:~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin Your team Dcplusplus-team is subscribed to branch lp:~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin. To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin/+edit-subscription
=== added directory 'src' === added file 'src/Dialog.c' --- src/Dialog.c 1970-01-01 00:00:00 +0000 +++ src/Dialog.c 2012-11-15 19:04:18 +0000 @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "stdafx.h" +#include "Dialog.h" + +#ifndef __cplusplus +# include <stdlib.h> +# include <string.h> +#else +# include <cstdlib> +# include <cstring> +#endif + +#include <pluginsdk/Config.h> + +DCUtilsPtr utils = NULL; + +#ifdef _WIN32 + +#include "resource.h" +extern HINSTANCE hInst; + +BOOL onConfigInit(HWND hWnd) { + char* value = get_cfg("SendSuffix"); + size_t len = strlen(value) + 1; + TCHAR* buf = (TCHAR*)memset(malloc(len * sizeof(TCHAR)), 0, len * sizeof(TCHAR)); + + utils->utf8_to_wcs(buf, value, len); + free(value); + value = NULL; + + SetDlgItemText(hWnd, IDC_SUFFIX, buf); + SetWindowText(hWnd, _T(PLUGIN_NAME) _T(" Settings")); + + free(buf); + return TRUE; +} + +BOOL onConfigClose(HWND hWnd, UINT wID) { + if(wID == IDOK) { + int len = GetWindowTextLength(GetDlgItem(hWnd, IDC_SUFFIX)) + 1; + TCHAR* wbuf = (TCHAR*)memset(malloc(len * sizeof(TCHAR)), 0, len * sizeof(TCHAR)); + char* value = (char*)memset(malloc(len), 0, len); + + GetWindowText(GetDlgItem(hWnd, IDC_SUFFIX), wbuf, len); + utils->wcs_to_utf8(value, wbuf, len); + set_cfg("SendSuffix", value); + + free(value); + free(wbuf); + } + + EndDialog(hWnd, wID); + return FALSE; +} + +INT_PTR CALLBACK configProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { + UNREFERENCED_PARAMETER(lParam); + switch(uMsg) { + case WM_INITDIALOG: + return onConfigInit(hWnd); + case WM_COMMAND: { + switch(LOWORD(wParam)) { + case IDOK: + case IDCANCEL: + case IDCLOSE: + return onConfigClose(hWnd, LOWORD(wParam)); + } + } + } + return FALSE; +} + +Bool dialog_create(dcptr_t hWnd, DCCorePtr core) { + utils = (DCUtilsPtr)core->query_interface(DCINTF_DCPP_UTILS, DCINTF_DCPP_UTILS_VER); + if(utils) { + DialogBox(hInst, MAKEINTRESOURCE(IDD_PLUGINDLG), (HWND)hWnd, configProc); + return True; + } + return False; +} + +#else + +Bool dialog_create(dcptr_t hWnd, DCCorePtr core) { return False; } + +#endif === added file 'src/Dialog.h' --- src/Dialog.h 1970-01-01 00:00:00 +0000 +++ src/Dialog.h 2012-11-15 19:04:18 +0000 @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PLUGIN_DIALOG_H +#define PLUGIN_DIALOG_H + +Bool dialog_create(dcptr_t hWnd, DCCorePtr core); + +#endif /* DIALOG_H */ === added file 'src/Plugin.c' --- src/Plugin.c 1970-01-01 00:00:00 +0000 +++ src/Plugin.c 2012-11-15 19:04:18 +0000 @@ -0,0 +1,221 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "stdafx.h" +#include "Plugin.h" + +#include "Dialog.h" + +#ifndef __cplusplus +# include <stdio.h> +# include <stdlib.h> +# include <string.h> +#else +# include <cstdio> +# include <cstdlib> +# include <cstring> +#endif + +#include <pluginsdk/Config.h> + +/* Variables */ +DCCorePtr dcpp; + +DCHooksPtr hooks; +DCLogPtr logging; + +DCHubPtr hub; +DCTaggerPtr tagger; +DCUIPtr ui = NULL; + +/* Hook subscription store */ +#define HOOKS_SUBSCRIBED 4 + +const char* hookGuids[HOOKS_SUBSCRIBED] = { + HOOK_UI_CHAT_COMMAND, + HOOK_HUB_ONLINE, + HOOK_TIMER_SECOND, + HOOK_UI_CHAT_TAGS +}; + +DCHOOK hookFuncs[HOOKS_SUBSCRIBED] = { + &onHubEnter, + &onHubOnline, + &onSecond, + &onChatTags +}; + +subsHandle subs[HOOKS_SUBSCRIBED]; + +Bool onLoad(uint32_t eventId, DCCorePtr core) { + uint32_t i = 0; + dcpp = core; + + hooks = (DCHooksPtr)core->query_interface(DCINTF_HOOKS, DCINTF_HOOKS_VER); + logging = (DCLogPtr)core->query_interface(DCINTF_LOGGING, DCINTF_LOGGING_VER); + + hub = (DCHubPtr)core->query_interface(DCINTF_DCPP_HUBS, DCINTF_DCPP_HUBS_VER); + tagger = (DCTaggerPtr)core->query_interface(DCINTF_DCPP_TAGGER, DCINTF_DCPP_TAGGER_VER); + ui = (DCUIPtr)core->query_interface(DCINTF_DCPP_UI, DCINTF_DCPP_UI_VER); + + if(!hooks || !init_cfg(core) || !logging || !hub || !tagger) + return False; + + if(eventId == ON_INSTALL) { + /* Default settings */ + set_cfg("SendSuffix", "<Plugins Test - " PLUGIN_NAME ">"); + } + + logging->log(PLUGIN_NAME " loaded..."); + + while(i < HOOKS_SUBSCRIBED) { + subs[i] = hooks->bind_hook(hookGuids[i], hookFuncs[i], NULL); + ++i; + } + + return True; +} + +Bool onUnload() { + uint32_t i = 0; + while(i < HOOKS_SUBSCRIBED) { + if(subs[i]) hooks->release_hook(subs[i]); + ++i; + } + return True; +} + +/* Event handlers */ +Bool DCAPI onHubEnter(dcptr_t pObject, dcptr_t pData, dcptr_t opaque, Bool* bBreak) { + HubDataPtr hHub = (HubDataPtr)pObject; + CommandDataPtr cmd = (CommandDataPtr)pData; + + if(stricmp(cmd->command, "help") == 0 && stricmp(cmd->params, "plugins") == 0) { + const char* help = + "\t\t\t Help: " PLUGIN_NAME " \n" + "\t /pluginhelp \t Prints info about the purpose of this plugin\n" + "\t /plugininfo \t Prints info about this plugin\n" + "\t /send <text> \t Chat message test\n"; + + hub->local_message(hHub, help, MSG_SYSTEM); + return True; + } else if(stricmp(cmd->command, "pluginhelp") == 0) { + const char* pluginhelp = + "\t\t\t Plugin help: " PLUGIN_NAME " \n" + "\t This plugin project is intended to both demonstrate the use and test the implementation of the core API\n" + "\t as such the plugin itself does nothing useful but it can be used to verify whether an implementation works\n" + "\t with the API or not, however, it is by no means intended to be a comprehensive testing tool for the API.\n"; + + hub->local_message(hHub, pluginhelp, MSG_SYSTEM); + return True; + } else if(stricmp(cmd->command, "plugininfo") == 0) { + const char* info = + "\t\t\t Plugin info: " PLUGIN_NAME " \n" + "\t Name: \t" PLUGIN_NAME "\n" + "\t Author: \t" PLUGIN_AUTHOR "\n" + "\t Version: \t" STRINGIZE(PLUGIN_VERSION) "\n" + "\t Description: \t" PLUGIN_DESC "\n" + "\t GUID/UUID: \t" PLUGIN_GUID "\n" + "\t Core API Ver: \t" STRINGIZE(DCAPI_CORE_VER) "\n"; + + hub->local_message(hHub, info, MSG_SYSTEM); + return True; + } else if(stricmp(cmd->command, "send") == 0) { + size_t len = strlen(cmd->params); + if(len > 0) { + char* suffix = get_cfg("SendSuffix"); + size_t msgLen = len + strlen(suffix) + 2; + char* text = (char*)memset(malloc(msgLen), 0, msgLen); + + strncat(text, cmd->params, len); + text[len] = ' '; + strncat(text, suffix, msgLen - (len + 2)); + + hub->send_message(hHub, text, (strnicmp(text, "/me ", 4) == 0) ? True : False); + + free(text); + free(suffix); + } else { + hub->local_message(hHub, "You must supply a parameter!", MSG_SYSTEM); + } + return True; + } + return False; +} + +Bool DCAPI onHubOnline(dcptr_t pObject, dcptr_t pData, dcptr_t opaque, Bool* bBreak) { + HubDataPtr hHub = (HubDataPtr)pObject; + + char* buf = (char*)memset(malloc(256), 0, 256); + snprintf(buf, 256, "*** %s connected! (%s)", hHub->url, (hHub->protocol == PROTOCOL_ADC ? "adc" : "nmdc")); + + logging->log(buf); + free(buf); + + return False; +} + +Bool DCAPI onSecond(dcptr_t pObject, dcptr_t pData, dcptr_t opaque, Bool* bBreak) { + static uint64_t prevTick = 0; + uint64_t tick = *(uint64_t*)pData; + + if(tick - prevTick >= 10*1000) { + prevTick = tick; + if(!ui) { + char* buf = (char*)memset(malloc(128), 0, 128); + snprintf(buf, 128, "*** Plugin timer tick (%lld)", tick); + + logging->log(buf); + free(buf); + } else ui->play_sound("Media\\tada.wav"); + } + return False; +} + +Bool DCAPI onChatTags(dcptr_t pObject, dcptr_t pData, dcptr_t opaque, Bool* bBreak) { + static const char* pattern = "ABC DEF"; + TagDataPtr tags = (TagDataPtr)pData; + char* text = strstr(tags->text, pattern); + + while(text != NULL) { + tagger->add_tag(tags, text - tags->text, (text - tags->text) + strlen(pattern), "b", ""); + text = strstr(text + strlen(pattern), pattern); + } + + text = strstr(tags->text, "***"); + if (text != NULL && (text - tags->text) == 0) + tagger->add_tag(tags, 0, strlen(tags->text), "b", ""); + + return False; +} + +/* Plugin main function */ +Bool DCAPI pluginMain(PluginState state, DCCorePtr core, dcptr_t pData) { + switch(state) { + case ON_INSTALL: + case ON_LOAD: + return onLoad(state, core); + case ON_UNINSTALL: + case ON_UNLOAD: + return onUnload(); + case ON_CONFIGURE: + /* Note: core may be NULL for this call */ + return dialog_create(pData, dcpp); + default: return False; + } +} === added file 'src/Plugin.h' --- src/Plugin.h 1970-01-01 00:00:00 +0000 +++ src/Plugin.h 2012-11-15 19:04:18 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PLUGIN_PLUGIN_H +#define PLUGIN_PLUGIN_H + +#ifdef _MSC_VER +# define snprintf _snprintf +# define snwprintf _snwprintf +#elif __GNUC__ +# define stricmp strcasecmp +# define strnicmp strncasecmp +#else +# error No supported compiler found +#endif + +/* Event handlers */ +Bool DCAPI onHubEnter(dcptr_t pObject, dcptr_t pData, dcptr_t opaque, Bool* bBreak); +Bool DCAPI onHubOnline(dcptr_t pObject, dcptr_t pData, dcptr_t opaque, Bool* bBreak); +Bool DCAPI onSecond(dcptr_t pObject, dcptr_t pData, dcptr_t opaque, Bool* bBreak); +Bool DCAPI onChatTags(dcptr_t pObject, dcptr_t pData, dcptr_t opaque, Bool* bBreak); + +/* Plugin main function */ +Bool DCAPI pluginMain(PluginState state, DCCorePtr core, dcptr_t pData); + +#endif /* PLUGIN_H */ === added file 'src/main.c' --- src/main.c 1970-01-01 00:00:00 +0000 +++ src/main.c 2012-11-15 19:04:18 +0000 @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "stdafx.h" +#include "Plugin.h" +#include "version.h" + +const char* dependencies[] = { + /* Plugins with these GUID's must have been loaded *before* this plugin */ + "{aaaaaaaa-1111-bbbb-2222-cccccccccccc}", + "{aaaaaaaa-2222-cccc-3333-dddddddddddd}" +}; + +#ifdef __cplusplus +extern "C" { +#endif + +/* Plugin loader */ +DCEXP DCMAIN DCAPI pluginInit(MetaDataPtr info) { + info->name = PLUGIN_NAME; + info->author = PLUGIN_AUTHOR; + info->description = PLUGIN_DESC; + info->version = PLUGIN_VERSION; + info->web = PLUGIN_WEB; + info->apiVersion = DCAPI_CORE_VER; + info->guid = PLUGIN_GUID; + + /* Plugin dependencies + info->dependencies = dependencies; + info->numDependencies = 2;*/ + + return &pluginMain; +} + +#ifdef _WIN32 +HINSTANCE hInst = NULL; + +BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { + UNREFERENCED_PARAMETER(fdwReason); + UNREFERENCED_PARAMETER(lpvReserved); + hInst = hinstDLL; + return TRUE; +} +#endif + +#ifdef __cplusplus +} +#endif === added file 'src/pluginsdk.c' --- src/pluginsdk.c 1970-01-01 00:00:00 +0000 +++ src/pluginsdk.c 2012-11-15 19:04:18 +0000 @@ -0,0 +1,6 @@ +/* This file compiles the plugin SDK. Normally the relevant files would be included directly in the +project; but it's impractical in the DC++ repository (would need some decent symlink support). */ + +#include "version.h" + +#include <pluginsdk/Config.c> === added file 'src/resource.h' --- src/resource.h 1970-01-01 00:00:00 +0000 +++ src/resource.h 2012-11-15 19:04:18 +0000 @@ -0,0 +1,19 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by SamplePlugin.rc +// +#define VERSION_INFO 1 +#define IDD_PLUGINDLG 101 +#define IDC_SUFFIX 1001 +#define IDC_API_TESTER 1002 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1003 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif === added file 'src/resource.rc' --- src/resource.rc 1970-01-01 00:00:00 +0000 +++ src/resource.rc 2012-11-15 19:04:18 +0000 @@ -0,0 +1,140 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,0 + PRODUCTVERSION 1,0,0,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080004b0" + BEGIN + VALUE "Comments", "http://dcplusplus.sourceforge.net" + VALUE "FileDescription", "Example plugin for DC++" + VALUE "FileVersion", "1, 0, 0, 0" + VALUE "InternalName", "ExamplePlugin" + VALUE "LegalCopyright", "Copyright (C) 2012 Jacek Sieka" + VALUE "OriginalFilename", "ExamplePlugin.dll" + VALUE "ProductName", "Example plugin for DC++" + VALUE "ProductVersion", "1, 0, 0, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x800, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_PLUGINDLG DIALOGEX 0, 0, 244, 75 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Example plugin settings" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,132,54,50,14 + PUSHBUTTON "Cancel",IDCANCEL,187,54,50,14 + GROUPBOX "Settings",IDC_STATIC,7,7,230,45 + EDITTEXT IDC_SUFFIX,93,16,133,14,ES_AUTOHSCROLL + LTEXT "/send command suffix:",IDC_STATIC,17,19,74,8 + CTEXT "This is an example of plugin implanted configuration dialog.",IDC_STATIC,14,37,216,13 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_PLUGINDLG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 237 + TOPMARGIN, 7 + BOTTOMMARGIN, 68 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + === added file 'src/stdafx.c' --- src/stdafx.c 1970-01-01 00:00:00 +0000 +++ src/stdafx.c 2012-11-15 19:04:18 +0000 @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "stdafx.h" === added file 'src/stdafx.h' --- src/stdafx.h 1970-01-01 00:00:00 +0000 +++ src/stdafx.h 2012-11-15 19:04:18 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PLUGIN_STDAFX_H +#define PLUGIN_STDAFX_H + +#ifdef _WIN32 + +#include <windows.h> +#include <tchar.h> + +#else + +#include <unistd.h> + +#endif + +/* This can make a #define value to string (from boost) */ +#define STRINGIZE(X) DO_STRINGIZE(X) +#define DO_STRINGIZE(X) #X + +#include <pluginsdk/PluginDefs.h> + +#include "version.h" + +#endif /* PLUGIN_STDAFX_H */ === added file 'src/version.h' --- src/version.h 1970-01-01 00:00:00 +0000 +++ src/version.h 2012-11-15 19:04:18 +0000 @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2012 Jacek Sieka, arnetheduck on gmail point com + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* Information about the plugin - fill this out! Don't forget to edit the resource file as well. */ + +#ifndef PLUGIN_VERSION_H +#define PLUGIN_VERSION_H + +/* UUID/GUID for this plugin project */ +#define PLUGIN_GUID "{5fa64766-ab6e-4d79-8439-dad40fda9738}" + +/* Name of the plugin */ +#define PLUGIN_NAME "Example plugin" + +/* Author of the plugin */ +#define PLUGIN_AUTHOR "DC++" + +/* Short description of the plugin */ +#define PLUGIN_DESC "Example project" + +/* Version of the plugin (note: not API version) */ +#define PLUGIN_VERSION 1.0 + +/* Plugin website, set to "N/A" if none */ +#define PLUGIN_WEB "http://dcplusplus.sourceforge.net/" + +#endif /* VERSION_H */
_______________________________________________ Mailing list: https://launchpad.net/~linuxdcpp-team Post to : linuxdcpp-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~linuxdcpp-team More help : https://help.launchpad.net/ListHelp