]> git.lyx.org Git - features.git/blobdiff - src/frontends/xforms/forms/fdfixc.sed
(Rob Lahaye): UI improvements to the preferences dialog.
[features.git] / src / frontends / xforms / forms / fdfixc.sed
index 8dcd0d60a12cdb9f21f4475fcad876c1893ec7ae..7b2e21c9dfc40eb2ffbaf213ea2a3ddb74539a02 100644 (file)
@@ -37,24 +37,62 @@ s/#include \"forms\.h\"/#include FORMS_H_LOCATION/
 #  replace the string with _(string)
 /fl_/ s/".[^|]*"/_(&)/
 
-#  For all lines containing "shortcut" and a string containing |, 
-#  replace the string with scex(_(string))
-/shortcut/ s/".*[|].*"/scex(_(&))/
-
-#  For all lines containing "fl_add" and a string containing |, replace
-#  the string with idex(_(string))
-/fl_add/ s/".*[|].*"/idex(_(&))/
+# For all lines containing "bmtable", replace "fl_add_button" by
+# "fl_add_bmtable"
+/bmtable/ s/fl_add_button/fl_add_bmtable/
 
-#  For all lines containing "fl_add" and a string containing |, add the
-#  shortcut command after the end of this line
-/fl_add/ s/idex(\(.*\)").*$/&\
-    fl_set_button_shortcut(obj,scex(\1")),1);/
+#  For all lines containing "_shortcut" and a string containing |, 
+#  replace the string with scex(_(string))
+/_shortcut/ s/".*[|].*"/scex(_(&))/
 
 #  gettext will get confused if the string contains a "%" unless the line is
-#  preceeded immediately by //xgettext:no-c-format
+#  preceeded immediately by // xgettext:no-c-format
 /_(".*[%].*")/i\
   // xgettext:no-c-format
 
+# For all lines containing "fl_add" and a string containing |
+# do several things.
+# Eg
+#   fdui->counter_zoom = obj = fl_add_counter(FL_NORMAL_COUNTER,1,2,3,4,"Zoom %|#Z");
+#
+# becomes
+#   fdui->counter_zoom = obj;
+#   {
+#     // xgettext:no-c-format
+#     char const * const dummy = N_("Zoom %|#Z");
+#     fdui->counter_zoom = obj = fl_add_counter(FL_NORMAL_COUNTER,1,2,3,4,idex(_(dummy)));
+#     fl_set_button_shortcut(obj,scex(_(dummy)),1);
+#   }
+
+/fl_add/{
+/".*[|].*"/{
+
+  s/fdui\(.*\)"\(.*\)".*/{\
+    char const * const dummy = N_("\2");\
+    fdui\1idex(_(dummy)));\
+    fl_set_button_shortcut(obj,scex(_(dummy)),1);\
+  }/
+
+  /N_(".*[%].*");/ s/\(.*\)\(char const [*]\)/\1\/\/ xgettext:no-c-format\
+    \2/
+}
+}
+
+# /fl_add/{
+# /".*[|].*"/{
+# 
+#   s/ = fl_add\(.*\)"\(.*\)".*/;\
+#   {\
+#     char const * dummy = N_("\2");\
+#     obj = fl_add\1idex(_(dummy)));\
+#     fl_set_button_shortcut(obj,scex(_(dummy)),1);\
+#   }/
+# 
+#   /N_(".*[%].*");/ s/\(.*\)\(char const [*]\)/\1\/\/ xgettext:no-c-format\
+#     \2/
+# }
+# }
+
 # We use new/delete not malloc/free so change to suit.
 s/\(\(FD_[^ ]*\) \*fdui =\).*sizeof(\*fdui))/\1 new \2/