1 # Create the destructor.
2 /\(.*\) *create_form_form/{
4 s/\(.*\) \*create_form_form[^ ]*/\1::~\1()/p
8 if ( form->visible ) fl_hide_form( form );\
17 # Rewrite "fdui->form_xxx->fdui = ..." as "fdui->form->fdui = ..."
18 s/fdui->form_\([^ ]*\)->fdui =/fdui->form->fdui =/
20 # Rewrite "fdui->form_xxx = ..." as "fdui->form = ..."
21 s/fdui->form_\([^ ]*\) =/fdui->form =/
23 # Rewrite "fdui->form_xxx->..." as "fdui->form->..."
24 s/fdui->form_\([^ ]*\)->/fdui->form->/
26 # Replace "forms.h" by FORMS_H_LOCATION in #include directives. This
27 # macro is defined in config.h and is either <forms.h> or
29 s/#include \"forms\.h\"/#include FORMS_H_LOCATION/
31 # For all lines containing "#include "form_*"", append a line
32 # containing the header file of the parent class
33 /#include \"form_.*\"/a\
34 #include \"CLASSNAME.h\"
36 # For all lines containing "fl_" and a string _not_ containing |,
37 # replace the string with _(string)
38 /fl_/ s/".[^|]*"/_(&)/
40 # For all lines containing "shortcut" and a string containing |,
41 # replace the string with scex(_(string))
42 /shortcut/ s/".*[|].*"/scex(_(&))/
44 # gettext will get confused if the string contains a "%" unless the line is
45 # preceeded immediately by // xgettext:no-c-format
47 // xgettext:no-c-format
49 # For all lines containing "fl_add" and a string containing |
52 # fdui->counter_zoom = obj = fl_add_counter(FL_NORMAL_COUNTER,1,2,3,4,"Zoom %|#Z");
55 # fdui->counter_zoom = obj;
57 # // xgettext:no-c-format
58 # char const * const dummy = N_("Zoom %|#Z");
59 # fdui->counter_zoom = obj = fl_add_counter(FL_NORMAL_COUNTER,1,2,3,4,idex(_(dummy)));
60 # fl_set_button_shortcut(obj,scex(_(dummy)),1);
66 s/fdui\(.*\)"\(.*\)".*/{\
67 char const * const dummy = N_("\2");\
68 fdui\1idex(_(dummy)));\
69 fl_set_button_shortcut(obj,scex(_(dummy)),1);\
72 /N_(".*[%].*");/ s/\(.*\)\(char const [*]\)/\1\/\/ xgettext:no-c-format\
80 # s/ = fl_add\(.*\)"\(.*\)".*/;\
82 # char const * dummy = N_("\2");\
83 # obj = fl_add\1idex(_(dummy)));\
84 # fl_set_button_shortcut(obj,scex(_(dummy)),1);\
87 # /N_(".*[%].*");/ s/\(.*\)\(char const [*]\)/\1\/\/ xgettext:no-c-format\
92 # We use new/delete not malloc/free so change to suit.
93 s/\(\(FD_[^ ]*\) \*fdui =\).*sizeof(\*fdui))/\1 new \2/
95 # Fixup the name of the create_form... function to have a signature
96 # matching that of the method it will become.
97 s/\(FD_f\([^ _]*\)_\([^ ]*\)\) \*create_form_form[^ ]*/\1 * CLASSNAME::build_\3()/
99 # We need to store a pointer to the dialog in u_vdata so that the
100 # callbacks will work.
101 s/\(fdui->form\)\(.*bgn_form.*\)/\1\2\
104 # Someone got busy and put spaces in after commas but didn't allow for the
105 # autogeneration of the files so their pretty formatting got lost. Not anymore.
109 # Clean up one special case where a comma appears at the end of a string
110 # while ensuring "...", "..." isn't affected.
112 s/\("[^"]+,\) \("\)/\1\2/g