
#include <stdio.h>
#include "./ac.h"


main()
{    int i;

ac_clrscr();           //  Erase Display
ac_cursor_on();
// ac_cursol_off();

// ac_func_disp( sw ); 
// 
// ac_func_on(); 
// ac_func_off();
// 
// ac_line25();
// ac_line20();
// 
// ac_cursor_save();
// ac_cursor_load();
// 
// 
// ac_attr1( a );     
// ac_attr2( a1, a2 );
// ac_attr3( a1, a2, a3 );    
// ac_attr4( a1, a2, a3, a4 );
// ac_attr_color( c ); 


ac_attr_off();    //   Turn off character attributes
//ac_attr_off0();   //   Turn off character attributes
ac_attr_bold();   //   Turn bold mode on
printf("test  ac_attr_bold() \n" );

ac_attr_off(); 
ac_attr_low();    //   Turn low intensity mode on
printf("test  ac_attr_low() \n" );

ac_attr_off(); 
ac_attr_underline(); //   Turn underline mode on
printf("test  ac_attr_underline() \n" );

ac_attr_off(); 
ac_attr_blink();      //   Turn blinking mode on
printf("test  ac_attr_blink() \n" );

ac_attr_off(); 
ac_attr_reverse();    //   Turn reverse video on
printf("test  ac_attr_reverse() \n" );

ac_attr_off(); 
ac_attr_invisible();  //   Turn invisible text mode on
printf("test  ac_attr_invisible() \n" );

ac_attr_off(); 

printf("press enter\n" );  getchar();




printf("press enter\n" );
ac_gotoxy( 10 , 10 ); //  goto x y  10 , 10 


printf(" wait  4 x  test ac_cursor_****  " );  fflush(stdout);
 usleep(600000); //getchar();
ac_cursor_up( 4 );    fflush(stdout);   // Move cursor up   l lines
 usleep(600000); // getchar();
ac_cursor_down( 4 );  fflush(stdout);  // Move cursor down l lines 
 usleep(600000); // getchar();
ac_cursor_right( 4 ); fflush(stdout);  // Move cursor right r rows
 usleep(600000); // getchar();
ac_cursor_left( 4 );  fflush(stdout);  // Move cursor left  r rows
 usleep(600000); //getchar();

getchar();
printf(" wait  4 x  test ac_cu* " );  fflush(stdout);
 usleep(600000);
ac_cuu( );  fflush(stdout);      // Move cursor up   l lines
 usleep(600000);
ac_cud( );  fflush(stdout);    // Move cursor down l lines 
 usleep(600000);
ac_cuf( );  fflush(stdout);   // Move cursor right r rows
 usleep(600000);
ac_cub( );  fflush(stdout);    // Move cursor left  r rows
 usleep(600000);

// ac_cursor_moverel( l, r );
// ac_clrscr();           //  Erase Display

 printf("test -- ac_erase_tolast()  press enter " );  fflush(stdout);
 getchar();
 ac_erase_tolast();     //  Clear screen from cursor down
 printf("test -- ac_erase_fromfirst()  press enter " );  fflush(stdout);
 getchar();
 ac_erase_fromfirst();   fflush(stdout); //  Clear screen from cursor up 

 usleep(800000);

 ac_gotoxy( 1 , 1 );
 for(i=1;i<18;i++)
 { printf("%02d_demo_line_demo_%02d_demo_line_demo\n",i,i );  }
 printf("\ngo to line nr 09 and erase 1 line\n" );  printf("press enter\n" );
 getchar();
 ac_gotoxy( 1 , 9 );
 ac_dellines( 1 );
 printf("press enter \n" );  getchar();

 ac_clrscr();  ac_gotoxy( 1 , 1 );
 for(i=1;i<18;i++)
 { printf("%02d_demo_line_demo_%02d_demo_line_demo\n",i,i );  }
 printf("\ngo to line nr 09 and erase 4 lines\n" );  printf("press enter\n" );
 getchar();
 ac_gotoxy( 1 , 9 );
 ac_dellines( 4 );
 printf("press enter \n" );  getchar();


 ac_clrscr();  ac_gotoxy( 1 , 1 );
 for(i=1;i<18;i++)
 { printf("%02d_demo_line_demo_%02d_demo_line_demo\n",i,i );  }
 printf("\ngo to line nr 09 and insert 4 lines\n" );  printf("press enter\n" );
 getchar();
 ac_gotoxy( 1 , 9 );
 ac_inslines( 4 );
 printf("press enter \n" );  getchar();

// ???? 
//printf( "\x1b[?4h" );  //  Set jump scrolling 
printf(" test  ac_scroll_up()  \n" ); // ????
 usleep(500000);
for(i=1;i<18;i++)
 {  ac_scroll_up();    fflush(stdout);  usleep(200000);  }
// printf(" test  ac_scroll_down()  \n" );
//  usleep(800000);
// for(i=1;i<18;i++)
//  {  ac_scroll_down();  fflush(stdout);  usleep(200000);  }
 ac_gotoxy( 1 , 4 );
 printf("--test  ac_erase_toright()  and  ac_erase_fromleft()--" ); fflush(stdout);
 ac_gotoxy( 18 , 4 );
 usleep(1200000);
 ac_erase_toright();  fflush(stdout);   usleep(1200000); 


 ac_gotoxy( 18 , 4 ); 
 ac_erase_fromleft();  fflush(stdout);  usleep(1200000);


 ac_gotoxy( 1 , 22 );
 printf("press enter 2 exit\n" );
 getchar();


} // main