documentation

2008-04-29  Thomas Thurman  <tthurman@gnome.org>

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


svn path=/trunk/; revision=3697
This commit is contained in:
Thomas Thurman 2008-04-29 02:54:56 +00:00 committed by Thomas James Alexander Thurman
parent b8a9ed1d3a
commit eacd442787
3 changed files with 59 additions and 2 deletions

View File

@ -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> 2008-04-27 Thomas Thurman <tthurman@gnome.org>
* configure.in: Post-release bump to 2.23.21. * configure.in: Post-release bump to 2.23.21.

View File

@ -25,9 +25,29 @@
#include "fixedtip.h" #include "fixedtip.h"
#include "ui.h" #include "ui.h"
/**
* The floating rectangle. This is a GtkWindow, and it contains
* the "label" widget, below.
*/
static GtkWidget *tip = NULL; static GtkWidget *tip = NULL;
/**
* The actual text that gets displayed.
*/
static GtkWidget *label = NULL; 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; 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 int screen_bottom_edge = 0;
static gint static gint

View File

@ -1,7 +1,5 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Metacity fixed tooltip routine */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
@ -21,15 +19,50 @@
* 02111-1307, USA. * 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 #ifndef META_FIXED_TIP_H
#define META_FIXED_TIP_H #define META_FIXED_TIP_H
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkx.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, void meta_fixed_tip_show (Display *xdisplay, int screen_number,
int root_x, int root_y, int root_x, int root_y,
const char *markup_text); 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); void meta_fixed_tip_hide (void);