Changeset f57a106 for stubgen.pl


Ignore:
Timestamp:
Jun 1, 2010, 8:04:56 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
43e3061
Parents:
f3a9d4d
git-author:
David Benjamin <davidben@mit.edu> (06/01/10 20:00:08)
git-committer:
David Benjamin <davidben@mit.edu> (06/01/10 20:04:56)
Message:
Wire the varstubs through g_object_set to fire the signal
File:
1 edited

Legend:

Unmodified
Added
Removed
  • stubgen.pl

    rd7cc50b rf57a106  
    1212    my $altvarname = $2;
    1313    $altvarname = $3 if ($3);
     14    my $detailname = $altvarname;
     15    $detailname =~ s/[^a-zA-Z0-9]/-/g;
    1416    if ($vartype =~ /^BOOL/) {
    15         print "void owl_global_set_${altvarname}_on(owl_global *g) {\n";
    16         print "  owl_variable_set_bool_on(&g->vars, \"$varname\");\n}\n";
    17         print "void owl_global_set_${altvarname}_off(owl_global *g) {\n";
    18         print "  owl_variable_set_bool_off(&g->vars, \"$varname\");\n}\n";
    19         print "int owl_global_is_$altvarname(const owl_global *g) {\n";
    20         print "  return owl_variable_get_bool(&g->vars, \"$varname\");\n}\n";
     17        print <<EOT;
     18void owl_global_set_${altvarname}_on(owl_global *g) {
     19  g_object_set(G_OBJECT(g->gn), "$detailname", TRUE, NULL);
     20}
     21void owl_global_set_${altvarname}_off(owl_global *g) {
     22  g_object_set(G_OBJECT(g->gn), "$detailname", FALSE, NULL);
     23}
     24int owl_global_is_$altvarname(const owl_global *g) {
     25  return owl_variable_get_bool(&g->vars, "$varname");
     26}
     27EOT
    2128    } elsif ($vartype =~ /^PATH/ or $vartype =~ /^STRING/) {
    22         print "void owl_global_set_$altvarname(owl_global *g, const char *text) {\n";
    23         print "  owl_variable_set_string(&g->vars, \"$varname\", text);\n}\n";
    24         print "const char *owl_global_get_$altvarname(const owl_global *g) {\n";
    25         print "  return owl_variable_get_string(&g->vars, \"$varname\");\n}\n";
     29        print <<EOT;
     30void owl_global_set_${altvarname}(owl_global *g, const char *text) {
     31  g_object_set(G_OBJECT(g->gn), "$detailname", text, NULL);
     32}
     33const char *owl_global_get_$altvarname(const owl_global *g) {
     34  return owl_variable_get_string(&g->vars, "$varname");
     35}
     36EOT
    2637    } elsif ($vartype =~ /^INT/ or $vartype =~ /^ENUM/) {
    27         print "void owl_global_set_$altvarname(owl_global *g, int n) {\n";
    28         print "  owl_variable_set_int(&g->vars, \"$varname\", n);\n}\n";
    29         print "int owl_global_get_$altvarname(const owl_global *g) {\n";
    30         print "  return owl_variable_get_int(&g->vars, \"$varname\");\n}\n";
     38        print <<EOT;
     39void owl_global_set_${altvarname}(owl_global *g, int n) {
     40  g_object_set(G_OBJECT(g->gn), "$detailname", n, NULL);
     41}
     42int owl_global_get_$altvarname(const owl_global *g) {
     43  return owl_variable_get_int(&g->vars, "$varname");
     44}
     45EOT
    3146    }
    3247    }
Note: See TracChangeset for help on using the changeset viewer.