]> git.lyx.org Git - features.git/blobdiff - src/frontends/xforms/xforms_helpers.h
Replace LString.h with support/std_string.h,
[features.git] / src / frontends / xforms / xforms_helpers.h
index cddfa68abe8e2042f010be90e50701ca17f485eb..dc59d7bdd70cfa1bc4099d1e29ac77db4db4e367 100644 (file)
@@ -1,35 +1,44 @@
 // -*- C++ -*-
 /**
  * \file xforms_helpers.h
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming <leeming@lyx.org>
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef XFORMSHELPERS_H
 #define XFORMSHELPERS_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
 #include "forms_fwd.h"
 
 #include "Color.h"
-#include "LString.h"
+#include "support/std_string.h"
 
 #include <algorithm>
 #include <vector>
 
 class LyXLength;
 
+/// parse "&Save" etc. to <"Save", "#S">. Does not handle &&
+std::pair<string, string> parse_shortcut(string const & str);
+
+// A wrapper for the xforms routine, but this one accepts uint args
+unsigned long fl_getmcolor(int i, unsigned int * r, unsigned int * g,
+                          unsigned int * b);
+
 // what we always need for lengths
 string const choice_Length_All =
     "cm|mm|in|text%%|col%%|page%%|line%%|ex|em|pt|sp|bp|dd|pc|cc|mu";
 string const choice_Length_WithUnit =
     "cm|mm|in|ex|em|pt|sp|bp|dd|pc|cc|mu";     // all with a Unit
 
+/// return the (in)active state of the object
+bool isActive(FL_OBJECT * ob);
+
 /// Set an FL_OBJECT to activated or deactivated
 void setEnabled(FL_OBJECT *, bool enable);
 
@@ -40,9 +49,10 @@ string formatted(string const &label, int w,
 /// Given an fl_choice or an fl_browser, create a vector of its entries
 std::vector<string> const getVector(FL_OBJECT *);
 
-/// Given an fl_input, an fl_choice or an fl_browser, return an entry
-/** \c num is the position for the string, where -1 means "current item" */
-string const getString(FL_OBJECT * ob, int num = -1);
+/** Given an fl_input, an fl_choice or an fl_browser, return an entry
+    \c num is the position for the string, where 0 means "current item"
+ */
+string const getString(FL_OBJECT * ob, int num = 0);
 
 /// Given input and choice widgets, create a string such as "1cm"
 string getLengthFromWidgets(FL_OBJECT * input, FL_OBJECT * choice);