@@ -60,23 +60,23 @@ StringList *get_items() {
6060 return items;
6161}
6262
63- void cmd_window_select_screen1 (var_s *self) {
63+ void cmd_window_select_screen1 (var_s *self, var_s * ) {
6464 g_system->getOutput ()->selectScreen (USER_SCREEN1);
6565}
6666
67- void cmd_window_select_screen2 (var_s *self) {
67+ void cmd_window_select_screen2 (var_s *self, var_s * ) {
6868 g_system->getOutput ()->selectScreen (USER_SCREEN2);
6969}
7070
71- void cmd_window_select_screen3 (var_s *self) {
71+ void cmd_window_select_screen3 (var_s *self, var_s * ) {
7272 g_system->getOutput ()->selectScreen (TEXT_SCREEN);
7373}
7474
75- void cmd_window_show_keypad (var_s *self) {
75+ void cmd_window_show_keypad (var_s *self, var_s * ) {
7676 maShowVirtualKeyboard ();
7777}
7878
79- void cmd_window_inset (var_s *self) {
79+ void cmd_window_inset (var_s *self, var_s * ) {
8080 var_int_t x, y, w, h;
8181 par_massget (" IIII" , &x, &y, &w, &h);
8282 if (!prog_error) {
@@ -91,7 +91,7 @@ void cmd_window_inset(var_s *self) {
9191 }
9292}
9393
94- void cmd_window_set_font (var_s *self) {
94+ void cmd_window_set_font (var_s *self, var_s * ) {
9595 var_num_t size;
9696 var_int_t bold, italic;
9797 char *unit = NULL ;
@@ -103,27 +103,29 @@ void cmd_window_set_font(var_s *self) {
103103 pfree (unit);
104104}
105105
106- void cmd_window_set_size (var_s *self) {
106+ void cmd_window_set_size (var_s *self, var_s * ) {
107107 var_int_t width, height;
108108 par_massget (" II" , &width, &height);
109109 g_system->setWindowSize (width, height);
110110}
111111
112- void cmd_window_get_theme (var_s *self) {
113- EditTheme theme;
114- theme.setId (g_themeId);
115- v_init (self);
116- map_init (self);
117- map_set_int (self, " background" , -theme._background );
118- map_set_int (self, " text1" , -theme._color );
119- map_set_int (self, " text2" , -theme._syntax_text );
120- map_set_int (self, " text3" , -theme._syntax_comments );
121- map_set_int (self, " text4" , -theme._syntax_command );
122- map_set_int (self, " text5" , -theme._syntax_statement );
123- map_set_int (self, " text6" , -theme._syntax_digit );
112+ void cmd_window_get_theme (var_s *, var_s *retval) {
113+ if (retval != nullptr ) {
114+ EditTheme theme;
115+ theme.setId (g_themeId);
116+ v_init (retval);
117+ map_init (retval);
118+ map_set_int (retval, " background" , -theme._background );
119+ map_set_int (retval, " text1" , -theme._color );
120+ map_set_int (retval, " text2" , -theme._syntax_text );
121+ map_set_int (retval, " text3" , -theme._syntax_comments );
122+ map_set_int (retval, " text4" , -theme._syntax_command );
123+ map_set_int (retval, " text5" , -theme._syntax_statement );
124+ map_set_int (retval, " text6" , -theme._syntax_digit );
125+ }
124126}
125127
126- void cmd_window_alert (var_s *self) {
128+ void cmd_window_alert (var_s *self, var_s * ) {
127129 StringList *items = get_items ();
128130 if (!prog_error && items->size () > 0 ) {
129131 const char *message = items->size () > 0 ? (*items)[0 ]->c_str () : " " ;
@@ -133,25 +135,29 @@ void cmd_window_alert(var_s *self) {
133135 delete items;
134136}
135137
136- void cmd_window_ask (var_s *self) {
138+ void cmd_window_ask (var_s *self, var_s *retval ) {
137139 StringList *items = get_items ();
138140 if (!prog_error && items->size () > 0 ) {
139141 const char *message = items->size () > 0 ? (*items)[0 ]->c_str () : " " ;
140142 const char *title = items->size () > 1 ? (*items)[1 ]->c_str () : " " ;
141- map_set_int (self, WINDOW_ASK_RTN, g_system->ask (title, message, false ));
143+ int result = g_system->ask (title, message, false );
144+ map_set_int (self, WINDOW_ASK_RTN, result);
145+ if (retval != nullptr ) {
146+ v_setint (retval, result);
147+ }
142148 }
143149 delete items;
144150}
145151
146- void cmd_window_menu (var_s *self) {
152+ void cmd_window_menu (var_s *self, var_s * ) {
147153 StringList *items = get_items ();
148154 if (!prog_error && items->size () > 0 ) {
149155 g_system->optionsBox (items);
150156 }
151157 delete items;
152158}
153159
154- void cmd_window_message (var_s *self) {
160+ void cmd_window_message (var_s *self, var_s * ) {
155161 var_t arg;
156162 v_init (&arg);
157163 eval (&arg);
0 commit comments