diff options
author | Bernard Cafarelli <voyageur@gentoo.org> | 2009-11-23 14:04:34 +0000 |
---|---|---|
committer | Bernard Cafarelli <voyageur@gentoo.org> | 2009-11-23 14:04:34 +0000 |
commit | 4b65baf597f91199d045cf39d3a6ff507f1587b1 (patch) | |
tree | 8e9a42cca062d331489cb361dae15c2bf2423df8 /x11-misc/google-gadgets/files | |
parent | Masking sys-apps/inputd for QA removal. (diff) | |
download | gentoo-2-4b65baf597f91199d045cf39d3a6ff507f1587b1.tar.gz gentoo-2-4b65baf597f91199d045cf39d3a6ff507f1587b1.tar.bz2 gentoo-2-4b65baf597f91199d045cf39d3a6ff507f1587b1.zip |
Add gtk+-2.18 support, reported by Alexandre Rostovtsev <tetromino@gmail.com> in bug #294124
(Portage version: 2.2_rc51/cvs/Linux x86_64)
Diffstat (limited to 'x11-misc/google-gadgets/files')
3 files changed, 0 insertions, 496 deletions
diff --git a/x11-misc/google-gadgets/files/google-gadgets-0.10.0-xulrunner-1.9.patch b/x11-misc/google-gadgets/files/google-gadgets-0.10.0-xulrunner-1.9.patch deleted file mode 100644 index cb2e65f151f4..000000000000 --- a/x11-misc/google-gadgets/files/google-gadgets-0.10.0-xulrunner-1.9.patch +++ /dev/null @@ -1,372 +0,0 @@ -Index: extensions/gtkmoz_browser_element/browser_element.cc -=================================================================== ---- extensions/gtkmoz_browser_element/browser_element.cc (revision 712) -+++ extensions/gtkmoz_browser_element/browser_element.cc (revision 713) -@@ -384,10 +384,6 @@ - std::string down_fd_str = StringPrintf("%d", down_pipe_fds[0]); - std::string up_fd_str = StringPrintf("%d", up_pipe_fds[1]); - std::string ret_fd_str = StringPrintf("%d", ret_pipe_fds[0]); --#ifdef MOZILLA_FIVE_HOME -- // Set appropriate environment variable for running mozilla gecko. -- setenv("MOZILLA_FIVE_HOME", MOZILLA_FIVE_HOME, 0); --#endif - for (size_t i = 0; kBrowserChildNames[i]; ++i) { - execl(kBrowserChildNames[i], kBrowserChildNames[i], - down_fd_str.c_str(), up_fd_str.c_str(), -Index: extensions/gtkmoz_browser_element/browser_child.cc -=================================================================== ---- extensions/gtkmoz_browser_element/browser_child.cc (revision 712) -+++ extensions/gtkmoz_browser_element/browser_child.cc (revision 713) -@@ -25,12 +25,18 @@ - #include <gtk/gtk.h> - - #define MOZILLA_CLIENT -+ -+#ifdef XPCOM_GLUE -+#include <gtkmozembed_glue.cpp> -+#endif -+ - #include <mozilla-config.h> - #include <gtkmozembed.h> - #include <gtkmozembed_internal.h> - #include <jsapi.h> - #include <jsconfig.h> - -+#include <nsComponentManagerUtils.h> - #include <nsCOMPtr.h> - #include <nsCRT.h> - #include <nsEvent.h> -@@ -772,9 +778,9 @@ - // Register external object (Javascript window.external object). - g_external_object.AddRef(); - nsCOMPtr<nsIGenericFactory> factory; -- rv = NS_NewGenericFactory(getter_AddRefs(factory), -- &kExternalObjectComponentInfo); -+ factory = do_CreateInstance ("@mozilla.org/generic-factory;1", &rv); - NS_ENSURE_SUCCESS(rv, rv); -+ factory->SetComponentInfo(&kExternalObjectComponentInfo); - rv = registrar->RegisterFactory(kExternalObjectComponentInfo.mCID, - EXTOBJ_CLASSNAME, EXTOBJ_CONTRACTID, - factory); -@@ -787,9 +793,9 @@ - - // Register customized content policy. - g_content_policy.AddRef(); -- rv = NS_NewGenericFactory(getter_AddRefs(factory), -- &kContentPolicyComponentInfo); -+ factory = do_CreateInstance ("@mozilla.org/generic-factory;1", &rv); - NS_ENSURE_SUCCESS(rv, rv); -+ factory->SetComponentInfo(&kContentPolicyComponentInfo); - rv = registrar->RegisterFactory(kContentPolicyComponentInfo.mCID, - CONTENT_POLICY_CLASSNAME, - CONTENT_POLICY_CONTRACTID, -@@ -803,8 +809,64 @@ - return rv; - } - -+static bool InitGecko() { -+#ifdef XPCOM_GLUE -+ nsresult rv; -+ -+ NS_LogInit(); -+ static const GREVersionRange kGREVersion = { -+ "1.9a", PR_TRUE, -+ "1.9.*", PR_TRUE -+ }; -+ -+ char xpcom_location[4096]; -+ rv = GRE_GetGREPathWithProperties(&kGREVersion, 1, nsnull, 0, xpcom_location, 4096); -+ if (NS_FAILED(rv)) { -+ g_warning("Failed to find proper Gecko Runtime Environment!"); -+ return false; -+ } -+ -+ // Startup the XPCOM Glue that links us up with XPCOM. -+ rv = XPCOMGlueStartup(xpcom_location); -+ if (NS_FAILED(rv)) { -+ g_warning("Failed to startup XPCOM Glue!"); -+ return false; -+ } -+ -+ rv = GTKEmbedGlueStartup(); -+ if (NS_FAILED(rv)) { -+ g_warning("Failed to startup Gtk Embed Glue!"); -+ return false; -+ } -+ -+ rv = GTKEmbedGlueStartupInternal(); -+ if (NS_FAILED(rv)) { -+ g_warning("Failed to startup Gtk Embed Glue (internal)!"); -+ return false; -+ } -+ -+ char *last_slash = strrchr(xpcom_location, '/'); -+ if (last_slash) -+ *last_slash = '\0'; -+ -+ gtk_moz_embed_set_path(xpcom_location); -+#elif defined(MOZILLA_FIVE_HOME) -+ gtk_moz_embed_set_comp_path(MOZILLA_FIVE_HOME); -+#endif -+ return true; -+} -+ - int main(int argc, char **argv) { -+ if (!g_thread_supported()) -+ g_thread_init(NULL); -+ - gtk_init(&argc, &argv); -+ -+ if (!InitGecko()) { -+ g_warning("Failed to initialize Gecko."); -+ return 1; -+ } -+ - signal(SIGPIPE, OnSigPipe); - if (argc >= 2) - g_down_fd = g_ret_fd = static_cast<int>(strtol(argv[1], NULL, 0)); -Index: hosts/gtk/sidebar_gtk_host.cc -=================================================================== ---- hosts/gtk/sidebar_gtk_host.cc (revision 712) -+++ hosts/gtk/sidebar_gtk_host.cc (revision 713) -@@ -203,9 +203,9 @@ - - void OnHotKeyPressed() { - if (!gadgets_shown_ || sidebar_->IsMinimized()) -- ShowOrHideAllGadgets(true); -+ ShowOrHideAll(true); - else -- ShowOrHideAllGadgets(false); -+ ShowOrHideAll(false); - } - - void OnWorkAreaChange() { -@@ -356,9 +356,9 @@ - - void OnSideBarClose() { - if (!gadgets_shown_ || sidebar_->IsMinimized()) -- ShowOrHideAllGadgets(true); -+ ShowOrHideAll(true); - else -- ShowOrHideAllGadgets(false); -+ ShowOrHideAll(false); - } - - void OnSideBarSizeEvent() { -@@ -1142,9 +1142,14 @@ - return false; - } - -+ void ShowOrHideAll(bool show) { -+ DLOG("ShowOrHideAll(%d)", show); -+ ShowOrHideSideBar(show); -+ ShowOrHideAllGadgets(show); -+ gadgets_shown_ = show; -+ } -+ - void ShowOrHideAllGadgets(bool show) { -- DLOG("ShowOrHideAllGadgets(%d)", show); -- ShowOrHideSideBar(show); - for (GadgetsMap::iterator it = gadgets_.begin(); - it != gadgets_.end(); ++it) { - if (it->second.gadget->GetDisplayTarget() != Gadget::TARGET_SIDEBAR) { -@@ -1158,7 +1163,6 @@ - OnMainViewPopIn(it->first); - } - } -- gadgets_shown_ = show; - } - - void ShowOrHideSideBar(bool show) { -@@ -1421,11 +1425,11 @@ - } - - void ShowAllMenuHandler(const char *str) { -- ShowOrHideAllGadgets(true); -+ ShowOrHideAll(true); - } - - void HideAllMenuHandler(const char *str) { -- ShowOrHideAllGadgets(false); -+ ShowOrHideAll(false); - } - - void AutoHideMenuHandler(const char *str) { -@@ -1551,6 +1555,9 @@ - g_source_remove(impl->auto_hide_source_); - impl->auto_hide_source_ = 0; - } -+ if (widget == impl->sidebar_window_ && !impl->sidebar_->IsMinimized()) { -+ impl->ShowOrHideAllGadgets(true); -+ } - return FALSE; - } - -@@ -1613,9 +1620,9 @@ - #if GTK_CHECK_VERSION(2,10,0) && defined(GGL_HOST_LINUX) - static void StatusIconActivateHandler(GtkWidget *widget, Impl *impl) { - if (!impl->gadgets_shown_ || impl->sidebar_->IsMinimized()) -- impl->ShowOrHideAllGadgets(true); -+ impl->ShowOrHideAll(true); - else -- impl->ShowOrHideAllGadgets(false); -+ impl->ShowOrHideAll(false); - } - - static void StatusIconPopupMenuHandler(GtkWidget *widget, guint button, -Index: ggadget/gtk/single_view_host.cc -=================================================================== ---- ggadget/gtk/single_view_host.cc (revision 712) -+++ ggadget/gtk/single_view_host.cc (revision 713) -@@ -339,9 +339,9 @@ - if (record_states_) - LoadWindowStates(); - -- // Show window immediately. So that following calls against the window can -- // take effect immediately. -- gtk_widget_show_now(window_); -+ // Can't use gtk_widget_show_now() here, because in some cases, it'll cause -+ // nested main loop and prevent ggl-gtk from being quitted. -+ gtk_widget_show(window_); - gtk_window_present(GTK_WINDOW(window_)); - gdk_window_raise(window_->window); - -Index: ggadget/decorated_view_host.cc -=================================================================== ---- ggadget/decorated_view_host.cc (revision 712) -+++ ggadget/decorated_view_host.cc (revision 713) -@@ -82,6 +82,7 @@ - hittest_(HT_CLIENT), - child_resizable_(ViewInterface::RESIZABLE_ZOOM), - auto_restore_view_size_(true), -+ view_state_restored_(false), - child_view_(NULL), - view_element_(new ViewElement(NULL, this, NULL, false)) { - view_element_->SetVisible(true); -@@ -104,6 +105,7 @@ - child_view_ = child_view; - view_element_->SetChildView(child_view); - -+ view_state_restored_ = false; - if (child_view_) { - child_resizable_ = child_view_->GetResizable(); - -@@ -401,7 +403,8 @@ - } - - virtual void SaveViewStates() { -- if (!auto_restore_view_size_) -+ // Don't save view state if the view state is not restored yet. -+ if (!auto_restore_view_size_ || !view_state_restored_) - return; - View *child = GetChildView(); - Gadget *gadget = child ? child->GetGadget() : NULL; -@@ -430,7 +433,8 @@ - View *child = GetChildView(); - Gadget *gadget = child ? child->GetGadget() : NULL; - // Only load view states when the original size has been saved. -- if (gadget) { -+ // Only restore view state once. -+ if (gadget && !view_state_restored_) { - OptionsInterface *opt = gadget->GetOptions(); - ViewElement *elm = GetViewElement(); - std::string prefix(option_prefix_); -@@ -458,6 +462,9 @@ - DLOG("RestoreViewStates(%d): w:%.0lf h:%.0lf s: %.2lf", - gadget->GetInstanceID(), elm->GetPixelWidth(), - elm->GetPixelHeight(), elm->GetScale()); -+ -+ // It's safe to save view state from now on. -+ view_state_restored_ = true; - UpdateViewSize(); - UpdateChildViewSize(); - } -@@ -533,6 +540,7 @@ - HitTest hittest_; - ViewInterface::ResizableMode child_resizable_; - bool auto_restore_view_size_; -+ bool view_state_restored_; - - View *child_view_; - ViewElement *view_element_; -@@ -850,7 +858,7 @@ - - virtual void SaveViewStates() { - Gadget *gadget = GetGadget(); -- if (gadget) { -+ if (gadget && minimized_state_loaded_) { - OptionsInterface *opt = gadget->GetOptions(); - opt->PutInternalValue("main_view_minimized", Variant(minimized_)); - DLOG("SaveViewStates(%d): main view minimized: %s", -Index: configure.ac -=================================================================== ---- configure.ac (revision 712) -+++ configure.ac (revision 713) -@@ -551,15 +551,25 @@ - PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= 2.14.0, [has_rsvg=yes], [has_rsvg=no]) - - # Check gtkmozembed --PKG_CHECK_MODULES(GTKMOZEMBED, [xulrunner-gtkmozembed xulrunner-js], -- [has_gtkmozembed=xulrunner-gtkmozembed], -- [PKG_CHECK_MODULES(GTKMOZEMBED, [firefox2-gtkmozembed firefox2-js], -- [has_gtkmozembed=firefox2-gtkmozembed], -- [PKG_CHECK_MODULES(GTKMOZEMBED, [firefox-gtkmozembed firefox-js], -- [has_gtkmozembed=firefox-gtkmozembed], -- [PKG_CHECK_MODULES(GTKMOZEMBED, [mozilla-gtkmozembed mozilla-js], -- [has_gtkmozembed=mozilla-gtkmozembed], -- [has_gtkmozembed=no])])])]) -+# Check priority: -+# xulrunner 1.9: mozilla-gtkmozembed-embedding and mozilla-js -+# xulrunner 1.9: libxul-embedding-unstable and mozilla-js -+# xulrunner 1.8: xulrunner-gtkmozembed and xulrunner-js -+# firefox 2.0: firefox2-gtkmozembed and firefox2-js -+# firefox 1.5: firefox-gtkmozembed and firefox-js -+# -+# Add more rules here if your distribution doesn't support above rules. -+PKG_CHECK_MODULES(GTKMOZEMBED, [mozilla-gtkmozembed-embedding mozilla-js], -+ [has_gtkmozembed=mozilla-gtkmozembed-embedding], -+ [PKG_CHECK_MODULES(GTKMOZEMBED, [libxul-embedding-unstable mozilla-js], -+ [has_gtkmozembed=libxul-embedding-unstable], -+ [PKG_CHECK_MODULES(GTKMOZEMBED, [xulrunner-gtkmozembed xulrunner-js], -+ [has_gtkmozembed=xulrunner-gtkmozembed], -+ [PKG_CHECK_MODULES(GTKMOZEMBED, [firefox2-gtkmozembed firefox2-js], -+ [has_gtkmozembed=firefox2-gtkmozembed], -+ [PKG_CHECK_MODULES(GTKMOZEMBED, [firefox-gtkmozembed firefox-js], -+ [has_gtkmozembed=firefox-gtkmozembed], -+ [has_gtkmozembed=no])])])])]) - - if test x$has_dbus = xyes; then - AC_DEFINE(HAVE_DBUS_LIBRARY,1,[Have dbus library]) -@@ -677,21 +687,26 @@ - GTKMOZEMBED_CFLAGS="$GTKMOZEMBED_CFLAGS -I$EMBED_INCDIR/dom" - GTKMOZEMBED_CFLAGS="$GTKMOZEMBED_CFLAGS -I$EMBED_INCDIR/xpconnect" - GTKMOZEMBED_CFLAGS="$GTKMOZEMBED_CFLAGS -I$EMBED_INCDIR/widget" -+ GTKMOZEMBED_LDFLAGS="" - MOZILLA_FIVE_HOME=`$PKG_CONFIG --variable=libdir $has_gtkmozembed` - if test "x$MOZILLA_FIVE_HOME" = "x"; then - # Some distributions doesn't have libdir, so try to extract libdir from LIBS. -+# It usually occurs on some pre xulrunner 1.9 versions. - # @<:@ and @:>@ will be replace by [ and ] by M4. Really evil. -+# FIXME: Following method might not work on systems other than Linux. - MOZILLA_FIVE_HOME=`echo $GTKMOZEMBED_LIBS | sed -e 's/.*-L\(@<:@^ @:>@*\) .*/\1/'` -- if test ! -e "$MOZILLA_FIVE_HOME"; then -- MOZILLA_FIVE_HOME="" -+ # Try to find out the correct xulrunner path. -+ if test -e "$MOZILLA_FIVE_HOME/libxpcom.so"; then -+ XPCOM_PATH=`readlink -f $MOZILLA_FIVE_HOME/libxpcom.so` -+ MOZILLA_FIVE_HOME=`dirname $XPCOM_PATH` - fi - fi -- PREDEFINED_MACROS="$PREDEFINED_MACROS -DMOZILLA_FIVE_HOME=\\\"$MOZILLA_FIVE_HOME\\\"" -- AC_SUBST(MOZILLA_FIVE_HOME) -- if test "x$MOZILLA_FIVE_HOME" != "x"; then -+ if test "x$MOZILLA_FIVE_HOME" != "x" -a -d "$MOZILLA_FIVE_HOME"; then -+ GTKMOZEMBED_CFLAGS="$GTKMOZEMBED_CFLAGS -DMOZILLA_FIVE_HOME=\\\"$MOZILLA_FIVE_HOME\\\"" - GTKMOZEMBED_LDFLAGS="$GTKMOZEMBED_LDFLAGS -R$MOZILLA_FIVE_HOME" -- AC_SUBST(GTKMOZEMBED_LDFLAGS) - fi -+ -+ AC_SUBST(GTKMOZEMBED_LDFLAGS) - fi - - AM_CONDITIONAL( diff --git a/x11-misc/google-gadgets/files/google-gadgets-0.10.4-gcc41.patch b/x11-misc/google-gadgets/files/google-gadgets-0.10.4-gcc41.patch deleted file mode 100644 index 3b8a28c39480..000000000000 --- a/x11-misc/google-gadgets/files/google-gadgets-0.10.4-gcc41.patch +++ /dev/null @@ -1,42 +0,0 @@ -=== extensions/gtkmoz_browser_element/browser_element.cc -================================================================== ---- extensions/gtkmoz_browser_element/browser_element.cc (revision 1184) -+++ extensions/gtkmoz_browser_element/browser_element.cc (revision 1185) -@@ -416,6 +416,8 @@ - object_id_str_(StringPrintf("%zu", object_id)), - call_self_(this), - to_string_(NewSlot(this, &BrowserObjectWrapper::ToString)) { -+ if (parent_) -+ parent_->Ref(); - } - - virtual ~BrowserObjectWrapper() { -@@ -426,6 +428,8 @@ - owner_->controller_->SendCommand(kUnrefCommand, owner_->browser_id_, - object_id_str_.c_str(), NULL); - } -+ if (parent_) -+ parent_->Unref(); - } - - void OnOwnerDestroy() { -@@ -523,8 +527,8 @@ - buffer += '\n'; - buffer += wrapper_->object_id_str_; - buffer += '\n'; -- if (wrapper_->parent_.Get()) -- buffer += wrapper_->parent_.Get()->object_id_str_; -+ if (wrapper_->parent_) -+ buffer += wrapper_->parent_->object_id_str_; - for (int i = 0; i < argc; i++) { - buffer += '\n'; - buffer += wrapper_->owner_->EncodeValue(argv[i]); -@@ -546,7 +550,7 @@ - }; - - BrowserElementImpl *owner_; -- ScriptableHolder<BrowserObjectWrapper> parent_; -+ BrowserObjectWrapper *parent_; - size_t object_id_; - std::string object_id_str_; - CallSelfSlot call_self_; diff --git a/x11-misc/google-gadgets/files/google-gadgets-0.10.4-xulrunner-1.9.1.patch b/x11-misc/google-gadgets/files/google-gadgets-0.10.4-xulrunner-1.9.1.patch deleted file mode 100644 index 7550ac8c2add..000000000000 --- a/x11-misc/google-gadgets/files/google-gadgets-0.10.4-xulrunner-1.9.1.patch +++ /dev/null @@ -1,82 +0,0 @@ -=== autotools/libmozjs.m4 -================================================================== ---- autotools/libmozjs.m4 (revision 1354) -+++ autotools/libmozjs.m4 (revision 1355) -@@ -32,9 +32,19 @@ - - AC_MSG_CHECKING([for libmozjs.so version >= $ggl_check_libmozjs_min_version]) - -+ AC_CHECK_HEADER([jsversion.h], [has_jsversion_h=yes], [has_jsversion_h=no]) -+ if test x$has_jsversion_h = xyes; then -+ LIBMOZJS_CFLAGS="$LIBMOZJS_CFLAGS -DHAVE_JSVERSION_H" -+ CPPFLAGS=$LIBMOZJS_CFLAGS -+ fi -+ - AC_LINK_IFELSE([[ - #include<jsapi.h> -+ #ifdef HAVE_JSVERSION_H -+ #include<jsversion.h> -+ #else - #include<jsconfig.h> -+ #endif - - #if JS_VERSION < $ggl_check_libmozjs_min_version - #error "libmozjs.so version is too low." -@@ -68,7 +78,11 @@ - // MOZILLA_1_8_BRANCH macro is not defined but the library was compiled - // with the flag, or vise versa. - #include <jsapi.h> -+ #ifdef HAVE_JSVERSION_H -+ #include<jsversion.h> -+ #else - #include<jsconfig.h> -+ #endif - - static JSBool f(JSContext *c, JSObject *o, uintN ac, jsval *av, jsval *r) { - return JS_TRUE; -=== extensions/gtkmoz_browser_element/Makefile.am -================================================================== ---- extensions/gtkmoz_browser_element/Makefile.am (revision 1354) -+++ extensions/gtkmoz_browser_element/Makefile.am (revision 1355) -@@ -59,8 +59,10 @@ - - gtkmoz_browser_child_CPPFLAGS = $(GTK2_CFLAGS) \ - $(GTKMOZEMBED_CFLAGS) \ -+ $(LIBMOZJS_CFLAGS) \ - $(PREDEFINED_MACROS) - -+# Don't link to libmozjs explicitly. - gtkmoz_browser_child_LDADD = $(GTK2_LIBS) \ - $(GTKMOZEMBED_LIBS) \ - $(top_builddir)/ggadget/libggadget@GGL_EPOCH@.la \ -=== extensions/gtkmoz_browser_element/browser_child.cc -================================================================== ---- extensions/gtkmoz_browser_element/browser_child.cc (revision 1354) -+++ extensions/gtkmoz_browser_element/browser_child.cc (revision 1355) -@@ -37,7 +37,12 @@ - #include <gtkmozembed.h> - #include <gtkmozembed_internal.h> - #include <jsapi.h> -+ -+#ifdef HAVE_JSVERSION_H -+#include <jsversion.h> -+#else - #include <jsconfig.h> -+#endif - - #include <nsComponentManagerUtils.h> - #include <nsCOMPtr.h> -=== configure.ac -================================================================== ---- configure.ac (revision 1354) -+++ configure.ac (revision 1355) -@@ -905,9 +905,6 @@ - build_gtkmoz_browser_element=no - fi - else -- # Add smjs related cflags, we don't want to link to smjs explicitly, -- # so don't use its libs. -- GTKMOZEMBED_CFLAGS="$GTKMOZEMBED_CFLAGS $LIBMOZJS_CFLAGS" - # Add additional include dirs for mozilla 1.8 and pre 1.9 - EMBED_INCDIR=`$PKG_CONFIG --variable=includedir $has_gtkmozembed` - GTKMOZEMBED_CFLAGS="$GTKMOZEMBED_CFLAGS -I$EMBED_INCDIR" |