Ejemplo n.º 1
0
static void _slk_calc(void)
{
    int i, j, idx, remaining_space;
    int n_groups = 0, group_size[10];

    label_length = COLS / n_labels;
    if (label_length > MAX_LABEL_LENGTH - 1)
        label_length = MAX_LABEL_LENGTH - 1;
    remaining_space = COLS - label_length * n_labels + 1;
    for( i = abs( label_fmt); i; i /= 16)
        group_size[n_groups++] = i % 16;
               /* We really want at least two spaces between groups: */
    while( label_length > 1 && remaining_space < n_groups - 1)
    {
        label_length--;
        remaining_space += n_labels;
    }

    for( i = idx = 0; i < n_groups; i++)
        for( j = 0; j < group_size[i]; j++, idx++)
            slk[idx].start_col = label_length * idx
                     + (i ? (i * remaining_space) / (n_groups - 1) : 0);

    if( label_length)
       --label_length;

    /* make sure labels are all in window */

    _redraw();
}
Ejemplo n.º 2
0
int slk_restore(void)
{
    PDC_LOG(("slk_restore() - called\n"));

    hidden = FALSE;
    _redraw();
    return wrefresh(SP->slk_winptr);
}
Ejemplo n.º 3
0
int slk_color(short color_pair)
{
    int rc;

    PDC_LOG(("slk_color() - called\n"));

    rc = wcolor_set(SP->slk_winptr, color_pair, NULL);
    _redraw();

    return rc;
}
Ejemplo n.º 4
0
int slk_attrset(const chtype attrs)
{
    int rc;

    PDC_LOG(("slk_attrset() - called\n"));

    rc = wattrset(SP->slk_winptr, attrs);
    _redraw();

    return rc;
}
Ejemplo n.º 5
0
void AvatarCreator::Render()
{
    //redraw (if necessary) and render mCompositePreview and the background image.
    if (mRedraw)
        _redraw();

    Image* scr = Screen::Instance();
    rect r = GetScreenPosition();

    Frame::Render();

    if (mCompositePreview)
    {
        mCompositePreview->Render(scr, r.x + 10, r.y + 50);
    }
}
Ejemplo n.º 6
0
bool F0Contour::computeF0()
{
    if (_f0_session == 0) {
        _f0_session = init_get_f0();
        _f0_session->par->min_f0 = 60.0;
        _f0_session->par->max_f0 = 650.0;
        _f0_session->par->wind_dur = 0.01;
        _f0_session->par->frame_step = 0.005;
    }

    if (pitch_track(_ann, _f0_session)) {
        _redraw();
        return true;
    }
    else
        return false;
}
Ejemplo n.º 7
0
F0Contour::F0Contour(const Annotation &ann, QGraphicsItem *parent) :
    QGraphicsPathItem(parent),
    _ann(ann),
    _pen_selected(Qt::darkBlue),
    _pen_hover(Qt::green),
    _pen(Qt::black),
    _highlighted(false),
    _f0_session(0)
{
    _pen_selected.setCosmetic(true);
    _pen_selected.setWidth(5);
    _pen_selected.setCapStyle(Qt::RoundCap);
    _pen_hover.setCosmetic(true);
    _pen_hover.setWidth(5);
    _pen_hover.setCapStyle(Qt::RoundCap);
    setAcceptsHoverEvents(true);
    _redraw();
}
Ejemplo n.º 8
0
bool_t gwinImageOpenStream(GHandle gh, void *streamPtr) {
	if (gdispImageIsOpen(&widget(gh)->image))
		gdispImageClose(&widget(gh)->image);

	if (!gdispImageSetBaseFileStreamReader(&widget(gh)->image, streamPtr))
		return FALSE;

	if (gdispImageOpen(&widget(gh)->image) != GDISP_IMAGE_ERR_OK)
		return FALSE;

	if ((gh->flags & GWIN_FLG_VISIBLE)) {
		// Setting the clip here shouldn't be necessary if the redraw doesn't overdraw
		//	but we put it in for safety anyway
		#if GDISP_NEED_CLIP
			gdispSetClip(gh->x, gh->y, gh->width, gh->height);
		#endif
		_redraw(gh);
	}

	return TRUE;
}
Ejemplo n.º 9
0
static void _slk_calc(void)
{
    int i, center, col = 0;
    label_length = COLS / labels;

    if (label_length > 31)
        label_length = 31;

    switch (label_fmt)
    {
    case 0:     /* 3 - 2 - 3 F-Key layout */

        --label_length;

        slk[0].start_col = col;
        slk[1].start_col = (col += label_length);
        slk[2].start_col = (col += label_length);

        center = COLS / 2;

        slk[3].start_col = center - label_length + 1;
        slk[4].start_col = center + 1;

        col = COLS - (label_length * 3) + 1;

        slk[5].start_col = col;
        slk[6].start_col = (col += label_length);
        slk[7].start_col = (col += label_length);
        break;

    case 1:     /* 4 - 4 F-Key layout */

        for (i = 0; i < 8; i++)
        {
            slk[i].start_col = col;
            col += label_length;

            if (i == 3)
                col = COLS - (label_length * 4) + 1; 
        }

        break;

    case 2:     /* 4 4 4 F-Key layout */
    case 3:     /* 4 4 4 F-Key layout with index */

        for (i = 0; i < 4; i++)
        {
            slk[i].start_col = col;
            col += label_length;
        }

        center = COLS/2;

        slk[4].start_col = center - (label_length * 2) + 1;
        slk[5].start_col = center - label_length - 1;
        slk[6].start_col = center + 1;
        slk[7].start_col = center + label_length + 1;

        col = COLS - (label_length * 4) + 1;

        for (i = 8; i < 12; i++)
        {
            slk[i].start_col = col;
            col += label_length;
        }

        break;

    default:    /* 5 - 5 F-Key layout */

        for (i = 0; i < 10; i++)
        {
            slk[i].start_col = col;
            col += label_length;

            if (i == 4)
                col = COLS - (label_length * 5) + 1;
        }
    }

    --label_length;

    /* make sure labels are all in window */

    _redraw();
}
Ejemplo n.º 10
0
/******************************************************************************
 * stream_io_server_push                                                      *
 *                                                                            *
 * in: request	      ... Flick request structure                             *
 *     event          ... incoming event                                      *
 * out: _ev           ... Flick exception (unused)                            *
 * ret:   0           ... success                                             *
 *                                                                            *
 * handle incoming events                                                     *
 *****************************************************************************/
void 
stream_io_push_component(CORBA_Object _dice_corba_obj,
    const stream_io_input_event_t *event,
    CORBA_Server_Environment *_dice_corba_env)
{
  stream_io_input_event_t const *input_ev = event;

  switch(input_ev->type)
    {
    case EV_KEY:
      switch(input_ev->code)
	{
	case KEY_RIGHTSHIFT:
	case KEY_LEFTSHIFT:
	  if (input_ev->value)
	    __shift = 1;
	  else
	    __shift = 0;
	  touch_repeat(input_ev->code, 0);
	  return;
	case KEY_LEFTCTRL:
	case KEY_RIGHTCTRL:
	  if (input_ev->value)
	    __ctrl  = 1;
	  else
	    __ctrl  = 0;
	  touch_repeat(input_ev->code, 0);
	  return;
	case KEY_UP:
	  if(input_ev->value && __shift)
	    {
	      _key_scroll(SDOWN, 1);
	      touch_repeat(input_ev->code, input_ev->value);
	      return;
	    }
	  break;
	case KEY_PAGEUP:
	  if(input_ev->value && __shift)
	    {
	      _key_scroll(SDOWN, 20);
	      touch_repeat(input_ev->code, input_ev->value);
	      return;
	    }
	  break;
	case KEY_DOWN:
	  if(input_ev->value && __shift)
	    {
	      _key_scroll(SUP, 1);
	      touch_repeat(input_ev->code, input_ev->value);
	      return;
	    }
	  break;
	case KEY_PAGEDOWN:
	  if(input_ev->value && __shift)
	    {
	      _key_scroll(SUP, 20);
	      touch_repeat(input_ev->code, input_ev->value);
	      return;
	    }
	  break;
	}
      /* ignore mouse buttons */
      if(input_ev->code>=BTN_MOUSE && input_ev->code<=BTN_TASK)
	break;
      if(input_ev->value)
	{
	  int gap = OFS_LINES(sb_y-fline);
	  if (gap)
	    _key_scroll(SUP, gap);
	  _add_key(input_ev->code);
	}
      touch_repeat(input_ev->code, input_ev->value);
      break;
    
    case EV_CON:
      switch(input_ev->code) 
	{
	case EV_CON_REDRAW:
	  if (__init)
	    _redraw();
	  break;
	}
    }
}
Ejemplo n.º 11
0
	static void _timer(void *gh) {
		// We need to re-test the visibility in case it has been made invisible since the last frame.
		if ((((GHandle)gh)->flags & GWIN_FLG_VISIBLE))
			_redraw((GHandle)gh);
	}