/*
 * Actually MOVE the hardware cursor
 */
static errr Term_curs_sla(int x, int y)
{
	/* Literally move the cursor */
	SLsmg_gotorc(y, x);

	/* Success */
	return 0;
}
Beispiel #2
0
static void update_display (void)
{
   unsigned int row, nrows;
   File_Line_Type *line;

   /* All well behaved applications should block signals that may affect
    * the display while performing screen update.
    */
   SLsig_block_signals ();

   Line_Window.nrows = nrows = SLtt_Screen_Rows - 1;

   /* Always make the current line equal to the top window line. */
   if (Line_Window.top_window_line != NULL)
     Line_Window.current_line = Line_Window.top_window_line;

   SLscroll_find_top (&Line_Window);

   row = 0;
   line = (File_Line_Type *) Line_Window.top_window_line;

   SLsmg_normal_video ();

   while (row < Line_Window.nrows)
     {
	SLsmg_gotorc (row, 0);

	if (line != NULL)
	  {
	     SLsmg_write_string (line->data);
	     line = line->next;
	  }
	SLsmg_erase_eol ();
	row++;
     }

   SLsmg_gotorc (row, 0);
   SLsmg_reverse_video ();
   SLsmg_printf ("%s | UTF-8 = %d",
		 (File_Name == NULL) ? "<stdin>" : File_Name,
		 SLutf8_is_utf8_mode ());
   SLsmg_erase_eol ();
   SLsmg_refresh ();

   SLsig_unblock_signals ();
}
Beispiel #3
0
/*
 * Actually MOVE the hardware cursor
 */
static errr Term_curs_sla(s32b x, s32b y, s32b z)
{
	/* Literally move the cursor */
	SLsmg_gotorc (y, x);

	/* Success */
	return 0;
}
Beispiel #4
0
void ephemeral_message(char *s) {

  SLsmg_gotorc(disp.num_rows - 1, 0);
  SLsmg_set_color(3);
  SLsmg_write_string(s);
  SLsmg_erase_eol();
  SLsmg_refresh();

}
int newtFinished(void) {
    SLsmg_gotorc(SLtt_Screen_Rows - 1, 0);
    newtCursorOn();
    SLsmg_refresh();
    SLsmg_reset_smg();
    SLang_reset_tty();

    return 0;
}
Beispiel #6
0
static void ctl_expression(int ch, int val)
{
  if(ch >= 16)
    return;
  if (!ctl.trace_playing)
    return;
  SLsmg_gotorc(8+ch, SLtt_Screen_Cols-12);
  SLsmg_printf("%3d", (val*100)/127);
}
Beispiel #7
0
static void ctl_file_name(char *name)
{
  SLsmg_gotorc(3,6);
  SLsmg_erase_eol();
  SLsmg_bold();
  SLsmg_write_string(name);
  SLsmg_normal();
  _ctl_refresh();
}
Beispiel #8
0
/** Draws the shadow of the Dialog
  *
  */
void RainbruRPG::Terminal::Dialog::drawShadow(){
  SLsmg_set_color(5);


  for (int y=yPos+1; y<yPos+height+1; y++){
    SLsmg_gotorc (y, xPos+width+1);
    // cast to char* to avoid deprecating conversion warning
    SLsmg_printf( (char*)"  " );
  }

  for (int x=xPos+1; x<xPos+width+3; x++){
    SLsmg_gotorc (yPos+height, x);
    // cast to char* to avoid deprecating conversion warning
    SLsmg_printf( (char*)" " );
  }

  SLsmg_set_color(0);
}
Beispiel #9
0
extern void
tty_gotoyx(int y, int x)
{
#ifdef HAVE_SLANG
    SLsmg_gotorc(y, x);
#else
    move(y, x);
#endif
}
Beispiel #10
0
void flush_message (char *m)
{
   message(m);
   if (Batch || (JWindow == NULL)) return;
   do_dialog(Message_Buffer);
   SLsmg_gotorc (Jed_Num_Screen_Rows - 1, strlen(Message_Buffer));
   *Message_Buffer = 0;
   JWindow->trashed = 1;
   SLsmg_refresh ();
}
Beispiel #11
0
static void tui_helpline__push(const char *msg)
{
	const size_t sz = sizeof(ui_helpline__current);

	SLsmg_gotorc(SLtt_Screen_Rows - 1, 0);
	SLsmg_set_color(0);
	SLsmg_write_nstring((char *)msg, SLtt_Screen_Cols);
	SLsmg_refresh();
	strlcpy(ui_helpline__current, msg, sz);
}
Beispiel #12
0
void newtGotorc(int newRow, int newCol) {
    if (currentWindow) {
	newRow += currentWindow->top;
	newCol += currentWindow->left;
    }

    cursorRow = newRow;
    cursorCol = newCol;
    SLsmg_gotorc(cursorRow, cursorCol);
}
Beispiel #13
0
static void ctl_sustain(int ch, int val)
{
  if(ch >= 16)
    return;
  if (!ctl.trace_playing)
    return;
  SLsmg_gotorc(8+ch, SLtt_Screen_Cols-4);
  if (val) SLsmg_write_char('S');
  else SLsmg_write_char(' ');
}
Beispiel #14
0
void c11_draw_background(void)
{
	SLtt_set_color(255,NULL,confdb.background,confdb.background);
	SLsmg_set_color(255);
	SLsmg_gotorc(0,0);
	SLsmg_erase_eos();
	SLsmg_refresh();
	
	return;
}
Beispiel #15
0
int SLcurses_wnoutrefresh (SLcurses_Window_Type *w)
{
   unsigned int len;
   unsigned int r, c;
   unsigned int i, imax;

   if (SLcurses_Is_Endwin)
     {
	if (TTY_State) init_tty (TTY_State - 1);
       	SLsmg_resume_smg ();
	SLcurses_Is_Endwin = 0;
     }

   if (w == NULL)
     {
	SLsmg_refresh ();
	return -1;
     }

   if (w->modified == 0)
     return 0;

   r = w->_begy;
   c = w->_begx;

   len = w->ncols;
   imax = w->nrows;

   for (i = 0; i < imax; i++)
     {
	SLsmg_gotorc (r, c);
	write_color_chars (w->lines[i], len);
	r++;
     }

   if (w->has_box)
     SLsmg_draw_box(w->_begy, w->_begx, w->nrows, w->ncols);

   SLsmg_gotorc (w->_begy + w->_cury, w->_begx + w->_curx);
   w->modified = 0;
   return 0;
}
Beispiel #16
0
void vtClearRect(VTScreenView *view, int s_col, int s_row, int e_col, int e_row) {
	int i,j;
	for(i = s_row; i <= e_row; i++) {
		SLsmg_gotorc(i, s_col);
		for(j = s_col; j < e_col; j++)
			SLsmg_write_char(' ');
		
		//SLsmg_erase_eol();
	}
	//SLsmg_refresh();
}
Beispiel #17
0
static void init_lyric(char *lang)
{
    int i;

    if(ctl.trace_playing)
      return;
    for(i=6;i<=SLtt_Screen_Rows;i++){
      SLsmg_gotorc(i,0);
      SLsmg_erase_eol();
    }
}
Beispiel #18
0
static void SLsmg_printfrc( int r, int c, char *fmt, ...) {
  char p[1000];
  va_list ap;

  SLsmg_gotorc( r, c);
  va_start(ap, fmt);
  vsnprintf(p, sizeof(p), fmt, ap);
  va_end(ap);

  SLsmg_write_string (p);
}
Beispiel #19
0
void
tty_draw_vline (int y, int x, int ch, int len)
{
    int y1;

    if (x < 0 || x >= COLS || y >= LINES)
        return;

    y1 = y;

    if (y < 0)
    {
        len += y;
        if (len <= 0)
            return;
        y = 0;
    }

    if (ch == ACS_VLINE)
        ch = mc_tty_frm[MC_TTY_FRM_VERT];
    if (ch == 0)
        ch = ACS_VLINE;

    SLsmg_gotorc (y, x);

    if (ch == ACS_VLINE)
        SLsmg_draw_vline (len);
    else
    {
        int pos = 0;

        while (len-- != 0)
        {
            SLsmg_gotorc (y + pos, x);
            tty_print_char (ch);
            pos++;
        }
    }

    SLsmg_gotorc (y1, x);
}
Beispiel #20
0
static void ctl_close(void)
{
  if (ctl.opened)
    {
        SLsmg_normal();
        SLsmg_gotorc(SLtt_Screen_Rows - 1, 0);
        SLsmg_refresh();
        SLsmg_reset_smg();
        SLang_reset_tty();
      ctl.opened=0;
    }
}
Beispiel #21
0
static void ctl_pitch_bend(int ch, int val)
{
  if(ch >= 16)
    return;
  if (!ctl.trace_playing)
    return;
  SLsmg_gotorc(8+ch, SLtt_Screen_Cols-2);
  if (val==-1) SLsmg_write_char('=');
  else if (val>0x2000) SLsmg_write_char('+');
  else if (val<0x2000) SLsmg_write_char('-');
  else SLsmg_write_char(' ');
}
Beispiel #22
0
static void ctl_total_time(int tt)
{
  int mins, secs=tt/play_mode->rate;
  mins=secs/60;
  secs-=mins*60;

  SLsmg_gotorc(4,6+6+3);
  SLsmg_bold();
  SLsmg_printf("%3d:%02d", mins, secs);
  SLsmg_normal();
  _ctl_refresh();
}
Beispiel #23
0
/** Draws the caption of the box
  *
  * \param x the x coordonate of the box
  * \param y the y coordonate of the box
  */
void RainbruRPG::Terminal::ListBox::drawTheCaption( int x, int y){
  SLsmg_gotorc ( y, x+2);
  SLsmg_set_char_set (1);
  SLsmg_write_char( SLSMG_RTEE_CHAR );
  SLsmg_set_char_set (0);

  // cast to char* to avoid deprecating conversion warning
  SLsmg_printf( (char*)" %s ", caption.c_str() );
  SLsmg_set_char_set (1);
  SLsmg_write_char( SLSMG_LTEE_CHAR );
  SLsmg_set_char_set (0);
}
Beispiel #24
0
/*
 * Erase some characters
 */
static errr Term_wipe_sla(int x, int y, int n)
{
	int i;

	/* Place the cursor */
	SLsmg_gotorc(y, x);

	/* Dump spaces */
	for (i = 0; i < n; i++) SLsmg_write_char(' ');

	/* Success */
	return 0;
}
Beispiel #25
0
/** Draws the title of the Dialog
  *
  */
void RainbruRPG::Terminal::Dialog::drawTitle(){
  int l=title.length();
  int x=(SLtt_Screen_Cols/2)-(l/2);

  SLsmg_set_color (8);


  SLsmg_set_char_set (1); //Use the alt charset
  SLsmg_gotorc (yPos, x-2);
  SLsmg_write_char(SLSMG_RTEE_CHAR);
  SLsmg_gotorc (yPos, x+l+1);
  SLsmg_write_char(SLSMG_LTEE_CHAR);

  //title
  SLsmg_set_color (9);
  SLsmg_gotorc (yPos, x-1);
  SLsmg_set_char_set (0); //Use the alt charset

  // cast to char* to avoid deprecating conversion warning
  SLsmg_printf( (char*)" %s ", title.c_str() );

}
Beispiel #26
0
/** Draws the white panel
  *
  */
void RainbruRPG::Terminal::Dialog::drawEmpty(){
  SLsmg_set_color (1);

  for (int y=yPos; y<yPos+height; y++){
    SLsmg_gotorc (y, xPos);
    for (int x=xPos; x<xPos+width; x++){

     // cast to char* to avoid deprecating conversion warning
      SLsmg_printf( (char*)" " );
    }
  }
  SLsmg_set_color (0);
}
Beispiel #27
0
static void init_smg_for_buffer (int *rowp, int *colp)
{
   SLsmg_Tab_Width = Buffer_Local.tab;
   if (IN_MINI_WINDOW)
     SLsmg_Newline_Behavior = SLSMG_NEWLINE_PRINTABLE;
   else
     SLsmg_Newline_Behavior = 0;
   (void) SLsmg_embedded_escape_mode (CBuf->flags & SMG_EMBEDDED_ESCAPE);

   *rowp = SLsmg_get_row ();
   *colp = SLsmg_get_column ();
   SLsmg_gotorc (0, 0);
}
Beispiel #28
0
/*
 * Erase some characters
 */
static errr Term_wipe_sla(s32b x, s32b y, s32b n)
{
	s32b i;

	/* Place the cursor */
	SLsmg_gotorc(y, x);

	/* Dump spaces */
	for (i = 0; i < n; i++) SLsmg_write_char(' ');

	/* Success */
	return 0;
}
Beispiel #29
0
/*
 * Place some text on the screen using an attribute
 */
static errr Term_text_sla(int x, int y, int n, byte a, cptr s)
{
	/* Move the cursor */
	SLsmg_gotorc(y, x);

	/* Set the color */
	if (can_use_color) SLsmg_set_color(colortable[a&0x0F]);

	/* Dump the string */
	SLsmg_write_nchars((char *)s, n);

	/* Success */
	return 0;
}
Beispiel #30
0
void newtDrawRootText(int col, int row, const char * text) {
    SLsmg_set_color(NEWT_COLORSET_ROOTTEXT);

    if (col < 0) {
	col = SLtt_Screen_Cols + col;
    }

    if (row < 0) {
	row = SLtt_Screen_Rows + row;
    }

    SLsmg_gotorc(row, col);
    SLsmg_write_string((char *)text);
}