comparison src/genprops.awk @ 10317:42d098307c30

untabify additional source files
author John W. Eaton <jwe@octave.org>
date Thu, 11 Feb 2010 13:30:42 -0500
parents 4516a0c97ced
children 92a85ed5b86e
comparison
equal deleted inserted replaced
10316:9966f1f71c32 10317:42d098307c30
305 else if (type[i] == "double_property") 305 else if (type[i] == "double_property")
306 emit_get_accessor(i, "double", "double_value"); 306 emit_get_accessor(i, "double", "double_value");
307 else if (type[i] == "double_radio_property") 307 else if (type[i] == "double_radio_property")
308 emit_get_double_radio(i); 308 emit_get_double_radio(i);
309 else if (type[i] == "array_property" \ 309 else if (type[i] == "array_property" \
310 || type[i] == "row_vector_property") 310 || type[i] == "row_vector_property")
311 emit_get_array(i); 311 emit_get_array(i);
312 else if (type[i] == "bool_property") 312 else if (type[i] == "bool_property")
313 emit_get_bool(i); 313 emit_get_bool(i);
314 else if (type[i] == "radio_property") 314 else if (type[i] == "radio_property")
315 emit_get_radio(i); 315 emit_get_radio(i);
339 { 339 {
340 printf (" void set_%s (const octave_value& val)", name[i], type[i]); 340 printf (" void set_%s (const octave_value& val)", name[i], type[i]);
341 341
342 if (emit_set[i] == "definition") 342 if (emit_set[i] == "definition")
343 { 343 {
344 if (updaters[i] || limits[i] || mode[i]) 344 if (updaters[i] || limits[i] || mode[i])
345 has_builtin_listeners = 1; 345 has_builtin_listeners = 1;
346 else 346 else
347 has_builtin_listeners = 0; 347 has_builtin_listeners = 0;
348 348
349 printf ("\n {\n if (! error_state)\n {\n if (%s.set (val, %s))\n {\n", 349 printf ("\n {\n if (! error_state)\n {\n if (%s.set (val, %s))\n {\n",
350 name[i], (has_builtin_listeners ? "false" : "true")); 350 name[i], (has_builtin_listeners ? "false" : "true"));
351 if (mode[i]) 351 if (mode[i])
352 printf (" set_%smode (\"manual\");\n", name[i]); 352 printf (" set_%smode (\"manual\");\n", name[i]);
353 if (updater[i]) 353 if (updater[i])
354 printf (" update_%s ();\n", name[i]); 354 printf (" update_%s ();\n", name[i]);
355 if (limits[i]) 355 if (limits[i])
356 printf (" update_axis_limits (\"%s\");\n", name[i]); 356 printf (" update_axis_limits (\"%s\");\n", name[i]);
357 if (has_builtin_listeners) 357 if (has_builtin_listeners)
358 printf (" %s.run_listeners (POSTSET);\n", name[i]); 358 printf (" %s.run_listeners (POSTSET);\n", name[i]);
359 printf (" mark_modified ();\n"); 359 printf (" mark_modified ();\n");
360 printf (" }\n"); 360 printf (" }\n");
361 if (mode[i]) 361 if (mode[i])
362 printf (" else\n set_%smode (\"manual\");\n", name[i]); 362 printf (" else\n set_%smode (\"manual\");\n", name[i]);
363 printf (" }\n }\n\n"); 363 printf (" }\n }\n\n");
364 } 364 }
365 else 365 else
366 printf (";\n\n"); 366 printf (";\n\n");
367 } 367 }
558 { 558 {
559 if (factory[i]) 559 if (factory[i])
560 { 560 {
561 dval = defval[i]; 561 dval = defval[i];
562 if (type[i] == "radio_property" || type[i] == "color_property") 562 if (type[i] == "radio_property" || type[i] == "color_property")
563 { 563 {
564 k = index (dval, "{"); 564 k = index (dval, "{");
565 dval = substr (dval, k+1); 565 dval = substr (dval, k+1);
566 l = index (dval, "}"); 566 l = index (dval, "}");
567 if (k > 0 && l > 0) 567 if (k > 0 && l > 0)
568 dval = "\"" substr (dval, 1, l-1) "\""; 568 dval = "\"" substr (dval, 1, l-1) "\"";
569 else 569 else
570 dval = "octave_value ()"; 570 dval = "octave_value ()";
571 } 571 }
572 572
573 printf (" m[\"%s\"] = %s%s;\n", name[i], dval, 573 printf (" m[\"%s\"] = %s%s;\n", name[i], dval,
574 (type[i] == "handle_property" || type[i] == "graphics_handle" ? ".as_octave_value ()" : "")); 574 (type[i] == "handle_property" || type[i] == "graphics_handle" ? ".as_octave_value ()" : ""));
575 } 575 }
576 } 576 }
602 printf ("%s::properties", class_name); 602 printf ("%s::properties", class_name);
603 printf ("::has_core_property (const caseless_str& pname)\n{\n std::set<std::string> pnames = core_property_names ();\n\n return pnames.find (pname) != pnames.end ();\n}\n\n", class_name); 603 printf ("::has_core_property (const caseless_str& pname)\n{\n std::set<std::string> pnames = core_property_names ();\n\n return pnames.find (pname) != pnames.end ();\n}\n\n", class_name);
604 604
605 printf ("std::set<std::string>\n"); 605 printf ("std::set<std::string>\n");
606 if (base) 606 if (base)
607 printf ("base_properties"); 607 printf ("base_properties");
608 else 608 else
609 printf ("%s::properties", class_name); 609 printf ("%s::properties", class_name);
610 printf ("::all_property_names (void) const\n{\n static std::set<std::string> all_pnames = core_property_names ();\n\n"); 610 printf ("::all_property_names (void) const\n{\n static std::set<std::string> all_pnames = core_property_names ();\n\n");
611 if (base) 611 if (base)
612 printf (" std::set<std::string> retval = all_pnames;\n std::set<std::string> dyn_props = dynamic_property_names ();\n retval.insert (dyn_props.begin (), dyn_props.end ());\n for (std::map<caseless_str, property, cmp_caseless_str>::const_iterator p = all_props.begin ();\n p != all_props.end (); p++)\n retval.insert (p->first);\n\n return retval;\n}\n\n"); 612 printf (" std::set<std::string> retval = all_pnames;\n std::set<std::string> dyn_props = dynamic_property_names ();\n retval.insert (dyn_props.begin (), dyn_props.end ());\n for (std::map<caseless_str, property, cmp_caseless_str>::const_iterator p = all_props.begin ();\n p != all_props.end (); p++)\n retval.insert (p->first);\n\n return retval;\n}\n\n");
734 ## There is a custom extern definition for the set function, 734 ## There is a custom extern definition for the set function,
735 ## but we still emit the declaration. 735 ## but we still emit the declaration.
736 if (index (quals, "S")) 736 if (index (quals, "S"))
737 emit_set[idx] = "declaration"; 737 emit_set[idx] = "declaration";
738 738
739 ## The property is hidden 739 ## The property is hidden
740 if (index (quals, "h")) 740 if (index (quals, "h"))
741 hidden[idx] = 1; 741 hidden[idx] = 1;
742 742
743 ## The property is read-only 743 ## The property is read-only
744 if (index (quals, "r")) 744 if (index (quals, "r"))
745 readonly[idx] = 1; 745 readonly[idx] = 1;
746 746
747 ## There is an inline updater method that should be called 747 ## There is an inline updater method that should be called
748 ## from the set method 748 ## from the set method
749 if (index (quals, "u")) 749 if (index (quals, "u"))
750 updater[idx] = "inline"; 750 updater[idx] = "inline";
751 751
752 ## There is an extern updater method that should be called 752 ## There is an extern updater method that should be called
753 ## from the set method 753 ## from the set method
754 if (index (quals, "U")) 754 if (index (quals, "U"))
755 updater[idx] = "extern"; 755 updater[idx] = "extern";
756 756
757 ## There is not factory default value 757 ## There is not factory default value
758 if (index (quals, "f")) 758 if (index (quals, "f"))
759 factory[idx] = 0; 759 factory[idx] = 0;
760 760
761 ## ## emmit an asignment set function 761 ## ## emmit an asignment set function
762 ## if (index (quals, "a")) 762 ## if (index (quals, "a"))