summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2008-04-29 02:54:56 +0000
committerThomas James Alexander Thurman <tthurman@src.gnome.org>2008-04-29 02:54:56 +0000
commiteacd44278733eea025109ee0fe1420e450bda882 (patch)
tree3065b7944a820f9b2a46bd76b85e76a8dfc6a921
parentb8a9ed1d3a5dcb143b444572796a55f41df1afd9 (diff)
downloadmetacity-eacd44278733eea025109ee0fe1420e450bda882.tar.gz
documentation
2008-04-29 Thomas Thurman <tthurman@gnome.org> * src/ui/fixedtip.[ch]: documentation svn path=/trunk/; revision=3697
-rw-r--r--ChangeLog4
-rw-r--r--src/ui/fixedtip.c20
-rw-r--r--src/ui/fixedtip.h37
3 files changed, 59 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7d934b2d..b531569a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-04-29 Thomas Thurman <tthurman@gnome.org>
+
+ * src/ui/fixedtip.[ch]: documentation
+
2008-04-27 Thomas Thurman <tthurman@gnome.org>
* configure.in: Post-release bump to 2.23.21.
diff --git a/src/ui/fixedtip.c b/src/ui/fixedtip.c
index a1470224..b4c5203c 100644
--- a/src/ui/fixedtip.c
+++ b/src/ui/fixedtip.c
@@ -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
diff --git a/src/ui/fixedtip.h b/src/ui/fixedtip.h
index 3b3e6fff..c196389d 100644
--- a/src/ui/fixedtip.h
+++ b/src/ui/fixedtip.h
@@ -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);