From ce902a39266619a24af32844816436ca08ef45ac Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Wed, 17 Aug 2011 15:11:25 +0200 Subject: skeleton for gtkpref launcher plugin --- plugins/gtkpref/gtkpref.c | 63 ++++++++++++++++++++++++++++++++++++++++++++ plugins/gtkpref/makefile.mak | 18 +++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 plugins/gtkpref/gtkpref.c create mode 100644 plugins/gtkpref/makefile.mak (limited to 'plugins/gtkpref') diff --git a/plugins/gtkpref/gtkpref.c b/plugins/gtkpref/gtkpref.c new file mode 100644 index 00000000..6bd20102 --- /dev/null +++ b/plugins/gtkpref/gtkpref.c @@ -0,0 +1,63 @@ +/* XChat-WDK + * Copyright (c) 2011 Berke Viktor. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#include "xchat-plugin.h" + +static xchat_plugin *ph; /* plugin handle */ + +static void +launch_tool () +{ + +} + +int +xchat_plugin_init (xchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg) +{ + ph = plugin_handle; + + *plugin_name = "GTKPref"; + *plugin_desc = "GTK+ Preference Tool Launcher"; + *plugin_version = "1.0"; + + xchat_hook_command (ph, "GTKPREF", XCHAT_PRI_NORM, launch_tool, 0, 0); + xchat_command (ph, "MENU -ietc\\gtkpref.png ADD \"Settings/GTK+ Preferences\" \"GTKPREF\""); + + xchat_print (ph, "GTKPref plugin loaded\n"); + + return 1; /* return 1 for success */ +} + +int +xchat_plugin_deinit (void) +{ + xchat_command (ph, "MENU DEL \"Settings/GTK+ Preferences\""); + xchat_print (ph, "GTKPref plugin unloaded\n"); + return 1; +} diff --git a/plugins/gtkpref/makefile.mak b/plugins/gtkpref/makefile.mak new file mode 100644 index 00000000..e2292365 --- /dev/null +++ b/plugins/gtkpref/makefile.mak @@ -0,0 +1,18 @@ +include "..\..\src\makeinc.mak" + +all: gtkpref.obj gtkpref.def + link $(LDFLAGS) $(LIBS) /dll /out:xcgtkpref.dll /def:gtkpref.def gtkpref.obj + +gtkpref.def: + echo EXPORTS > gtkpref.def + echo xchat_plugin_init >> gtkpref.def + echo xchat_plugin_deinit >> gtkpref.def + +gtkpref.obj: gtkpref.c makefile.mak + cl $(CFLAGS) $(GLIB) /I.. gtkpref.c + +clean: + del *.obj + del *.dll + del *.exp + del *.lib -- cgit 1.4.1 From 5472a813fa62370926ace45d7506f098368428eb Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Wed, 17 Aug 2011 15:22:40 +0200 Subject: working gtkpref plugin --- plugins/gtkpref/gtkpref.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'plugins/gtkpref') diff --git a/plugins/gtkpref/gtkpref.c b/plugins/gtkpref/gtkpref.c index 6bd20102..18a6d958 100644 --- a/plugins/gtkpref/gtkpref.c +++ b/plugins/gtkpref/gtkpref.c @@ -25,7 +25,6 @@ */ #include -#include #include "xchat-plugin.h" @@ -34,7 +33,20 @@ static xchat_plugin *ph; /* plugin handle */ static void launch_tool () { + STARTUPINFO si; + PROCESS_INFORMATION pi; + ZeroMemory (&si, sizeof (si)); + si.cb = sizeof (si); + ZeroMemory (&pi, sizeof (pi)); + + if (!CreateProcess ( NULL, "gtk2-prefs.exe", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + { + xchat_print (ph, "Error launching the GTK+ Preference Tool! Maybe the executable is missing?"); + } + + CloseHandle (pi.hProcess); + CloseHandle (pi.hThread); } int -- cgit 1.4.1 From 49e739b511003117cc53f55447d74e95bd913ea9 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Thu, 18 Aug 2011 02:17:41 +0200 Subject: omit gtkpref messages --- plugins/gtkpref/gtkpref.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'plugins/gtkpref') diff --git a/plugins/gtkpref/gtkpref.c b/plugins/gtkpref/gtkpref.c index 18a6d958..3816abcc 100644 --- a/plugins/gtkpref/gtkpref.c +++ b/plugins/gtkpref/gtkpref.c @@ -61,8 +61,6 @@ xchat_plugin_init (xchat_plugin *plugin_handle, char **plugin_name, char **plugi xchat_hook_command (ph, "GTKPREF", XCHAT_PRI_NORM, launch_tool, 0, 0); xchat_command (ph, "MENU -ietc\\gtkpref.png ADD \"Settings/GTK+ Preferences\" \"GTKPREF\""); - xchat_print (ph, "GTKPref plugin loaded\n"); - return 1; /* return 1 for success */ } @@ -70,6 +68,6 @@ int xchat_plugin_deinit (void) { xchat_command (ph, "MENU DEL \"Settings/GTK+ Preferences\""); - xchat_print (ph, "GTKPref plugin unloaded\n"); + return 1; } -- cgit 1.4.1 From 7c0baeffbc302ff0851790b7bc7f87e033368d07 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Tue, 29 Nov 2011 02:04:08 +0100 Subject: relicense own plugins under the MIT license --- plugins/checksum/checksum.c | 37 ++++++++++++++++--------------------- plugins/exec/exec.c | 36 ++++++++++++++++-------------------- plugins/gtkpref/gtkpref.c | 36 ++++++++++++++++-------------------- plugins/upd/upd.c | 36 ++++++++++++++++-------------------- 4 files changed, 64 insertions(+), 81 deletions(-) (limited to 'plugins/gtkpref') diff --git a/plugins/checksum/checksum.c b/plugins/checksum/checksum.c index 2b5f801a..12fc0d93 100644 --- a/plugins/checksum/checksum.c +++ b/plugins/checksum/checksum.c @@ -1,29 +1,23 @@ /* XChat-WDK * Copyright (c) 2010-2011 Berke Viktor. * - * Use of OpenSSL SHA256 interface: http://adamlamers.com/?p=5 + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. */ #include @@ -50,6 +44,7 @@ static xchat_plugin *ph; /* plugin handle */ static int config_fail; /* variable for config availability */ +/* Use of OpenSSL SHA256 interface: http://adamlamers.com/?p=5 */ static void sha256_hash_string (unsigned char hash[SHA256_DIGEST_LENGTH], char outputBuffer[65]) { diff --git a/plugins/exec/exec.c b/plugins/exec/exec.c index 9571faad..b043ae83 100644 --- a/plugins/exec/exec.c +++ b/plugins/exec/exec.c @@ -1,27 +1,23 @@ /* XChat-WDK * Copyright (c) 2011 Berke Viktor. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. */ #include diff --git a/plugins/gtkpref/gtkpref.c b/plugins/gtkpref/gtkpref.c index 3816abcc..5cc754bf 100644 --- a/plugins/gtkpref/gtkpref.c +++ b/plugins/gtkpref/gtkpref.c @@ -1,27 +1,23 @@ /* XChat-WDK * Copyright (c) 2011 Berke Viktor. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. */ #include diff --git a/plugins/upd/upd.c b/plugins/upd/upd.c index a6ece301..3eec06dc 100644 --- a/plugins/upd/upd.c +++ b/plugins/upd/upd.c @@ -1,27 +1,23 @@ /* XChat-WDK * Copyright (c) 2010-2011 Berke Viktor. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. */ #include -- cgit 1.4.1