1997-11-24 22:37:52 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
1998-12-15 20:31:26 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1998-12-15 20:31:26 +00:00
|
|
|
* License along with this library; if not, write to the Free
|
|
|
|
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#ifndef __GTK_LABEL_H__
|
|
|
|
#define __GTK_LABEL_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
#include <gtk/gtkmisc.h>
|
2001-03-21 18:58:28 +00:00
|
|
|
#include <gtk/gtkwindow.h>
|
2001-09-19 00:49:52 +00:00
|
|
|
#include <gtk/gtkmenu.h>
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
1998-12-15 20:31:26 +00:00
|
|
|
|
2000-02-13 08:16:48 +00:00
|
|
|
#define GTK_TYPE_LABEL (gtk_label_get_type ())
|
2002-10-05 23:15:39 +00:00
|
|
|
#define GTK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL, GtkLabel))
|
|
|
|
#define GTK_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LABEL, GtkLabelClass))
|
|
|
|
#define GTK_IS_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LABEL))
|
|
|
|
#define GTK_IS_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LABEL))
|
|
|
|
#define GTK_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LABEL, GtkLabelClass))
|
2000-02-13 08:16:48 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
typedef struct _GtkLabel GtkLabel;
|
|
|
|
typedef struct _GtkLabelClass GtkLabelClass;
|
|
|
|
|
2001-02-17 00:11:03 +00:00
|
|
|
typedef struct _GtkLabelSelectionInfo GtkLabelSelectionInfo;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
struct _GtkLabel
|
|
|
|
{
|
|
|
|
GtkMisc misc;
|
1998-12-15 20:31:26 +00:00
|
|
|
|
2001-02-17 00:11:03 +00:00
|
|
|
/*< private >*/
|
2001-03-05 14:08:42 +00:00
|
|
|
gchar *label;
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
guint jtype : 2;
|
2000-11-01 07:07:46 +00:00
|
|
|
guint wrap : 1;
|
2001-03-05 14:08:42 +00:00
|
|
|
guint use_underline : 1;
|
|
|
|
guint use_markup : 1;
|
|
|
|
|
2001-03-21 18:58:28 +00:00
|
|
|
guint mnemonic_keyval;
|
2000-11-01 07:07:46 +00:00
|
|
|
|
2001-03-05 14:08:42 +00:00
|
|
|
gchar *text;
|
2000-11-01 07:07:46 +00:00
|
|
|
PangoAttrList *attrs;
|
2001-06-24 15:34:48 +00:00
|
|
|
PangoAttrList *effective_attrs;
|
2001-03-05 14:08:42 +00:00
|
|
|
|
|
|
|
PangoLayout *layout;
|
2001-02-17 00:11:03 +00:00
|
|
|
|
2001-03-21 18:58:28 +00:00
|
|
|
GtkWidget *mnemonic_widget;
|
|
|
|
GtkWindow *mnemonic_window;
|
|
|
|
|
2001-02-17 00:11:03 +00:00
|
|
|
GtkLabelSelectionInfo *select_info;
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkLabelClass
|
|
|
|
{
|
|
|
|
GtkMiscClass parent_class;
|
2001-09-19 00:49:52 +00:00
|
|
|
|
|
|
|
void (* move_cursor) (GtkLabel *label,
|
|
|
|
GtkMovementStep step,
|
|
|
|
gint count,
|
|
|
|
gboolean extend_selection);
|
|
|
|
void (* copy_clipboard) (GtkLabel *label);
|
|
|
|
|
|
|
|
/* Hook to customize right-click popup for selectable labels */
|
|
|
|
void (* populate_popup) (GtkLabel *label,
|
|
|
|
GtkMenu *menu);
|
2002-02-23 20:22:05 +00:00
|
|
|
|
|
|
|
/* Padding for future expansion */
|
|
|
|
void (*_gtk_reserved1) (void);
|
|
|
|
void (*_gtk_reserved2) (void);
|
|
|
|
void (*_gtk_reserved3) (void);
|
|
|
|
void (*_gtk_reserved4) (void);
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
2002-10-05 23:15:39 +00:00
|
|
|
GType gtk_label_get_type (void) G_GNUC_CONST;
|
2001-06-24 15:34:48 +00:00
|
|
|
GtkWidget* gtk_label_new (const char *str);
|
|
|
|
GtkWidget* gtk_label_new_with_mnemonic (const char *str);
|
|
|
|
void gtk_label_set_text (GtkLabel *label,
|
|
|
|
const char *str);
|
|
|
|
G_CONST_RETURN gchar* gtk_label_get_text (GtkLabel *label);
|
|
|
|
void gtk_label_set_attributes (GtkLabel *label,
|
|
|
|
PangoAttrList *attrs);
|
|
|
|
PangoAttrList *gtk_label_get_attributes (GtkLabel *label);
|
|
|
|
void gtk_label_set_label (GtkLabel *label,
|
|
|
|
const gchar *str);
|
|
|
|
G_CONST_RETURN gchar *gtk_label_get_label (GtkLabel *label);
|
|
|
|
void gtk_label_set_markup (GtkLabel *label,
|
|
|
|
const gchar *str);
|
|
|
|
void gtk_label_set_use_markup (GtkLabel *label,
|
|
|
|
gboolean setting);
|
|
|
|
gboolean gtk_label_get_use_markup (GtkLabel *label);
|
|
|
|
void gtk_label_set_use_underline (GtkLabel *label,
|
|
|
|
gboolean setting);
|
|
|
|
gboolean gtk_label_get_use_underline (GtkLabel *label);
|
|
|
|
|
2001-03-22 13:44:00 +00:00
|
|
|
void gtk_label_set_markup_with_mnemonic (GtkLabel *label,
|
|
|
|
const gchar *str);
|
|
|
|
guint gtk_label_get_mnemonic_keyval (GtkLabel *label);
|
|
|
|
void gtk_label_set_mnemonic_widget (GtkLabel *label,
|
|
|
|
GtkWidget *widget);
|
2001-06-24 15:34:48 +00:00
|
|
|
GtkWidget *gtk_label_get_mnemonic_widget (GtkLabel *label);
|
2001-03-22 13:44:00 +00:00
|
|
|
void gtk_label_set_text_with_mnemonic (GtkLabel *label,
|
2001-03-23 22:21:06 +00:00
|
|
|
const gchar *str);
|
2001-03-22 13:44:00 +00:00
|
|
|
void gtk_label_set_justify (GtkLabel *label,
|
|
|
|
GtkJustification jtype);
|
2001-06-24 15:34:48 +00:00
|
|
|
GtkJustification gtk_label_get_justify (GtkLabel *label);
|
2001-03-22 13:44:00 +00:00
|
|
|
void gtk_label_set_pattern (GtkLabel *label,
|
|
|
|
const gchar *pattern);
|
|
|
|
void gtk_label_set_line_wrap (GtkLabel *label,
|
|
|
|
gboolean wrap);
|
2001-06-24 15:34:48 +00:00
|
|
|
gboolean gtk_label_get_line_wrap (GtkLabel *label);
|
2001-03-22 13:44:00 +00:00
|
|
|
void gtk_label_set_selectable (GtkLabel *label,
|
|
|
|
gboolean setting);
|
|
|
|
gboolean gtk_label_get_selectable (GtkLabel *label);
|
|
|
|
void gtk_label_select_region (GtkLabel *label,
|
|
|
|
gint start_offset,
|
|
|
|
gint end_offset);
|
2001-06-01 19:26:01 +00:00
|
|
|
gboolean gtk_label_get_selection_bounds (GtkLabel *label,
|
|
|
|
gint *start,
|
|
|
|
gint *end);
|
2001-06-09 00:12:00 +00:00
|
|
|
|
|
|
|
PangoLayout *gtk_label_get_layout (GtkLabel *label);
|
|
|
|
void gtk_label_get_layout_offsets (GtkLabel *label,
|
|
|
|
gint *x,
|
|
|
|
gint *y);
|
|
|
|
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
#ifndef GTK_DISABLE_DEPRECATED
|
2001-08-23 15:26:49 +00:00
|
|
|
|
|
|
|
#define gtk_label_set gtk_label_set_text
|
2000-04-26 22:53:01 +00:00
|
|
|
void gtk_label_get (GtkLabel *label,
|
|
|
|
char **str);
|
2001-03-22 06:45:57 +00:00
|
|
|
|
|
|
|
/* Convenience function to set the name and pattern by parsing
|
|
|
|
* a string with embedded underscores, and return the appropriate
|
|
|
|
* key symbol for the accelerator.
|
|
|
|
*/
|
|
|
|
guint gtk_label_parse_uline (GtkLabel *label,
|
|
|
|
const gchar *string);
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
#endif /* GTK_DISABLE_DEPRECATED */
|
2000-04-26 22:53:01 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GTK_LABEL_H__ */
|