chiark / gitweb /
doxygen
[disorder] / disobedience / help.c
index f8e660f53b24c71a1aaad750ec6a99a90550680f..0815bac737947136744e1c482f727f4beecc0d31 100644 (file)
@@ -17,6 +17,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  * USA
  */
+/** @file disobedience/help.c
+ * @brief Help support
+ */
 
 #include "disobedience.h"
 #include "table.h"
@@ -37,17 +40,25 @@ struct tag {
   GtkTextTag *tag;
 };
 
+/** @brief Initialize the bold tag
+ *
+ * This doesn't seem to work on OS X though the italic and monospace tags are
+ * fine, and bold is OK on Linux, even connecting to the Apple X swerver.
+ */
 static void init_bold(GtkTextTag *tag) {
   g_object_set(G_OBJECT(tag), "weight", PANGO_WEIGHT_BOLD, (char *)0);
 }
 
+/** @brief Initialize the italic tag */
 static void init_italic(GtkTextTag *tag) {
   g_object_set(G_OBJECT(tag), "style", PANGO_STYLE_ITALIC, (char *)0);
 }
 
+/** @brief Initialize the pre tag */
 static void init_pre(GtkTextTag *tag) {
   g_object_set(G_OBJECT(tag), "family", "monospace", (char *)0);
 }
+
 /** @brief Table of known tags
  *
  * Keep in alphabetical order
@@ -191,6 +202,7 @@ static void insert_html(GtkTextBuffer *buffer,
   html_parse(&insert_html_callbacks, html, s);
 }
 
+/** @brief Create a GtkTextBuffer with @p html rendered into it */
 static GtkTextBuffer *html_buffer(const char *html) {
   GtkTextBuffer *buffer = gtk_text_buffer_new(NULL);
 
@@ -198,8 +210,10 @@ static GtkTextBuffer *html_buffer(const char *html) {
   return buffer;
 }
 
+/** @brief The manual page window */
 static GtkWidget *help_window;
 
+/** @brief Pop up the manual page in a window */
 void popup_help(void) {
   GtkWidget *view;
   
@@ -210,13 +224,13 @@ void popup_help(void) {
   help_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   g_signal_connect(help_window, "destroy",
                   G_CALLBACK(gtk_widget_destroyed), &help_window);
-  gtk_window_set_title(GTK_WINDOW(help_window), "Disobedience Manual");
+  gtk_window_set_title(GTK_WINDOW(help_window), "Disobedience Manual Page");
   view = gtk_text_view_new_with_buffer(html_buffer(manual));
   gtk_text_view_set_editable(GTK_TEXT_VIEW(view), FALSE);
   gtk_container_add(GTK_CONTAINER(help_window),
                    scroll_widget(view,
                                  "help"));
-  gtk_window_set_default_size(GTK_WINDOW(help_window), 480, 512);
+  gtk_window_set_default_size(GTK_WINDOW(help_window), 512, 512);
   gtk_widget_show_all(help_window);
 }