Changeset 94be4a8


Ignore:
Timestamp:
Jun 3, 2010, 2:19:28 AM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
cc36f27
Parents:
d6f2d21
Message:
Add a command-executed signal for the sepbar

Now we can remove sepbar_dirty()
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    r0e98d87 r94be4a8  
    44#include <unistd.h>
    55#include "owl.h"
     6#include "globalnotifier.h"
    67
    78extern const owl_cmd commands_to_init[];
     
    7374  } else if (NULL != (cmd = owl_dict_find_element(cd, argv[0]))) {
    7475    retval = owl_cmd_execute(cmd, cd, ctx, argc, argv, buff);
     76    /* This really should be attached to the cmd or cmddict... */
     77    owl_global_notifier_emit_command_executed(g.gn);
    7578  } else {
    7679    owl_function_makemsg("Unknown command '%s'.", buff);
     
    103106  owl_parse_delete(argv, argc);
    104107  owl_free(tmpbuff);
    105   sepbar_dirty();
    106108  return retval;
    107109}
  • globalnotifier.h

    rf06baef r94be4a8  
    4141void owl_global_notifier_emit_view_changed(OwlGlobalNotifier *gn);
    4242void owl_global_notifier_emit_message_received(OwlGlobalNotifier *gn, owl_message *msg);
     43void owl_global_notifier_emit_command_executed(OwlGlobalNotifier *gn);
    4344
    4445G_END_DECLS
  • globalnotifiergen.pl

    r608681f r94be4a8  
    5555  VIEW_CHANGED,
    5656  MESSAGE_RECEIVED,
     57  COMMAND_EXECUTED,
    5758  LAST_SIGNAL
    5859};
     
    181182                 1,
    182183                 G_TYPE_POINTER, NULL);
     184
     185  notifier_signals[COMMAND_EXECUTED] =
     186    g_signal_new("command-executed",
     187                 G_TYPE_FROM_CLASS(gobject_class),
     188                 G_SIGNAL_RUN_FIRST,
     189                 0,
     190                 NULL, NULL,
     191                 g_cclosure_marshal_VOID__VOID,
     192                 G_TYPE_NONE,
     193                 0,
     194                 NULL);
    183195
    184196  /* Register properties */
     
    276288  g_signal_emit(gn, notifier_signals[MESSAGE_RECEIVED], 0, msg);
    277289}
    278 EOT
     290
     291void owl_global_notifier_emit_command_executed(OwlGlobalNotifier *gn)
     292{
     293  g_signal_emit(gn, notifier_signals[COMMAND_EXECUTED], 0);
     294}
     295
     296EOT
  • sepbar.c

    rd6f2d21 r94be4a8  
    77  g_signal_connect(w, "redraw", G_CALLBACK(sepbar_redraw), NULL);
    88  owl_dirty_window_on_signal(w, g.gn, "message-received");
     9  owl_dirty_window_on_signal(w, g.gn, "command-executed");
    910  owl_window_dirty(w);
    10 }
    11 
    12 void sepbar_dirty(void)
    13 {
    14   owl_window_dirty(owl_global_get_curs_sepwin(&g));
    1511}
    1612
Note: See TracChangeset for help on using the changeset viewer.