comparison src/genprops.awk @ 7427:65f0a8ced9d2

[project @ 2008-01-28 22:42:18 by jwe]
author jwe
date Mon, 28 Jan 2008 22:44:46 +0000
parents e9b2e44f9341
children f2000f1971ab
comparison
equal deleted inserted replaced
7426:b9df9abdffbb 7427:65f0a8ced9d2
105 ## set_NAMEmode ("manual"); 105 ## set_NAMEmode ("manual");
106 ## 106 ##
107 ## to the type-specific set function. 107 ## to the type-specific set function.
108 ## 108 ##
109 ## h: Make the property hidden 109 ## h: Make the property hidden
110 ##
111 ## r: Make the property read-only. A read-only property is not
112 ## settable from the global set (caseless_str, octave_value)
113 ## method, but still has set_X accessor.
114 ##
115 ## u: The property has an updater method. This effectively add
116 ## the line
117 ##
118 ## update_NAME ();
119 ##
120 ## to the type-specific set function. This line is added before
121 ## any other update call (like those added by the 'l' or 'm'
122 ## modifiers.
110 ## 123 ##
111 ## The 'o' and 'O' qualifiers are only useful when the the property type 124 ## The 'o' and 'O' qualifiers are only useful when the the property type
112 ## is something other than octave_value. 125 ## is something other than octave_value.
113 126
114 ## simple accessor 127 ## simple accessor
273 286
274 if (emit_set[i] == "definition") 287 if (emit_set[i] == "definition")
275 { 288 {
276 printf ("\n {\n if (! error_state)\n {\n %s = val;\n", 289 printf ("\n {\n if (! error_state)\n {\n %s = val;\n",
277 name[i]); 290 name[i]);
291 if (updater[i])
292 printf (" %s ();\n", updater[i]);
278 if (limits[i]) 293 if (limits[i])
279 printf (" update_axis_limits (\"%s\");\n", name[i]); 294 printf (" update_axis_limits (\"%s\");\n", name[i]);
280 if (mode[i]) 295 if (mode[i])
281 printf (" set_%smode (\"manual\");\n", name[i]); 296 printf (" set_%smode (\"manual\");\n", name[i]);
282 printf (" mark_modified ();\n }\n }\n\n"); 297 printf (" mark_modified ();\n }\n }\n\n");
463 hidden[idx] = 0; 478 hidden[idx] = 0;
464 readonly[idx] = 0; 479 readonly[idx] = 0;
465 emit_get[idx] = "definition"; 480 emit_get[idx] = "definition";
466 emit_set[idx] = "definition"; 481 emit_set[idx] = "definition";
467 defval[idx] = ""; 482 defval[idx] = "";
483 updater[idx] = "";
468 ## if (type[idx] == "octave_value") 484 ## if (type[idx] == "octave_value")
469 ## emit_ov_set[idx] = ""; 485 ## emit_ov_set[idx] = "";
470 ## else 486 ## else
471 ## emit_ov_set[idx] = "definition"; 487 ## emit_ov_set[idx] = "definition";
472 488
508 524
509 ## The property is read-only 525 ## The property is read-only
510 if (index (quals, "r")) 526 if (index (quals, "r"))
511 readonly[idx] = 1; 527 readonly[idx] = 1;
512 528
529 ## There is an updater method that should be called
530 ## from the set method
531 if (index (quals, "u"))
532 updater[idx] = ("update_" name[idx]);
533
513 ## ## emmit an asignment set function 534 ## ## emmit an asignment set function
514 ## if (index (quals, "a")) 535 ## if (index (quals, "a"))
515 ## emit_ov_set[idx] = "assignment"; 536 ## emit_ov_set[idx] = "assignment";
516 ## 537 ##
517 ## if (type[idx] != "octave_value") 538 ## if (type[idx] != "octave_value")