]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/gnome_helpers.h
fix problem with nroff detection, remove dead code with old floats, bogus message...
[lyx.git] / src / frontends / gnome / gnome_helpers.h
1 // -*- C++ -*-
2 /* This file is part of
3  * =================================================
4  * 
5  *          LyX, The Document Processor
6  *          Copyright 1995-2000 The LyX Team.
7  *
8  * ================================================= */
9
10 #ifndef GNOME_HELPERS_H
11 #define GNOME_HELPERS_H
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 #include "debug.h"
18 #include <glade/glade-xml.h>
19 #include <glib.h>
20
21 // Glade Helper Function.  
22
23
24 /** This function will get a widget from the glade XML representation and
25  * will wrap it into the gtk--/gnome-- representation.
26  */
27 template<class T>
28 T* getWidgetPtr(GladeXML* xml, char const * name)
29 {   
30         T* result = static_cast<T*>(Gtk::wrap_auto((GtkObject*)glade_xml_get_widget(xml, name)));
31         if (result == NULL)
32         {
33                 lyxerr << "** ERROR **: unable to load widget: " << name << endl;
34                 g_assert(result != NULL);
35         }
36         return result;
37 }
38
39 class Gdk_Font;
40
41 /** Takes a Gdk::Font object reference and returns the name associated
42  * with the font it holds.
43  */
44 string get_font_name(Gdk_Font const & font);
45
46
47 /** Takes a GdkFont pointer and returns the name associated with the font
48  * it holds. It returns a newly allocated gchar* string.
49  *
50  * This function was lifted from e-font.c from the gabber package.
51  */
52 gchar * get_font_name(GdkFont const * font);
53
54 #endif