Make plugins working and compiling on Windows.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1758 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
b0322faa93
commit
03b61bbbc9
@ -11,6 +11,8 @@
|
|||||||
Use PACKAGE_LIB_DIR.
|
Use PACKAGE_LIB_DIR.
|
||||||
Load plugins in ~/.geany/plugins/ prior to the default location.
|
Load plugins in ~/.geany/plugins/ prior to the default location.
|
||||||
* src/symbols.c: Hide empty symbol types in the symbol list.
|
* src/symbols.c: Hide empty symbol types in the symbol list.
|
||||||
|
* makefile.win32, win32-config.h, plugins/makefile.win32,
|
||||||
|
src/plugins.c: Make plugins working and compiling on Windows.
|
||||||
|
|
||||||
|
|
||||||
2007-07-27 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
2007-07-27 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||||
|
@ -23,6 +23,7 @@ RM = del
|
|||||||
all: check-tools config.h
|
all: check-tools config.h
|
||||||
cd tagmanager && make -f makefile.win32 && cd ..
|
cd tagmanager && make -f makefile.win32 && cd ..
|
||||||
cd scintilla && make -f makefile.win32 && cd ..
|
cd scintilla && make -f makefile.win32 && cd ..
|
||||||
|
cd plugins && make -f makefile.win32 && cd ..
|
||||||
cd src && make -f makefile.win32 && cd ..
|
cd src && make -f makefile.win32 && cd ..
|
||||||
|
|
||||||
# first check the required tools are installed
|
# first check the required tools are installed
|
||||||
@ -35,7 +36,7 @@ config.h: win32-config.h
|
|||||||
$(CP) $< $@
|
$(CP) $< $@
|
||||||
|
|
||||||
deps:
|
deps:
|
||||||
-$(RM) tagmanager\deps.mak scintilla\deps.mak src\deps.mak
|
-$(RM) tagmanager\deps.mak scintilla\deps.mak plugins\deps.mak src\deps.mak
|
||||||
|
|
||||||
# used by src/makefile.win32 to avoid del ../file which is an error
|
# used by src/makefile.win32 to avoid del ../file which is an error
|
||||||
clean-local:
|
clean-local:
|
||||||
@ -44,4 +45,5 @@ clean-local:
|
|||||||
clean: deps
|
clean: deps
|
||||||
cd tagmanager && make -f makefile.win32 clean && cd ..
|
cd tagmanager && make -f makefile.win32 clean && cd ..
|
||||||
cd scintilla && make -f makefile.win32 clean && cd ..
|
cd scintilla && make -f makefile.win32 clean && cd ..
|
||||||
|
cd plugins && make -f makefile.win32 clean && cd ..
|
||||||
cd src && make -f makefile.win32 clean && cd ..
|
cd src && make -f makefile.win32 clean && cd ..
|
||||||
|
58
plugins/makefile.win32
Normal file
58
plugins/makefile.win32
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
# Adapted from Pidgin's plugins/Makefile.am, thanks
|
||||||
|
|
||||||
|
CC = gcc
|
||||||
|
CXX = g++
|
||||||
|
PREFIX = C:\libs
|
||||||
|
RM = del
|
||||||
|
-include ../localwin32.mk
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .c .dll
|
||||||
|
|
||||||
|
GTK_INCLUDES= \
|
||||||
|
-I$(PREFIX)/include/gtk-2.0 \
|
||||||
|
-I$(PREFIX)/lib/gtk-2.0/include \
|
||||||
|
-I$(PREFIX)/include/atk-1.0 \
|
||||||
|
-I$(PREFIX)/include/pango-1.0 \
|
||||||
|
-I$(PREFIX)/include/cairo \
|
||||||
|
-I$(PREFIX)/include/glib-2.0 \
|
||||||
|
-I$(PREFIX)/lib/glib-2.0/include \
|
||||||
|
-I$(PREFIX)/include/gettext \
|
||||||
|
-I$(PREFIX)/include
|
||||||
|
|
||||||
|
INCLUDEDIRS= -I.. \
|
||||||
|
-I../src \
|
||||||
|
-I../scintilla/include \
|
||||||
|
-I../tagmanager/include \
|
||||||
|
$(GTK_INCLUDES)
|
||||||
|
|
||||||
|
ALL_GTK_LIBS= \
|
||||||
|
-L"$(PREFIX)/lib" \
|
||||||
|
-lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 \
|
||||||
|
-lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv
|
||||||
|
|
||||||
|
CCFLAGS=-Wall -O2 -mms-bitfields
|
||||||
|
|
||||||
|
.PHONY: all clean plugins
|
||||||
|
|
||||||
|
all: plugins
|
||||||
|
|
||||||
|
.c.dll:
|
||||||
|
$(CC) $(CCFLAGS) $(DEFINES) $(INCLUDEDIRS) -o $@.o -c $<
|
||||||
|
$(CC) -shared $@.o $(ALL_GTK_LIBS) $(DLL_LD_FLAGS) -o $@
|
||||||
|
|
||||||
|
plugins: \
|
||||||
|
htmlchars.dll \
|
||||||
|
demoplugin.dll \
|
||||||
|
classbuilder.dll
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-$(RM) deps.mak *.o *.dll
|
||||||
|
|
||||||
|
deps.mak:
|
||||||
|
$(CC) -MM $(CCFLAGS) $(DEFINES) $(INCLUDEDIRS) *.c >deps.mak
|
||||||
|
|
||||||
|
# Generate header dependencies with "make deps.mak"
|
||||||
|
include deps.mak
|
||||||
|
|
||||||
|
..\localwin32.mk:
|
||||||
|
echo # Set local variables here >$@
|
@ -652,6 +652,7 @@ gboolean dialogs_show_unsaved_file(gint idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef G_OS_WIN32
|
||||||
static void
|
static void
|
||||||
on_font_apply_button_clicked (GtkButton *button,
|
on_font_apply_button_clicked (GtkButton *button,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
@ -681,6 +682,7 @@ on_font_cancel_button_clicked (GtkButton *button,
|
|||||||
{
|
{
|
||||||
gtk_widget_hide(app->open_fontsel);
|
gtk_widget_hide(app->open_fontsel);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* This shows the font selection dialog to choose a font. */
|
/* This shows the font selection dialog to choose a font. */
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#ifdef HAVE_PLUGINS
|
#ifdef HAVE_PLUGINS
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "plugins.h"
|
#include "plugins.h"
|
||||||
#include "plugindata.h"
|
#include "plugindata.h"
|
||||||
#include "support.h"
|
#include "support.h"
|
||||||
@ -37,6 +39,12 @@
|
|||||||
#include "sciwrappers.h"
|
#include "sciwrappers.h"
|
||||||
#include "ui_utils.h"
|
#include "ui_utils.h"
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
# define PLUGIN_EXT "dll"
|
||||||
|
#else
|
||||||
|
# define PLUGIN_EXT "so"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef struct Plugin
|
typedef struct Plugin
|
||||||
{
|
{
|
||||||
@ -267,14 +275,18 @@ static void
|
|||||||
load_plugins(const gchar *path)
|
load_plugins(const gchar *path)
|
||||||
{
|
{
|
||||||
GSList *list, *item;
|
GSList *list, *item;
|
||||||
|
gchar *fname, *tmp;
|
||||||
|
Plugin *plugin;
|
||||||
|
|
||||||
list = utils_get_file_list(path, NULL, NULL);
|
list = utils_get_file_list(path, NULL, NULL);
|
||||||
|
|
||||||
for (item = list; item != NULL; item = g_slist_next(item))
|
for (item = list; item != NULL; item = g_slist_next(item))
|
||||||
{
|
{
|
||||||
gchar *fname = g_strconcat(path, G_DIR_SEPARATOR_S, item->data, NULL);
|
tmp = strrchr(item->data, '.');
|
||||||
Plugin *plugin;
|
if (tmp == NULL || strcasecmp(tmp, "." PLUGIN_EXT) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
fname = g_strconcat(path, G_DIR_SEPARATOR_S, item->data, NULL);
|
||||||
plugin = plugin_new(fname);
|
plugin = plugin_new(fname);
|
||||||
if (plugin != NULL)
|
if (plugin != NULL)
|
||||||
{
|
{
|
||||||
@ -288,25 +300,43 @@ load_plugins(const gchar *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
static gchar *get_plugin_path()
|
||||||
|
{
|
||||||
|
gchar *install_dir = g_win32_get_package_installation_directory("geany", NULL);
|
||||||
|
gchar *path;
|
||||||
|
|
||||||
|
path = g_strconcat(install_dir, "\\plugins", NULL);
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void plugins_init()
|
void plugins_init()
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
gchar *path_user;
|
gchar *path;
|
||||||
|
|
||||||
geany_data_init();
|
geany_data_init();
|
||||||
|
|
||||||
widget = gtk_separator_menu_item_new();
|
widget = gtk_separator_menu_item_new();
|
||||||
gtk_container_add(GTK_CONTAINER(geany_data.tools_menu), widget);
|
gtk_container_add(GTK_CONTAINER(geany_data.tools_menu), widget);
|
||||||
|
|
||||||
path_user = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "plugins", NULL);
|
path = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "plugins", NULL);
|
||||||
// first load plugins in ~/.geany/plugins/, then in $prefix/lib/geany
|
// first load plugins in ~/.geany/plugins/, then in $prefix/lib/geany
|
||||||
load_plugins(path_user);
|
load_plugins(path);
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
g_free(path);
|
||||||
|
path = get_plugin_path();
|
||||||
|
load_plugins(path);
|
||||||
|
#else
|
||||||
load_plugins(PACKAGE_LIB_DIR G_DIR_SEPARATOR_S "geany");
|
load_plugins(PACKAGE_LIB_DIR G_DIR_SEPARATOR_S "geany");
|
||||||
|
#endif
|
||||||
if (g_list_length(plugin_list) > 0)
|
if (g_list_length(plugin_list) > 0)
|
||||||
gtk_widget_show(widget);
|
gtk_widget_show(widget);
|
||||||
|
|
||||||
g_free(path_user);
|
g_free(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@
|
|||||||
/* #undef HAVE_NDIR_H */
|
/* #undef HAVE_NDIR_H */
|
||||||
|
|
||||||
/* Define if plugins are enabled. */
|
/* Define if plugins are enabled. */
|
||||||
//#define HAVE_PLUGINS 1
|
#define HAVE_PLUGINS 1
|
||||||
|
|
||||||
/* Define to 1 if you have the `putenv' function. */
|
/* Define to 1 if you have the `putenv' function. */
|
||||||
#define HAVE_PUTENV 1
|
#define HAVE_PUTENV 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user