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 "bmtable", replace "fl_add_button" by
42 /bmtable/ s/fl_add_button/fl_add_bmtable/
44 # For all lines containing "shortcut" and a string containing |,
45 # replace the string with scex(_(string))
46 /shortcut/ s/".*[|].*"/scex(_(&))/
48 # gettext will get confused if the string contains a "%" unless the line is
49 # preceeded immediately by // xgettext:no-c-format
51 // xgettext:no-c-format
53 # For all lines containing "fl_add" and a string containing |
56 # fdui->counter_zoom = obj = fl_add_counter(FL_NORMAL_COUNTER,1,2,3,4,"Zoom %|#Z");
59 # fdui->counter_zoom = obj;
61 # // xgettext:no-c-format
62 # char const * const dummy = N_("Zoom %|#Z");
63 # fdui->counter_zoom = obj = fl_add_counter(FL_NORMAL_COUNTER,1,2,3,4,idex(_(dummy)));
64 # fl_set_button_shortcut(obj,scex(_(dummy)),1);
70 s/fdui\(.*\)"\(.*\)".*/{\
71 char const * const dummy = N_("\2");\
72 fdui\1idex(_(dummy)));\
73 fl_set_button_shortcut(obj,scex(_(dummy)),1);\
76 /N_(".*[%].*");/ s/\(.*\)\(char const [*]\)/\1\/\/ xgettext:no-c-format\
84 # s/ = fl_add\(.*\)"\(.*\)".*/;\
86 # char const * dummy = N_("\2");\
87 # obj = fl_add\1idex(_(dummy)));\
88 # fl_set_button_shortcut(obj,scex(_(dummy)),1);\
91 # /N_(".*[%].*");/ s/\(.*\)\(char const [*]\)/\1\/\/ xgettext:no-c-format\
96 # We use new/delete not malloc/free so change to suit.
97 s/\(\(FD_[^ ]*\) \*fdui =\).*sizeof(\*fdui))/\1 new \2/
99 # Fixup the name of the create_form... function to have a signature
100 # matching that of the method it will become.
101 s/\(FD_f\([^ _]*\)_\([^ ]*\)\) \*create_form_form[^ ]*/\1 * CLASSNAME::build_\3()/
103 # We need to store a pointer to the dialog in u_vdata so that the
104 # callbacks will work.
105 s/\(fdui->form\)\(.*bgn_form.*\)/\1\2\
108 # Someone got busy and put spaces in after commas but didn't allow for the
109 # autogeneration of the files so their pretty formatting got lost. Not anymore.
113 # Clean up one special case where a comma appears at the end of a string
114 # while ensuring "...", "..." isn't affected.
116 s/\("[^"]+,\) \("\)/\1\2/g