Last active
August 29, 2015 13:59
-
-
Save b4n/10555799 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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) | |
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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