summaryrefslogtreecommitdiff
path: root/test cases/frameworks/7 gnome/gir/meson-python-sample.c
blob: 0ab7439d023e2a1d387024313024434404faca4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "meson-python-sample.h"

#include <Python.h>

struct _MesonPythonSample
{
  GObject parent_instance;
};

G_DEFINE_TYPE (MesonPythonSample, meson_python_sample, G_TYPE_OBJECT)

/**
 * meson_python_sample_new:
 *
 * Allocates a new #MesonPythonSample.
 *
 * Returns: (transfer full): a #MesonPythonSample.
 */
MesonPythonSample *
meson_python_sample_new (void)
{
  return g_object_new (MESON_TYPE_PYTHON_SAMPLE, NULL);
}

static void
meson_python_sample_class_init (MesonPythonSampleClass *klass)
{
  if (!Py_IsInitialized ()) {
    Py_Initialize ();
    Py_Finalize ();
  }
}

static void
meson_python_sample_init (MesonPythonSample *self)
{
}

/**
 * meson_python_sample_print_message:
 * @self: a #MesonSample2.
 *
 * Prints Hello.
 *
 * Returns: Nothing.
 */
void
meson_python_sample_print_message (MesonPythonSample *self)
{
  g_print ("Message: Hello\n");
}