~ubuntu-branches/ubuntu/trusty/libgii/trusty

« back to all changes in this revision

Viewing changes to input/touchscreen/common.c

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2006-10-17 19:36:15 UTC
  • mfrom: (3.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20061017193615-6civk5a1i4n1kyb0
Tags: 1:1.0.1-3
Fixed "ggtick is missing". Closes: #388682.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: common.c,v 1.2.2.2 2003/02/01 14:33:32 cegger Exp $
 
1
/* $Id: common.c,v 1.7 2004/11/27 14:37:54 soyt Exp $
2
2
******************************************************************************
3
3
 
4
4
   Input-touchscreen_common: common functions for touchscreen handling
81
81
      else if(values==7)
82
82
          configured = 1;
83
83
      fclose(fp);
84
 
      GIIDPRINT_MISC("touchscreen: %d %d %d | %d %d %d (%dx%d)\n",
 
84
      DPRINT_MISC("touchscreen: %d %d %d | %d %d %d (%dx%d)\n",
85
85
                     tc.a, tc.b, tc.c, tc.d, tc.e, tc.e, calwidth, calheight);
86
86
    }
87
87
  if (!configured)
88
 
    GIIDPRINT_MISC("touchscreen: NOT configured! Calibrate before use.\n");
 
88
    DPRINT_MISC("touchscreen: NOT configured! Calibrate before use.\n");
89
89
 
90
90
  return configured;
91
91
}
97
97
  gii_cmddata_getvalinfo *VI;
98
98
  gii_event ev;
99
99
 
100
 
  GIIDPRINT_MISC("touchscreen sending valinfo\n");
 
100
  DPRINT_MISC("touchscreen sending valinfo\n");
101
101
    
102
 
  if (val >= 2) return -1;
 
102
  if (val >= 2) return GGI_ENOSPACE;
103
103
 
104
104
  int size = sizeof(gii_cmd_nodata_event)+sizeof(gii_cmddata_getvalinfo);
105
105
  
126
126
  
127
127
  int size = sizeof(gii_cmd_nodata_event)+sizeof(gii_cmddata_getdevinfo);
128
128
  
129
 
  GIIDPRINT_MISC("touchscreen sending devinfo\n");
 
129
  DPRINT_MISC("touchscreen sending devinfo\n");
130
130
  
131
131
  _giiEventBlank(&ev, size);
132
132
  
325
325
 
326
326
  if (touchscreen_filter(&x, &y, pressure))
327
327
    {
328
 
      GIIDPRINT_EVENTS("touchscreen: filtered out!\n");
 
328
      DPRINT_EVENTS("touchscreen: filtered out!\n");
329
329
      return sent;
330
330
    }
331
331
 
332
332
  if(inp->curreventmask & emValuator)
333
333
    {
334
 
      GIIDPRINT_EVENTS("touchscreen: valuator (%d,%d)\n", x, y);
 
334
      DPRINT_EVENTS("touchscreen: valuator (%d,%d)\n", x, y);
335
335
      
336
336
      _giiEventBlank(&ev, sizeof(gii_val_event));
337
337
      ev.any.type   = evValAbsolute;
352
352
      is_calibrated)
353
353
    {
354
354
      touchscreen_pentoscreen(&x, &y);
355
 
      GIIDPRINT_EVENTS("touchscreen: pmove event (%d,%d)\n", x, y);
 
355
      DPRINT_EVENTS("touchscreen: pmove event (%d,%d)\n", x, y);
356
356
 
357
357
      _giiEventBlank(&ev, sizeof(gii_pmove_event));
358
358
      
375
375
      if ((inp->curreventmask & emPtrButtonPress) &&
376
376
          pressure && !tshook->is_pressed)
377
377
        {
378
 
          GIIDPRINT_EVENTS("touchscreen: pbutton pressed event\n");
 
378
          DPRINT_EVENTS("touchscreen: pbutton pressed event\n");
379
379
 
380
380
          /* touches surface */
381
381
          ev.pbutton.type = evPtrButtonPress;
385
385
      else if ((inp->curreventmask & emPtrButtonRelease) && 
386
386
               !pressure && tshook->is_pressed)
387
387
        {
388
 
          GIIDPRINT_EVENTS("touchscreen: pbutton release event\n");
 
388
          DPRINT_EVENTS("touchscreen: pbutton release event\n");
389
389
 
390
390
          /* pen leaves surface */
391
391
          ev.pbutton.type = evPtrButtonRelease;
410
410
  if ((ev->any.target != inp->origin) &&
411
411
      (ev->any.target != GII_EV_TARGET_ALL))
412
412
    /* not for us */
413
 
    return -1;
 
413
    return GGI_EEVNOTARGET;
414
414
  
415
415
  if (ev->any.type != evCommand)
416
 
    return -1;
 
416
    return GGI_EEVUNKNOWN;
417
417
  
418
418
  if (ev->cmd.code == GII_CMDCODE_GETDEVINFO)
419
419
    {
438
438
      return touchscreen_sendvalinfo(inp, vi->number);
439
439
    }
440
440
  
441
 
  return -1; /* unknown command */
 
441
  return GGI_EEVUNKNOWN; /* unknown command */
442
442
}