~jtaylor/ubuntu/natty/pyfltk/fix-779340

« back to all changes in this revision

Viewing changes to src/CallbackStruct.h

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2009-03-13 20:47:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090313204700-ra4hgdlhxzrccas3
Tags: upstream-1.1.3
ImportĀ upstreamĀ versionĀ 1.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// This struct manages callbacks into Python.  It is stored as the
 
2
// user data portion of a widget, and the PythonCallback function is
 
3
// set as the callback.  PythonCallback unmarshalls the pointer to
 
4
// the Python function and Python user data and calls back into
 
5
// Python. 
 
6
// 
 
7
 
 
8
#ifndef CallbackStruct_h
 
9
#define CallbackStruct_h
 
10
 
 
11
#include <Python.h>
 
12
 
 
13
class CallbackStruct
 
14
{
 
15
public:
 
16
  PyObject *func;
 
17
  PyObject *data;
 
18
  PyObject *widget;
 
19
  void     *type;
 
20
  PyObject *link;
 
21
  CallbackStruct( PyObject *theFunc, PyObject *theData, PyObject *theWidget, PyObject *theLink = 0):
 
22
    func(theFunc),
 
23
    data(theData),
 
24
    widget(theWidget)
 
25
  {}
 
26
  CallbackStruct( PyObject *theFunc, PyObject *theData, void *theType):
 
27
    func(theFunc),
 
28
    data(theData),
 
29
    widget(0),
 
30
    type(theType)
 
31
  {}
 
32
  
 
33
};
 
34
 
 
35
#endif