IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2006, 2:42:35 PM (20 years ago)
Author:
eugene
Message:

moved check_permissions to libohana, added buttons to Kii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kii/picture/Reorient.c

    r2466 r6674  
    11# include "Ximage.h"
    22
    3 void Reorient (Graphic *graphic, Layout *layout, XButtonEvent *mouse_event) {
    4 
    5   int x, y, dummy2;
    6   double X0, Y0;
    7   unsigned int dummy3;
    8   Window dummy1;
     3void Reorient (Graphic *graphic, Layout *layout, double X, double Y, int mode) {
    94
    105  if (layout[0].expand == 0)
    116    layout[0].expand = 1;
    127
    13   Screen_to_Image (&X0, &Y0, (double)mouse_event[0].x, (double)mouse_event[0].y, layout);
    14   X0 = 0.5*layout[0].matrix.Naxis[0] - X0;
    15   Y0 = 0.5*layout[0].matrix.Naxis[1] - Y0;
    16 
    17   switch (mouse_event[0].button) {
    18   case 1:
    19     if ((layout[0].X != X0) || (layout[0].Y != Y0)) {
    20       layout[0].X = X0;
    21       layout[0].Y = Y0;
     8  switch (mode) {
     9  case 0:
     10    if ((layout[0].X != X) || (layout[0].Y != Y)) {
     11      layout[0].X = X;
     12      layout[0].Y = Y;
    2213    }
    2314    break;
    24   case 2:
     15  case -1:
    2516    layout[0].expand--;
    2617    if ((layout[0].expand == 0) || (layout[0].expand == -1))
     
    3122      return;
    3223    }
    33     layout[0].X = X0;
    34     layout[0].Y = Y0;
     24    layout[0].X = X;
     25    layout[0].Y = Y;
    3526    break;
    36   case 3:
     27  case +1:
    3728    layout[0].expand++;
    3829    if ((layout[0].expand == 0) || (layout[0].expand == -1))
     
    4334      return;
    4435    }
    45     layout[0].X = X0;
    46     layout[0].Y = Y0;
     36    layout[0].X = X;
     37    layout[0].Y = Y;
    4738    break;
    4839  }
     
    5142  Refresh (graphic, layout, 0);
    5243 
    53 # ifndef NOWARP  /* the "warp" function seems to be a problem on SUNs for some reason */
     44  XFlush (graphic[0].display);
     45}
     46
     47# if (0) /* the "warp" function seems to be a problem on SUNs for some reason */
    5448  XQueryPointer (graphic[0].display, graphic[0].window, &dummy1, &dummy1, &dummy2, &dummy2, &x, &y, &dummy3);
    5549  if ((x > layout[0].picture.x) && (x < layout[0].picture.x + layout[0].picture.dx) &&
     
    6256# endif
    6357
    64   XFlush (graphic[0].display);
    65 }
Note: See TracChangeset for help on using the changeset viewer.