- register char const * se = sc;
- while (se[0]!= 0 && se[0] != '|') ++se;
-
- if (se[0] == 0) return sc;
-
- char * sb = new char[se - sc + 1];
- int index = 0;
- register char const * sd = sc;
- while (sd != se) {
- sb[index] = sd[0];
- ++index; ++sd;
- }
- sb[index] = 0;
- return sb;
+ return ob && ob->active > 0;
+}
+
+
+std::pair<string, string> parse_shortcut(string const & str)
+{
+ string::size_type i = str.find_first_of("&");
+ if (i == string::npos || i == str.length() - 1)
+ return make_pair(str, string());
+
+ // FIXME: handle &&
+
+ string::value_type c = str[i + 1];
+ return make_pair(str.substr(0, i) + str.substr(i + 1),
+ string("#") + c);
+}
+
+
+// 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)
+{
+ int r2, g2, b2;
+ unsigned long ret_val = ::fl_getmcolor(i, &r2, &g2, &b2);
+ *r = r2;
+ *g = g2;
+ *b = b2;
+ return ret_val;