From: <dat...@us...> - 2006-08-28 20:27:10
|
Revision: 17070 Author: datallah Date: 2006-08-28 13:27:03 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17070&view=rev Log Message: ----------- Disabled GTK+ components of the Perl plugin (we'll no longer support gtk-perl prefs frames until this is refactored into a gtkgaim plugin somehow). Fix gaim_util_fetch_url and plug some leaks. I haven't successfully tested gaim_util_fetch_url from perl yet - it doesn't seem to actually pass the retrieved text to the plugin sub correctly yet. The syntax for calling gaim_util_fetch_url() from perl is also funky and should be made more consistent to the C function. Modified Paths: -------------- trunk/libgaim/plugins/perl/common/Request.xs trunk/libgaim/plugins/perl/common/Util.xs trunk/libgaim/plugins/perl/common/module.h trunk/libgaim/plugins/perl/perl-common.h trunk/libgaim/plugins/perl/perl-handlers.c trunk/libgaim/plugins/perl/perl.c Modified: trunk/libgaim/plugins/perl/common/Request.xs =================================================================== --- trunk/libgaim/plugins/perl/common/Request.xs 2006-08-28 06:15:21 UTC (rev 17069) +++ trunk/libgaim/plugins/perl/common/Request.xs 2006-08-28 20:27:03 UTC (rev 17070) @@ -46,6 +46,10 @@ PUTBACK; FREETMPS; LEAVE; + + g_free(gpr->ok_cb); + g_free(gpr->cancel_cb); + g_free(gpr); } static void @@ -67,6 +71,10 @@ PUTBACK; FREETMPS; LEAVE; + + g_free(gpr->ok_cb); + g_free(gpr->cancel_cb); + g_free(gpr); } MODULE = Gaim::Request PACKAGE = Gaim::Request PREFIX = gaim_request_ @@ -89,14 +97,14 @@ CODE: GaimPerlRequestData *gpr; STRLEN len; - char *basename, *package; + char *basename; basename = g_path_get_basename(handle->path); gaim_perl_normalize_script_name(basename); - package = g_strdup_printf("Gaim::Script::%s", basename); gpr = g_new(GaimPerlRequestData, 1); - gpr->ok_cb = g_strdup_printf("%s::%s", package, SvPV(ok_cb, len)); - gpr->cancel_cb = g_strdup_printf("%s::%s", package, SvPV(cancel_cb, len)); + gpr->ok_cb = g_strdup_printf("Gaim::Script::%s::%s", basename, SvPV(ok_cb, len)); + gpr->cancel_cb = g_strdup_printf("Gaim::Script::%s::%s", basename, SvPV(cancel_cb, len)); + g_free(basename); RETVAL = gaim_request_input(handle, title, primary, secondary, default_value, multiline, masked, hint, ok_text, G_CALLBACK(gaim_perl_request_ok_cb), cancel_text, G_CALLBACK(gaim_perl_request_cancel_cb), gpr); OUTPUT: @@ -113,14 +121,14 @@ CODE: GaimPerlRequestData *gpr; STRLEN len; - char *basename, *package; + char *basename; basename = g_path_get_basename(handle->path); gaim_perl_normalize_script_name(basename); - package = g_strdup_printf("Gaim::Script::%s", basename); gpr = g_new(GaimPerlRequestData, 1); - gpr->ok_cb = g_strdup_printf("%s::%s", package, SvPV(ok_cb, len)); - gpr->cancel_cb = g_strdup_printf("%s::%s", package, SvPV(cancel_cb, len)); + gpr->ok_cb = g_strdup_printf("Gaim::Script::%s::%s", basename, SvPV(ok_cb, len)); + gpr->cancel_cb = g_strdup_printf("Gaim::Script::%s::%s", basename, SvPV(cancel_cb, len)); + g_free(basename); RETVAL = gaim_request_file(handle, title, filename, savedialog, G_CALLBACK(gaim_perl_request_ok_cb), G_CALLBACK(gaim_perl_request_cancel_cb), gpr); OUTPUT: @@ -140,14 +148,14 @@ CODE: GaimPerlRequestData *gpr; STRLEN len; - char *basename, *package; + char *basename; basename = g_path_get_basename(handle->path); gaim_perl_normalize_script_name(basename); - package = g_strdup_printf("Gaim::Script::%s", basename); gpr = g_new(GaimPerlRequestData, 1); - gpr->ok_cb = g_strdup_printf("%s::%s", package, SvPV(ok_cb, len)); - gpr->cancel_cb = g_strdup_printf("%s::%s", package, SvPV(cancel_cb, len)); + gpr->ok_cb = g_strdup_printf("Gaim::Script::%s::%s", basename, SvPV(ok_cb, len)); + gpr->cancel_cb = g_strdup_printf("Gaim::Script::%s::%s", basename, SvPV(cancel_cb, len)); + g_free(basename); RETVAL = gaim_request_fields(handle, title, primary, secondary, fields, ok_text, G_CALLBACK(gaim_perl_request_ok_cb), cancel_text, G_CALLBACK(gaim_perl_request_cancel_cb), gpr); OUTPUT: Modified: trunk/libgaim/plugins/perl/common/Util.xs =================================================================== --- trunk/libgaim/plugins/perl/common/Util.xs 2006-08-28 06:15:21 UTC (rev 17069) +++ trunk/libgaim/plugins/perl/common/Util.xs 2006-08-28 20:27:03 UTC (rev 17070) @@ -4,19 +4,22 @@ char *cb; } GaimPerlUrlData; -static void gaim_perl_util_url_cb(Gaim::Util::FetchUrlData *url_data, void *user_data, const gchar *url_data, size_t size, const gchar *error_message) { +static void gaim_perl_util_url_cb(GaimUtilFetchUrlData *url_data, void *user_data, const gchar *url_text, size_t size, const gchar *error_message) { GaimPerlUrlData *gpr = (GaimPerlUrlData *)user_data; dSP; ENTER; SAVETMPS; - PUSHMARK(sp); + PUSHMARK(SP); - XPUSHs(sv_2mortal(newSVpv(url_data, 0))); + XPUSHs(sv_2mortal(newSVpvn(url_text, size))); PUTBACK; call_pv(gpr->cb, G_EVAL | G_SCALAR); SPAGAIN; + g_free(gpr->cb); + g_free(gpr); + PUTBACK; FREETMPS; LEAVE; @@ -36,14 +39,14 @@ CODE: GaimPerlUrlData *gpr; STRLEN len; - char *basename, *package; + char *basename; basename = g_path_get_basename(handle->path); gaim_perl_normalize_script_name(basename); - package = g_strdup_printf("Gaim::Script::%s", basename); gpr = g_new(GaimPerlUrlData, 1); - gpr->cb = g_strdup_printf("%s::%s", package, SvPV(cb, len)); + gpr->cb = g_strdup_printf("Gaim::Script::%s::%s", basename, SvPV(cb, len)); + g_free(basename); gaim_util_fetch_url(url, full, user_agent, http11, gaim_perl_util_url_cb, gpr); int Modified: trunk/libgaim/plugins/perl/common/module.h =================================================================== --- trunk/libgaim/plugins/perl/common/module.h 2006-08-28 06:15:21 UTC (rev 17069) +++ trunk/libgaim/plugins/perl/common/module.h 2006-08-28 20:27:03 UTC (rev 17070) @@ -248,6 +248,7 @@ typedef GaimStringref * Gaim__Stringref; /* util.h */ +typedef GaimInfoFieldFormatCallback Gaim__Util__InfoFieldFormatCallback; typedef GaimUtilFetchUrlData Gaim__Util__FetchUrlData; typedef GaimMenuAction * Gaim__Menu__Action; Modified: trunk/libgaim/plugins/perl/perl-common.h =================================================================== --- trunk/libgaim/plugins/perl/perl-common.h 2006-08-28 06:15:21 UTC (rev 17069) +++ trunk/libgaim/plugins/perl/perl-common.h 2006-08-28 20:27:03 UTC (rev 17070) @@ -31,7 +31,9 @@ char *load_sub; char *unload_sub; char *prefs_sub; +#ifdef GAIM_GTKPERL char *gtk_prefs_sub; +#endif char *plugin_action_sub; } GaimPerlScript; Modified: trunk/libgaim/plugins/perl/perl-handlers.c =================================================================== --- trunk/libgaim/plugins/perl/perl-handlers.c 2006-08-28 06:15:21 UTC (rev 17069) +++ trunk/libgaim/plugins/perl/perl-handlers.c 2006-08-28 20:27:03 UTC (rev 17070) @@ -103,6 +103,7 @@ return l; } +#ifdef GAIM_GTKPERL GtkWidget * gaim_perl_gtk_get_plugin_frame(GaimPlugin *plugin) { @@ -138,6 +139,7 @@ return ret; } +#endif GaimPluginPrefFrame * gaim_perl_get_plugin_frame(GaimPlugin *plugin) Modified: trunk/libgaim/plugins/perl/perl.c =================================================================== --- trunk/libgaim/plugins/perl/perl.c 2006-08-28 06:15:21 UTC (rev 17069) +++ trunk/libgaim/plugins/perl/perl.c 2006-08-28 20:27:03 UTC (rev 17070) @@ -104,11 +104,13 @@ NULL /* frame (Reserved) */ }; +#ifdef GAIM_GTKPERL static GaimGtkPluginUiInfo gtk_ui_info = { gaim_perl_gtk_get_plugin_frame, 0 /* page_num (Reserved) */ }; +#endif static void #ifdef OLD_PERL @@ -366,6 +368,7 @@ info->prefs_info = &ui_info; } +#ifdef GAIM_GTKPERL if ((key = hv_fetch(plugin_info, "gtk_prefs_info", strlen("gtk_prefs_info"), 0))) { /* key now is the name of the Perl sub that @@ -375,6 +378,7 @@ SvPV(*key, len)); info->ui_info = >k_ui_info; } +#endif if ((key = hv_fetch(plugin_info, "plugin_action_sub", strlen("plugin_action_sub"), 0))) { @@ -538,7 +542,9 @@ g_free(gps->unload_sub); g_free(gps->package); g_free(gps->prefs_sub); +#ifdef GAIM_GTKPERL g_free(gps->gtk_prefs_sub); +#endif g_free(gps); plugin->info->extra_info = NULL; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-29 04:33:58
|
Revision: 17079 Author: datallah Date: 2006-08-28 21:33:53 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17079&view=rev Log Message: ----------- Remove the gtkgaim headers from the include path. Modified Paths: -------------- trunk/libgaim/plugins/perl/Makefile.mingw trunk/libgaim/plugins/perl/common/Makefile.mingw Modified: trunk/libgaim/plugins/perl/Makefile.mingw =================================================================== --- trunk/libgaim/plugins/perl/Makefile.mingw 2006-08-29 04:15:29 UTC (rev 17078) +++ trunk/libgaim/plugins/perl/Makefile.mingw 2006-08-29 04:33:53 UTC (rev 17079) @@ -19,20 +19,13 @@ -I$(GAIM_TOP) \ -I$(GAIM_LIB_TOP) \ -I$(GAIM_LIB_TOP)/win32 \ - -I$(GAIM_GTK_TOP) \ - -I$(GAIM_GTK_TOP)/win32 \ -I$(GTK_TOP)/include \ - -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ - -I$(GTK_TOP)/include/pango-1.0 \ - -I$(GTK_TOP)/include/atk-1.0 \ - -I$(GTK_TOP)/lib/gtk-2.0/include \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(PERL_LIB_TOP)/CORE LIB_PATHS = -L$(GTK_TOP)/lib \ -L$(GAIM_LIB_TOP) \ - -L$(GAIM_GTK_TOP) \ -L$(PERL_LIB_TOP) ## @@ -54,7 +47,6 @@ -lws2_32 \ -lintl \ -lgaim \ - -lgtkgaim \ -lperl58 include $(GAIM_COMMON_RULES) @@ -76,7 +68,7 @@ ## ## BUILD DLL ## -$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS) +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--export-all-symbols -o $(TARGET).dll ## @@ -84,7 +76,7 @@ ## clean: rm -rf $(OBJECTS) - rm -rf $(TARGET).dll $(TARGET).lib + rm -rf $(TARGET).dll $(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE) clean include $(GAIM_COMMON_TARGETS) Modified: trunk/libgaim/plugins/perl/common/Makefile.mingw =================================================================== --- trunk/libgaim/plugins/perl/common/Makefile.mingw 2006-08-29 04:15:29 UTC (rev 17078) +++ trunk/libgaim/plugins/perl/common/Makefile.mingw 2006-08-29 04:33:53 UTC (rev 17079) @@ -20,20 +20,14 @@ INCLUDE_PATHS = -I. \ -I$(GAIM_TOP) \ -I$(GAIM_LIB_TOP) \ - -I$(GAIM_GTK_TOP) \ -I$(GTK_TOP)/include \ - -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ - -I$(GTK_TOP)/include/pango-1.0 \ - -I$(GTK_TOP)/include/atk-1.0 \ - -I$(GTK_TOP)/lib/gtk-2.0/include \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(PERL_LIB_TOP)/CORE LIB_PATHS = -L$(PERL_LIB_TOP) \ -L$(PERL_PLUGIN_TOP) \ -L$(GAIM_LIB_TOP) \ - -L$(GAIM_GTK_TOP) \ -L$(GTK_TOP)/lib ## @@ -83,7 +77,6 @@ LIBS = -lperl58 \ -lperl \ -lgaim \ - -lgtkgaim \ -lglib-2.0 include $(GAIM_COMMON_RULES) @@ -110,7 +103,7 @@ cp Gaim.pm ./lib $(PERL) -MAutoSplit -e 'autosplit("lib/Gaim.pm")' -$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(FALLBACKS) $(OBJECTS) +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(FALLBACKS) $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) -o $(TARGET).dll ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-11-19 19:58:52
|
Revision: 17784 http://svn.sourceforge.net/gaim/?rev=17784&view=rev Author: rlaager Date: 2006-11-19 11:58:45 -0800 (Sun, 19 Nov 2006) Log Message: ----------- SF Patch #1571670 from zdeqb "Perl bindings for the functions in core.h and some bindings for the functions in privacy.h." I made the following changes: 1. I chose to export gaim_get_core() as Gaim::get_core instead of Gaim::Core::get_core. 2. I don't see any reason to require Perl code to pass bogus values just because C requires them. So, I changed Gaim::Core::quit_cb to NOT take an argument, and to pass NULL to gaim_core_quit_cb(). 3. I fixed a typo. 4. I cleaned up some spacing issues. I noticed that Core.c didn't get created from Core.xs until I re-ran configure. Maybe there's no way to avoid this? Modified Paths: -------------- trunk/libgaim/plugins/perl/Makefile.am trunk/libgaim/plugins/perl/common/Gaim.xs trunk/libgaim/plugins/perl/common/Privacy.xs trunk/libgaim/plugins/perl/common/module.h trunk/libgaim/plugins/perl/common/typemap Added Paths: ----------- trunk/libgaim/plugins/perl/common/Core.xs Modified: trunk/libgaim/plugins/perl/Makefile.am =================================================================== --- trunk/libgaim/plugins/perl/Makefile.am 2006-11-19 19:14:48 UTC (rev 17783) +++ trunk/libgaim/plugins/perl/Makefile.am 2006-11-19 19:58:45 UTC (rev 17784) @@ -50,6 +50,7 @@ common/BuddyList.xs \ common/Cipher.xs \ common/Cmds.xs \ + common/Core.xs \ common/Connection.xs \ common/Conversation.xs \ common/Debug.xs \ Added: trunk/libgaim/plugins/perl/common/Core.xs =================================================================== --- trunk/libgaim/plugins/perl/common/Core.xs (rev 0) +++ trunk/libgaim/plugins/perl/common/Core.xs 2006-11-19 19:58:45 UTC (rev 17784) @@ -0,0 +1,28 @@ +#include "module.h" + +MODULE = Gaim::Core PACKAGE = Gaim::Core PREFIX = gaim_core_ +PROTOTYPES: ENABLE + +gboolean +gaim_core_quit_cb() +PPCODE: + /* The argument to gaim_core_quit_cb is not used, + * so there's little point in requiring it on the + * Perl side. */ + RETVAL = gaim_core_quit_cb(NULL); + ST(0) = boolSV(RETVAL); + sv_2mortal(ST(0)); + +const char * +gaim_core_get_version() + +const char * +gaim_core_get_ui() + +void +gaim_core_set_ui_ops(ops) + Gaim::Core::UiOps ops + +Gaim::Core::UiOps +gaim_core_get_ui_ops() + Property changes on: trunk/libgaim/plugins/perl/common/Core.xs ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/libgaim/plugins/perl/common/Gaim.xs =================================================================== --- trunk/libgaim/plugins/perl/common/Gaim.xs 2006-11-19 19:14:48 UTC (rev 17783) +++ trunk/libgaim/plugins/perl/common/Gaim.xs 2006-11-19 19:58:45 UTC (rev 17784) @@ -11,6 +11,7 @@ GAIM_PERL_BOOT_PROTO(Cmd); GAIM_PERL_BOOT_PROTO(Connection); GAIM_PERL_BOOT_PROTO(Conversation); +GAIM_PERL_BOOT_PROTO(Core); GAIM_PERL_BOOT_PROTO(Debug); GAIM_PERL_BOOT_PROTO(Xfer); GAIM_PERL_BOOT_PROTO(ImgStore); @@ -50,6 +51,7 @@ GAIM_PERL_BOOT(Cmd); GAIM_PERL_BOOT(Connection); GAIM_PERL_BOOT(Conversation); + GAIM_PERL_BOOT(Core); GAIM_PERL_BOOT(Debug); GAIM_PERL_BOOT(Xfer); GAIM_PERL_BOOT(ImgStore); @@ -88,3 +90,10 @@ deinit() CODE: gaim_perl_timeout_clear(); + + +MODULE = Gaim PACKAGE = Gaim PREFIX = gaim_ +PROTOTYPES: ENABLE + +Gaim::Core +gaim_get_core() Modified: trunk/libgaim/plugins/perl/common/Privacy.xs =================================================================== --- trunk/libgaim/plugins/perl/common/Privacy.xs 2006-11-19 19:14:48 UTC (rev 17783) +++ trunk/libgaim/plugins/perl/common/Privacy.xs 2006-11-19 19:58:45 UTC (rev 17784) @@ -12,3 +12,32 @@ void gaim_privacy_set_ui_ops(ops) Gaim::Privacy::UiOps ops + +gboolean +gaim_privacy_permit_add(account, name, local_only) + Gaim::Account account + const char * name + gboolean local_only + +gboolean +gaim_privacy_permit_remove(account, name, local_only) + Gaim::Account account + const char * name + gboolean local_only + +gboolean +gaim_privacy_deny_add(account, name, local_only) + Gaim::Account account + const char * name + gboolean local_only + +gboolean +gaim_privacy_deny_remove(account, name, local_only) + Gaim::Account account + const char * name + gboolean local_only + +gboolean +gaim_privacy_check(account, who) + Gaim::Account account + const char * who Modified: trunk/libgaim/plugins/perl/common/module.h =================================================================== --- trunk/libgaim/plugins/perl/common/module.h 2006-11-19 19:14:48 UTC (rev 17783) +++ trunk/libgaim/plugins/perl/common/module.h 2006-11-19 19:58:45 UTC (rev 17784) @@ -24,6 +24,7 @@ #include "cmds.h" #include "connection.h" #include "conversation.h" +#include "core.h" #include "debug.h" #include "desktopitem.h" #include "eventloop.h" @@ -108,6 +109,11 @@ typedef GaimConvChat * Gaim__Conversation__Chat; typedef GaimConvChatBuddy * Gaim__Conversation__ChatBuddy; +/* core.h */ + +typedef GaimCore * Gaim__Core; +typedef GaimCoreUiOps * Gaim__Core__UiOps; + /* debug.h */ typedef GaimDebugLevel Gaim__DebugLevel; Modified: trunk/libgaim/plugins/perl/common/typemap =================================================================== --- trunk/libgaim/plugins/perl/common/typemap 2006-11-19 19:14:48 UTC (rev 17783) +++ trunk/libgaim/plugins/perl/common/typemap 2006-11-19 19:58:45 UTC (rev 17784) @@ -68,6 +68,8 @@ Gaim::Conversation::ChatBuddy T_GaimObj Gaim::Conversation::IM T_GaimObj Gaim::Conversation::UiOps T_GaimObj +Gaim::Core T_GaimObj +Gaim::Core::UiOps T_GaimObj Gaim::Desktop::Item T_GaimObj Gaim::DesktopItemType T_IV This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |