[xiph-cvs] cvs commit: postfish Makefile.am form.c postfish.c

Monty xiphmont at xiph.org
Fri Nov 29 23:30:29 PST 2002



xiphmont    02/11/30 02:30:29

  Modified:    .        Makefile.am form.c postfish.c
  Log:
  cleanup bugfixes

Revision  Changes    Path
1.2       +1 -1      postfish/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/postfish/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile.am	30 Nov 2002 06:41:24 -0000	1.1
+++ Makefile.am	30 Nov 2002 07:30:29 -0000	1.2
@@ -17,4 +17,4 @@
 profile:
         $(MAKE) all CFLAGS="@PROFILE@"
 
-EXTRA_DIST = COPYING autogen.sh
\ No newline at end of file
+EXTRA_DIST = COPYING autogen.sh configure.in Makefile.am
\ No newline at end of file

<p><p>1.2       +31 -10    postfish/form.c

Index: form.c
===================================================================
RCS file: /usr/local/cvsroot/postfish/form.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- form.c	30 Nov 2002 06:41:24 -0000	1.1
+++ form.c	30 Nov 2002 07:30:29 -0000	1.2
@@ -29,6 +29,11 @@
 #include <stdlib.h>
 #include <ncurses.h>
 #include <pthread.h>
+#include <math.h>
+
+static int cursor_active=0;
+static int cursor_x;
+static int cursor_y;
 
 extern pthread_mutex_t master_mutex;
 
@@ -60,6 +65,22 @@
     if(ret>0)return(ret);
   }
 }
+
+int pgetch(){
+  while(1){
+    int ret;
+
+    if(cursor_active){
+      move(cursor_y,cursor_x);
+      curs_set(1);
+    }else{
+      curs_set(0);
+    }
+    
+    ret=getch();
+    if(ret>0)return(ret);
+  }
+}
 /***************** simple form entry fields *******************/
 
 enum field_type { FORM_TIME, FORM_DB, FORM_P2 };
@@ -156,24 +177,23 @@
       /* cursor? */
       if(focus){
         int val=f->editwidth-f->cursor-1;
-	curs_set(1);
+	cursor_active=1;
+	cursor_y=f->y;
         switch(val){
         case 0:case 1:
-	  move(f->y,f->x+f->width-val-1);
+	  cursor_x=f->x+f->width-val-1;
           break;
         case 2:case 3:
-	  move(f->y,f->x+f->width-val-2);
+	  cursor_x=f->x+f->width-val-2;
           break;
         case 4:case 5:
-	  move(f->y,f->x+f->width-val-3);
+	  cursor_x=f->x+f->width-val-3;
           break;
         default:
-	  move(f->y,f->x+f->width-val-4);
+	  cursor_x=f->x+f->width-val-4;
           break;
         }
-      }else{
-	curs_set(0);
-      } 
+      }
     }
     break;
   case FORM_P2:
@@ -181,7 +201,7 @@
       char buf[80];
       snprintf(buf,80,"%*ld",f->width,lval);
       addstr(buf);
-      curs_set(0);
+      if(focus)cursor_active=0;
     }
     break;
   default:
@@ -192,12 +212,13 @@
       else
         snprintf(buf,80,"%+*ld",f->width,lval);
       addstr(buf);
-      curs_set(0);
+      if(focus)cursor_active=0;
     }
     break;
   }
   
   attrset(0);
+
 }
 
 void form_redraw(form *f){

<p><p>1.2       +2 -2      postfish/postfish.c

Index: postfish.c
===================================================================
RCS file: /usr/local/cvsroot/postfish/postfish.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- postfish.c	30 Nov 2002 06:41:24 -0000	1.1
+++ postfish.c	30 Nov 2002 07:30:29 -0000	1.2
@@ -1688,7 +1688,7 @@
     form_init(&editf,120,1);
     form_init(&noneditf,50,0);
     box(stdscr,0,0);
-    mvaddstr(0, 2, " Postfish Filter build 20021120.0 ");
+    mvaddstr(0, 2, " Postfish Filter $Id: postfish.c,v 1.2 2002/11/30 07:30:29 xiphmont Exp $ ");
     mvaddstr(LINES-1, 2, 
              " [<]<<   [,]<   [Spc] Play/Pause   [Bksp] Stop   [.]>   [>]>>   [p] Process ");
 
@@ -1714,7 +1714,7 @@
     signal(SIGINT,SIG_IGN);
 
     while(1){
-      int c=form_handle_char(&editf,getch());
+      int c=form_handle_char(&editf,pgetch());
       if(c=='q')break;
       switch(c){
       case '<':

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list