/usr/share/codelite/templates/gizmos/plugin.cpp.wizard is in codelite-plugins 2.8.0.4537~dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | #include "$(BaseFileName).h"
#include <wx/xrc/xmlres.h>
static $(PluginName)* thePlugin = NULL;
//Define the plugin entry point
extern "C" EXPORT IPlugin *CreatePlugin(IManager *manager)
{
if (thePlugin == 0) {
thePlugin = new $(PluginName)(manager);
}
return thePlugin;
}
extern "C" EXPORT PluginInfo GetPluginInfo()
{
PluginInfo info;
info.SetAuthor(wxT("$(UserName)"));
info.SetName(wxT("$(PluginShortName)"));
info.SetDescription(wxT("$(PluginLongName)"));
info.SetVersion(wxT("v1.0"));
return info;
}
extern "C" EXPORT int GetPluginInterfaceVersion()
{
return PLUGIN_INTERFACE_VERSION;
}
$(PluginName)::$(PluginName)(IManager *manager)
: IPlugin(manager)
{
m_longName = wxT("$(PluginLongName)");
m_shortName = wxT("$(PluginShortName)");
}
$(PluginName)::~$(PluginName)()
{
}
clToolBar *$(PluginName)::CreateToolBar(wxWindow *parent)
{
// Create the toolbar to be used by the plugin
clToolBar *tb(NULL);
/*
// You can use the below code a snippet:
// First, check that CodeLite allows plugin to register plugins
if (m_mgr->AllowToolbar()) {
// Support both toolbars icon size
int size = m_mgr->GetToolbarIconSize();
// Allocate new toolbar, which will be freed later by CodeLite
tb = new clToolBar(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, clTB_DEFAULT_STYLE);
// Set the toolbar size
tb->SetToolBitmapSize(wxSize(size, size));
// Add tools to the plugins toolbar. You must provide 2 sets of icons: 24x24 and 16x16
if (size == 24) {
tb->AddTool(XRCID("new_plugin"), wxT("New CodeLite Plugin Project"), wxXmlResource::Get()->LoadBitmap(wxT("plugin24")), wxT("New Plugin Wizard..."));
tb->AddTool(XRCID("new_class"), wxT("Create New Class"), wxXmlResource::Get()->LoadBitmap(wxT("class24")), wxT("New Class..."));
tb->AddTool(XRCID("new_wx_project"), wxT("New wxWidget Project"), wxXmlResource::Get()->LoadBitmap(wxT("new_wx_project24")), wxT("New wxWidget Project"));
} else {
tb->AddTool(XRCID("new_plugin"), wxT("New CodeLite Plugin Project"), wxXmlResource::Get()->LoadBitmap(wxT("plugin16")), wxT("New Plugin Wizard..."));
tb->AddTool(XRCID("new_class"), wxT("Create New Class"), wxXmlResource::Get()->LoadBitmap(wxT("class16")), wxT("New Class..."));
tb->AddTool(XRCID("new_wx_project"), wxT("New wxWidget Project"), wxXmlResource::Get()->LoadBitmap(wxT("new_wx_project16")), wxT("New wxWidget Project"));
}
// And finally, we must call 'Realize()'
tb->Realize();
}
// return the toolbar, it can be NULL if CodeLite does not allow plugins to register toolbars
// or in case the plugin simply does not require toolbar
*/
return tb;
}
void $(PluginName)::CreatePluginMenu(wxMenu *pluginsMenu)
{
/*
// You can use the below code a snippet:
wxMenu *menu = new wxMenu();
wxMenuItem *item(NULL);
item = new wxMenuItem(menu, XRCID("new_plugin"), _("New CodeLite Plugin Wizard..."), wxEmptyString, wxITEM_NORMAL);
menu->Append(item);
item = new wxMenuItem(menu, XRCID("new_class"), _("New Class Wizard..."), wxEmptyString, wxITEM_NORMAL);
menu->Append(item);
item = new wxMenuItem(menu, XRCID("new_wx_project"), _("New wxWidgets Project Wizard..."), wxEmptyString, wxITEM_NORMAL);
menu->Append(item);
pluginsMenu->Append(wxID_ANY, _("Gizmos"), menu);
*/
}
void $(PluginName)::HookPopupMenu(wxMenu *menu, MenuType type)
{
if (type == MenuTypeEditor) {
//TODO::Append items for the editor context menu
} else if (type == MenuTypeFileExplorer) {
//TODO::Append items for the file explorer context menu
} else if (type == MenuTypeFileView_Workspace) {
//TODO::Append items for the file view / workspace context menu
} else if (type == MenuTypeFileView_Project) {
//TODO::Append items for the file view/Project context menu
} else if (type == MenuTypeFileView_Folder) {
//TODO::Append items for the file view/Virtual folder context menu
} else if (type == MenuTypeFileView_File) {
//TODO::Append items for the file view/file context menu
}
}
void $(PluginName)::UnHookPopupMenu(wxMenu *menu, MenuType type)
{
if (type == MenuTypeEditor) {
//TODO::Unhook items for the editor context menu
} else if (type == MenuTypeFileExplorer) {
//TODO::Unhook items for the file explorer context menu
} else if (type == MenuTypeFileView_Workspace) {
//TODO::Unhook items for the file view / workspace context menu
} else if (type == MenuTypeFileView_Project) {
//TODO::Unhook items for the file view/Project context menu
} else if (type == MenuTypeFileView_Folder) {
//TODO::Unhook items for the file view/Virtual folder context menu
} else if (type == MenuTypeFileView_File) {
//TODO::Unhook items for the file view/file context menu
}
}
void $(PluginName)::UnPlug()
{
//TODO:: perform the unplug action for this plugin
}
|