Changeset 5b80b87


Ignore:
Timestamp:
Jun 1, 2010, 8:28:15 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
b2ea16b
Parents:
e20dd769
Message:
Avoid flagrant violations of layering and just g_object_notify in the setters.

g_object_set_property calls g_object_freeze_notify and
g_object_thaw_notify, so it should Just Work.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • global.c

    re20dd769 r5b80b87  
    341341
    342342void owl_global_set_rightshift(owl_global *g, int i) {
    343   g_object_set(g->gn, "rightshift", i, NULL);
     343  g->rightshift = i;
     344  g_object_notify(G_OBJECT(g->gn), "rightshift");
    344345}
    345346
     
    592593
    593594void owl_global_set_curmsg_vert_offset(owl_global *g, int i) {
    594   g_object_set(g->gn, "curmsg-vert-offset", i, NULL);
     595  g->curmsg_vert_offset = i;
     596  g_object_notify(G_OBJECT(g->gn), "curmsg-vert-offset");
    595597}
    596598
  • globalnotifiergen.pl

    re20dd769 r5b80b87  
    6262    /* normal properties */
    6363    case PROP_RIGHTSHIFT:
    64       notifier->g->rightshift = g_value_get_int(value);
     64      owl_global_set_rightshift(notifier->g, g_value_get_int(value));
    6565      break;
    6666    case PROP_CURMSG_VERT_OFFSET:
    67       notifier->g->curmsg_vert_offset = g_value_get_int(value);
     67      owl_global_set_curmsg_vert_offset(notifier->g, g_value_get_int(value));
    6868      break;
    6969    /* generated from variable listings */
  • stubgen.pl

    re20dd769 r5b80b87  
    1818        print <<EOT;
    1919void owl_global_set_${altvarname}_on(owl_global *g) {
    20   g_object_set(G_OBJECT(g->gn), "$detailname", TRUE, NULL);
     20  owl_variable_set_bool_on(&g->vars, "$altvarname");
     21  g_object_notify(G_OBJECT(g->gn), "$detailname");
    2122}
    2223void owl_global_set_${altvarname}_off(owl_global *g) {
    23   g_object_set(G_OBJECT(g->gn), "$detailname", FALSE, NULL);
     24  owl_variable_set_bool_off(&g->vars, "$altvarname");
     25  g_object_notify(G_OBJECT(g->gn), "$detailname");
    2426}
    2527int owl_global_is_$altvarname(const owl_global *g) {
     
    3032        print <<EOT;
    3133void owl_global_set_${altvarname}(owl_global *g, const char *text) {
    32   g_object_set(G_OBJECT(g->gn), "$detailname", text, NULL);
     34  owl_variable_set_string(&g->vars, "$altvarname", text);
     35  g_object_notify(G_OBJECT(g->gn), "$detailname");
    3336}
    3437const char *owl_global_get_$altvarname(const owl_global *g) {
     
    3942        print <<EOT;
    4043void owl_global_set_${altvarname}(owl_global *g, int n) {
    41   g_object_set(G_OBJECT(g->gn), "$detailname", n, NULL);
     44  owl_variable_set_int(&g->vars, "$altvarname", n);
     45  g_object_notify(G_OBJECT(g->gn), "$detailname");
    4246}
    4347int owl_global_get_$altvarname(const owl_global *g) {
Note: See TracChangeset for help on using the changeset viewer.