Exemplo n.º 1
0
static void
set_font(glw_t *w, rstr_t *font)
{
  glw_text_bitmap_t *gtb = (glw_text_bitmap_t *)w;
  rstr_set(&gtb->gtb_font, font);
  gtb_update_epilogue(gtb, GTB_UPDATE_REALIZE);
}
Exemplo n.º 2
0
static void
glw_quad_set_fs(glw_t *w, rstr_t *vs)
{
    glw_quad_t *q = (glw_quad_t *)w;
    rstr_set(&q->fs, vs);
    q->recompile = 1;

}
Exemplo n.º 3
0
static void *
bgloader_thread(void *aux)
{
  bg_helper_t *bgh = aux;

  rstr_t *current_bg = NULL;
  float current_alpha = 0;

  while(1) {
    struct prop_notify_queue q;

    float alpha = 1.0f;
    int timo = alpha != current_alpha ? 16 : 0;

    prop_courier_wait(bgh->pc, &q, timo);
    prop_notify_dispatch(&q);

    rstr_t *bg;
    if(bgh->bg_url[0]) {
      bg = bgh->bg_url[0];

      if(bgh->bg_alpha[0])
	alpha = bgh->bg_alpha[0];
    } else if(bgh->bg_url[1]) {
      bg = bgh->bg_url[1];

      if(bgh->bg_alpha[1])
	alpha = bgh->bg_alpha[1];
    } else {
      bg = bgh->bg_url[2];
    }

    if(bgh->fullwindow || bgh->screensaver)
      alpha = 0;

    if(alpha != current_alpha) {
      if(current_alpha < alpha)
	current_alpha = MIN(alpha, current_alpha + 0.1);
      else if(current_alpha > alpha)
	current_alpha = MAX(alpha, current_alpha - 0.1);

      bgh->set_alpha(current_alpha, bgh->opaque);
    }

    if(!rstr_eq(current_bg, bg)) {
      rstr_set(&current_bg, bg);
      const char *v[3];

      v[0] = "skin";
      v[1] = rstr_get(bgh->skin_path);
      v[2] = NULL;

      bgh->set_image(bg, v, bgh->opaque);
    }

  }
  return NULL;
}
Exemplo n.º 4
0
static int
gtb_set_rstr(glw_t *w, glw_attribute_t a, rstr_t *str, glw_style_t *origin)
{
  glw_text_bitmap_t *gtb = (glw_text_bitmap_t *)w;
  switch(a) {
  case GLW_ATTRIB_FONT:
    if(rstr_eq(gtb->gtb_font, str))
      return 0;

    rstr_set(&gtb->gtb_font, str);
    break;
  default:
    return -1;
  }

  gtb_update_epilogue(gtb, GTB_UPDATE_REALIZE);
  return 1;
}
Exemplo n.º 5
0
static void
set_id_rstr(glw_t *w, rstr_t *rstr)
{
  rstr_set(&w->glw_id_rstr, rstr);
}
Exemplo n.º 6
0
static void
set_bg2(bg_helper_t *bgh, rstr_t *r)
{
  rstr_set(&bgh->bg_url[2], r);
}
Exemplo n.º 7
0
static void
set_skin_path(bg_helper_t *bgh, rstr_t *r)
{
  rstr_set(&bgh->skin_path, r);
}