Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Re-enabled ModuleInit/ModuleExit methods
Browse files Browse the repository at this point in the history
  • Loading branch information
abock committed Nov 8, 2010
1 parent db20e13 commit 638d911
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
5 changes: 5 additions & 0 deletions Maigre/Maigre.Osx/OsxTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ namespace Maigre.Osx
{
public class OsxTheme : Theme
{
protected override void ModuleInit ()
{
Console.WriteLine ("OsxTheme::ModuleInit");
}

protected override void DrawBox ()
{
switch (Detail) {
Expand Down
20 changes: 19 additions & 1 deletion Maigre/Maigre/Theme.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Style.cs
// Theme.cs
//
// Author:
// Aaron Bockover <abockover@novell.com>
Expand Down Expand Up @@ -34,6 +34,24 @@ public Theme ()
{
}

private void ProxyModuleInit ()
{
ModuleInit ();
}

protected virtual void ModuleInit ()
{
}

private void ProxyModuleExit ()
{
ModuleExit ();
}

protected virtual void ModuleExit ()
{
}

public static Theme Create ()
{
return new Maigre.Osx.OsxTheme ();
Expand Down
18 changes: 10 additions & 8 deletions libmaigre/maigre-theme-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ theme_init (GTypeModule *module)

maigre_rc_style_register_types (module);

/*if ((init_method =
mono_class_get_method_from_name (bridge->theme_class, "ModuleInit", 0)) != NULL) {
mono_runtime_invoke (init_method, NULL, NULL, NULL);
}*/
if ((init_method =
mono_class_get_method_from_name (bridge->theme_class,
"ProxyModuleInit", 0)) != NULL) {
mono_runtime_invoke (init_method, bridge->theme_object, NULL, NULL);
}
}

G_MODULE_EXPORT void
Expand All @@ -59,10 +60,11 @@ theme_exit ()
MonoMethod *exit_method;
MaigreMonoBridge *bridge = maigre_mono_bridge ();

/*if (bridge->init_success && (exit_method =
mono_class_get_method_from_name (bridge->theme_class, "ModuleExit", 0)) != NULL) {
mono_runtime_invoke (exit_method, NULL, NULL, NULL);
}*/
if (bridge->init_success && (exit_method =
mono_class_get_method_from_name (bridge->theme_class,
"ProxyModuleExit", 0)) != NULL) {
mono_runtime_invoke (exit_method, bridge->theme_object, NULL, NULL);
}
}

G_MODULE_EXPORT GtkRcStyle *
Expand Down

0 comments on commit 638d911

Please sign in to comment.