Exemplo n.º 1
0
void
win_redraw(ProfWin *window)
{
    int i, size;
    werase(window->layout->win);
    size = buffer_size(window->layout->buffer);

    for (i = 0; i < size; i++) {
        ProfBuffEntry *e = buffer_yield_entry(window->layout->buffer, i);
        _win_print(window, e->show_char, e->pad_indent, e->time, e->flags, e->theme_item, e->from, e->message, e->receipt);
    }
}
Exemplo n.º 2
0
void
win_save_print(ProfWin *window, const char show_char, GTimeVal *tstamp,
    int flags, theme_item_t theme_item, const char * const from, const char * const message)
{
    GDateTime *time;

    if (tstamp == NULL) {
        time = g_date_time_new_now_local();
    } else {
        time = g_date_time_new_from_timeval_utc(tstamp);
    }

    buffer_push(window->buffer, show_char, time, flags, theme_item, from, message);
    _win_print(window, show_char, time, flags, theme_item, from, message);
}
Exemplo n.º 3
0
void
win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp,
    int flags, theme_item_t theme_item, const char *const from, const char *const message)
{
    if (timestamp == NULL) {
        timestamp = g_date_time_new_now_local();
    } else {
        g_date_time_ref(timestamp);
    }

    buffer_push(window->layout->buffer, show_char, pad_indent, timestamp, flags, theme_item, from, message, NULL);
    _win_print(window, show_char, pad_indent, timestamp, flags, theme_item, from, message, NULL);
    // TODO: cross-reference.. this should be replaced by a real event-based system
    inp_nonblocking(TRUE);
    g_date_time_unref(timestamp);
}
Exemplo n.º 4
0
void
win_print_with_receipt(ProfWin *window, const char show_char, int pad_indent, GTimeVal *tstamp,
    int flags, theme_item_t theme_item, const char *const from, const char *const message, char *id)
{
    GDateTime *time;

    if (tstamp == NULL) {
        time = g_date_time_new_now_local();
    } else {
        time = g_date_time_new_from_timeval_utc(tstamp);
    }

    DeliveryReceipt *receipt = malloc(sizeof(struct delivery_receipt_t));
    receipt->id = strdup(id);
    receipt->received = FALSE;

    buffer_push(window->layout->buffer, show_char, pad_indent, time, flags, theme_item, from, message, receipt);
    _win_print(window, show_char, pad_indent, time, flags, theme_item, from, message, receipt);
    // TODO: cross-reference.. this should be replaced by a real event-based system
    inp_nonblocking(TRUE);
    g_date_time_unref(time);
}