-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gnome: Add support for gi-compile-repository for generate_gir
- Loading branch information
Showing
23 changed files
with
928 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
test cases/frameworks/39 gnome glib compile repository/copyfile.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import shutil | ||
|
||
shutil.copy(sys.argv[1], sys.argv[2]) |
18 changes: 18 additions & 0 deletions
18
test cases/frameworks/39 gnome glib compile repository/gir/copy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env python3 | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright © 2021 Intel Corporation | ||
|
||
import argparse | ||
import shutil | ||
|
||
def main() -> None: | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('src') | ||
parser.add_argument('dest') | ||
args = parser.parse_args() | ||
|
||
shutil.copy(args.src, args.dest) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
56 changes: 56 additions & 0 deletions
56
test cases/frameworks/39 gnome glib compile repository/gir/dep1/dep1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "dep1.h" | ||
|
||
struct _MesonDep1 | ||
{ | ||
GObject parent_instance; | ||
}; | ||
|
||
G_DEFINE_TYPE (MesonDep1, meson_dep1, G_TYPE_OBJECT) | ||
|
||
/** | ||
* meson_dep1_new: | ||
* | ||
* Allocates a new #MesonDep1. | ||
* | ||
* Returns: (transfer full): a #MesonDep1. | ||
*/ | ||
MesonDep1 * | ||
meson_dep1_new (void) | ||
{ | ||
return g_object_new (MESON_TYPE_DEP1, NULL); | ||
} | ||
|
||
static void | ||
meson_dep1_finalize (GObject *object) | ||
{ | ||
G_OBJECT_CLASS (meson_dep1_parent_class)->finalize (object); | ||
} | ||
|
||
static void | ||
meson_dep1_class_init (MesonDep1Class *klass) | ||
{ | ||
GObjectClass *object_class = G_OBJECT_CLASS (klass); | ||
|
||
object_class->finalize = meson_dep1_finalize; | ||
} | ||
|
||
static void | ||
meson_dep1_init (MesonDep1 *self) | ||
{ | ||
} | ||
|
||
/** | ||
* meson_dep1_just_return_it: | ||
* @dep: a #MesonDep2. | ||
* | ||
* Returns the #MesonDep2 that is passed in | ||
* | ||
* Returns: (transfer none): a #MesonDep2 | ||
*/ | ||
MesonDep2* | ||
meson_dep1_just_return_it (MesonDep1 *self, MesonDep2 *dep) | ||
{ | ||
g_return_val_if_fail (MESON_IS_DEP1 (self), NULL); | ||
|
||
return dep; | ||
} |
23 changes: 23 additions & 0 deletions
23
test cases/frameworks/39 gnome glib compile repository/gir/dep1/dep1.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef MESON_DEP1_H | ||
#define MESON_DEP1_H | ||
|
||
#if !defined (MESON_TEST_1) | ||
#error "MESON_TEST_1 not defined." | ||
#endif | ||
|
||
#include <glib-object.h> | ||
#include "dep2/dep2.h" | ||
|
||
G_BEGIN_DECLS | ||
|
||
#define MESON_TYPE_DEP1 (meson_dep1_get_type()) | ||
|
||
G_DECLARE_FINAL_TYPE (MesonDep1, meson_dep1, MESON, DEP1, GObject) | ||
|
||
MesonDep1 *meson_dep1_new (void); | ||
MesonDep2 *meson_dep1_just_return_it (MesonDep1 *self, | ||
MesonDep2 *dep); | ||
|
||
G_END_DECLS | ||
|
||
#endif /* MESON_DEP1_H */ |
124 changes: 124 additions & 0 deletions
124
test cases/frameworks/39 gnome glib compile repository/gir/dep1/dep2/dep2.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
#include "dep2.h" | ||
|
||
struct _MesonDep2 | ||
{ | ||
GObject parent_instance; | ||
|
||
gchar *msg; | ||
}; | ||
|
||
G_DEFINE_TYPE (MesonDep2, meson_dep2, G_TYPE_OBJECT) | ||
|
||
enum { | ||
PROP_0, | ||
PROP_MSG, | ||
LAST_PROP | ||
}; | ||
|
||
static GParamSpec *gParamSpecs [LAST_PROP]; | ||
|
||
/** | ||
* meson_dep2_new: | ||
* @msg: The message to set. | ||
* | ||
* Allocates a new #MesonDep2. | ||
* | ||
* Returns: (transfer full): a #MesonDep2. | ||
*/ | ||
MesonDep2 * | ||
meson_dep2_new (const gchar *msg) | ||
{ | ||
g_return_val_if_fail (msg != NULL, NULL); | ||
|
||
return g_object_new (MESON_TYPE_DEP2, | ||
"message", msg, | ||
NULL); | ||
} | ||
|
||
static void | ||
meson_dep2_finalize (GObject *object) | ||
{ | ||
MesonDep2 *self = (MesonDep2 *)object; | ||
|
||
g_clear_pointer (&self->msg, g_free); | ||
|
||
G_OBJECT_CLASS (meson_dep2_parent_class)->finalize (object); | ||
} | ||
|
||
static void | ||
meson_dep2_get_property (GObject *object, | ||
guint prop_id, | ||
GValue *value, | ||
GParamSpec *pspec) | ||
{ | ||
MesonDep2 *self = MESON_DEP2 (object); | ||
|
||
switch (prop_id) | ||
{ | ||
case PROP_MSG: | ||
g_value_set_string (value, self->msg); | ||
break; | ||
default: | ||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
} | ||
} | ||
|
||
static void | ||
meson_dep2_set_property (GObject *object, | ||
guint prop_id, | ||
const GValue *value, | ||
GParamSpec *pspec) | ||
{ | ||
MesonDep2 *self = MESON_DEP2 (object); | ||
|
||
switch (prop_id) | ||
{ | ||
case PROP_MSG: | ||
self->msg = g_value_dup_string (value); | ||
break; | ||
default: | ||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
} | ||
} | ||
|
||
static void | ||
meson_dep2_class_init (MesonDep2Class *klass) | ||
{ | ||
GObjectClass *object_class = G_OBJECT_CLASS (klass); | ||
|
||
object_class->finalize = meson_dep2_finalize; | ||
object_class->get_property = meson_dep2_get_property; | ||
object_class->set_property = meson_dep2_set_property; | ||
|
||
gParamSpecs [PROP_MSG] = | ||
g_param_spec_string ("message", | ||
"Message", | ||
"The message to print.", | ||
NULL, | ||
(G_PARAM_READWRITE | | ||
G_PARAM_CONSTRUCT_ONLY | | ||
G_PARAM_STATIC_STRINGS)); | ||
|
||
g_object_class_install_properties (object_class, LAST_PROP, gParamSpecs); | ||
} | ||
|
||
static void | ||
meson_dep2_init (MesonDep2 *self) | ||
{ | ||
} | ||
|
||
/** | ||
* meson_dep2_return_message: | ||
* @self: a #MesonDep2. | ||
* | ||
* Returns the message. | ||
* | ||
* Returns: (transfer none): a const gchar* | ||
*/ | ||
const gchar* | ||
meson_dep2_return_message (MesonDep2 *self) | ||
{ | ||
g_return_val_if_fail (MESON_IS_DEP2 (self), NULL); | ||
|
||
return (const gchar*) self->msg; | ||
} |
Oops, something went wrong.