Hy , I am Ivan, and I am doing a little program to do thumbnails of
images and display in an window,
controled by a infra red control (using lirc + some routines to find
what button is pressed ).

The problem is... 
I make the window and map it, all fine;
I put the thumbnail images on the window, all fine;
I check the lirc device for data, data received, all fine;

Now when I try to put anything on the window, not appears :( 
the function of the infrared data check:

-----------------------------------------------------------------------        
int read_irdata(ir *ir)
{
  int i,n;
  lirc_t signal;
  unsigned short int word=0;
  ir->timeout.tv_usec = 100000;
  ir->timeout.tv_sec = 0;
  for(n=1;n;)
    {           
   FD_SET(ir->irfd,&ir->rdset); 
   n=select(ir->irfd+1,&ir->rdset,NULL,NULL, &ir->timeout);
      if (n);
        {
          read(ir->irfd,&signal,1);
          if(!(signal&PULSE_BIT))
            {                 
              if(signal > 1000)
                word = (word<<1)+1;
              else
                word = (word<<1);
              
        
              for(i=0;ir->ircode[i].code != 0 && word>>8 ==
ir->ircode[0].code>>8;i++)
                if(word == ir->ircode[i].code)
                  {
                    ir->press[1] = ir->press[0];
                    ir->press[0] = i;
                    return i;
                  }
            }    
          
        }
    }
  ir->press[0] = 0;
  return 0;
}             for(i=0;ir->ircode[i].code != 0 && word>>8 ==
ir->ircode[0].code>>8;i++)
                if(word == ir->ircode[i].code)
                  {
                    ir->press[1] = ir->press[0];
                    ir->press[0] = i;
                    return i;
                  }
            }    
          
        }
    }
  ir->press[0] = 0;
  return 0;
}
----------------------------------------------------------------
and the typedef ir struct:

typedef struct ircode
{   
  unsigned short int code;
  char name[CODENAME_MAX];
} ircode;

//Infra Red Struct
typedef struct ir                          
{
 fd_set rdset;
 struct timeval timeout;
 int irfd;
 struct ircode ircode[32];       
 unsigned int press[1];
} ir;
------------------------------------
here:

 quad = load_files("/temp");    // Put all images of the /temp directory
on a linked list
 thumbs(win,&th,quad,1,pos);  // descompress,resize and XputImage the
thumbnail images on the window
 read_irdata(ir);             // read the lirc device and check if an
button was pressed
 
now is the problem if I try to display anything on the window.

Can my int read_irdata(ir *) to bug anything ?

If anybody wants, I can send also all source code.




Reguards. 
Ivan Gustavo Munix Dos Santos
[EMAIL PROTECTED]
http://www.munix.com.br
tel: 012 - 3923 2925 Ramal 225
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to