Home | History | Annotate | Download | only in win
      1 # These are inline-routines/defines, so we do them "by hand"
      2 #
      3 
      4 f = Method(Boolean, 'IsWindowVisible',
      5     (WindowRef, 'theWindow', InMode),
      6 )
      7 methods.append(f)
      8 
      9 f = Method(void, 'GetWindowStructureRgn',
     10         (WindowRef, 'theWindow', InMode),
     11         (RgnHandle, 'r', InMode),
     12 )
     13 methods.append(f)
     14 
     15 f = Method(void, 'GetWindowContentRgn',
     16         (WindowRef, 'theWindow', InMode),
     17         (RgnHandle, 'r', InMode),
     18 )
     19 methods.append(f)
     20 
     21 f = Method(void, 'GetWindowUpdateRgn',
     22         (WindowRef, 'theWindow', InMode),
     23         (RgnHandle, 'r', InMode),
     24 )
     25 methods.append(f)
     26 
     27 f = Method(ExistingWindowPtr, 'GetNextWindow',
     28         (WindowRef, 'theWindow', InMode),
     29 )
     30 methods.append(f)
     31 
     32 f = Function(short, 'FindWindow',
     33     (Point, 'thePoint', InMode),
     34     (ExistingWindowPtr, 'theWindow', OutMode),
     35 )
     36 functions.append(f)
     37 
     38 f = Method(void, 'MoveWindow',
     39     (WindowPtr, 'theWindow', InMode),
     40     (short, 'hGlobal', InMode),
     41     (short, 'vGlobal', InMode),
     42     (Boolean, 'front', InMode),
     43 )
     44 methods.append(f)
     45 
     46 f = Method(void, 'ShowWindow',
     47     (WindowPtr, 'theWindow', InMode),
     48 )
     49 methods.append(f)
     50 
     51 #
     52 # A method to set the auto-dispose flag
     53 #
     54 AutoDispose_body = """
     55 int onoff, old = 0;
     56 if (!PyArg_ParseTuple(_args, "i", &onoff))
     57         return NULL;
     58 if ( _self->ob_freeit )
     59         old = 1;
     60 if ( onoff )
     61         _self->ob_freeit = PyMac_AutoDisposeWindow;
     62 else
     63         _self->ob_freeit = NULL;
     64 _res = Py_BuildValue("i", old);
     65 return _res;
     66 """
     67 f = ManualGenerator("AutoDispose", AutoDispose_body)
     68 f.docstring = lambda: "(int)->int. Automatically DisposeHandle the object on Python object cleanup"
     69 methods.append(f)
     70