bug 475811 - provide a widgetToolkit attribute on nsIXULRuntime. r=bsmedberg
authorTed Mielczarek <ted.mielczarek@gmail.com>
Mon, 02 Feb 2009 08:53:24 -0500
changeset 24526 ad08e07cb8e6eac1b38c11540fb87d13388be5db
parent 24525 dbe9086219a66dc1cc77ce856e09013fc933250c
child 24527 078ad879e689a1259ff016d64635e36b3858e622
push id5091
push usertmielczarek@mozilla.com
push dateMon, 02 Feb 2009 13:54:22 +0000
treeherdermozilla-central@078ad879e689 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs475811
milestone1.9.2a1pre
bug 475811 - provide a widgetToolkit attribute on nsIXULRuntime. r=bsmedberg
toolkit/xre/Makefile.in
toolkit/xre/nsAppRunner.cpp
xpcom/system/nsIXULRuntime.idl
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -229,17 +229,20 @@ CXXFLAGS += $(TK_CFLAGS) $(MOZ_DBUS_GLIB
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 CXXFLAGS += $(MOZ_PANGO_CFLAGS)
 endif
 
 ifdef BUILD_STATIC_LIBS
 DEFINES += -D_BUILD_STATIC_BIN
 endif
 
-DEFINES += -DOS_TARGET=\"$(OS_TARGET)\"
+DEFINES += \
+  -DOS_TARGET=\"$(OS_TARGET)\" \
+  -DMOZ_WIDGET_TOOLKIT=\"$(MOZ_WIDGET_TOOLKIT)\"
+
 ifdef TARGET_XPCOM_ABI
 DEFINES += \
 	-DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\" \
 	-DTARGET_OS_ABI=\"$(OS_TARGET)_$(TARGET_XPCOM_ABI)\" \
 	$(NULL)
 endif
 
 DEFINES += -DTOOLKIT_EM_VERSION=\"$(shell $(PERL) $(topsrcdir)/config/milestone.pl --topsrcdir=$(topsrcdir))\"
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -724,16 +724,23 @@ nsXULAppInfo::GetXPCOMABI(nsACString& aR
 #ifdef TARGET_XPCOM_ABI
   aResult.AssignLiteral(TARGET_XPCOM_ABI);
   return NS_OK;
 #else
   return NS_ERROR_NOT_AVAILABLE;
 #endif
 }
 
+NS_IMETHODIMP
+nsXULAppInfo::GetWidgetToolkit(nsACString& aResult)
+{
+  aResult.AssignLiteral(MOZ_WIDGET_TOOLKIT);
+  return NS_OK;
+}
+
 #ifdef XP_WIN
 // Matches the enum in WinNT.h for the Vista SDK but renamed so that we can
 // safely build with the Vista SDK and without it.
 typedef enum 
 {
   VistaTokenElevationTypeDefault = 1,
   VistaTokenElevationTypeFull,
   VistaTokenElevationTypeLimited
--- a/xpcom/system/nsIXULRuntime.idl
+++ b/xpcom/system/nsIXULRuntime.idl
@@ -39,17 +39,17 @@
 
 /**
  * Provides information about the XUL runtime.
  * @status UNSTABLE - This interface is not frozen and will probably change in
  *                    future releases. If you need this functionality to be
  *                    stable/frozen, please contact Benjamin Smedberg.
  */
 
-[scriptable, uuid(2848AB92-D912-11D9-89F7-001124787B2E)]
+[scriptable, uuid(17311145-97da-49eb-b984-965bdee8879c)]
 interface nsIXULRuntime : nsISupports
 {
   /**
    * Whether the application was launched in safe mode.
    */
   readonly attribute boolean inSafeMode;
 
   /**
@@ -75,9 +75,15 @@ interface nsIXULRuntime : nsISupports
    *   x86-msvc
    *   ppc-gcc3
    *
    * This value should almost always be used in combination with "OS".
    *
    * @throw NS_ERROR_NOT_AVAILABLE if not available.
    */
   readonly attribute AUTF8String XPCOMABI;
+
+  /**
+   * A string tag identifying the target widget toolkit in use.
+   * This is taken from the MOZ_WIDGET_TOOLKIT configure variable.
+   */
+  readonly attribute AUTF8String widgetToolkit;
 };