Exemple #1
0
void LeftMargin::setupMargin(GtkTextView *textView)
    {
    if(!mMarginLayout)
        {
        GtkWidget *widget = GTK_WIDGET(textView);

        mMarginLayout = gtk_widget_create_pango_layout(widget, "");
        updateTextInfo(textView);

        pango_layout_set_width(mMarginLayout, mTextWidth);
        pango_layout_set_alignment(mMarginLayout, PANGO_ALIGN_RIGHT);

        GtkStyleContext *widgetStyle = gtk_widget_get_style_context(widget);
        GdkRGBA color;
        gtk_style_context_get_color(widgetStyle, GTK_STATE_FLAG_NORMAL, &color);
        mMarginAttr = pango_attr_foreground_new(convertGdkColorToPango(color.red),
                convertGdkColorToPango(color.green), convertGdkColorToPango(color.blue));
        mMarginAttrList = pango_attr_list_new();

        mMarginAttr->start_index = 0;
        mMarginAttr->end_index = G_MAXUINT;
        pango_attr_list_insert(mMarginAttrList, mMarginAttr);
        pango_layout_set_attributes(mMarginLayout, mMarginAttrList);
        }
    }
static void *bt_update_thread(void *priv)
{
    struct bt_factory *bf = (struct bt_factory *)priv;
    struct itemview *iv = bf->iv;

    LOGD(TAG "%s: Start\n", __FUNCTION__);

    sprintf(bf->info, "Status: Initializing\n");
    iv->redraw(iv);

    if(FM_BT_init() == false) {
        LOGD(TAG "%s: Exit\n", __FUNCTION__);
        sprintf(bf->info, "Status: INIT FAILED\n");
        iv->redraw(iv);
        pthread_exit(NULL);
        return NULL;
    }

    if (bf->exit_thd)
        goto exit;

    sprintf(bf->info, "Status: Initialized\n");
    iv->redraw(iv);

    FM_BT_inquiry();

    while (1) {
        if (bf->exit_thd)
            break;

        updateTextInfo(g_pBtListHear, bf->info, sizeof(bf->info));
        iv->redraw(iv);
        usleep(200000);
    }

exit:
    LOGD(TAG "%s: Exit\n", __FUNCTION__);
    pthread_exit(NULL);
    return NULL;
}
void ScoreBoard::Draw()
{
  updateTextInfo();
  drawTowerButton();
  drawInfoText();
}