Skip to content

Commit

Permalink
-Added license text
Browse files Browse the repository at this point in the history
-support for PHP added
-adding two new functions init() and cleanup() in the plugins
  • Loading branch information
kapilratnani committed Dec 4, 2011
1 parent 83b34bc commit a41fb2c
Show file tree
Hide file tree
Showing 9 changed files with 413 additions and 12 deletions.
3 changes: 1 addition & 2 deletions NppDocIt.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//this file is part of notepad++
//Copyright (C)2003 Don HO <[email protected]>
//Copyright (C)2011 Kapil Ratnani <[email protected]>
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
Expand Down
14 changes: 14 additions & 0 deletions NppDocIt.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nppdocitCPP", "nppdocitplug
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nppdocitJava", "nppdocitplugins\nppdocitJava\nppdocitJava.vcxproj", "{48212FCA-75E8-4DA6-8DE5-CBF46C1644E8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nppdocitPHP", "nppdocitplugins\nppdocitPHP\nppdocitPHP.vcxproj", "{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
ANSI Debug|Win32 = ANSI Debug|Win32
Expand Down Expand Up @@ -86,6 +88,18 @@ Global
{48212FCA-75E8-4DA6-8DE5-CBF46C1644E8}.Unicode Debug|Win32.Build.0 = Debug|Win32
{48212FCA-75E8-4DA6-8DE5-CBF46C1644E8}.Unicode Realeas|Win32.ActiveCfg = Release|Win32
{48212FCA-75E8-4DA6-8DE5-CBF46C1644E8}.Unicode Realeas|Win32.Build.0 = Release|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.ANSI Debug|Win32.ActiveCfg = Debug|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.ANSI Debug|Win32.Build.0 = Debug|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.ANSI Release|Win32.ActiveCfg = Release|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.ANSI Release|Win32.Build.0 = Release|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.Debug|Win32.ActiveCfg = Debug|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.Debug|Win32.Build.0 = Debug|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.Release|Win32.ActiveCfg = Release|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.Release|Win32.Build.0 = Release|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.Unicode Debug|Win32.ActiveCfg = Debug|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.Unicode Debug|Win32.Build.0 = Debug|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.Unicode Realeas|Win32.ActiveCfg = Release|Win32
{360C1FAF-67E3-4D9C-8A9E-D206CB9C7C49}.Unicode Realeas|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
9 changes: 5 additions & 4 deletions PluginDefinition.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//this file is part of notepad++
//Copyright (C)2003 Don HO <[email protected]>
//Copyright (C)2011 Kapil Ratnani <[email protected]>
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -157,6 +156,7 @@ void loadDocitPlugins()
wcscpy(dllFilePath,nppDir);
wcscat(dllFilePath,TEXT("\\plugins\\nppdocitplugins\\"));
wcscat(dllFilePath,ffd.cFileName);

hinstLib=LoadLibrary(dllFilePath);
if(hinstLib!=NULL)
{
Expand Down Expand Up @@ -190,6 +190,7 @@ nppDocItPlugin* getCurrentPlugin()
//----------------------------------------------//
void insert_doc_string()
{
//load when required
if(docitPluginsLoaded==FALSE)
loadDocitPlugins();

Expand Down Expand Up @@ -217,7 +218,7 @@ void insert_doc_string()
::SendMessage(curScintilla,SCI_SETTARGETEND,curPos+200,0);
::SendMessage(curScintilla,SCI_SETSEARCHFLAGS,SCFIND_REGEXP,0);
int pos=::SendMessage(curScintilla,SCI_SEARCHINTARGET,4,(LPARAM)(plugin->get_terminating_character)());
//This gives me the occurance of the terminating character, need to fetch the string up to
//This gives me the occurence of the terminating character, need to fetch the string up to
//this location
Sci_TextRange tr;
tr.chrg.cpMin=curPos;
Expand All @@ -242,7 +243,7 @@ void insert_doc_string()
}


//TODO: think of a proper abstraction to define termination condition for a function of each language
//TODO: think of a proper method to define termination condition for a function of each language
//TODO: Reorganise the whole code

}
Expand Down
8 changes: 2 additions & 6 deletions nppdocitplugins/dlltest/dlltest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void testPlugin(LPCWSTR pluginFile)
{
fRunTimeLinkSuccess = TRUE;
char *temp=NULL;
(ProcGenDocString)("void temp(int a,int b)",5,&temp);
(ProcGenDocString)("function morsetrans($temp)",0,&temp);
printf("%s",temp);
printf("%s",(ProcTermChar)());
printf("%d",(ProcLangType)());
Expand All @@ -58,16 +58,12 @@ void testPlugin(LPCWSTR pluginFile)
}
}

struct test
{
int d;
};

int main( void )
{
WIN32_FIND_DATA ffd;
HANDLE hFind=INVALID_HANDLE_VALUE;
hFind=FindFirstFile(TEXT(".\\*.dll"),&ffd);
hFind=FindFirstFile(TEXT(".\\nppdocitPHP.dll"),&ffd);
if(hFind!=INVALID_HANDLE_VALUE)
{

Expand Down
28 changes: 28 additions & 0 deletions nppdocitplugins/nppdocitC/nppdocitC.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
//Copyright (C)2011 Kapil Ratnani <[email protected]>
//
//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., 675 Mass Ave, Cambridge, MA 02139, USA.

#define PCRE_STATIC
#include"include\pcre.h"
#define OVECCOUNT 60
Expand Down Expand Up @@ -25,6 +41,18 @@ std::string get_spaces(int sp_count)

extern "C"
{
__declspec(dllexport) void init()
{
//TODO: write some code here :P
//compile regex or do any other initialization
}

__declspec(dllexport) void cleanup()
{
//TODO: write some code here :P
//free memory
}

__declspec(dllexport) void gen_doc_string(char *func_string,int indentation,char** out)
{
pcre *re;
Expand Down
28 changes: 28 additions & 0 deletions nppdocitplugins/nppdocitCPP/nppdocitCPP.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
//Copyright (C)2011 Kapil Ratnani <[email protected]>
//
//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., 675 Mass Ave, Cambridge, MA 02139, USA.

#define PCRE_STATIC
#include"include\pcre.h"
#define OVECCOUNT 60
Expand Down Expand Up @@ -56,6 +72,18 @@ void removeCRLF(std::string *str)

extern "C"
{
__declspec(dllexport) void init()
{
//TODO: write some code here :P
//compile regex or do any other initialization
}

__declspec(dllexport) void cleanup()
{
//TODO: write some code here :P
//free memory
}

__declspec(dllexport) void gen_doc_string(char *func_string,int indentation,char** out)
{
pcre *re;
Expand Down
28 changes: 28 additions & 0 deletions nppdocitplugins/nppdocitJava/nppdocitJava.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
//Copyright (C)2011 Kapil Ratnani <[email protected]>
//
//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., 675 Mass Ave, Cambridge, MA 02139, USA.

#define PCRE_STATIC
#include"include\pcre.h"
#define OVECCOUNT 60
Expand Down Expand Up @@ -45,6 +61,18 @@ void trim(std::string *str)

extern "C"
{
__declspec(dllexport) void init()
{
//TODO: write some code here :P
//compile regex or do any other initialization
}

__declspec(dllexport) void cleanup()
{
//TODO: write some code here :P
//free memory
}

__declspec(dllexport) void gen_doc_string(char *func_string,int indentation,char** out)
{
pcre *re;
Expand Down
Loading

0 comments on commit a41fb2c

Please sign in to comment.