⛏️ index : haiku.git

author Adrien Destugues <pulkomandy@pulkomandy.ath.cx> 2011-05-19 20:38:53.0 +00:00:00
committer Adrien Destugues <pulkomandy@pulkomandy.ath.cx> 2011-05-19 20:38:53.0 +00:00:00
commit
f10a77aabbb76ee2d16102b0d5a24cf0087bb06d [patch]
tree
22ea21c8a3befc96765ca8300c792961d11af229
parent
465c575c64eb1bcef8212fa1ed4e1555dddb520e
download
f10a77aabbb76ee2d16102b0d5a24cf0087bb06d.tar.gz

Merge from trunk : * Decorator refactoring and appearance preflet * Localize Mandelbrot * Optional packages * Broadcom kernel panic fix

git-svn-id: file:///srv/svn/repos/haiku/haiku/branches/releases/r1alpha3@41594 a95241bf-73f2-0310-859d-f6bbb57e9c96

Diff

 build/jam/OptionalBuildFeatures                           |   2 +-
 build/jam/OptionalPackages                                | 226 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 src/bin/Jamfile                                           |   2 +-
 src/bin/setdecor.cpp                                      | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 headers/private/interface/DecorInfo.h                     | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/apps/mandelbrot/Jamfile                               |  13 ++++++++++---
 src/apps/mandelbrot/Mandelbrot.cpp                        |  27 +++++++++++++++++----------
 src/kits/interface/DecorInfo.cpp                          | 594 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/kits/interface/InterfaceDefs.cpp                      | 123 ++++++++++++++++++++++++++++++++------------------------------------------------
 src/kits/interface/Jamfile                                |   1 +
 src/preferences/appearance/APRView.cpp                    |  37 +++++++++++++++++--------------------
 src/preferences/appearance/APRView.h                      |   2 ++
 src/servers/app/DecorManager.cpp                          | 290 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 src/servers/app/DecorManager.h                            |  71 +++++++++++++++++++++++++++++++++--------------------------------------
 src/servers/app/Desktop.cpp                               |  26 ++++++++++++++++----------
 src/servers/app/Desktop.h                                 |   2 +-
 src/servers/app/ProfileMessageSupport.cpp                 |   4 ----
 src/servers/app/ServerApp.cpp                             |  59 ++++++++++-------------------------------------------------
 src/servers/app/Window.cpp                                |  25 ++++++++++++++++---------
 src/servers/app/Window.h                                  |   2 ++
 src/add-ons/decorators/BeDecorator/BeDecorator.cpp        |   7 -------
 src/add-ons/decorators/BeDecorator/BeDecorator.h          |   2 --
 src/add-ons/decorators/BeDecorator/Jamfile                |   3 +++
 src/add-ons/decorators/BeDecorator/resources.rdef         |  10 ++++++++++
 src/add-ons/decorators/MacDecorator/Jamfile               |   2 ++
 src/add-ons/decorators/MacDecorator/MacDecorator.cpp      |   7 -------
 src/add-ons/decorators/MacDecorator/MacDecorator.h        |   2 --
 src/add-ons/decorators/MacDecorator/resources.rdef        |  10 ++++++++++
 src/add-ons/decorators/SATDecorator/Jamfile               |   2 ++
 src/add-ons/decorators/SATDecorator/SATDecorator.cpp      |   7 -------
 src/add-ons/decorators/SATDecorator/SATDecorator.h        |   1 -
 src/add-ons/decorators/SATDecorator/resources.rdef        |  11 +++++++++++
 src/add-ons/decorators/WinDecorator/Jamfile               |   2 ++
 src/add-ons/decorators/WinDecorator/WinDecorator.cpp      |   7 -------
 src/add-ons/decorators/WinDecorator/WinDecorator.h        |   1 -
 src/add-ons/decorators/WinDecorator/resources.rdef        |  10 ++++++++++
 src/libs/compat/freebsd_wlan/net80211/ieee80211_node.c    |  14 ++++++++++++--
 src/libs/compat/freebsd_wlan/net80211/ieee80211_ratectl.h |   9 +--------
 38 files changed, 1388 insertions(+), 594 deletions(-)

diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures
index adc286a..60ac412 100644
--- a/build/jam/OptionalBuildFeatures
+++ b/build/jam/OptionalBuildFeatures
@@ -14,7 +14,7 @@
if $(HAIKU_GCC_VERSION[1]) >= 4 {
	HAIKU_OPENSSL_PACKAGE = openssl-1.0.0d-x86-gcc4-2011-05-10.zip ;
} else {
	HAIKU_OPENSSL_PACKAGE = openssl-1.0.0d-x86-gcc2-2011-05-10.zip ;
	HAIKU_OPENSSL_PACKAGE = openssl-1.0.0d-r1a3-x86-gcc2-2011-05-17.zip ;
}

local baseURL = http://haiku-files.org/files/optional-packages ;
diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages
index 1ad1af7..a1ac42b 100644
--- a/build/jam/OptionalPackages
+++ b/build/jam/OptionalPackages
@@ -118,8 +118,8 @@
			: $(baseURL)/apr-1.4.2-x86-gcc4-2011-05-05.zip
			: : true ;
	} else {
		InstallOptionalHaikuImagePackage apr-1.4.2-x86-gcc2-2011-05-05.zip
			: $(baseURL)/apr-1.4.2-x86-gcc2-2011-05-05.zip
		InstallOptionalHaikuImagePackage apr-1.4.2-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/apr-1.4.2-r1a3-x86-gcc2-2011-05-17.zip
			: : true ;
	}
}
@@ -134,8 +134,8 @@
			: $(baseURL)/apr-util-1.3.10-x86-gcc4-2011-05-05.zip
			: : true ;
	} else {
		InstallOptionalHaikuImagePackage apr-util-1.3.10-x86-gcc2-2011-05-05.zip
			: $(baseURL)/apr-util-1.3.10-x86-gcc2-2011-05-05.zip
		InstallOptionalHaikuImagePackage apr-util-1.3.10-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/apr-util-1.3.10-r1a3-x86-gcc2-2011-05-17.zip
			: : true ;
	}
}
@@ -164,8 +164,8 @@
		InstallOptionalHaikuImagePackage bzr-2.2.0-gcc4-2010-09-15.zip
			: $(baseURL)/bzr-2.2.0-x86-gcc4-2010-09-15.zip ;
	} else {
		InstallOptionalHaikuImagePackage bzr-2.2.1-x86-gcc2-2010-10-16.zip
			: $(baseURL)/bzr-2.2.1-x86-gcc2-2010-10-16.zip ;
		InstallOptionalHaikuImagePackage bzr-2.2.2-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/bzr-2.2.2-r1a3-x86-gcc2-2011-05-17.zip ;
	}
}

@@ -179,8 +179,8 @@
			InstallOptionalHaikuImagePackage beae-22-x86-gcc4-2010-09-15.zip
				: $(baseURL)/beae-22-x86-gcc4-2010-09-15.zip ;
		} else {
			InstallOptionalHaikuImagePackage beae-22-x86-gcc2-2010-09-15.zip
				: $(baseURL)/beae-22-x86-gcc2-2010-09-15.zip ;
			InstallOptionalHaikuImagePackage beae-22-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/beae-22-r1a3-x86-gcc2-2011-05-18.zip ;
		}
		AddSymlinkToHaikuImage home config be Applications
			: /boot/apps/BeAE/BeAE ;
@@ -327,8 +327,8 @@
			InstallOptionalHaikuImagePackage burnitnow-39-x86-gcc4-2010-09-15.zip
				: $(baseURL)/burnitnow-39-x86-gcc4-2010-09-15.zip ;
		} else {
		InstallOptionalHaikuImagePackage burnitnow-39-x86-gcc2-2010-09-15.zip
			: $(baseURL)/burnitnow-39-x86-gcc2-2010-09-15.zip ;
		InstallOptionalHaikuImagePackage burnitnow-39-r1a3-x86-gcc2-2011-05-18.zip
			: $(baseURL)/burnitnow-39-r1a3-x86-gcc2-2011-05-18.zip ;
		}
		AddSymlinkToHaikuImage home config be Applications
			: /boot/apps/BurnItNow/BurnItNow ;
@@ -347,8 +347,8 @@
			: : true ;
	} else {
		InstallOptionalHaikuImagePackage
			bzip2-1.0.6-x86-gcc2-2010-09-21.zip
			: $(baseURL)/bzip2-1.0.6-x86-gcc2-2010-09-21.zip
			bzip2-1.0.6-x86-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/bzip2-1.0.6-r1a3-x86-gcc2-2011-05-17.zip
			: : true ;
	}
}
@@ -364,8 +364,8 @@
			: $(baseURL)/ccache-3.1.4-x86-gcc4-2011-05-12.zip ;
	} else {
		InstallOptionalHaikuImagePackage
			ccache-3.0.1-x86-gcc2-2010-08-30.zip
			: $(baseURL)/ccache-3.0.1-x86-gcc2-2010-08-30.zip ;
			ccache-3.0.1-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/ccache-3.0.1-r1a3-x86-gcc2-2011-05-17.zip ;
	}
}

@@ -378,8 +378,8 @@
		InstallOptionalHaikuImagePackage cdrtools-3.01a01-x86-gcc4-2011-05-03.zip
			: $(baseURL)/cdrtools-3.01a01-x86-gcc4-2011-05-03.zip ;
	} else {
		InstallOptionalHaikuImagePackage cdrtools-3.01a01-x86-gcc2-2011-04-30.zip
			: $(baseURL)/cdrtools-3.01a01-x86-gcc2-2011-04-30.zip ;
		InstallOptionalHaikuImagePackage cdrtools-3.01a01-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/cdrtools-3.01a01-r1a3-x86-gcc2-2011-05-17.zip ;
	}
}

@@ -431,8 +431,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				cmake-2.8.4-x86-gcc2-2011-05-03.zip
				: $(baseURL)/cmake-2.8.4-x86-gcc2-2011-05-03.zip
				cmake-2.8.4-x86-r1a3-x86-gcc2-2011-05-19.zip
				: $(baseURL)/cmake-2.8.4-r1a3-x86-gcc2-2011-05-19.zip
				: : true ;
		}
	}
@@ -447,8 +447,8 @@
		InstallOptionalHaikuImagePackage curl-7.21.4-x86-gcc4-2011-05-10.zip
			: $(baseURL)/curl-7.21.6-x86-gcc4-2011-05-10.zip ;
	} else {
		InstallOptionalHaikuImagePackage curl-7.21.6-x86-gcc2-2011-05-10.zip
			: $(baseURL)/curl-7.21.6-x86-gcc2-2011-05-10.zip ;
		InstallOptionalHaikuImagePackage curl-7.21.6-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/curl-7.21.6-r1a3-x86-gcc2-2011-05-17.zip ;
	}
}

@@ -465,8 +465,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				cvs-1.12.13.1-x86-gcc2-2011-03-14.zip
				: $(baseURL)/cvs-1.12.13.1-x86-gcc2-2011-03-14.zip
				cvs-1.12.13.1-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/cvs-1.12.13.1-r1a3-x86-gcc2-2011-05-18.zip
				: : true ;
		}
	}
@@ -490,19 +490,19 @@
			: $(baseURL)/texinfo-4.13a-x86-gcc4-2011-03-14.zip
			: : true ;
	} else {
		InstallOptionalHaikuImagePackage autoconf-2.68-x86-gcc2-2011-03-14.zip
			: $(baseURL)/autoconf-2.68-x86-gcc2-2011-03-14.zip
		InstallOptionalHaikuImagePackage autoconf-2.68-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/autoconf-2.68-r1a3-x86-gcc2-2011-05-17.zip
			: : true ;
		InstallOptionalHaikuImagePackage
			automake-1.11.1-x86-gcc2-2011-03-14.zip
			: $(baseURL)/automake-1.11.1-x86-gcc2-2011-03-14.zip
			automake-1.11.1-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/automake-1.11.1-r1a3-x86-gcc2-2011-05-17.zip
			: : true ;
		InstallOptionalHaikuImagePackage libtool-2.4-x86-gcc2-2011-03-14.zip
			: $(baseURL)/libtool-2.4-x86-gcc2-2011-03-14.zip
		InstallOptionalHaikuImagePackage libtool-2.4-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/libtool-2.4-r1a3-x86-gcc2-2011-05-17.zip
			: : true ;
		InstallOptionalHaikuImagePackage
			texinfo-4.13a-x86-gcc2-2011-03-14-a.zip
			: $(baseURL)/texinfo-4.13a-x86-gcc2-2011-03-14.zip
			texinfo-4.13a-r1a3-x86-gcc2-2011-05-18.zip
			: $(baseURL)/texinfo-4.13a-r1a3-x86-gcc2-2011-05-18.zip
			: : true ;
	}
}
@@ -514,8 +514,8 @@
	# gcc and binutils
	if $(HAIKU_GCC_VERSION[1]) = 2 || $(isHybridBuild) {
		InstallOptionalHaikuImagePackage
			gcc-2.95.3-x86-gcc2-2010-08-18.zip
			: $(baseURL)/gcc-2.95.3-x86-gcc2-2010-08-18.zip ;
			gcc-2.95.3-r1a3-x86-gcc2-2010-08-18.zip
			: $(baseURL)/gcc-2.95.3-r1a3-x86-gcc2-2010-08-18.zip ;
	}

	if $(HAIKU_GCC_VERSION[1]) = 2 {
@@ -562,20 +562,20 @@
			: $(baseURL)/make-3.82-x86-gcc4-2011-03-15.zip ;
	} else {
		InstallOptionalHaikuImagePackage
			bison-2.4.3-x86-gcc2-2011-03-14.zip
			: $(baseURL)/bison-2.4.3-x86-gcc2-2011-03-14.zip ;
			bison-2.4.3-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/bison-2.4.3-r1a3-x86-gcc2-2011-05-17.zip ;
		InstallOptionalHaikuImagePackage
			m4-1.4.16-x86-gcc2-2011-03-14.zip
			: $(baseURL)/m4-1.4.16-x86-gcc2-2011-03-14.zip ;
			m4-1.4.16-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/m4-1.4.16-r1a3-x86-gcc2-2011-05-17.zip ;
		InstallOptionalHaikuImagePackage
			flex-2.5.35-x86-gcc2-2011-03-14.zip
			: $(baseURL)/flex-2.5.35-x86-gcc2-2011-03-14.zip ;
		InstallOptionalHaikuImagePackage jam-2.5-r1a2-x86-gcc2-2010-04-21.zip
			: $(baseURL)/jam-2.5-r1a2-x86-gcc2-2010-04-21.zip ;
		InstallOptionalHaikuImagePackage mkdepend-1.7-x86-gcc2-2010-09-24.zip
			: $(baseURL)/mkdepend-1.7-x86-gcc2-2010-09-24.zip ;
		InstallOptionalHaikuImagePackage make-3.82-x86-gcc2-2011-03-15.zip
			: $(baseURL)/make-3.82-x86-gcc2-2011-03-15.zip ;
			flex-2.5.35-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/flex-2.5.35-r1a3-x86-gcc2-2011-05-17.zip ;
		InstallOptionalHaikuImagePackage jam-2.5-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/jam-2.5-r1a3-x86-gcc2-2011-05-17.zip ;
		InstallOptionalHaikuImagePackage mkdepend-1.7-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/mkdepend-1.7-r1a3-x86-gcc2-2011-05-17.zip ;
		InstallOptionalHaikuImagePackage make-3.82-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/make-3.82-r1a3-x86-gcc2-2011-05-17.zip ;
	}
}

@@ -742,8 +742,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				expat-2.0.1-x86-gcc2-2011-05-08.zip
				: $(baseURL)/expat-2.0.1-x86-gcc2-2011-05-08.zip
				expat-2.0.1-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/expat-2.0.1-r1a3-x86-gcc2-2011-05-18.zip
				: : true ;
		}
	}
@@ -760,8 +760,8 @@
			: $(baseURL)/fastdep-0.16-x86-gcc4-2011-05-12.zip ;
	} else {
		InstallOptionalHaikuImagePackage
			fastdep-0.16-x86-gcc2-2010-09-02.zip
			: $(baseURL)/fastdep-0.16-x86-gcc2-2010-09-02.zip ;
			fastdep-0.16-r1a3-x86-gcc2-2011-05-18.zip
			: $(baseURL)/fastdep-0.16-r1a3-x86-gcc2-2011-05-18.zip ;
	}
}

@@ -796,8 +796,6 @@
				: $(baseURL)/gettext-0.18.1.1-x86-gcc2-2011-02-07.zip
				: : true ;
		}
		InstallSourceArchive gettext-0.18.1.1_haiku-2011-02-07.tar.xz
			: $(baseSourceURL)/2010/gettext-0.18.1.1_haiku-2011-02-07.tar.xz ;
	}
}

@@ -814,8 +812,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				git-1.7.5-x86-gcc2-2011-05-10.zip
				: $(baseURL)/git-1.7.5-x86-gcc2-2011-05-10.zip
				git-1.7.5-x86-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/git-1.7.5-r1a3-x86-gcc2-2011-05-18.zip
				: : true ;
		}
	}
@@ -834,8 +832,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				gperf-3.0.4-x86-gcc2-2011-05-06.zip
				: $(baseURL)/gperf-3.0.4-x86-gcc2-2011-05-06.zip
				gperf-3.0.4-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/gperf-3.0.4-r1a3-x86-gcc2-2011-05-18.zip
				: : true ;
		}
	}
@@ -854,8 +852,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				 groff-1.20.1-x86-gcc2-2011-05-06.zip
				: $(baseURL)/groff-1.20.1-x86-gcc2-2011-05-06.zip
				 groff-1.20.1-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/groff-1.20.1-r1a3-x86-gcc2-2011-05-18.zip
				: : true ;
		}
	}
@@ -944,8 +942,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				libevent-2.0.10-x86-gcc2-2011-02-25.zip
				: $(baseURL)/lib/libevent-2.0.10-x86-gcc2-2011-02-25.zip
				libevent-2.0.10-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/lib/libevent-2.0.10-r1a3-x86-gcc2-2011-05-18.zip
				: : true ;
		}
	}
@@ -963,8 +961,8 @@
				: $(baseURL)/libiconv-1.13.1-x86-gcc4-2011-05-13.zip ;
		} else {
			InstallOptionalHaikuImagePackage
				libiconv-1.13.1-x86-gcc2-2011-05-15.zip
				: $(baseURL)/libiconv-1.13.1-x86-gcc2-2011-05-15.zip ;
				libiconv-1.13.1-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/libiconv-1.13.1-r1a3-x86-gcc2-2011-05-18.zip ;
		}
	}
}
@@ -988,11 +986,13 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Libmng available for $(TARGET_ARCH)" ;
	} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
		InstallOptionalHaikuImagePackage libmng-1.0.10-x86-gcc4-2010-10-30.zip
		InstallOptionalHaikuImagePackage 
			libmng-1.0.10-x86-gcc4-2010-10-30.zip
			: $(baseURL)/lib/libmng-1.0.10-x86-gcc4-2010-10-30.zip ;
	} else {
		InstallOptionalHaikuImagePackage libmng-1.0.10-x86-gcc2-2010-10-29.zip
			: $(baseURL)/lib/libmng-1.0.10-x86-gcc2-2010-10-29.zip ;
		InstallOptionalHaikuImagePackage 
			libmng-1.0.10-r1a3-x86-gcc2-2011-05-18.zip
			: $(baseURL)/lib/libmng-1.0.10-r1a3-x86-gcc2-2011-05-18.zip ;
	}
}

@@ -1008,8 +1008,8 @@
				: $(baseURL)/libxml2-2.7.8-x86-gcc4-2011-03-16.zip ;
		} else {
			InstallOptionalHaikuImagePackage
				libxml2-2.7.8-x86-gcc2-2011-03-16.zip
				: $(baseURL)/libxml2-2.7.8-x86-gcc2-2011-03-16.zip ;
				libxml2-2.7.8-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/libxml2-2.7.8-r1a3-x86-gcc2-2011-05-18.zip ;
		}
	}
}
@@ -1021,11 +1021,9 @@
		Echo "No optional package LibXSLT available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage
			libxslt-1.1.26-r1a2-x86-gcc2-2010-04-22-a.zip
			: $(baseURL)/libxslt-1.1.26-r1a2-x86-gcc2-2010-04-22-a.zip
			libxslt-1.1.26-r1a3-x86-gcc2-2011-05-18.zip
			: $(baseURL)/libxslt-1.1.26-r1a3-x86-gcc2-2011-05-18.zip
			: : true ;
		InstallSourceArchive libxslt-1.1.26_haiku-2010-04-29.tar.xz
			: $(baseSourceURL)/2010/libxslt-1.1.26_haiku-2010-04-29.tar.xz ;
	}
}

@@ -1057,8 +1055,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				lua-5.1.4-x86-gcc2-2010-10-29.zip
				: $(baseURL)/lua-5.1.4-x86-gcc2-2010-10-29.zip
				lua-5.1.4-3-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/lua-5.1.4-3-r1a3-x86-gcc2-2011-05-18.zip
				: : true ;
		}
	}
@@ -1075,8 +1073,8 @@
			: $(baseURL)/man-1.6f-x86-gcc4-2011-05-12.zip ;		
	} else {
		InstallOptionalHaikuImagePackage
			 man-1.6f-x86-gcc2-2010-09-01.zip
			: $(baseURL)/man-1.6f-x86-gcc2-2010-09-01.zip ;
			 man-1.6f-r1a3-x86-gcc2-2011-05-18.zip
			: $(baseURL)/man-1.6f-r1a3-x86-gcc2-2011-05-18.zip ;
	}
}

@@ -1099,8 +1097,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				mercurial-1.8.3-x86-gcc2-2011-05-10.zip
				: $(baseURL)/mercurial-1.8.3-x86-gcc2-2011-05-10.zip
				mercurial-1.8.3-r1a3-x86-gcc2-2011-05-17.zip
				: $(baseURL)/mercurial-1.8.3-r1a3-x86-gcc2-2011-05-17.zip
				: : true ;
		}
	}
@@ -1118,8 +1116,8 @@
				: $(baseURL)/nano-2.2.6-x86-gcc4-2011-03-14.zip ;
		} else {
			InstallOptionalHaikuImagePackage
				nano-2.2.6-x86-gcc2-2011-03-14.zip
				: $(baseURL)/nano-2.2.6-x86-gcc2-2011-03-14.zip ;
				nano-2.2.6-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/nano-2.2.6-r1a3-x86-gcc2-2011-05-18.zip ;
		}
	}
}
@@ -1136,8 +1134,8 @@
				: $(baseURL)/neon-0.29.6-x86-gcc4-2011-05-14.zip ;
		} else {
			InstallOptionalHaikuImagePackage
				neon-0.29.6-x86-gcc2-2011-05-14.zip
				: $(baseURL)/neon-0.29.6-x86-gcc2-2011-05-14.zip ;
				neon-0.29.6-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/neon-0.29.6-r1a3-x86-gcc2-2011-05-18.zip ;
		}
	}
}
@@ -1232,8 +1230,8 @@
				: $(baseURL)/openssh-5.8p2-x86-gcc4-2011-05-11.zip ;
		} else {
			InstallOptionalHaikuImagePackage
				openssh-5.8p2-x86-gcc2-2011-05-10.zip
				: $(baseURL)/openssh-5.8p2-x86-gcc2-2011-05-10.zip ;
				openssh-5.8p2-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/openssh-5.8p2-r1a3-x86-gcc2-2011-05-18.zip ;
		}

		AddUserToHaikuImage sshd : 1001 : 100 : /var/empty : /bin/true
@@ -1269,8 +1267,8 @@
				: $(baseURL)/p7zip-9.13-x86-gcc4-2011-02-28.zip ;
		} else {
			InstallOptionalHaikuImagePackage
				p7zip-9.13-x86-gcc2-2011-02-25.zip
				: $(baseURL)/p7zip-9.13-x86-gcc2-2011-02-25.zip ;
				p7zip-9.13-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/p7zip-9.13-r1a3-x86-gcc2-2011-05-18.zip ;
		}
		AddExpanderRuleToHaikuImage "application/x-7z-compressed" : .7z
			: "7za l \\0045s"
@@ -1287,11 +1285,13 @@
		Echo "No optional package Paladin available for $(TARGET_ARCH)" ;
	} else {
		if $(HAIKU_GCC_VERSION[1]) >= 4 {
			InstallOptionalHaikuImagePackage paladin-1.3-x86-gcc4-2011-03-18.zip
			InstallOptionalHaikuImagePackage 
				paladin-1.3-x86-gcc4-2011-03-18.zip
				: $(baseURL)/paladin-1.3-x86-gcc4-2011-03-18.zip ;
		} else {
			InstallOptionalHaikuImagePackage paladin-1.3-x86-gcc2-2010-09-06.zip
				: $(baseURL)/paladin-1.3-x86-gcc2-2010-09-06.zip ;
			InstallOptionalHaikuImagePackage 
				paladin-1.3-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/paladin-1.3-r1a3-x86-gcc2-2011-05-18.zip ;
		}

		AddSymlinkToHaikuImage home config be Applications
@@ -1308,12 +1308,13 @@
		Echo "No optional package PCRE available for $(TARGET_ARCH)" ;
	} else {
		if $(HAIKU_GCC_VERSION[1]) >= 4 {
			InstallOptionalHaikuImagePackage libpcre-8.12-x86-gcc4-2011-05-13.zip
			InstallOptionalHaikuImagePackage 
				libpcre-8.12-x86-gcc4-2011-05-13.zip
				: $(baseURL)/libpcre-8.12-x86-gcc4-2011-05-13.zip ;
		} else {
			InstallOptionalHaikuImagePackage
				libpcre-8.12-x86-gcc2-2011-03-14.zip
				: $(baseURL)/libpcre-8.12-x86-gcc2-2011-03-14.zip ;
				libpcre-8.12-r1a3-x86-gcc2-2011-05-17.zip
				: $(baseURL)/libpcre-8.12-r1a3-x86-gcc2-2011-05-17.zip ;
		}
	}
}
@@ -1330,8 +1331,8 @@
				: $(baseURL)/pe-2.4.3-600-x86-gcc4-2010-11-14.zip ;
		} else {
			InstallOptionalHaikuImagePackage
				pe-2.4.3-600-x86-gcc2-2010-09-28.zip
				: $(baseURL)/pe-2.4.3-600-x86-gcc2-2010-09-28.zip ;
				pe-2.4.3-600-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/pe-2.4.3-600-r1a3-x86-gcc2-2011-05-18.zip ;
		}
		AddSymlinkToHaikuImage home config be Applications
			: /boot/apps/Pe/Pe ;
@@ -1353,12 +1354,10 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				perl-5.10.1-r1a2-x86-gcc2-2010-04-25-a.zip
				: $(baseURL)/perl-5.10.1-r1a2-x86-gcc2-2010-04-25-a.zip
				perl-5.10.1-r1a3-x86-gcc2-2011-05-17.zip
				: $(baseURL)/perl-5.10.1-r1a3-x86-gcc2-2011-05-17.zip
				: : true ;
		}
		InstallSourceArchive perl-5.10.1_haiku-2010-04-29.tar.xz
			: $(baseSourceURL)/2010/perl-5.10.1_haiku-2010-04-29.tar.xz ;
	}
}

@@ -1375,8 +1374,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				python-2.6.6-x86-gcc2-2010-08-30.zip
				: $(baseURL)/python-2.6.6-x86-gcc2-2010-08-30.zip
				python-2.6.6-r1a3-x86-gcc2-2011-05-19.zip
				: $(baseURL)/python-2.6.6-r1a3-x86-gcc2-2011-05-19.zip
				: : true ;
		}
	}
@@ -1395,8 +1394,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				rsync-3.0.7-x86-gcc2-2011-05-06.zip
				: $(baseURL)/rsync-3.0.7-x86-gcc2-2011-05-06.zip
				rsync-3.0.7-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/rsync-3.0.7-r1a3-x86-gcc2-2011-05-18.zip
				: : true ;
		}
	}
@@ -1425,8 +1424,8 @@
			: $(baseURL)/sed-4.2.1-x86-gcc4-2011-05-13.zip ;
	} else {
		InstallOptionalHaikuImagePackage
			sed-4.2.1-x86-gcc2-2011-03-14.zip
			: $(baseURL)/sed-4.2.1-x86-gcc2-2011-03-14.zip ;
			sed-4.2.1-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/sed-4.2.1-r1a3-x86-gcc2-2011-05-17.zip ;
	}
}

@@ -1442,8 +1441,8 @@
				: $(baseURL)/sqlite-3.7.5-x86-gcc4-2011-03-16.zip ;
		} else {
			InstallOptionalHaikuImagePackage
				sqlite-3.7.5-x86-gcc2-2011-05-06.zip
				: $(baseURL)/sqlite-3.7.5-x86-gcc2-2011-05-06.zip ;
				sqlite-3.7.5-r1a3-x86-gcc2-2011-05-17.zip
				: $(baseURL)/sqlite-3.7.5-r1a3-x86-gcc2-2011-05-17.zip ;
		}
	}
}
@@ -1461,8 +1460,8 @@
				: : true ;
		} else {
			InstallOptionalHaikuImagePackage
				subversion-1.6.15-x86-gcc2-2011-05-14.zip
				: $(baseURL)/subversion-1.6.15-x86-gcc2-2011-05-14.zip
				subversion-1.6.15-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/subversion-1.6.15-r1a3-x86-gcc2-2011-05-18.zip
				: : true ;
		}
	}
@@ -1496,8 +1495,8 @@
				: $(baseURL)/tar-1.25-x86-gcc4-2011-03-14.zip ;
		} else {
			InstallOptionalHaikuImagePackage
				tar-1.25-x86-gcc2-2011-03-14.zip
				: $(baseURL)/tar-1.25-x86-gcc2-2011-03-14.zip ;
				tar-1.25-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/tar-1.25-r1a3-x86-gcc2-2011-05-18.zip ;
		}
	}
}
@@ -1620,8 +1619,9 @@
			InstallOptionalHaikuImagePackage vision-908-x86-gcc4-2010-11-14.zip
				: $(baseURL)/vision-908-x86-gcc4-2010-11-14.zip ;
		} else {
			InstallOptionalHaikuImagePackage vision-908-x86-gcc2-2010-10-30.zip
				: $(baseURL)/vision-908-x86-gcc2-2010-10-30.zip ;
			InstallOptionalHaikuImagePackage 
				vision-908-r1a3-x86-gcc2-2011-05-18.zip
				: $(baseURL)/vision-908-r1a3-x86-gcc2-2011-05-18.zip ;
		}
		AddSymlinkToHaikuImage home config be Applications
			: /boot/apps/Vision/Vision ;
@@ -1726,8 +1726,8 @@
# WQY-MicroHei
if [ IsOptionalHaikuImagePackageAdded WQY-MicroHei ] {
	InstallOptionalHaikuImagePackage
		wqy-microhei-0.2.0-beta-x86-gcc2-2011-02-23.zip
		: $(baseURL)/wqy-microhei-0.2.0-beta-x86-gcc2-2011-02-23.zip ;
		wqy-microhei-0.2.0-beta-r1a3-x86-gcc2-2011-05-18.zip
		: $(baseURL)/wqy-microhei-0.2.0-beta-r1a3-x86-gcc2-2011-05-18.zip ;
}


@@ -1765,7 +1765,7 @@
			: $(baseURL)/yasm-1.1.0-x86-gcc4-2011-05-14.zip ;
	} else {
		InstallOptionalHaikuImagePackage
			yasm-1.1.0-x86-gcc2-2011-04-29.zip
			: $(baseURL)/yasm-1.1.0-x86-gcc2-2011-04-29.zip ;
			yasm-1.1.0-r1a3-x86-gcc2-2011-05-17.zip
			: $(baseURL)/yasm-1.1.0-r1a3-x86-gcc2-2011-05-17.zip ;
	}
}
diff --git a/src/bin/Jamfile b/src/bin/Jamfile
index e41b9b5..3769a6b 100644
--- a/src/bin/Jamfile
+++ b/src/bin/Jamfile
@@ -102,7 +102,6 @@
	play.cpp
	quit.cpp
	roster.cpp
	setdecor.cpp
	setversion.cpp
	trash.cpp
	version.cpp
@@ -123,6 +122,7 @@
	hey.cpp
	reindex.cpp
	resattr.cpp
	setdecor.cpp
	settype.cpp
	spybmessage.cpp
	urlwrapper.cpp
diff --git a/src/bin/setdecor.cpp b/src/bin/setdecor.cpp
index 9bc80e0..273b787 100644
--- a/src/bin/setdecor.cpp
+++ b/src/bin/setdecor.cpp
@@ -1,4 +1,5 @@
/*
 * Copyright 2011, Joseph "looncraz" Groover, looncraz@satx.rr.com
 * Copyright 2007, François Revol, revol@free.fr.
 * Distributed under the terms of the MIT license.
 */
@@ -7,87 +8,224 @@
#include <stdio.h>

#include <Application.h>
#include <Bitmap.h>
#include <InterfaceDefs.h>
#include <String.h>
#include <Window.h>
#include <View.h>

class BBitmap;

namespace BPrivate {
int32 count_decorators(void);
int32 get_decorator(void);
status_t get_decorator_name(const int32 &index, BString &name);
status_t get_decorator_preview(const int32 &index, BBitmap *bitmap);
status_t set_decorator(const int32 &index);
#include <private/interface/DecorInfo.h>


void
print_decor_info_header()
{
	printf("    Name      License\t    Description\n");
	printf("----------------------------------------------------\n");
}


void
print_decor_summary(DecorInfo* decor, bool isCurrent)
{
	if (isCurrent)
		printf("*");

	printf("%-12s\t%-8s  %-30s\n", decor->Name().String(),
		decor->LicenseName().String(), decor->ShortDescription().String());
}


void
print_decor_shortcut(DecorInfo* decor, bool isCurrent)
{
	if (isCurrent)
		printf("*");

	printf("%-12s\t%-12s\n", decor->ShortcutName().String(),
		decor->Name().String());
}

using namespace BPrivate;

int main(int argc, char **argv)
void
print_decor_info_verbose(DecorInfo* decor, bool isCurrent)
{
	status_t err;
	printf("Name:\t\t%s\n", decor->Name().String());
	printf("Version:\t%f\n", decor->Version());
	printf("Author(s):\t%s\n", decor->Authors().String());
	printf("Description:\t%s\n", decor->ShortDescription().String());
	printf("License:\t%s (%s)\n", decor->LicenseName().String(),
		decor->LicenseURL().String());
	printf("Support URL:\t%s\n", decor->SupportURL().String());
	printf("%s\n", isCurrent ? "Currently in use." : "Currently not in use.");
}


int
main(int argc, char** argv)
{
	if (argc < 2) {
		printf("usage: %s [-l|-c|decorname]\n", argv[0]);
		printf("\t-l: list available decors\n");
		printf("\t-s: list shortcut names for available decors\n");
		printf("\t-c: give current decor name\n");
		printf("\t-i: detailed information about decor\n");
		printf("\t-p: see preview window\n");
		return 1;
	}

	// combine remaining args into one string:
	BString decoratorName;
	for (int i = 2; i < argc; ++i)
		decoratorName << argv[i] << " ";
	decoratorName.RemoveLast(" ");

	BApplication app("application/x-vnd.Haiku-setdecor");

	DecorInfoUtility* util = new DecorInfoUtility();
	DecorInfo* decor = NULL;

	if (util == NULL) {
		fprintf(stderr, "error instantiating DecoratorInfoUtility (out of"
			" memory?)\n");
		return 1;
	}

	// we want the list
	if (!strcmp(argv[1], "-l")) {
		int32 i, count;
		count = count_decorators();
		if (count < 0) {
			fprintf(stderr, "error counting decorators: %s\n", strerror(count));
		// Print default decorator:
		print_decor_info_header();
		int32 count = util->CountDecorators();
		for (int32 i = 0; i < count; ++i) {
			decor = util->DecoratorAt(i);
			if (decor == NULL) {
				fprintf(stderr, "error NULL entry @ %li / %li - BUG BUG BUG\n",
					i, count);
				// return 2 to track DecorInfoUtility errors
				return 2;
			}
			print_decor_summary(decor, util->IsCurrentDecorator(decor));
		}

		return 0;
	}

	// we want the current decorator
	if (!strcmp(argv[1], "-c")) {
		decor = util->CurrentDecorator();

		if (decor == NULL) {
			fprintf(stderr, "Unable to determine current decorator, sorry! - "
				"BUG BUG BUG\n");
			return 2;
		}

		print_decor_info_header();
		print_decor_summary(decor, true);
		return 0;
	}


	if (!strcmp(argv[1], "-s")) {

		printf("  Shortcut        Name\n");
		printf("------------------------------------\n");

		int32 count = util->CountDecorators();
		for (int32 i = 0; i < count; ++i) {
			decor = util->DecoratorAt(i);
			if (decor == NULL) {
				fprintf(stderr, "error NULL entry @ %li / %li - BUG BUG BUG\n",
					i, count);
				// return 2 to track DecorInfoUtility errors
				return 2;
			}
			print_decor_shortcut(decor, util->IsCurrentDecorator(decor));
		}

		return 0;
	}

	// we want detailed information for a specific decorator ( by name or path )
	if (!strcmp(argv[1], "-i")) {
		if (argc < 3) {
			fprintf(stderr, "not enough arguments\n");
			return 1;
		}
		for (i = 0; i < count; i++) {
			BString name;
			err = get_decorator_name(i, name);
			if (err < 0)
				continue;
			printf("%s\n", name.String());

		decor = util->FindDecorator(decoratorName.String());

		if (decor == NULL) {
			fprintf(stderr, "Can't find decor named \"%s\", try again\n",
				decoratorName.String());
			return 1;
		}

		print_decor_info_verbose(decor, util->IsCurrentDecorator(decor));
		return 0;
	}
	// we want the current one
	if (!strcmp(argv[1], "-c")) {
		int32 i;
		BString name;
		i = get_decorator();
		if (i < 0) {
			fprintf(stderr, "error getting current decorator: %s\n", strerror(i));


	if (!strcmp(argv[1], "-p")) {
		if (argc < 3) {
			fprintf(stderr, "not enough arguments\n");
			return 1;
		}

		decor = util->FindDecorator(decoratorName.String());

		if (decor == NULL) {
			fprintf(stderr, "Can't find decor named \"%s\", try again\n",
				decoratorName.String());
			return 1;
		}
		err = get_decorator_name(i, name);
		if (err < 0) {
			fprintf(stderr, "error getting name of decorator: %s\n", strerror(err));

		printf("Preparing preview...\n");

		BWindow* previewWindow = new BWindow(BRect(150, 150, 390, 490),
			decor->Name().String(), B_TITLED_WINDOW, B_NOT_ZOOMABLE
				| B_QUIT_ON_WINDOW_CLOSE | B_NOT_RESIZABLE );

		previewWindow->AddChild(new BView(previewWindow->Bounds(), "",
			B_FOLLOW_ALL, 0));

		if (util->Preview(decor, previewWindow) != B_OK) {
			fprintf(stderr, "Unable to preview decorator, sorry!\n");
			// TODO: more detailed error...
			return 1;
		}
		printf("%s\n", name.String());

		previewWindow->Show();

		app.Run();
		return 0;
	}

	// we want to change it
	int32 i, count;
	count = count_decorators();
	if (count < 0) {
		fprintf(stderr, "error counting decorators: %s\n", strerror(count));
	decoratorName = "";
	for (int i = 1; i < argc; ++i)
		decoratorName << argv[i] << " ";
	decoratorName.RemoveLast(" ");

	decor = util->FindDecorator(decoratorName.String());

	if (decor == NULL) {
		fprintf(stderr, "no such decorator \"%s\"\n", decoratorName.String());
		return 1;
	}
	for (i = 0; i < count; i++) {
		BString name;
		err = get_decorator_name(i, name);
		if (err < 0)
			continue;
		if (name == argv[1]) {
			err = set_decorator(i);
			if (err < 0) {
				fprintf(stderr, "error setting decorator: %s\n", strerror(err));
				return 1;
			}
			return 0;
		}

	if (util->IsCurrentDecorator(decor)) {
		printf("\"%s\" is already the current decorator\n",
			decor->Name().String());
		return 0;
	}
	fprintf(stderr, "can't find decorator \"%s\"\n", argv[1]);
	return 1;

	printf("Setting %s as the current decorator...\n", decor->Name().String());
	if (util->SetDecorator(decor) != B_OK ) {
		fprintf(stderr, "Unable to set decorator, sorry\n\n");
		return 1;	// todo more detailed error...
	}

	return 0;
}

diff --git a/headers/private/interface/DecorInfo.h b/headers/private/interface/DecorInfo.h
new file mode 100644
index 0000000..d66eb74 100644
--- /dev/null
+++ b/headers/private/interface/DecorInfo.h
@@ -1,0 +1,129 @@
/*
 * Public domain source code.
 *
 * Author:
 *		Joseph "looncraz" Groover <looncraz@satx.rr.com>
 */


#ifndef DECOR_INFO_H
#define DECOR_INFO_H


#include <Entry.h>
#include <Bitmap.h>
#include <String.h>
#include <Locker.h>
#include <ObjectList.h>


// NOTE: DecorInfo itself is not thread-safe
class DecorInfo {
public:
								DecorInfo();
								DecorInfo(const BString& path);
								DecorInfo(const entry_ref& ref);
								~DecorInfo();

			status_t			SetTo(const entry_ref& ref);
			status_t			SetTo(BString path);
			status_t			InitCheck()	const;
			void				Unset();

			bool				IsDefault()	const;

			BString				Path()	const;
					// Returns "Default" for the default decorator

			const entry_ref*	Ref() const;
				// Returns NULL if virtual (default) or InitCheck() != B_OK
				// The ref returned may NOT be the same as the one given to
				// SetTo or the constructor - we may have traversed a Symlink!

			BString				Name() const;
			BString				ShortcutName() const;

			BString				Authors() const;
			BString				ShortDescription() const;
			BString				LongDescription() const;
			BString				LicenseURL() const;
			BString				LicenseName() const;
			BString				SupportURL() const;

			float				Version() const;
			time_t				ModificationTime() const;

			bool				CheckForChanges(bool &deleted);

private:
			void				_Init(bool is_update = false);

private:
			entry_ref			fRef;

			BString				fPath;
			BString				fName;
			BString				fAuthors;
			BString				fShortDescription;
			BString				fLongDescription;
			BString				fLicenseURL;
			BString				fLicenseName;
			BString				fSupportURL;

			float				fVersion;

			time_t				fModificationTime;

			status_t			fInitStatus;
};


class DecorInfoUtility{
public:
								DecorInfoUtility(bool scanNow = true);
									// NOTE: When scanNow is passed false,
									// scanning will be performed lazily, such
									// as in CountDecorators() and other
									// methods.

								~DecorInfoUtility();

			status_t			ScanDecorators();
									// Can also be used to rescan for changes.
									// Warning: potentially destructive as we
									// will remove all DecorInfo objects which
									// no longer have a file system cousin.
									// TODO: Would a call-back mechanism be
									// worthwhile here?

			int32				CountDecorators();

			DecorInfo*			DecoratorAt(int32);

			DecorInfo*			FindDecorator(const BString& string);
									// Checks for ref.name, path, fName, and
									// "Default," an empty-string returns the
									// current decorator NULL on match failure

			DecorInfo*			CurrentDecorator();
			DecorInfo*			DefaultDecorator();

			bool				IsCurrentDecorator(DecorInfo*);

			status_t			SetDecorator(DecorInfo*);
			status_t			SetDecorator(int32);

			status_t			Preview(DecorInfo* decor, BWindow* window);

private:
			DecorInfo*			_FindDecor(const BString& path);

private:
			BObjectList<DecorInfo>	fList;
			BLocker					fLock;
			bool					fHasScanned;

};


#endif
diff --git a/src/apps/mandelbrot/Jamfile b/src/apps/mandelbrot/Jamfile
index b75b7e0..55c6ab4 100644
--- a/src/apps/mandelbrot/Jamfile
+++ b/src/apps/mandelbrot/Jamfile
@@ -1,10 +1,17 @@
SubDir HAIKU_TOP src apps mandelbrot ;

SetSubDirSupportedPlatformsBeOSCompatible ;
AddSubDirSupportedPlatforms libbe_test ;

Application Mandelbrot : 
Application Mandelbrot :
	Mandelbrot.cpp
	tsb.cpp
	: be $(TARGET_LIBSUPC++)
	: Mandelbrot.rdef ;
	: be locale $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
	: Mandelbrot.rdef
	;

DoCatalogs Mandelbrot :
    x-vnd.Haiku-Mandelbrot
    :
	Mandelbrot.cpp
;
diff --git a/src/apps/mandelbrot/Mandelbrot.cpp b/src/apps/mandelbrot/Mandelbrot.cpp
index aaa0220..239903a 100644
--- a/src/apps/mandelbrot/Mandelbrot.cpp
+++ b/src/apps/mandelbrot/Mandelbrot.cpp
@@ -10,6 +10,7 @@
#include <Alert.h>
#include <Application.h>
#include <Bitmap.h>
#include <Catalog.h>
#include <Menu.h>
#include <MenuBar.h>
#include <MenuItem.h>
@@ -20,7 +21,10 @@
#include <math.h>
#include <stdio.h>

#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Mandelbrot"


/* Those are the menu item id's of the main window */
#define	P1		0x60
#define	P2		0x61
@@ -52,21 +56,23 @@
	BMenuItem* item;
	BMenu* menu;

	menu = new BMenu("File");
	menu->AddItem(new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED), 'Q'));
	menu = new BMenu(B_TRANSLATE("File"));
	menu->AddItem(new BMenuItem(B_TRANSLATE("Quit"),
		new BMessage(B_QUIT_REQUESTED), 'Q'));
	menuBar->AddItem(menu);

	menu = new BMenu("Palette");
	menu->AddItem(new BMenuItem("Palette 1", new BMessage(P1)));
	menu->AddItem(new BMenuItem("Palette 2", new BMessage(P2)));
	menu->AddItem(item = new BMenuItem("Palette 3", new BMessage(P3)));
	menu->AddItem(new BMenuItem("Palette 4", new BMessage(P4)));
	menu = new BMenu(B_TRANSLATE("Palette"));
	menu->AddItem(new BMenuItem(B_TRANSLATE("Palette 1"), new BMessage(P1)));
	menu->AddItem(new BMenuItem(B_TRANSLATE("Palette 2"), new BMessage(P2)));
	menu->AddItem(item = new BMenuItem(B_TRANSLATE("Palette 3"),
		new BMessage(P3)));
	menu->AddItem(new BMenuItem(B_TRANSLATE("Palette 4"), new BMessage(P4)));
	menuBar->AddItem(menu);

	item->SetMarked(true);
	menu->SetRadioMode(true);

	menu = new BMenu("Iterations");
	menu = new BMenu(B_TRANSLATE("Iterations"));
	menu->AddItem(new BMenuItem("128", new BMessage(128)));
	menu->AddItem(item = new BMenuItem("256", new BMessage(256)));
	menu->AddItem(new BMenuItem("384", new BMessage(384)));
@@ -198,8 +204,9 @@
{
	BApplication* app = new BApplication("application/x-vnd.Haiku-Mandelbrot");

	BWindow* window = new TMainWindow(BRect(100, 100, 288, 288), "Mandelbrot",
		B_DOCUMENT_WINDOW, B_WILL_ACCEPT_FIRST_CLICK);
	BWindow* window = new TMainWindow(BRect(100, 100, 288, 288),
		B_TRANSLATE_SYSTEM_NAME("Mandelbrot"), B_DOCUMENT_WINDOW,
		B_WILL_ACCEPT_FIRST_CLICK);
	window->Show();

	app->Run();
diff --git a/src/kits/interface/DecorInfo.cpp b/src/kits/interface/DecorInfo.cpp
new file mode 100644
index 0000000..abec0f3 100644
--- /dev/null
+++ b/src/kits/interface/DecorInfo.cpp
@@ -1,0 +1,594 @@
/*
 * Public domain source code.
 *
 * Author:
 *		Joseph "looncraz" Groover <looncraz@satx.rr.com>
 */


#include <DecorInfo.h>

#include <new>
#include <stdio.h>

#include <Autolock.h>
#include <Directory.h>
#include <FindDirectory.h>
#include <Path.h>
#include <Resources.h>


DecorInfo::DecorInfo()
	:
	fVersion(0),
	fModificationTime(0),
	fInitStatus(B_NO_INIT)
{
}


DecorInfo::DecorInfo(const BString& path)
	:
	fPath(path),
	fVersion(0),
	fModificationTime(0),
	fInitStatus(B_NO_INIT)
{
	BEntry entry(path.String(), true);
	entry.GetRef(&fRef);

	_Init();
}


DecorInfo::DecorInfo(const entry_ref& ref)
	:
	fRef(ref),
	fVersion(0),
	fModificationTime(0),
	fInitStatus(B_NO_INIT)
{
	BPath path(&ref);
	fPath = path.Path();

	_Init();
}


DecorInfo::~DecorInfo()
{
}


status_t
DecorInfo::SetTo(const entry_ref& ref)
{
	Unset();

	BPath path(&ref);
	fPath = path.Path();
	path.Unset();

	fRef = ref;
	_Init();

	return InitCheck();
}


status_t
DecorInfo::SetTo(BString path)
{
	entry_ref ref;
	BEntry entry(path.String(), true);
	entry.GetRef(&ref);
	entry.Unset();
	return SetTo(ref);
}


status_t
DecorInfo::InitCheck()	const
{
	return fInitStatus;
}


void
DecorInfo::Unset()
{
	fRef = entry_ref();
	fPath = "";
	fName = "";
	fAuthors = "";
	fShortDescription = "";
	fLicenseURL = "";
	fLicenseName = "";
	fSupportURL = "";
	fVersion = 0;
	fModificationTime = 0;
	fInitStatus = B_NO_INIT;
}


bool
DecorInfo::IsDefault() const
{
	return fInitStatus == B_OK && fPath == "Default";
}


BString
DecorInfo::Path() const
{
	return fPath.String();
}


const entry_ref*
DecorInfo::Ref() const
{
	if (InitCheck() != B_OK || IsDefault())
		return NULL;
	return &fRef;
}


BString
DecorInfo::Name() const
{
	return fName;
}


BString
DecorInfo::ShortcutName() const
{
	if (Ref())
		return fRef.name;
	return Name();
}


BString
DecorInfo::Authors() const
{
	return fAuthors;
}


BString
DecorInfo::ShortDescription() const
{
	return fShortDescription;
}


BString
DecorInfo::LongDescription() const
{
	return fLongDescription;
}


BString
DecorInfo::LicenseURL() const
{
	return fLicenseURL;
}


BString
DecorInfo::LicenseName() const
{
	return fLicenseName;
}


BString
DecorInfo::SupportURL() const
{
	return fSupportURL;
}


float
DecorInfo::Version() const
{
	return fVersion;
}


time_t
DecorInfo::ModificationTime() const
{
	return fModificationTime;
}


bool
DecorInfo::CheckForChanges(bool& deleted)
{
	if (InitCheck() != B_OK)
		return false;

	BEntry entry(&fRef);

	if (entry.InitCheck() != B_OK)
		return false;

	if (!entry.Exists()) {
		deleted = true;
		return true;
	}

	time_t modtime = 0;
	if (entry.GetModificationTime(&modtime) != B_OK) {
		fprintf(stderr, "DecorInfo::CheckForChanges()\tERROR: "
			"BEntry:GetModificationTime() failed\n");
		return false;
	}

	if (fModificationTime != modtime) {
		_Init(true);
		return true;
	}

	return false;
}


void
DecorInfo::_Init(bool isUpdate)
{
	if (!isUpdate && InitCheck() != B_NO_INIT) {
		// TODO: remove after validation
		fprintf(stderr, "DecorInfo::_Init()\tImproper init state\n");
		return;
	}

	BEntry entry;

	if (fPath == "Default") {
		if (isUpdate){
			// should never happen
			fprintf(stderr, "DecorInfo::_Init(true)\tBUG BUG updating default"
				"decorator!?!?!\n");
			return;
		}

		fName = "Default";
		fAuthors = "DarkWyrm, Stephan Aßmus, Clemens Zeidler, Ingo Weinhold";
		fShortDescription = "Default Haiku window decorator.";
		fLongDescription = fShortDescription;
		fLicenseURL = "http://";
		fLicenseName = "MIT";
		fSupportURL = "http://www.haiku-os.org/";
		fVersion = 0.5;
		fInitStatus = B_OK;

		// The following is to get the modification time of the app_server
		// and, thusly, the Default decorator...
		// If you can make it more simple, please do!
		BPath path;
		find_directory(B_BEOS_SERVERS_DIRECTORY, &path);
		path.Append("app_server");
		entry.SetTo(path.Path(), true);
		if (!entry.Exists()) {
			fprintf(stderr, "Server MIA the world has become its slave! "
				"Call the CIA!\n");
			return;
		}

		entry.GetModificationTime(&fModificationTime);
		entry.Unset();
		return;
	}

	// Is a file system object...

	entry.SetTo(&fRef, true);	// follow link
	if (entry.InitCheck() != B_OK) {
		fInitStatus = entry.InitCheck();
		return;
	}

	if (!entry.Exists()) {
		if (isUpdate) {
			fprintf(stderr, "DecorInfo::_Init()\tERROR: decorator deleted"
					" after CheckForChanges() found it!\n");
			fprintf(stderr, "DecorInfo::_Init()\tERROR: DecorInfo will "
					"Unset\n");
			Unset();
		}
		return;
	}

	// update fRef to match file system object
	entry.GetRef(&fRef);
	entry.GetModificationTime(&fModificationTime);

	BResources resources(&fRef);
	if (resources.InitCheck() != B_OK) {
		fprintf(stderr, "DecorInfo::_Init()\t BResource InitCheck() failure\n");
		return;
	}

	size_t infoSize = 0;
	const void* infoData = resources.LoadResource(B_MESSAGE_TYPE,
		"be:decor:info", &infoSize);
	BMessage infoMessage;

	if (infoData == NULL || infoSize == 0
		|| infoMessage.Unflatten((const char*)infoData) != B_OK) {
		fprintf(stderr, "DecorInfo::_init()\tNo extended information found for"
			" \"%s\"\n", fRef.name);
	} else {
		infoMessage.FindString("name", &fName);
		infoMessage.FindString("authors", &fAuthors);
		infoMessage.FindString("short_descr", &fShortDescription);
		infoMessage.FindString("long_descr", &fLongDescription);
		infoMessage.FindString("lic_url", &fLicenseURL);
		infoMessage.FindString("lic_name", &fLicenseName);
		infoMessage.FindString("support_url", &fSupportURL);
		infoMessage.FindFloat ("version", &fVersion);
	}

	resources.Unset();
	fInitStatus = B_OK;
	fName = fRef.name;
}


// #pragma mark - DecorInfoUtility


namespace BPrivate {
	// kits/interface/InterfaceDefs.cpp
	bool get_decorator(BString&);
	status_t set_decorator(const BString&);
	status_t preview_decorator(const BString&, BWindow*);
};

using namespace BPrivate;


DecorInfoUtility::DecorInfoUtility(bool scanNow)
	:
	fHasScanned(false)
{
	// get default decorator from app_server
	DecorInfo* info = new(std::nothrow) DecorInfo("Default");
	if (info == NULL || info->InitCheck() != B_OK)	{
		delete info;
		fprintf(stderr, "DecorInfoUtility::constructor\tdefault decorator's "
				"DecorInfo failed InitCheck()\n");
		return;
	}

	fList.AddItem(info);

	if (scanNow)
		ScanDecorators();
}


DecorInfoUtility::~DecorInfoUtility()
{
	BAutolock _(fLock);
	for	(int i = fList.CountItems() - 1; i >= 0; --i)
		delete fList.ItemAt(i);
}


status_t
DecorInfoUtility::ScanDecorators()
{
	BPath decorPath;
	status_t ret = find_directory(B_USER_ADDONS_DIRECTORY, &decorPath);
	if (ret != B_OK)
		return ret;
	ret = decorPath.Append("decorators");
	if (ret != B_OK)
		return ret;

	BDirectory dir(decorPath.Path());
	ret = dir.InitCheck();
	if (ret != B_OK) {
		fprintf(stderr, "DecorInfoUtility::ScanDecorators:\tERROR: "
			"DECORATORS_DIR not found!\n");
		return ret;
	}

	BAutolock _(fLock);
	// First, run through our list and DecorInfos CheckForChanges()

	if (fHasScanned) {
		for (int i = fList.CountItems() - 1; i > 0; --i) {
			DecorInfo* decorInfo = fList.ItemAt(i);

			bool deleted = false;
			decorInfo->CheckForChanges(deleted);

			if (deleted) {
				fList.RemoveItem(decorInfo);
				delete decorInfo;
			}
		}
	}

	BPath path;
	entry_ref ref;
	// Now, look at file system, skip the entries for which we already have
	// a DecorInfo in the list.
	while (dir.GetNextRef(&ref) == B_OK) {
		path.SetTo(decorPath.Path());
		path.Append(ref.name);
		if (_FindDecor(path.Path()) != NULL)
			continue;

		DecorInfo* decorInfo = new(std::nothrow) DecorInfo(ref);
		if (decorInfo == NULL || decorInfo->InitCheck() != B_OK) {
			fprintf(stderr, "DecorInfoUtility::ScanDecorators()\tInitCheck() "
				"failure on decorator, skipping\n");
			delete decorInfo;
			continue;
		}

		fList.AddItem(decorInfo);
	}

	fHasScanned = true;

	return B_OK;
}


int32
DecorInfoUtility::CountDecorators()
{
	BAutolock _(fLock);
	if (!fHasScanned)
		ScanDecorators();

	return fList.CountItems();
}


DecorInfo*
DecorInfoUtility::DecoratorAt(int32 index)
{
	BAutolock _(fLock);
	return fList.ItemAt(index);
}


DecorInfo*
DecorInfoUtility::FindDecorator(const BString& string)
{
	if (string.Length() == 0)
		return CurrentDecorator();

	if (string.ICompare("default") == 0)
		return DefaultDecorator();

	BAutolock _(fLock);
	if (!fHasScanned)
		ScanDecorators();

	// search by path
	DecorInfo* decor = _FindDecor(string);
	if (decor != NULL)
		return decor;

	// search by cached name
	for (int i = 1; i < fList.CountItems(); ++i) {
		decor = fList.ItemAt(i);
		if (string.ICompare(decor->Name()) == 0)
			return decor;
	}

	return NULL;
}


DecorInfo*
DecorInfoUtility::CurrentDecorator()
{
	BAutolock _(fLock);
	if (!fHasScanned)
		ScanDecorators();

	BString name;
	get_decorator(name);
	return FindDecorator(name);
}


DecorInfo*
DecorInfoUtility::DefaultDecorator()
{
	BAutolock _(fLock);
	return fList.ItemAt(0);
}


bool
DecorInfoUtility::IsCurrentDecorator(DecorInfo* decor)
{
	BAutolock _(fLock);
	if (decor == NULL)
		 return false;
	return decor->Path() == CurrentDecorator()->Path();
}


status_t
DecorInfoUtility::SetDecorator(DecorInfo* decor)
{
	if (decor == NULL)
		return B_BAD_VALUE;

	BAutolock _(fLock);
	if (decor->IsDefault())
		return set_decorator("Default");

	return set_decorator(decor->Path());
}


status_t
DecorInfoUtility::SetDecorator(int32 index)
{
	BAutolock _(fLock);
	if (!fHasScanned)
		return B_ERROR;

	DecorInfo* decor = DecoratorAt(index);
	if (decor == NULL)
		return B_BAD_INDEX;

	return SetDecorator(decor);
}


status_t
DecorInfoUtility::Preview(DecorInfo* decor, BWindow* window)
{
	if (decor == NULL)
		return B_BAD_VALUE;

	return preview_decorator(decor->Path(), window);
}


// #pargma mark - private


DecorInfo*
DecorInfoUtility::_FindDecor(const BString& pathString)
{
	// find decor by path and path alone!
	if (!fLock.IsLocked()) {
		fprintf(stderr, "DecorInfoUtility::_find_decor()\tfailure to lock! - "
			"BUG BUG BUG\n");
		return NULL;
	}

	if (pathString == "Default")
		return fList.ItemAt(0);

	for (int i = 1; i < fList.CountItems(); ++i) {
		DecorInfo* decor = fList.ItemAt(i);
		// Find the DecoratorInfo either by its true current location or by
		// what we still think the location is (before we had a chance to
		// update). NOTE: This will only catch the case when the user moved the
		// folder in which the add-on file lives. It will not work when the user
		// moves the add-on file itself or renames it.
		BPath path(decor->Ref());
		if (path.Path() == pathString || decor->Path() == pathString)
			return decor;
	}

	return NULL;
}
diff --git a/src/kits/interface/InterfaceDefs.cpp b/src/kits/interface/InterfaceDefs.cpp
index 9b8f8db..ed61c2f 100644
--- a/src/kits/interface/InterfaceDefs.cpp
+++ b/src/kits/interface/InterfaceDefs.cpp
@@ -32,10 +32,12 @@
#include <ScrollBar.h>
#include <String.h>
#include <TextView.h>
#include <Window.h>

#include <ApplicationPrivate.h>
#include <AppServerLink.h>
#include <ColorConversion.h>
#include <DecorInfo.h>
#include <DefaultColors.h>
#include <InputServerTypes.h>
#include <input_globals.h>
@@ -1185,129 +1187,66 @@
}


//	#pragma mark -


/*!	\brief private function used by Deskbar to set window decor
	Note, we don't have to be compatible here, and could just change
	the Deskbar not to use this anymore
	\param theme The theme to choose

	- \c 0: BeOS
	- \c 1: AmigaOS
	- \c 2: Win95
	- \c 3: MacOS
*/
void
__set_window_decor(int32 theme)
{
	BPrivate::AppServerLink link;
	link.StartMessage(AS_R5_SET_DECORATOR);
	link.Attach<int32>(theme);
	link.Flush();
}


namespace BPrivate {


/*!	\brief queries the server for the number of available decorators
	\return the number of available decorators
*/
int32
count_decorators(void)
{
	BPrivate::AppServerLink link;
	link.StartMessage(AS_COUNT_DECORATORS);

	int32 code;
	int32 count = -1;
	if (link.FlushWithReply(code) == B_OK && code == B_OK)
		link.Read<int32>(&count);

	return count;
}


/*!	\brief queries the server for the index of the current decorators
	\return the current decorator's index

	If for some bizarre reason this function fails, it returns -1
/*!	\brief queries the server for the current decorator
	\param ref entry_ref into which to store current decorator's location
	\return boolean true/false
*/
int32
get_decorator(void)
bool
get_decorator(BString& path)
{
	BPrivate::AppServerLink link;
	link.StartMessage(AS_GET_DECORATOR);

	int32 code;
	int32 index = -1;
	if (link.FlushWithReply(code) == B_OK && code == B_OK)
		link.Read<int32>(&index);
	if (link.FlushWithReply(code) != B_OK || code != B_OK)
		return false;

	return index;
 	return link.ReadString(path) == B_OK;
}


/*!	\brief queries the server for the name of the decorator with a certain index
	\param index The index of the decorator to get the name for
	\param name BString to receive the name of the decorator
	\return B_OK if successful, B_ERROR if not
/*!	\brief Private function which sets the window decorator for the system.
	\param entry_ref to the decorator to set

	Will return detailed error status via status_t
*/
status_t
get_decorator_name(const int32 &index, BString &name)
set_decorator(const BString& path)
{
	BPrivate::AppServerLink link;
	link.StartMessage(AS_GET_DECORATOR_NAME);
	link.Attach<int32>(index);

	int32 code;
	if (link.FlushWithReply(code) == B_OK && code == B_OK) {
		char *string;
		if (link.ReadString(&string) == B_OK) {
			name = string;
			free(string);
			return B_OK;
		}
	}

	return B_ERROR;
}
	link.StartMessage(AS_SET_DECORATOR);

	link.AttachString(path.String());
	link.Flush();

/*!	\brief asks the server to draw a decorator preview into a BBitmap
	\param index The index of the decorator to get the name for
	\param bitmap BBitmap to receive the preview
	\return B_OK if successful, B_ERROR if not.
	status_t error = B_OK;
	link.Read<status_t>(&error);

	This is currently unimplemented.
*/
status_t
get_decorator_preview(const int32 &index, BBitmap *bitmap)
{
	// TODO: implement get_decorator_preview
	return B_ERROR;
	return error;
}


/*!	\brief Private function which sets the window decorator for the system.
	\param index Index of the decorator to set
/*! \brief sets a window to preview a given decorator
	\param path path to any given decorator add-on
	\param window pointer to BWindow which will show decorator

	If the index is invalid, this function and the server do nothing
	Piggy-backs on BWindow::SetDecoratorSettings(...)
*/
status_t
set_decorator(const int32 &index)
preview_decorator(const BString& path, BWindow* window)
{
	if (index < 0)
		return B_BAD_VALUE;

	BPrivate::AppServerLink link;
	if (window == NULL)
		return B_ERROR;

	link.StartMessage(AS_SET_DECORATOR);
	link.Attach<int32>(index);
	link.Flush();
	BMessage msg('prVu');
	msg.AddString("preview", path.String());

	return B_OK;
	return window->SetDecoratorSettings(msg);
}


diff --git a/src/kits/interface/Jamfile b/src/kits/interface/Jamfile
index 4545803..911473a 100644
--- a/src/kits/interface/Jamfile
+++ b/src/kits/interface/Jamfile
@@ -49,6 +49,7 @@
	ColorTools.cpp
	Control.cpp
	ControlLook.cpp
	DecorInfo.cpp
	Deskbar.cpp
	Dragger.cpp
	Font.cpp
diff --git a/src/preferences/appearance/APRView.cpp b/src/preferences/appearance/APRView.cpp
index 2b3f546..bbe2863 100644
--- a/src/preferences/appearance/APRView.cpp
+++ b/src/preferences/appearance/APRView.cpp
@@ -20,7 +20,10 @@
#include <Path.h>
#include <SpaceLayoutItem.h>

#include <private/interface/DecorInfo.h>

#include <stdio.h>


#include "APRWindow.h"
#include "defs.h"
@@ -35,39 +38,33 @@
#define COLOR_DROPPED 'cldp'
#define DECORATOR_CHANGED 'dcch'

namespace BPrivate
{
	int32 count_decorators(void);
	status_t set_decorator(const int32 &index);
	int32 get_decorator(void);
	status_t get_decorator_name(const int32 &index, BString &name);
	status_t get_decorator_preview(const int32 &index, BBitmap *bitmap);
}

APRView::APRView(const char *name, uint32 flags)
 :	BView(name, flags),
APRView::APRView(const char* name, uint32 flags)
	:
 	BView(name, flags),
 	fDefaultSet(ColorSet::DefaultColorSet()),
 	fDecorMenu(NULL)
 	fDecorMenu(NULL),
 	fDecorUtil(new DecorInfoUtility(false))
{
	SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));

#if 0

	fDecorMenu = new BMenu("Window Style");
	int32 decorCount = BPrivate::count_decorators();
	int32 decorCount = fDecorUtil->CountDecorators();
	DecorInfo* decor = NULL;
	if (decorCount > 1) {
		for (int32 i = 0; i < decorCount; i++) {
			BString name;
			BPrivate::get_decorator_name(i, name);
			if (name.CountChars() < 1)
			decor = fDecorUtil->GetDecorator(i);
			if (!decor)
				continue;
			fDecorMenu->AddItem(new BMenuItem(name.String(),
			fDecorMenu->AddItem(new BMenuItem(decor->Name().String(),
				new BMessage(DECORATOR_CHANGED)));
		}

		BMenuField *field = new BMenuField("Window Style", fDecorMenu);
		BMenuField* field = new BMenuField("Window Style", fDecorMenu);
		// TODO: use this menu field.
	}
	BMenuItem *marked = fDecorMenu->ItemAt(BPrivate::get_decorator());
	BMenuItem* marked = fDecorMenu->ItemAt(fDecorUtil->IndexOfCurrentDecorator());
	if (marked)
		marked->SetMarked(true);
	else {
@@ -156,7 +153,7 @@
			int32 index = fDecorMenu->IndexOf(fDecorMenu->FindMarked());
			#ifdef HAIKU_TARGET_PLATFORM_HAIKU
			if (index >= 0)
				BPrivate::set_decorator(index);
				fDecorUtil->SetDecorator(index);
			#endif
			break;
		}
@@ -207,7 +204,7 @@
				if (item) {
					item->SetMarked(true);
					#ifdef HAIKU_TARGET_PLATFORM_HAIKU
					BPrivate::set_decorator(fDecorMenu->IndexOf(item));
					fDecorUtil->SetDecorator(fDecorMenu->IndexOf(item));
					#endif
				}
			}
diff --git a/src/preferences/appearance/APRView.h b/src/preferences/appearance/APRView.h
index fbc75ee..e51ed2d 100644
--- a/src/preferences/appearance/APRView.h
+++ b/src/preferences/appearance/APRView.h
@@ -28,6 +28,7 @@
#include "ColorSet.h"

class ColorWell;
class DecorInfoUtility;
class APRWindow;

class APRView : public BView
@@ -62,6 +63,7 @@
	ColorSet		fDefaultSet;
	
	BMenu			*fDecorMenu;
	DecorInfoUtility*fDecorUtil;
};

#endif
diff --git a/src/servers/app/DecorManager.cpp b/src/servers/app/DecorManager.cpp
index 10c621d..9b53e06 100644
--- a/src/servers/app/DecorManager.cpp
+++ b/src/servers/app/DecorManager.cpp
@@ -1,10 +1,11 @@
/*
 * Copyright (c) 2001-2010, Haiku, Inc.
 * Copyright (c) 2001-2011, Haiku, Inc.
 * Distributed under the terms of the MIT license.
 *
 * Author:
 *		DarkWyrm <bpmagic@columbus.rr.com>
 *		Clemens Zeidler <haiku@clemens-zeidler.de>
 *		Joseph Groover <looncraz@satx.rr.com>
 */

#include "DecorManager.h"
@@ -44,7 +45,6 @@

DecorAddOn::~DecorAddOn()
{

}


@@ -70,6 +70,7 @@

	if (!decorator)
		return NULL;

	decorator->SetDrawingEngine(engine);
	decorator->SetTitle(title);

@@ -104,87 +105,23 @@

DecorManager::DecorManager()
	:
	fDefaultDecorAddOn(-1, "Default"),
	fCurrentDecor(NULL)
	fDefaultDecor(-1, "Default"),
	fCurrentDecor(&fDefaultDecor),
	fPreviewDecor(NULL),
	fPreviewWindow(NULL),
	fCurrentDecorPath("Default")
{
	// Start with the default decorator - index is always 0
	fDecorList.AddItem(&fDefaultDecorAddOn);

	// Add any on disk
	RescanDecorators();

	_LoadSettingsFromDisk();

	if (!fCurrentDecor)
		fCurrentDecor = fDecorList.ItemAt(0L);
}


DecorManager::~DecorManager()
{
	_EmptyList();
}


void
DecorManager::RescanDecorators()
{
	BDirectory dir(DECORATORS_DIR);

	if (dir.InitCheck() != B_OK)
		return;

	entry_ref ref;
	while (dir.GetNextRef(&ref) == B_OK) {
		BPath path;
		path.SetTo(DECORATORS_DIR);
		path.Append(ref.name);

		// Because this function is used for both initialization and for keeping
		// the list up to date, check for existence in the list. Note that we
		// do not check to see if a decorator has been removed. This is for
		// stability. If there is a decorator in memory already whose file has
		// been deleted, it is still available until the next boot, at which point
		// it will obviously not be loaded.

		if (_FindDecor(ref.name))
			continue;

		image_id image = load_add_on(path.Path());
		if (image < 0)
			continue;

		// As of now, we do nothing with decorator versions, but the possibility
		// exists that the API will change even though I cannot forsee any reason
		// to do so. If we *did* do anything with decorator versions, the 
		// assignment would go here.

		create_decor_addon* createFunc;

		// Get the instantiation function
		status_t status = get_image_symbol(image, "instantiate_decor_addon",
								B_SYMBOL_TYPE_TEXT, (void**)&createFunc);
		if (status != B_OK) {
			unload_add_on(image);
			continue;
		}

		DecorAddOn* addon = createFunc(image, ref.name);

		// TODO: unload images until they are actually used!
		if (!addon || addon->InitCheck() != B_OK
			|| !fDecorList.AddItem(addon)) {
			unload_add_on(image);
			delete addon;
			continue;
		}
	}
}


Decorator *
DecorManager::AllocateDecorator(Desktop* desktop, DrawingEngine* engine,
	BRect rect, const char* title, window_look look, uint32 flags)
Decorator*
DecorManager::AllocateDecorator(Window* window)
{
	// Create a new instance of the current decorator.
	// Ownership is that of the caller
@@ -195,8 +132,20 @@
		return NULL;
	}

	return fCurrentDecor->AllocateDecorator(desktop, engine, rect, title,
		look, flags);
	// Are we previewing a specific decorator?
	if (window == fPreviewWindow) {
		if (fPreviewDecor != NULL) {
			return fPreviewDecor->AllocateDecorator(window->Desktop(),
				window->GetDrawingEngine(), window->Frame(), window->Title(),
				window->Look(), window->Flags());
		} else {
			fPreviewWindow = NULL;
		}
	}

	return fCurrentDecor->AllocateDecorator(window->Desktop(),
		window->GetDrawingEngine(), window->Frame(), window->Title(),
		window->Look(), window->Flags());
}


@@ -213,107 +162,151 @@
}


const DesktopListenerList&
DecorManager::GetDesktopListeners()
void
DecorManager::CleanupForWindow(Window* window)
{
	return fCurrentDecor->GetDesktopListeners();
}
	// Given window is being deleted, do any cleanup needed
	if (fPreviewWindow == window && window != NULL){
		fPreviewWindow = NULL;

		if (fPreviewDecor != NULL)
			unload_add_on(fPreviewDecor->ImageID());

int32
DecorManager::CountDecorators() const
{
	return fDecorList.CountItems();
		fPreviewDecor = NULL;
	}
}


int32
DecorManager::GetDecorator() const
{
	return fDecorList.IndexOf(fCurrentDecor);
}
status_t
DecorManager::PreviewDecorator(BString path, Window* window)
{
	if (fPreviewWindow != NULL && fPreviewWindow != window){
		// Reset other window to current decorator - only one can preview
		Window* oldPreviewWindow = fPreviewWindow;
		fPreviewWindow = NULL;
		oldPreviewWindow->ReloadDecor();
	}

	if (window == NULL)
		return B_BAD_VALUE;

bool
DecorManager::SetDecorator(int32 index, Desktop* desktop)
{
	DecorAddOn* newDecor = fDecorList.ItemAt(index);
	// We have to jump some hoops because the window must be able to
	// delete its decorator before we unload the add-on
	status_t error = B_OK;
	DecorAddOn* decorPtr = _LoadDecor(path, error);
	if (decorPtr == NULL)
		return error == B_OK ? B_ERROR : error;

	if (newDecor) {
		fCurrentDecor = newDecor;
		desktop->ReloadDecor();
		_SaveSettingsToDisk();
		return true;
	}
	BRegion border;
	window->GetBorderRegion(&border);

	return false;
}
	DecorAddOn* oldDecor = fPreviewDecor;
	fPreviewDecor = decorPtr;
	fPreviewWindow = window;
	// After this call, the window has deleted its decorator.
	fPreviewWindow->ReloadDecor();

	BRegion newBorder;
	window->GetBorderRegion(&newBorder);

bool
DecorManager::SetR5Decorator(int32 value)
{
	BString string;

	switch (value) {
		case 0: string = "BeOS"; break;
		case 1: string = "AmigaOS"; break;
		case 2: string = "Windows"; break;
		case 3: string = "MacOS"; break;
		default:
			return false;
	}
	border.Include(&newBorder);
	window->Desktop()->RebuildAndRedrawAfterWindowChange(window, border);

	DecorAddOn *newDecor = _FindDecor(string);
	if (newDecor) {
		fCurrentDecor = newDecor;
		return true;
	}
	if (oldDecor != NULL)
		unload_add_on(oldDecor->ImageID());

	return false;
	return B_OK;
}


BString
DecorManager::GetDecoratorName(int32 index)
const DesktopListenerList&
DecorManager::GetDesktopListeners()
{
	DecorAddOn *decor = fDecorList.ItemAt(index);
	if (decor)
		return decor->Name();
	return fCurrentDecor->GetDesktopListeners();
}

	return BString("");

BString
DecorManager::GetCurrentDecorator() const
{
	return fCurrentDecorPath.String();
}


void
DecorManager::_EmptyList()
{
	for (int32 i = 1; i < fDecorList.CountItems(); i++) {
		unload_add_on(fDecorList.ItemAt(i)->ImageID());
		delete fDecorList.ItemAt(i);
status_t
DecorManager::SetDecorator(BString path, Desktop* desktop)
{
	status_t error = B_OK;
	DecorAddOn* newDecor = _LoadDecor(path, error);
	if (newDecor == NULL)
		return error == B_OK ? B_ERROR : error;

	DecorAddOn* oldDecor = fCurrentDecor;
	BString oldPath = fCurrentDecorPath;
	image_id oldImage = fCurrentDecor->ImageID();

	fCurrentDecor = newDecor;
	fCurrentDecorPath = path.String();

	if (desktop->ReloadDecor()) {
		// now safe to unload all old decorator data
		// saves us from deleting oldDecor...
		unload_add_on(oldImage);
		_SaveSettingsToDisk();
		return B_OK;
	}

	fDecorList.MakeEmpty();
	fDecorList.AddItem(&fDefaultDecorAddOn);
	// TODO: unloading the newDecor and its image
	// problem is we don't know how many windows failed... or why they failed...
	syslog(LOG_WARNING,
		"app_server:DecorManager:SetDecorator:\"%s\" *partly* failed\n",
		fCurrentDecorPath.String());

	fCurrentDecor = &fDefaultDecorAddOn;
	fCurrentDecor = oldDecor;
	fCurrentDecorPath = oldPath;
	return B_ERROR;
}


DecorAddOn*
DecorManager::_FindDecor(BString name)
{
	if (!name)
DecorManager::_LoadDecor(BString _path, status_t& error )
{
	if (_path == "Default") {
		error = B_OK;
		return &fDefaultDecor;
	}

	BEntry entry(_path.String(), true);
	if (!entry.Exists()) {
		error = B_ENTRY_NOT_FOUND;
		return NULL;
	}

	BPath path(&entry);
	image_id image = load_add_on(path.Path());
	if (image < 0) {
		error = B_BAD_IMAGE_ID;
		return NULL;
	}

	for (int32 i = 0; i < fDecorList.CountItems(); i++) {
		DecorAddOn* decor = fDecorList.ItemAt(i);
	create_decor_addon*	createFunc;
	if (get_image_symbol(image, "instantiate_decor_addon", B_SYMBOL_TYPE_TEXT,
			(void**)&createFunc) != B_OK) {
		unload_add_on(image);
		error = B_MISSING_SYMBOL;
		return NULL;
	}

		if (decor->Name() == name)
			return decor;
	char name[B_FILE_NAME_LENGTH];
	entry.GetName(name);
	DecorAddOn* newDecor = createFunc(image, name);
	if (newDecor == NULL || newDecor->InitCheck() != B_OK) {
		unload_add_on(image);
		error = B_ERROR;
		return NULL;
	}

	return NULL;
	return newDecor;
}


@@ -338,12 +331,15 @@

	BMessage settings;
	if (settings.Unflatten(&file) == B_OK) {
		BString itemtext;
		if (settings.FindString("decorator", &itemtext) == B_OK) {
			DecorAddOn* decor = _FindDecor(itemtext);
			if (decor) {
		BString itemPath;
		if (settings.FindString("decorator", &itemPath) == B_OK) {
			status_t error = B_OK;
			DecorAddOn* decor = _LoadDecor(itemPath, error);
			if (decor != NULL) {
				fCurrentDecor = decor;
				return true;
			} else {
				//TODO: do something with the reported error
			}
		}
	}
@@ -371,7 +367,7 @@
		return false;

	BMessage settings;
	if (settings.AddString("decorator", fCurrentDecor->Name()) != B_OK)
	if (settings.AddString("decorator", fCurrentDecorPath.String()) != B_OK)
		return false;
	if (settings.Flatten(&file) != B_OK)
		return false;
diff --git a/src/servers/app/DecorManager.h b/src/servers/app/DecorManager.h
index 15dc6c1..92feeb0 100644
--- a/src/servers/app/DecorManager.h
+++ b/src/servers/app/DecorManager.h
@@ -14,10 +14,11 @@
#include <String.h>
#include <Locker.h>
#include <ObjectList.h>
#include <Entry.h>
#include <DecorInfo.h>

#include "Decorator.h"

class DecorInfo;
class Desktop;
class DesktopListener;
class DrawingEngine;
@@ -28,6 +29,9 @@
typedef BObjectList<DesktopListener> DesktopListenerList;


// special name to test for use of non-fs-tied default decorator
// this just keeps things clean and simple is all

class DecorAddOn {
public:
								DecorAddOn(image_id id, const char* name);
@@ -35,68 +39,57 @@

	virtual status_t			InitCheck() const;

		image_id				ImageID() const { return fImageID; }
		BString					Name() const { return fName; }
			image_id			ImageID() const { return fImageID; }

		Decorator*				AllocateDecorator(Desktop* desktop,
			Decorator*			AllocateDecorator(Desktop* desktop,
									DrawingEngine* engine, BRect rect,
									const char* title, window_look look,
									uint32 flags);

	virtual float				Version() { return 1.0; }
	virtual WindowBehaviour*	AllocateWindowBehaviour(Window* window);
	virtual	WindowBehaviour*	AllocateWindowBehaviour(Window* window);

	virtual const DesktopListenerList&	GetDesktopListeners();
	virtual const DesktopListenerList& GetDesktopListeners();

protected:
	virtual Decorator*			_AllocateDecorator(DesktopSettings& settings,
									BRect rect, window_look look, uint32 flags);

		DesktopListenerList		fDesktopListeners;
			DesktopListenerList	fDesktopListeners;

private:
		image_id				fImageID;
		BString 				fName;
			image_id			fImageID;
			BString 			fName;
};


class DecorManager
{
class DecorManager {
public:
					DecorManager();
					~DecorManager();
								DecorManager();
								~DecorManager();

		void		RescanDecorators();
			Decorator*			AllocateDecorator(Window *window);
			WindowBehaviour*	AllocateWindowBehaviour(Window *window);
			void				CleanupForWindow(Window *window);

		Decorator*	AllocateDecorator(Desktop* desktop,
						DrawingEngine* engine,
						BRect rect,
						const char* title, window_look look,
						uint32 flags);
		WindowBehaviour*			AllocateWindowBehaviour(Window* window);
		const DesktopListenerList&	GetDesktopListeners();
			status_t			PreviewDecorator(BString path, Window *window);

		int32		CountDecorators() const;
			const DesktopListenerList& GetDesktopListeners();

		int32		GetDecorator() const;
		bool		SetDecorator(int32 index, Desktop* desktop);
		bool		SetR5Decorator(int32 value);
		BString		GetDecoratorName(int32 index);
			BString 			GetCurrentDecorator() const;
			status_t			SetDecorator(BString path, Desktop *desktop);

		// TODO: Implement this method once the rest of the necessary infrastructure
		// is in place
		//status_t	GetPreview(int32 index, ServerBitmap *bitmap);
private:
			DecorAddOn*			_LoadDecor(BString path, status_t &error);
			bool				_LoadSettingsFromDisk();
			bool				_SaveSettingsToDisk();

private:
		void		_EmptyList();
		DecorAddOn*	_FindDecor(BString name);

		bool		_LoadSettingsFromDisk();
		bool		_SaveSettingsToDisk();

		BObjectList<DecorAddOn> fDecorList;
		DecorAddOn	fDefaultDecorAddOn;
		DecorAddOn*	fCurrentDecor;
			DecorAddOn			fDefaultDecor;
			DecorAddOn*			fCurrentDecor;
			DecorAddOn*			fPreviewDecor;

			Window*				fPreviewWindow;
			BString				fCurrentDecorPath;
};

extern DecorManager gDecorManager;
diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp
index ac05af8..d6a5d28 100644
--- a/src/servers/app/Desktop.cpp
+++ b/src/servers/app/Desktop.cpp
@@ -17,7 +17,6 @@


#include "Desktop.h"

#include <stdio.h>
#include <string.h>
#include <syslog.h>
@@ -2044,11 +2043,13 @@
}


void
bool
Desktop::ReloadDecor()
{
	AutoWriteLocker _(fWindowLock);

	bool returnValue = true;

	// TODO it is assumed all listeners are registered by one decor
	// unregister old listeners
	const DesktopListenerDLList& currentListeners = GetDesktopListenerList();
@@ -2058,16 +2059,19 @@

	for (Window* window = fAllWindows.FirstWindow(); window != NULL;
			window = window->NextWindow(kAllWindowList)) {
			BRegion oldBorder;
			window->GetBorderRegion(&oldBorder);

			window->ReloadDecor();
		BRegion oldBorder;
		window->GetBorderRegion(&oldBorder);

		if (!window->ReloadDecor()) {
			// prevent unloading previous add-on
			returnValue = false;
		}

			BRegion border;
			window->GetBorderRegion(&border);
		BRegion border;
		window->GetBorderRegion(&border);

			border.Include(&oldBorder);
			RebuildAndRedrawAfterWindowChange(window, border);
		border.Include(&oldBorder);
		RebuildAndRedrawAfterWindowChange(window, border);
	}

	// register new listeners
@@ -2075,6 +2079,8 @@
		= gDecorManager.GetDesktopListeners();
	for (int i = 0; i < newListeners.CountItems(); i++)
 		RegisterListener(newListeners.ItemAt(i));

 	return returnValue;
}


diff --git a/src/servers/app/Desktop.h b/src/servers/app/Desktop.h
index e5f4d88..388c3f4 100644
--- a/src/servers/app/Desktop.h
+++ b/src/servers/app/Desktop.h
@@ -221,7 +221,7 @@
			void				Redraw();
			void				RedrawBackground();

			void				ReloadDecor();
			bool				ReloadDecor();

			BRegion&			BackgroundRegion()
									{ return fBackgroundRegion; }
diff --git a/src/servers/app/ProfileMessageSupport.cpp b/src/servers/app/ProfileMessageSupport.cpp
index 3a6192f..5472f04 100644
--- a/src/servers/app/ProfileMessageSupport.cpp
+++ b/src/servers/app/ProfileMessageSupport.cpp
@@ -162,10 +162,6 @@
		CODE(AS_SET_UI_COLOR);
		CODE(AS_SET_DECORATOR);
		CODE(AS_GET_DECORATOR);
		case AS_R5_SET_DECORATOR:
			string = "AS_R5_SET_DECORATOR"; break;
		CODE(AS_COUNT_DECORATORS);
		CODE(AS_GET_DECORATOR_NAME);

		CODE(AS_SET_WORKSPACE_LAYOUT);
		CODE(AS_GET_WORKSPACE_LAYOUT);
diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp
index 65724f3..c5dce90 100644
--- a/src/servers/app/ServerApp.cpp
+++ b/src/servers/app/ServerApp.cpp
@@ -648,65 +648,26 @@
		case AS_SET_DECORATOR:
		{
			// Attached Data:
			// int32 the index of the decorator to use
			// path to decorator add-on

			int32 index;
			link.Read<int32>(&index);
			if (gDecorManager.SetDecorator(index, fDesktop))
				fDesktop->BroadcastToAllApps(AS_UPDATE_DECORATOR);
			break;
		}
			BString path;
			link.ReadString(path);

		case AS_COUNT_DECORATORS:
		{
			fLink.StartMessage(B_OK);
			fLink.Attach<int32>(gDecorManager.CountDecorators());
			status_t error = gDecorManager.SetDecorator(path, fDesktop);

			fLink.Attach<status_t>(error);
			fLink.Flush();

			if (error == B_OK)
				fDesktop->BroadcastToAllApps(AS_UPDATE_DECORATOR);
			break;
		}

		case AS_GET_DECORATOR:
		{
			fLink.StartMessage(B_OK);
			fLink.Attach<int32>(gDecorManager.GetDecorator());
			fLink.Flush();
			break;
		}

		case AS_GET_DECORATOR_NAME:
		{
			int32 index;
			link.Read<int32>(&index);

			BString str(gDecorManager.GetDecoratorName(index));
			if (str.CountChars() > 0) {
				fLink.StartMessage(B_OK);
				fLink.AttachString(str.String());
			} else
				fLink.StartMessage(B_ERROR);

			fLink.AttachString(gDecorManager.GetCurrentDecorator().String());
			fLink.Flush();
			break;
		}

		case AS_R5_SET_DECORATOR:
		{
			// Sort of supports Tracker's nifty Easter Egg. It was easy to do
			// and it's kind of neat, so why not?

			// Attached Data:
			// int32 value of the decorator to use
			// 0: BeOS
			// 1: Amiga
			// 2: Windows
			// 3: MacOS

			int32 decindex = 0;
			link.Read<int32>(&decindex);

			if (gDecorManager.SetR5Decorator(decindex))
				fDesktop->BroadcastToAllApps(AS_UPDATE_DECORATOR);

			break;
		}

diff --git a/src/servers/app/Window.cpp b/src/servers/app/Window.cpp
index 40b3639..dd57406 100644
--- a/src/servers/app/Window.cpp
+++ b/src/servers/app/Window.cpp
@@ -129,8 +129,7 @@
	SetFlags(flags, NULL);

	if (fLook != B_NO_BORDER_WINDOW_LOOK) {
		fDecorator = gDecorManager.AllocateDecorator(fDesktop, fDrawingEngine,
			frame, name, fLook, fFlags);
		fDecorator = gDecorManager.AllocateDecorator(this);
		if (fDecorator) {
			fDecorator->GetSizeLimits(&fMinWidth, &fMinHeight,
				&fMaxWidth, &fMaxHeight);
@@ -172,8 +171,9 @@

	delete fWindowBehaviour;
	delete fDecorator;

	delete fDrawingEngine;

	gDecorManager.CleanupForWindow(this);
}


@@ -548,19 +548,19 @@
{
	::Decorator* decorator = NULL;
	WindowBehaviour* windowBehaviour = NULL;


	if (fLook != B_NO_BORDER_WINDOW_LOOK) {
		// we need a new decorator
		decorator = gDecorManager.AllocateDecorator(fDesktop, fDrawingEngine,
			Frame(), Title(), fLook, fFlags);
		if (!decorator)
		decorator = gDecorManager.AllocateDecorator(this);
		if (decorator == NULL)
			return false;
		if (IsFocus())
			decorator->SetFocus(true);
	}

	windowBehaviour = gDecorManager.AllocateWindowBehaviour(this);
	if (!windowBehaviour) {
	if (windowBehaviour == NULL) {
		delete decorator;
		return false;
	}
@@ -1108,6 +1108,14 @@
bool
Window::SetDecoratorSettings(const BMessage& settings, BRegion& dirty)
{
	if (settings.what == 'prVu') {
		// 'prVu' == preview a decorator!
		BString path;
		if (settings.FindString("preview", &path) == B_OK)
			return gDecorManager.PreviewDecorator(path, this) == B_OK;
		return false;
	}

	if (fDecorator)
		return fDecorator->SetSettings(settings, &dirty);
	return false;
@@ -1142,8 +1150,7 @@
{
	if (fDecorator == NULL && look != B_NO_BORDER_WINDOW_LOOK) {
		// we need a new decorator
		fDecorator = gDecorManager.AllocateDecorator(fDesktop, fDrawingEngine,
			Frame(), Title(), fLook, fFlags);
		fDecorator = gDecorManager.AllocateDecorator(this);
		if (IsFocus())
			fDecorator->SetFocus(true);
	}
diff --git a/src/servers/app/Window.h b/src/servers/app/Window.h
index 7b62336..749ba08 100644
--- a/src/servers/app/Window.h
+++ b/src/servers/app/Window.h
@@ -375,6 +375,8 @@
			int32				fMaxHeight;

			int32				fWorkspacesViewCount;

		friend class DecorManager;
};

#endif // WINDOW_H
diff --git a/src/add-ons/decorators/BeDecorator/BeDecorator.cpp b/src/add-ons/decorators/BeDecorator/BeDecorator.cpp
index bf7907e..2c39148 100644
--- a/src/add-ons/decorators/BeDecorator/BeDecorator.cpp
+++ b/src/add-ons/decorators/BeDecorator/BeDecorator.cpp
@@ -93,13 +93,6 @@
}


float
BeDecorAddOn::Version()
{
	return 1.00;
}


Decorator*
BeDecorAddOn::_AllocateDecorator(DesktopSettings& settings, BRect rect,
	window_look look, uint32 flags)
diff --git a/src/add-ons/decorators/BeDecorator/BeDecorator.h b/src/add-ons/decorators/BeDecorator/BeDecorator.h
index a6bb80d..34ad4b0 100644
--- a/src/add-ons/decorators/BeDecorator/BeDecorator.h
+++ b/src/add-ons/decorators/BeDecorator/BeDecorator.h
@@ -24,8 +24,6 @@
public:
								BeDecorAddOn(image_id id, const char* name);

			float				Version();

protected:
	virtual Decorator*			_AllocateDecorator(DesktopSettings& settings,
									BRect rect, window_look look, uint32 flags);
diff --git a/src/add-ons/decorators/BeDecorator/Jamfile b/src/add-ons/decorators/BeDecorator/Jamfile
index 6a1dc0f..2cea3d0 100644
--- a/src/add-ons/decorators/BeDecorator/Jamfile
+++ b/src/add-ons/decorators/BeDecorator/Jamfile
@@ -7,7 +7,10 @@
UsePrivateHeaders app shared interface graphics ;
UseLibraryHeaders agg ;

AddResources ClassicBe : resources.rdef ;

Addon ClassicBe :
	BeDecorator.cpp
	: be <nogrist>app_server $(TARGET_LIBSTDC++) $(TARGET_LIBSUPC++)
	: resources.rdef
;
diff --git a/src/add-ons/decorators/BeDecorator/resources.rdef b/src/add-ons/decorators/BeDecorator/resources.rdef
new file mode 100644
index 0000000..6174acd 100644
--- /dev/null
+++ b/src/add-ons/decorators/BeDecorator/resources.rdef
@@ -1,0 +1,10 @@
resource("be:decor:info") message('deco') {
	"name"			= "Classic BeOS",
	"authors"		= "DarkWyrm, Stephan Aßmus, Clemens Zeidler",
	"short_descr"	= "Basic appearance of the classic BeOS.",
	"long_descr"	= "",
	"lic_url"		= "",
	"lic_name"		= "MIT",
	"support_url"	= "http://www.haiku-os.org/",
	float "version"	= 1.0
};
diff --git a/src/add-ons/decorators/MacDecorator/Jamfile b/src/add-ons/decorators/MacDecorator/Jamfile
index 7671ab5..f6eacce 100644
--- a/src/add-ons/decorators/MacDecorator/Jamfile
+++ b/src/add-ons/decorators/MacDecorator/Jamfile
@@ -7,6 +7,8 @@
UsePrivateHeaders app shared interface graphics ;
UseLibraryHeaders agg ;

AddResources MacDecorator : resources.rdef ;

Addon MacDecorator :
	MacDecorator.cpp
	: be <nogrist>app_server $(TARGET_LIBSTDC++)
diff --git a/src/add-ons/decorators/MacDecorator/MacDecorator.cpp b/src/add-ons/decorators/MacDecorator/MacDecorator.cpp
index df94420..5f8d362 100644
--- a/src/add-ons/decorators/MacDecorator/MacDecorator.cpp
+++ b/src/add-ons/decorators/MacDecorator/MacDecorator.cpp
@@ -38,13 +38,6 @@
}


float
MacDecorAddOn::Version()
{
	return 1.00;
}


Decorator*
MacDecorAddOn::_AllocateDecorator(DesktopSettings& settings, BRect rect,
	window_look look, uint32 flags)
diff --git a/src/add-ons/decorators/MacDecorator/MacDecorator.h b/src/add-ons/decorators/MacDecorator/MacDecorator.h
index e1aa512..634e61a 100644
--- a/src/add-ons/decorators/MacDecorator/MacDecorator.h
+++ b/src/add-ons/decorators/MacDecorator/MacDecorator.h
@@ -14,8 +14,6 @@
public:
								MacDecorAddOn(image_id id, const char* name);

			float				Version();

protected:
	virtual Decorator*			_AllocateDecorator(DesktopSettings& settings,
									BRect rect, window_look look, uint32 flags);
diff --git a/src/add-ons/decorators/MacDecorator/resources.rdef b/src/add-ons/decorators/MacDecorator/resources.rdef
new file mode 100644
index 0000000..d10ae68 100644
--- /dev/null
+++ b/src/add-ons/decorators/MacDecorator/resources.rdef
@@ -1,0 +1,10 @@
resource("be:decor:info") message('deco') {
	"name"			= "MacOS 9",
	"authors"		= "",
	"short_descr"	= "MacOS 9",
	"long_descr"	= "",
	"lic_url"		= "",
	"lic_name"		= "MIT",
	"support_url"	= "http://www.haiku-os.org/",
	float "version"	= 1.0
};
diff --git a/src/add-ons/decorators/SATDecorator/Jamfile b/src/add-ons/decorators/SATDecorator/Jamfile
index 94f39b7..1f07f3e 100644
--- a/src/add-ons/decorators/SATDecorator/Jamfile
+++ b/src/add-ons/decorators/SATDecorator/Jamfile
@@ -8,6 +8,8 @@
UseHeaders [ FDirName $(HAIKU_TOP) src servers app drawing Painter ] ;
UseFreeTypeHeaders ;

AddResources SATDecorator : resources.rdef ;

Addon SATDecorator :
	SATDecorator.cpp
	SATGroup.cpp
diff --git a/src/add-ons/decorators/SATDecorator/SATDecorator.cpp b/src/add-ons/decorators/SATDecorator/SATDecorator.cpp
index e9bcce9..c31d739 100644
--- a/src/add-ons/decorators/SATDecorator/SATDecorator.cpp
+++ b/src/add-ons/decorators/SATDecorator/SATDecorator.cpp
@@ -66,13 +66,6 @@
}


float
SATDecorAddOn::Version()
{
	return 0.1;
}


Decorator*
SATDecorAddOn::_AllocateDecorator(DesktopSettings& settings, BRect rect,
	window_look look, uint32 flags)
diff --git a/src/add-ons/decorators/SATDecorator/SATDecorator.h b/src/add-ons/decorators/SATDecorator/SATDecorator.h
index 3eb9c5d..e722625 100644
--- a/src/add-ons/decorators/SATDecorator/SATDecorator.h
+++ b/src/add-ons/decorators/SATDecorator/SATDecorator.h
@@ -19,7 +19,6 @@
								SATDecorAddOn(image_id id, const char* name);

	virtual status_t			InitCheck() const;
			float				Version();

protected:
	virtual Decorator*			_AllocateDecorator(DesktopSettings& settings,
diff --git a/src/add-ons/decorators/SATDecorator/resources.rdef b/src/add-ons/decorators/SATDecorator/resources.rdef
new file mode 100644
index 0000000..3ceacd0 100644
--- /dev/null
+++ b/src/add-ons/decorators/SATDecorator/resources.rdef
@@ -1,0 +1,11 @@
resource("be:decor:info") message('deco') {
	"name"			= "Stack and Tile",
	"authors"		= "Clemens Zeidler, Ingo Weinhold",
	"short_descr"	= "Default look with ability to stack & tile windows.",
	"long_descr"	= "Group windows together and take advantage of those"
						" tabs!\n\nTODO: instructions",
	"lic_url"		= "",
	"lic_name"		= "MIT",
	"support_url"	= "http://www.haiku-os.org/",
	float "version"	= 1.0
};
diff --git a/src/add-ons/decorators/WinDecorator/Jamfile b/src/add-ons/decorators/WinDecorator/Jamfile
index fa945b9..49acf41 100644
--- a/src/add-ons/decorators/WinDecorator/Jamfile
+++ b/src/add-ons/decorators/WinDecorator/Jamfile
@@ -7,6 +7,8 @@
UsePrivateHeaders app shared interface graphics ;
UseLibraryHeaders agg ;

AddResources WinDecorator : resources.rdef ;

Addon WinDecorator :
	WinDecorator.cpp
	: be <nogrist>app_server $(TARGET_LIBSTDC++)
diff --git a/src/add-ons/decorators/WinDecorator/WinDecorator.cpp b/src/add-ons/decorators/WinDecorator/WinDecorator.cpp
index fc7971e..8368419 100644
--- a/src/add-ons/decorators/WinDecorator/WinDecorator.cpp
+++ b/src/add-ons/decorators/WinDecorator/WinDecorator.cpp
@@ -37,13 +37,6 @@
}


float
WinDecorAddOn::Version()
{
	return 1.00;
}


Decorator*
WinDecorAddOn::_AllocateDecorator(DesktopSettings& settings, BRect rect,
	window_look look, uint32 flags)
diff --git a/src/add-ons/decorators/WinDecorator/WinDecorator.h b/src/add-ons/decorators/WinDecorator/WinDecorator.h
index eddd59d..aec2b0f 100644
--- a/src/add-ons/decorators/WinDecorator/WinDecorator.h
+++ b/src/add-ons/decorators/WinDecorator/WinDecorator.h
@@ -14,7 +14,6 @@
public:
								WinDecorAddOn(image_id id, const char* name);

			float				Version();

protected:
	virtual Decorator*			_AllocateDecorator(DesktopSettings& settings,
diff --git a/src/add-ons/decorators/WinDecorator/resources.rdef b/src/add-ons/decorators/WinDecorator/resources.rdef
new file mode 100644
index 0000000..06e3be2 100644
--- /dev/null
+++ b/src/add-ons/decorators/WinDecorator/resources.rdef
@@ -1,0 +1,10 @@
resource("be:decor:info") message('deco') {
	"name"				= "Windows 95",
	"authors"			= "",
	"short_descr"		= "Windows 95",
	"long_descr"		= "",
	"lic_url"			= "",
	"lic_name"			= "MIT",
	"support_url"		= "http://www.haiku-os.org/",
	float "version"		= 1.0
};
diff --git a/src/libs/compat/freebsd_wlan/net80211/ieee80211_node.c b/src/libs/compat/freebsd_wlan/net80211/ieee80211_node.c
index eb3f177..514e666 100644
--- a/src/libs/compat/freebsd_wlan/net80211/ieee80211_node.c
+++ b/src/libs/compat/freebsd_wlan/net80211/ieee80211_node.c
@@ -51,6 +51,7 @@
#endif
#include <net80211/ieee80211_wds.h>
#include <net80211/ieee80211_mesh.h>
#include <net80211/ieee80211_ratectl.h>

#include <net/bpf.h>

@@ -428,7 +429,7 @@
	ieee80211_reset_erp(ic);

	ni = ieee80211_alloc_node(&ic->ic_sta, vap, vap->iv_myaddr);
	KASSERT(ni != NULL, ("unable to setup inital BSS node"));
	KASSERT(ni != NULL, ("unable to setup initial BSS node"));
	obss = vap->iv_bss;
	vap->iv_bss = ieee80211_ref_node(ni);
	if (obss != NULL) {
@@ -813,6 +814,7 @@
	if (ieee80211_iserp_rateset(&ni->ni_rates))
		ni->ni_flags |= IEEE80211_NODE_ERP;
	ieee80211_node_setuptxparms(ni);
	ieee80211_ratectl_node_init(ni);

	return ieee80211_sta_join1(ieee80211_ref_node(ni));
}
@@ -1032,6 +1034,7 @@
{
	struct ieee80211com *ic = ni->ni_ic;

	ieee80211_ratectl_node_deinit(ni);
	ic->ic_node_cleanup(ni);
	ieee80211_ies_cleanup(&ni->ni_ies);
	ieee80211_psq_cleanup(&ni->ni_psq);
@@ -1131,6 +1134,8 @@
	IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni,
	    "%s: inact_reload %u", __func__, ni->ni_inact_reload);

	ieee80211_ratectl_node_init(ni);

	return ni;
}

@@ -1168,6 +1173,8 @@
		ni->ni_txpower = bss->ni_txpower;
		/* XXX optimize away */
		ieee80211_psq_init(&ni->ni_psq, "unknown");

		ieee80211_ratectl_node_init(ni);
	} else {
		/* XXX msg */
		vap->iv_stats.is_rx_nodealloc++;
@@ -1396,6 +1403,7 @@
#endif
		}
		ieee80211_node_setuptxparms(ni);
		ieee80211_ratectl_node_init(ni);
		if (ic->ic_newassoc != NULL)
			ic->ic_newassoc(ni, 1);
		/* XXX not right for 802.1x/WPA */
@@ -1465,6 +1473,7 @@
		if (ieee80211_iserp_rateset(&ni->ni_rates))
			ni->ni_flags |= IEEE80211_NODE_ERP;
		ieee80211_node_setuptxparms(ni);
		ieee80211_ratectl_node_init(ni);
		if (ic->ic_newassoc != NULL)
			ic->ic_newassoc(ni, 1);
		/* XXX not right for 802.1x/WPA */
@@ -1736,7 +1745,7 @@
		status = ieee80211_crypto_delkey(ni->ni_vap, &ni->ni_ucastkey);
		if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax) {
			nikey = nt->nt_keyixmap[keyix];
			nt->nt_keyixmap[keyix] = NULL;;
			nt->nt_keyixmap[keyix] = NULL;
		}
	}
	if (!isowned)
@@ -2333,6 +2342,7 @@
	);

	ieee80211_node_setuptxparms(ni);
	ieee80211_ratectl_node_init(ni);
	/* give driver a chance to setup state like ni_txrate */
	if (ic->ic_newassoc != NULL)
		ic->ic_newassoc(ni, newassoc);
diff --git a/src/libs/compat/freebsd_wlan/net80211/ieee80211_ratectl.h b/src/libs/compat/freebsd_wlan/net80211/ieee80211_ratectl.h
index 64f28d8..a39efb4 100644
--- a/src/libs/compat/freebsd_wlan/net80211/ieee80211_ratectl.h
+++ b/src/libs/compat/freebsd_wlan/net80211/ieee80211_ratectl.h
@@ -83,9 +83,8 @@
ieee80211_ratectl_node_init(struct ieee80211_node *ni)
{
	const struct ieee80211vap *vap = ni->ni_vap;
	kernel_debugger("ieee80211_ratectl_node_init\n");

	vap->iv_rate->ir_node_init(ni);
	kernel_debugger("ieee80211_ratectl_node_init exit\n");
}

static void __inline
@@ -101,20 +100,14 @@
{
	const struct ieee80211vap *vap = ni->ni_vap;

#ifndef __HAIKU__
	return vap->iv_rate->ir_rate(ni, arg, iarg);
#else
	return 0;
#endif
}

static void __inline
ieee80211_ratectl_tx_complete(const struct ieee80211vap *vap,
    const struct ieee80211_node *ni, int status, void *arg1, void *arg2)
{
#ifndef __HAIKU__
	vap->iv_rate->ir_tx_complete(vap, ni, status, arg1, arg2);
#endif
}

static void __inline