summaryrefslogtreecommitdiff
path: root/src/Fl_Window.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2010-11-16 22:17:40 +0000
committerMatthias Melcher <fltk@matthiasm.com>2010-11-16 22:17:40 +0000
commitffbe1b76b1d8ed8e25430f75fc8621858f0432be (patch)
treec88593e6fef65df18ba07122b922833bade833e0 /src/Fl_Window.cxx
parente91fe6e6d5931953f558345e17e269e5432e956f (diff)
Fixed xclass support for Fl_Window (STR #2053)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7863 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Window.cxx')
-rw-r--r--src/Fl_Window.cxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx
index adc3fa094..0c641fe32 100644
--- a/src/Fl_Window.cxx
+++ b/src/Fl_Window.cxx
@@ -40,6 +40,8 @@
#include <FL/fl_draw.H>
#endif
+char *Fl_Window::default_xclass_ = 0L;
+
void Fl_Window::_Fl_Window() {
type(FL_WINDOW);
box(FL_FLAT_BOX);
@@ -178,6 +180,53 @@ Fl_Window *Fl_Window::current() {
return current_;
}
+/** Returns the default xclass */
+const char *Fl_Window::default_xclass()
+{
+ if (default_xclass_) {
+ return default_xclass_;
+ } else {
+ return "FLTK";
+ }
+}
+
+/** Sets the defaul xclass */
+void Fl_Window::default_xclass(const char *xc)
+{
+ if (default_xclass_) {
+ free(default_xclass_);
+ default_xclass_ = 0L;
+ }
+ if (xc) {
+ default_xclass_ = strdup(xc);
+ }
+}
+
+/** Set the xclass for this window */
+void Fl_Window::xclass(const char *xc)
+{
+ if (xclass_) {
+ free(xclass_);
+ xclass_ = 0L;
+ }
+ if (xc) {
+ xclass_ = strdup(xc);
+ if (!default_xclass_) {
+ default_xclass(xc);
+ }
+ }
+}
+
+/** Return the XClass for this window, or a default. */
+const char *Fl_Window::xclass() const
+{
+ if (xclass_) {
+ return xclass_;
+ } else {
+ return default_xclass();
+ }
+}
+
//
// End of "$Id$".