Skip to content

Instantly share code, notes, and snippets.

@b4n
Last active August 29, 2015 13:59
Show Gist options
  • Save b4n/10555799 to your computer and use it in GitHub Desktop.
Save b4n/10555799 to your computer and use it in GitHub Desktop.
PLUGIN := cc-plugin
PLUGIN_SOURCES := plugin.cc plugin.c
plugindir = $(HOME)/.config/geany/plugins
VPATH ?= .
# requires https://github.com/b4n/geany-plugin.mk
include $(VPATH)/geany-plugin.mk
/*
* Copyright 2014 Colomban Wendling <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <geanyplugin.h>
#include "plugin.h"
GeanyPlugin *geany_plugin;
GeanyData *geany_data;
GeanyFunctions *geany_functions;
PLUGIN_VERSION_CHECK (GEANY_API_VERSION)
PLUGIN_SET_INFO (_("C++ Plugin"),
_("Test for C++ plugin with geany-plugin.mk."),
"0.1",
"Colomban Wendling <[email protected]>")
void
plugin_init (GeanyData *data)
{
plugin_main ();
}
void
plugin_cleanup (void)
{
}
/*
* Copyright 2014 Colomban Wendling <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <iostream>
#include "plugin.h"
class P
{
public:
P()
{
std::string str("hello");
str += " world";
std::cout << str << std::endl;
}
~P()
{
std::cout << "bye!" << std::endl;
}
};
extern "C" {
void
plugin_main ()
{
std::cout << "hi!" << std::endl;
P p;
}
}
/*
* Copyright 2014 Colomban Wendling <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifdef __cplusplus
extern "C" {
#endif
void plugin_main ();
#ifdef __cplusplus
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment