Hi Damon,

From: Damon Chaplin <[EMAIL PROTECTED]>
Subject: Supporting Ruby (Was Re: Glade CVS 20000124 - Losing gnome_support)
Date: Fri, 28 Jan 2000 01:07:42 +0000

> Ideally we'd have a plug-in system to add support for other languages,
> but for now you have to hack Glade.

Thank you for your nice mini-howto ;) It helped me a lot to get me
started.

anyway, I hacked a bit to put the word "Ruby" on the Project Window.
Let me know if I did something stupid.  I'm attaching the patch to
this mail.

I'll hack more to get project options little by little.  Hope you like
the patch.

I also has a little request for the current glade.  Can you move
Subdirectories: option to language specific tab?  I think directory
strategy is depending on the language you use.

regards,
--
          yashi


Index: glade_project.c
===================================================================
RCS file: /cvs/gnome/glade/glade/glade_project.c,v
retrieving revision 1.17
diff -u -u -r1.17 glade_project.c
--- glade_project.c     2000/01/23 22:57:58     1.17
+++ glade_project.c     2000/01/28 10:25:43
@@ -42,7 +42,7 @@
 
 
 /* The order must match the GladeLanguageType enum in glade_project.h. */
-gchar *GladeLanguages[] = { "C", "C++", "Ada 95", "Perl", "Eiffel" };
+gchar *GladeLanguages[] = { "C", "C++", "Ada 95", "Perl", "Eiffel", "Ruby" };
 gint GladeNumLanguages = sizeof (GladeLanguages) / sizeof (GladeLanguages[0]);
 
 
@@ -55,6 +55,7 @@
 static GladeError* glade_project_write_ada95_source (GladeProject *project);
 static GladeError* glade_project_write_perl_source (GladeProject *project);
 static GladeError* glade_project_write_eiffel_source (GladeProject *project);
+static GladeError* glade_project_write_ruby_source (GladeProject *project);
 
 static void free_key (gchar    *key,
                      gchar     *value,
@@ -391,6 +392,8 @@
       return glade_project_write_perl_source (project);
     case GLADE_LANGUAGE_EIFFEL:
       return glade_project_write_eiffel_source (project);
+    case GLADE_LANGUAGE_RUBY:
+      return glade_project_write_ruby_source (project);
     default:
       break;
     }
@@ -496,6 +499,17 @@
        }
 
        return NULL;
+}
+
+/* Code generation for Ruby is not yet supported. */
+static GladeError*
+glade_project_write_ruby_source (GladeProject *project)
+{
+  return glade_error_new_general
+    (GLADE_STATUS_ERROR,
+     _("Code generation for Ruby is not yet supported.\n"
+       "Use glade xml parser object with the glade xml file to\n"
+       "generate Gtk objects at runtime\n"));
 }



Index: glade_project.h
===================================================================
RCS file: /cvs/gnome/glade/glade/glade_project.h,v
retrieving revision 1.12
diff -u -u -r1.12 glade_project.h
--- glade_project.h     1999/09/05 00:01:07     1.12
+++ glade_project.h     2000/01/28 10:26:07
@@ -41,7 +41,8 @@
   GLADE_LANGUAGE_CPP,
   GLADE_LANGUAGE_ADA95,
   GLADE_LANGUAGE_PERL,
-  GLADE_LANGUAGE_EIFFEL
+  GLADE_LANGUAGE_EIFFEL,
+  GLADE_LANGUAGE_RUBY
 } GladeLanguageType;
 
 extern gchar *GladeLanguages[];

+---------------------------------------------------------------------+
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the line "unsubscribe glade-devel" in the body of the message.

Reply via email to