mozilla-kde.patch
changeset 935 9ae2b79d3bb1
parent 932 a58cc7936ce7
child 942 66115255ad6f
equal deleted inserted replaced
934:b61e849fe451 935:9ae2b79d3bb1
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent  6ff55468281e12a84adefb46b17acb60d9cea608
     2 # Parent  f3e80d26a430dfa1c58421fb66144a3c23ffc166
     3 Description: Add KDE integration to Firefox (toolkit parts)
     3 Description: Add KDE integration to Firefox (toolkit parts)
     4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     5 Author: Lubos Lunak <lunak@suse.com>
     5 Author: Lubos Lunak <lunak@suse.com>
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     7      https://bugzilla.novell.com/show_bug.cgi?id=170055
     7      https://bugzilla.novell.com/show_bug.cgi?id=170055
    25  
    25  
    26  #include "prefapi.h"
    26  #include "prefapi.h"
    27  #include "prefread.h"
    27  #include "prefread.h"
    28  #include "prefapi_private_data.h"
    28  #include "prefapi_private_data.h"
    29  
    29  
    30 @@ -1180,16 +1181,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
    30 @@ -1174,16 +1175,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
    31  
    31  
    32  static nsresult pref_LoadPrefsInDirList(const char *listId)
    32  static nsresult pref_LoadPrefsInDirList(const char *listId)
    33  {
    33  {
    34    nsresult rv;
    34    nsresult rv;
    35    nsCOMPtr<nsIProperties> dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
    35    nsCOMPtr<nsIProperties> dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
    60                getter_AddRefs(list));
    60                getter_AddRefs(list));
    61    if (!list)
    61    if (!list)
    62      return NS_OK;
    62      return NS_OK;
    63  
    63  
    64    bool hasMore;
    64    bool hasMore;
    65 @@ -1205,17 +1224,17 @@ static nsresult pref_LoadPrefsInDirList(
    65 @@ -1199,17 +1218,17 @@ static nsresult pref_LoadPrefsInDirList(
    66  
    66  
    67      nsAutoCString leaf;
    67      nsAutoCString leaf;
    68      path->GetNativeLeafName(leaf);
    68      path->GetNativeLeafName(leaf);
    69  
    69  
    70      // Do we care if a file provided by this process fails to load?
    70      // Do we care if a file provided by this process fails to load?
    79  
    79  
    80  static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name)
    80  static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name)
    81  {
    81  {
    82    nsZipItemPtr<char> manifest(jarReader, name, true);
    82    nsZipItemPtr<char> manifest(jarReader, name, true);
    83    NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
    83    NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
    84 @@ -1309,24 +1328,36 @@ static nsresult pref_InitInitialObjects(
    84 @@ -1303,24 +1322,36 @@ static nsresult pref_InitInitialObjects(
    85    /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
    85    /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
    86    static const char* specialFiles[] = {
    86    static const char* specialFiles[] = {
    87  #if defined(XP_MACOSX)
    87  #if defined(XP_MACOSX)
    88      "macprefs.js"
    88      "macprefs.js"
    89  #elif defined(XP_WIN)
    89  #elif defined(XP_WIN)
   185          self.base = base
   185          self.base = base
   186          self.flags = Flags(*flags)
   186          self.flags = Flags(*flags)
   187 diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
   187 diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
   188 --- a/toolkit/components/downloads/moz.build
   188 --- a/toolkit/components/downloads/moz.build
   189 +++ b/toolkit/components/downloads/moz.build
   189 +++ b/toolkit/components/downloads/moz.build
   190 @@ -60,17 +60,18 @@ if not CONFIG['MOZ_SUITE']:
   190 @@ -57,16 +57,17 @@ if not CONFIG['MOZ_SUITE']:
   191          'nsDownloadManagerUI.js',
       
   192          'nsDownloadManagerUI.manifest',
   191          'nsDownloadManagerUI.manifest',
   193      ]
   192      ]
   194  
   193  
   195  FINAL_LIBRARY = 'xul'
   194  FINAL_LIBRARY = 'xul'
   196  
   195  
   197  LOCAL_INCLUDES += [
   196  LOCAL_INCLUDES += [
   198      '../protobuf',
   197      '../protobuf',
   199 -    '/ipc/chromium/src'
   198      '/ipc/chromium/src',
   200 +    '/ipc/chromium/src',
   199 +    '/toolkit/xre',
   201 +    '/toolkit/xre'
   200      'chromium'
   202  ]
   201  ]
   203  
   202  
   204  DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
   203  DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
   205  DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
   204  DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
   206  
   205  
   207  CXXFLAGS += CONFIG['TK_CFLAGS']
   206  CXXFLAGS += CONFIG['TK_CFLAGS']
   208  
   207  
   209  if CONFIG['GNU_CXX']:
       
   210 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
   208 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
   211 --- a/toolkit/components/downloads/nsDownloadManager.cpp
   209 --- a/toolkit/components/downloads/nsDownloadManager.cpp
   212 +++ b/toolkit/components/downloads/nsDownloadManager.cpp
   210 +++ b/toolkit/components/downloads/nsDownloadManager.cpp
   213 @@ -51,16 +51,20 @@
   211 @@ -52,16 +52,20 @@
   214  #ifdef XP_WIN
   212  #ifdef XP_WIN
   215  #include <shlobj.h>
   213  #include <shlobj.h>
   216  #include "nsWindowsHelpers.h"
   214  #include "nsWindowsHelpers.h"
   217  #ifdef DOWNLOAD_SCANNER
   215  #ifdef DOWNLOAD_SCANNER
   218  #include "nsDownloadScanner.h"
   216  #include "nsDownloadScanner.h"
   226  #ifdef XP_MACOSX
   224  #ifdef XP_MACOSX
   227  #include <CoreFoundation/CoreFoundation.h>
   225  #include <CoreFoundation/CoreFoundation.h>
   228  #endif
   226  #endif
   229  
   227  
   230  #ifdef MOZ_WIDGET_ANDROID
   228  #ifdef MOZ_WIDGET_ANDROID
   231  #include "GeneratedJNIWrappers.h"
   229  #include "FennecJNIWrappers.h"
   232  #endif
   230  #endif
   233  
   231  
   234 @@ -2719,16 +2723,25 @@ nsDownload::SetState(DownloadState aStat
   232 @@ -2723,16 +2727,25 @@ nsDownload::SetState(DownloadState aStat
   235        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
   233        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
   236  
   234  
   237        // Master pref to control this function.
   235        // Master pref to control this function.
   238        bool showTaskbarAlert = true;
   236        bool showTaskbarAlert = true;
   239        if (pref)
   237        if (pref)
   255  
   253  
   256          int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
   254          int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
   257          int64_t goat = PR_Now() - mStartTime;
   255          int64_t goat = PR_Now() - mStartTime;
   258          showTaskbarAlert = goat > alertIntervalUSec;
   256          showTaskbarAlert = goat > alertIntervalUSec;
   259  
   257  
   260 @@ -2759,16 +2772,17 @@ nsDownload::SetState(DownloadState aStat
   258 @@ -2763,16 +2776,17 @@ nsDownload::SetState(DownloadState aStat
   261                    NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
   259                    NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
   262                    message, !removeWhenDone,
   260                    message, !removeWhenDone,
   263                    mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
   261                    mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
   264                    mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"),
   262                    mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"),
   265                    EmptyString(), EmptyString(), nullptr, mPrivate);
   263                    EmptyString(), EmptyString(), nullptr, mPrivate);
   314     content/global/bindings/scrollbox.xml       (widgets/scrollbox.xml)
   312     content/global/bindings/scrollbox.xml       (widgets/scrollbox.xml)
   315 diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/dialog-kde.xml
   313 diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/dialog-kde.xml
   316 new file mode 100644
   314 new file mode 100644
   317 --- /dev/null
   315 --- /dev/null
   318 +++ b/toolkit/content/widgets/dialog-kde.xml
   316 +++ b/toolkit/content/widgets/dialog-kde.xml
   319 @@ -0,0 +1,463 @@
   317 @@ -0,0 +1,457 @@
   320 +<?xml version="1.0"?>
   318 +<?xml version="1.0"?>
   321 +<!-- This Source Code Form is subject to the terms of the Mozilla Public
   319 +<!-- This Source Code Form is subject to the terms of the Mozilla Public
   322 +   - License, v. 2.0. If a copy of the MPL was not distributed with this
   320 +   - License, v. 2.0. If a copy of the MPL was not distributed with this
   323 +   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
   321 +   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
   324 +
   322 +
   384 +      <property name="defaultButton">
   382 +      <property name="defaultButton">
   385 +        <getter>
   383 +        <getter>
   386 +        <![CDATA[
   384 +        <![CDATA[
   387 +          if (this.hasAttribute("defaultButton"))
   385 +          if (this.hasAttribute("defaultButton"))
   388 +            return this.getAttribute("defaultButton");
   386 +            return this.getAttribute("defaultButton");
   389 +          else // default to the accept button
   387 +          return "accept";  // default to the accept button
   390 +            return "accept";
       
   391 +        ]]>
   388 +        ]]>
   392 +        </getter>
   389 +        </getter>
   393 +        <setter>
   390 +        <setter>
   394 +        <![CDATA[
   391 +        <![CDATA[
   395 +          this._setDefaultButton(val);
   392 +          this._setDefaultButton(val);
   489 +
   486 +
   490 +      <method name="postLoadInit">
   487 +      <method name="postLoadInit">
   491 +        <parameter name="aEvent"/>
   488 +        <parameter name="aEvent"/>
   492 +        <body>
   489 +        <body>
   493 +        <![CDATA[
   490 +        <![CDATA[
   494 +          let { AppConstants } =
       
   495 +              Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
       
   496 +
       
   497 +          function focusInit() {
   491 +          function focusInit() {
   498 +            const dialog = document.documentElement;
   492 +            const dialog = document.documentElement;
   499 +            const defaultButton = dialog.getButton(dialog.defaultButton);
   493 +            const defaultButton = dialog.getButton(dialog.defaultButton);
   500 +            // give focus to the first focusable element in the dialog
   494 +            // give focus to the first focusable element in the dialog
   501 +            if (!document.commandDispatcher.focusedElement) {
   495 +            if (!document.commandDispatcher.focusedElement) {
   517 +                    // We don't want to focus on anonymous OK, Cancel, etc. buttons,
   511 +                    // We don't want to focus on anonymous OK, Cancel, etc. buttons,
   518 +                    // so return focus to the tab itself
   512 +                    // so return focus to the tab itself
   519 +                    initialFocusedElt.focus();
   513 +                    initialFocusedElt.focus();
   520 +                  }
   514 +                  }
   521 +                }
   515 +                }
   522 +                else if (AppConstants.platform != "macosx" &&
   516 +                else if (!/Mac/.test(navigator.platform) &&
   523 +                         focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {
   517 +                         focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {
   524 +                  defaultButton.focus();
   518 +                  defaultButton.focus();
   525 +                }
   519 +                }
   526 +              }
   520 +              }
   527 +            }
   521 +            }
   602 +                button.setAttribute("icon", this.getAttribute("buttonicon"+dlgtype));
   596 +                button.setAttribute("icon", this.getAttribute("buttonicon"+dlgtype));
   603 +              // otherwise set defaults
   597 +              // otherwise set defaults
   604 +              else
   598 +              else
   605 +                switch (dlgtype) {
   599 +                switch (dlgtype) {
   606 +                  case "accept":
   600 +                  case "accept":
   607 +                    button.setAttribute("icon","accept");
   601 +                    button.setAttribute("icon", "accept");
   608 +                    break;
   602 +                    break;
   609 +                  case "cancel":
   603 +                  case "cancel":
   610 +                    button.setAttribute("icon","cancel");
   604 +                    button.setAttribute("icon", "cancel");
   611 +                    break;
   605 +                    break;
   612 +                  case "disclosure":
   606 +                  case "disclosure":
   613 +                    button.setAttribute("icon","properties");
   607 +                    button.setAttribute("icon", "properties");
   614 +                    break;
   608 +                    break;
   615 +                  case "help":
   609 +                  case "help":
   616 +                    button.setAttribute("icon","help");
   610 +                    button.setAttribute("icon", "help");
   617 +                    break;
   611 +                    break;
   618 +                  default:
   612 +                  default:
   619 +                    break;
   613 +                    break;
   620 +                }
   614 +                }
   621 +            }
   615 +            }
   637 +
   631 +
   638 +            // hide/show the buttons we want
   632 +            // hide/show the buttons we want
   639 +            for (dlgtype in buttons)
   633 +            for (dlgtype in buttons)
   640 +              buttons[dlgtype].hidden = !shown[dlgtype];
   634 +              buttons[dlgtype].hidden = !shown[dlgtype];
   641 +
   635 +
   642 +            let { AppConstants } =
       
   643 +                Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
       
   644 +            // show the spacer on Windows only when the extra2 button is present
   636 +            // show the spacer on Windows only when the extra2 button is present
   645 +            if (AppConstants.platform == "win") {
   637 +            if (/Win/.test(navigator.platform)) {
   646 +              var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
   638 +              var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
   647 +              spacer.removeAttribute("hidden");
   639 +              spacer.removeAttribute("hidden");
   648 +              spacer.setAttribute("flex", shown["extra2"]?"1":"0");
   640 +              spacer.setAttribute("flex", shown["extra2"]?"1":"0");
   649 +            }
   641 +            }
   650 +          }
   642 +          }
   782 +</bindings>
   774 +</bindings>
   783 diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml
   775 diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml
   784 new file mode 100644
   776 new file mode 100644
   785 --- /dev/null
   777 --- /dev/null
   786 +++ b/toolkit/content/widgets/preferences-kde.xml
   778 +++ b/toolkit/content/widgets/preferences-kde.xml
   787 @@ -0,0 +1,1410 @@
   779 @@ -0,0 +1,1403 @@
   788 +<?xml version="1.0"?>
   780 +<?xml version="1.0"?>
   789 +
   781 +
   790 +<!DOCTYPE bindings [
   782 +<!DOCTYPE bindings [
   791 +  <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd">
   783 +  <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd">
   792 +  %preferencesDTD;
   784 +  %preferencesDTD;
  1420 +          if (this.instantApply) {
  1412 +          if (this.instantApply) {
  1421 +            var docElt = document.documentElement;
  1413 +            var docElt = document.documentElement;
  1422 +            var acceptButton = docElt.getButton("accept");
  1414 +            var acceptButton = docElt.getButton("accept");
  1423 +            acceptButton.hidden = true;
  1415 +            acceptButton.hidden = true;
  1424 +            var cancelButton  = docElt.getButton("cancel");
  1416 +            var cancelButton  = docElt.getButton("cancel");
  1425 +
  1417 +            if (/Mac/.test(navigator.platform)) {
  1426 +            let { AppConstants } =
       
  1427 +                Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
       
  1428 +            if (AppConstants.platform == "macosx") {
       
  1429 +              // no buttons on Mac except Help
  1418 +              // no buttons on Mac except Help
  1430 +              cancelButton.hidden = true;
  1419 +              cancelButton.hidden = true;
  1431 +              // Move Help button to the end
  1420 +              // Move Help button to the end
  1432 +              document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;
  1421 +              document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;
  1433 +              // Also, don't fire onDialogAccept on enter
  1422 +              // Also, don't fire onDialogAccept on enter
  1605 +      <field name="_initialized">false</field>
  1594 +      <field name="_initialized">false</field>
  1606 +      <method name="_selectPane">
  1595 +      <method name="_selectPane">
  1607 +        <parameter name="aPaneElement"/>
  1596 +        <parameter name="aPaneElement"/>
  1608 +        <body>
  1597 +        <body>
  1609 +        <![CDATA[
  1598 +        <![CDATA[
  1610 +          let { AppConstants } =
  1599 +          if (/Mac/.test(navigator.platform)) {
  1611 +              Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
       
  1612 +          if (AppConstants.platform == "macosx") {
       
  1613 +            var paneTitle = aPaneElement.label;
  1600 +            var paneTitle = aPaneElement.label;
  1614 +            if (paneTitle != "")
  1601 +            if (paneTitle != "")
  1615 +              document.title = paneTitle;
  1602 +              document.title = paneTitle;
  1616 +          }
  1603 +          }
  1617 +          var helpButton = document.documentElement.getButton("help");
  1604 +          var helpButton = document.documentElement.getButton("help");
  1681 +      </method>
  1668 +      </method>
  1682 +
  1669 +
  1683 +      <property name="_shouldAnimate">
  1670 +      <property name="_shouldAnimate">
  1684 +        <getter>
  1671 +        <getter>
  1685 +        <![CDATA[
  1672 +        <![CDATA[
  1686 +          let { AppConstants } =
       
  1687 +              Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
       
  1688 +          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
  1673 +          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
  1689 +                               .getService(Components.interfaces.nsIPrefBranch);
  1674 +                               .getService(Components.interfaces.nsIPrefBranch);
  1690 +          var animate = AppConstants.platform == "macosx";
  1675 +          var animate = /Mac/.test(navigator.platform);
  1691 +          try {
  1676 +          try {
  1692 +            animate = psvc.getBoolPref("browser.preferences.animateFadeIn");
  1677 +            animate = psvc.getBoolPref("browser.preferences.animateFadeIn");
  1693 +          }
  1678 +          }
  1694 +          catch (e) { }
  1679 +          catch (e) { }
  1695 +          return animate;
  1680 +          return animate;
  1852 +      </method>
  1837 +      </method>
  1853 +    </implementation>
  1838 +    </implementation>
  1854 +    <handlers>
  1839 +    <handlers>
  1855 +      <handler event="dialogaccept">
  1840 +      <handler event="dialogaccept">
  1856 +      <![CDATA[
  1841 +      <![CDATA[
  1857 +        if (!this._fireEvent("beforeaccept", this)){
  1842 +        if (!this._fireEvent("beforeaccept", this)) {
  1858 +          return false;
  1843 +          return false;
  1859 +        }
  1844 +        }
  1860 +
  1845 +
  1861 +        var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
  1846 +        var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
  1862 +                    .getService(Components.interfaces.nsIScriptSecurityManager);
  1847 +                    .getService(Components.interfaces.nsIScriptSecurityManager);
  2290 +}
  2275 +}
  2291 +
  2276 +
  2292 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
  2277 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
  2293 --- a/toolkit/xre/moz.build
  2278 --- a/toolkit/xre/moz.build
  2294 +++ b/toolkit/xre/moz.build
  2279 +++ b/toolkit/xre/moz.build
  2295 @@ -39,17 +39,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
  2280 @@ -40,17 +40,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
  2296          'updaterfileutils_osx.mm',
  2281          'updaterfileutils_osx.mm',
  2297      ]
  2282      ]
  2298  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
  2283  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
  2299      UNIFIED_SOURCES += [
  2284      UNIFIED_SOURCES += [
  2300          'nsNativeAppSupportDefault.cpp',
  2285          'nsNativeAppSupportDefault.cpp',
  2314  if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
  2299  if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
  2315 diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
  2300 diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
  2316 new file mode 100644
  2301 new file mode 100644
  2317 --- /dev/null
  2302 --- /dev/null
  2318 +++ b/toolkit/xre/nsKDEUtils.cpp
  2303 +++ b/toolkit/xre/nsKDEUtils.cpp
  2319 @@ -0,0 +1,339 @@
  2304 @@ -0,0 +1,344 @@
  2320 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2305 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2321 +/* This Source Code Form is subject to the terms of the Mozilla Public
  2306 +/* This Source Code Form is subject to the terms of the Mozilla Public
  2322 + * License, v. 2.0. If a copy of the MPL was not distributed with this
  2307 + * License, v. 2.0. If a copy of the MPL was not distributed with this
  2323 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  2308 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  2324 +
  2309 +
  2335 +#include <stdio.h>
  2320 +#include <stdio.h>
  2336 +#include <sys/wait.h>
  2321 +#include <sys/wait.h>
  2337 +#include <sys/resource.h>
  2322 +#include <sys/resource.h>
  2338 +#include <unistd.h>
  2323 +#include <unistd.h>
  2339 +#include <X11/Xlib.h>
  2324 +#include <X11/Xlib.h>
       
  2325 +// copied from X11/X.h as a hack since for an unknown
       
  2326 +// reason it's not picked up from X11/X.h
       
  2327 +#ifndef None
       
  2328 +#define None                 0L /* universal null resource or null atom */
       
  2329 +#endif
  2340 +
  2330 +
  2341 +//#define DEBUG_KDE
  2331 +//#define DEBUG_KDE
  2342 +#ifdef DEBUG_KDE
  2332 +#ifdef DEBUG_KDE
  2343 +#define KMOZILLAHELPER "kmozillahelper"
  2333 +#define KMOZILLAHELPER "kmozillahelper"
  2344 +#else
  2334 +#else
  3159        return gnomeInfo.forget();
  3149        return gnomeInfo.forget();
  3160      }
  3150      }
  3161 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
  3151 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
  3162 --- a/widget/gtk/moz.build
  3152 --- a/widget/gtk/moz.build
  3163 +++ b/widget/gtk/moz.build
  3153 +++ b/widget/gtk/moz.build
  3164 @@ -90,16 +90,17 @@ else:
  3154 @@ -101,16 +101,17 @@ else:
  3165  include('/ipc/chromium/chromium-config.mozbuild')
  3155  include('/ipc/chromium/chromium-config.mozbuild')
  3166  
  3156  
  3167  FINAL_LIBRARY = 'xul'
  3157  FINAL_LIBRARY = 'xul'
  3168  
  3158  
  3169  LOCAL_INCLUDES += [
  3159  LOCAL_INCLUDES += [
  3532  
  3522  
  3533  #endif
  3523  #endif
  3534 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
  3524 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
  3535 --- a/xpcom/components/ManifestParser.cpp
  3525 --- a/xpcom/components/ManifestParser.cpp
  3536 +++ b/xpcom/components/ManifestParser.cpp
  3526 +++ b/xpcom/components/ManifestParser.cpp
  3537 @@ -35,16 +35,17 @@
  3527 @@ -32,16 +32,17 @@
       
  3528  #include "nsTextFormatter.h"
       
  3529  #include "nsVersionComparator.h"
       
  3530  #include "nsXPCOMCIDInternal.h"
  3538  
  3531  
  3539  #include "nsIConsoleService.h"
  3532  #include "nsIConsoleService.h"
  3540  #include "nsIScriptError.h"
  3533  #include "nsIScriptError.h"
  3541  #include "nsIXULAppInfo.h"
  3534  #include "nsIXULAppInfo.h"
  3542  #include "nsIXULRuntime.h"
  3535  #include "nsIXULRuntime.h"
  3543  #ifdef MOZ_B2G_LOADER
       
  3544  #include "mozilla/XPTInterfaceInfoManager.h"
       
  3545  #endif
       
  3546 +#include "nsKDEUtils.h"
  3536 +#include "nsKDEUtils.h"
  3547  
  3537  
  3548  #ifdef MOZ_B2G_LOADER
  3538  using namespace mozilla;
  3549  #define XPTONLY_MANIFEST &nsComponentManagerImpl::XPTOnlyManifestManifest
  3539  
  3550  #define XPTONLY_XPT &nsComponentManagerImpl::XPTOnlyManifestXPT
  3540  struct ManifestDirective
  3551  #else
  3541  {
  3552  #define XPTONLY_MANIFEST nullptr
  3542    const char* directive;
  3553  #define XPTONLY_XPT nullptr
  3543    int argc;
  3554  #endif
  3544  
  3555 @@ -494,16 +495,17 @@ ParseManifest(NSLocationType aType, File
  3545 @@ -472,16 +473,17 @@ ParseManifest(NSLocationType aType, File
  3556    NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
  3546    NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
  3557    NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
  3547    NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
  3558    NS_NAMED_LITERAL_STRING(kApplication, "application");
  3548    NS_NAMED_LITERAL_STRING(kApplication, "application");
  3559    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
  3549    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
  3560    NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
  3550    NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
  3568  #endif
  3558  #endif
  3569  
  3559  
  3570    NS_NAMED_LITERAL_STRING(kMain, "main");
  3560    NS_NAMED_LITERAL_STRING(kMain, "main");
  3571    NS_NAMED_LITERAL_STRING(kContent, "content");
  3561    NS_NAMED_LITERAL_STRING(kContent, "content");
  3572  
  3562  
  3573 @@ -554,44 +556,49 @@ ParseManifest(NSLocationType aType, File
  3563 @@ -532,44 +534,49 @@ ParseManifest(NSLocationType aType, File
  3574          CopyUTF8toUTF16(s, abi);
  3564          CopyUTF8toUTF16(s, abi);
  3575          abi.Insert(char16_t('_'), 0);
  3565          abi.Insert(char16_t('_'), 0);
  3576          abi.Insert(osTarget, 0);
  3566          abi.Insert(osTarget, 0);
  3577        }
  3567        }
  3578      }
  3568      }
  3618      process = kContent;
  3608      process = kContent;
  3619    } else {
  3609    } else {
  3620      process = kMain;
  3610      process = kMain;
  3621    }
  3611    }
  3622  
  3612  
  3623 @@ -694,25 +701,27 @@ ParseManifest(NSLocationType aType, File
  3613 @@ -672,25 +679,27 @@ ParseManifest(NSLocationType aType, File
  3624      TriState stOsVersion = eUnspecified;
  3614      TriState stOsVersion = eUnspecified;
  3625      TriState stOs = eUnspecified;
  3615      TriState stOs = eUnspecified;
  3626      TriState stABI = eUnspecified;
  3616      TriState stABI = eUnspecified;
  3627      TriState stProcess = eUnspecified;
  3617      TriState stProcess = eUnspecified;
  3628  #if defined(MOZ_WIDGET_ANDROID)
  3618  #if defined(MOZ_WIDGET_ANDROID)
  3646            CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) {
  3636            CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) {
  3647          continue;
  3637          continue;
  3648        }
  3638        }
  3649  
  3639  
  3650  #if defined(MOZ_WIDGET_ANDROID)
  3640  #if defined(MOZ_WIDGET_ANDROID)
  3651 @@ -762,16 +771,17 @@ ParseManifest(NSLocationType aType, File
  3641 @@ -740,16 +749,17 @@ ParseManifest(NSLocationType aType, File
  3652      }
  3642      }
  3653  
  3643  
  3654      if (!ok ||
  3644      if (!ok ||
  3655          stApp == eBad ||
  3645          stApp == eBad ||
  3656          stAppVersion == eBad ||
  3646          stAppVersion == eBad ||