metacity r3697 - in trunk: . src/ui



Author: tthurman
Date: Tue Apr 29 02:54:56 2008
New Revision: 3697
URL: http://svn.gnome.org/viewvc/metacity?rev=3697&view=rev

Log:
2008-04-29  Thomas Thurman  <tthurman gnome org>

        * src/ui/fixedtip.[ch]: documentation



Modified:
   trunk/ChangeLog
   trunk/src/ui/fixedtip.c
   trunk/src/ui/fixedtip.h

Modified: trunk/src/ui/fixedtip.c
==============================================================================
--- trunk/src/ui/fixedtip.c	(original)
+++ trunk/src/ui/fixedtip.c	Tue Apr 29 02:54:56 2008
@@ -25,9 +25,29 @@
 #include "fixedtip.h"
 #include "ui.h"
 
+/**
+ * The floating rectangle.  This is a GtkWindow, and it contains
+ * the "label" widget, below.
+ */
 static GtkWidget *tip = NULL;
+
+/**
+ * The actual text that gets displayed.
+ */
 static GtkWidget *label = NULL;
+/*
+ * X coordinate of the right-hand edge of the screen.
+ *
+ * \bug  This appears to be a bug; screen_right_edge is calculated only when
+ *       the window is redrawn.  Actually we should never cache it because
+ *       different windows are different sizes.
+ */
 static int screen_right_edge = 0;
+/*
+ * Y coordinate of the bottom edge of the screen.
+ *
+ * \bug  As with screen_right_edge.
+ */
 static int screen_bottom_edge = 0;
 
 static gint

Modified: trunk/src/ui/fixedtip.h
==============================================================================
--- trunk/src/ui/fixedtip.h	(original)
+++ trunk/src/ui/fixedtip.h	Tue Apr 29 02:54:56 2008
@@ -1,7 +1,5 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 
-/* Metacity fixed tooltip routine */
-
 /* 
  * Copyright (C) 2001 Havoc Pennington
  * 
@@ -21,15 +19,50 @@
  * 02111-1307, USA.
  */
 
+/**
+ * \file fixedtip.h  Metacity fixed tooltip routine
+ * 
+ * Sometimes we want to display a small floating rectangle with helpful
+ * text near the pointer.  For example, if the user holds the mouse over
+ * the maximise button, we can display a tooltip saying "Maximize".
+ * The text is localised, of course.
+ *
+ * This file contains the functions to create and delete these tooltips.
+ *
+ * \todo  Since we now consider MetaDisplay a singleton, there can be
+ *        only one tooltip per display; this might quite simply live in
+ *        display.c.  Alternatively, it could move to frames.c, which
+ *        is the only place this business is called anyway.
+ *
+ * \todo  Apparently some UI needs changing (check bugzilla)
+ */
+
 #ifndef META_FIXED_TIP_H
 #define META_FIXED_TIP_H
 
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 
+/**
+ * Displays a tooltip.  There can be only one across the entire system.
+ * This function behaves identically whether or not a tooltip is already
+ * displayed, but if it is the window will be reused rather than destroyed
+ * and recreated.
+ *
+ * \param  xdisplay       An X display.
+ * \param  screen_number  The number of the screen.
+ * \param  root_x         The X coordinate where the tooltip should appear
+ * \param  root_y         The Y coordinate where the tooltip should appear
+ * \param  markup_text    Text to display in the tooltip; can contain markup
+ */
 void meta_fixed_tip_show (Display *xdisplay, int screen_number,
                           int root_x, int root_y,
                           const char *markup_text);
+
+/**
+ * Removes the tooltip that was created by meta_fixed_tip_show().  If there
+ * is no tooltip currently visible, this is a no-op.
+ */
 void meta_fixed_tip_hide (void);
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]