gimp/libgimpwidgets/gimpunitmenu.h

93 lines
3.1 KiB
C
Raw Normal View History

/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpunitmenu.h
* Copyright (C) 1999 Michael Natterer <mitch@gimp.org>
*
* This library is free software; you can redistribute it and/or
1999-11-18 05:13:50 +08:00
* modify it under the terms of the GNU Lesser General Public
* 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
1999-11-18 05:13:50 +08:00
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_UNIT_MENU_H__
#define __GIMP_UNIT_MENU_H__
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#define GIMP_TYPE_UNIT_MENU (gimp_unit_menu_get_type ())
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) 2001-07-24 Michael Natterer <mitch@gimp.org> Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) * configure.in: require glib/gtk+ >= 1.3.7, commented out the gtkxmhtml stuff. From now on, you will need glib, pango, atk and gtk+ HEAD from CVS to hack or use GIMP HEAD. Beware, it crashes randomly :) * app/core/Makefile.am * app/core/gimpmarshal.list: new file plus rules to generate gimpmarshal.[ch] from it. * app/core/* * app/tools/* * app/widgets/* * libgimpwidgets/*: started to use the glib object system. All core/ objects are still gtk objects however. All signals are created using g_signal_new(). There are many gtk+ artefacts left. Finally, we will _not_ use the gtk_signal_foo() wrappers and friends any more. * app/colormaps.c * app/devices.[ch] * app/disp_callbacks.c * app/errorconsole.c * app/file-save.[ch] * app/interface.c * app/module_db.c * app/nav_window.c * app/ops_buttons.c * app/scroll.c * app/user_install.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/brushes-commands.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/file-commands.c * app/gui/file-dialog-utils.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradients-commands.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/layer-select.c * app/gui/layers-commands.c * app/gui/menus.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.[ch] * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/tool-options-dialog.c * app/gui/toolbox.c * app/gui/tools-commands.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimp/gimpui.c * libgimpbase/gimpenv.c: tons and tons of changes like "const gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete and currently disables), lots of s/gtk_signal/g_signal/, removal/replacement of deprecated stuff, s/GtkSignalFunc/GCallback/ and lots of small changes and fixes while I was on it, zillions of warnings left... * modules/Makefile.am: disabled the water color selector temporarily (XInput issues). * plug-ins/Makefile.am * plug-ins/common/.cvsignore * plug-ins/common/Makefile.am * plug-ins/common/plugin-defs.pl: simply excluded all plug-ins which did not build (including Script-Fu). They are trivial to fix.
2001-07-25 05:27:11 +08:00
#define GIMP_UNIT_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_UNIT_MENU, GimpUnitMenu))
#define GIMP_UNIT_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_UNIT_MENU, GimpUnitMenuClass))
#define GIMP_IS_UNIT_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_UNIT_MENU))
#define GIMP_IS_UNIT_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_UNIT_MENU))
2001-08-04 03:52:08 +08:00
#define GIMP_UNIT_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_UNIT_MENU, GimpUnitMenuClass))
typedef struct _GimpUnitMenuClass GimpUnitMenuClass;
struct _GimpUnitMenu
{
2001-08-04 03:52:08 +08:00
GtkOptionMenu parent_instance;
This implements the rest of the unit system (unitrc loading and saving and 1999-03-16 Michael Natterer <mitschel@cs.tu-berlin.de> This implements the rest of the unit system (unitrc loading and saving and full PDB interface) * Makefile.am * gimp.1 * user_install * user_install.bat * unitrc: new file (default unit database) and some documentation * app/Makefile.am * app/gimpunit.c * app/gimpunit_cmds.h * app/unitrc.h: new files enabling the unit database and PDB access to the unit system * app/app_procs.c: parse and save unitrc * app/gimprc.[ch]: enable unit parsing. New function init_parse_buffers() to enable unitrc to be loaded before gimprc * app/gimage_cmds.[ch]: new PDB procedures which set/return an image's unit * app/install.c: mention unitrc installation * app/xcf.c: new xcf property for user defined units. An image's unit is saved as either an integer ID (built in units) or as a full unit definition without any ID * libgimp/Makefile.am: moved gimpunit.o from libgimpi.a to libgimp.a * libgimp/gimp.h * libgimp/gimpimage.c: get/set an image's unit with PDB calls * libgimp/gimpunit.h: this file is now the header for both app/gimpunit.c and libgimp/gimpunit.c * libgimp/gimpunit.c: does the unit calls as PDB calls now * libgimp/gimpunitmenu.[ch]: enable user unit functionality and a unit selection dialog * libgimp/gimpsizeentry.c: disble hilighting on focus_in_event and minor bugfixes * plug-ins/tiff/tiff.c: set image unit to "mm" if tiff unit is "cm", save "cm" if image unit is metric
1999-03-17 04:14:07 +08:00
/* public (read only) */
This implements the rest of the unit system (unitrc loading and saving and 1999-03-16 Michael Natterer <mitschel@cs.tu-berlin.de> This implements the rest of the unit system (unitrc loading and saving and full PDB interface) * Makefile.am * gimp.1 * user_install * user_install.bat * unitrc: new file (default unit database) and some documentation * app/Makefile.am * app/gimpunit.c * app/gimpunit_cmds.h * app/unitrc.h: new files enabling the unit database and PDB access to the unit system * app/app_procs.c: parse and save unitrc * app/gimprc.[ch]: enable unit parsing. New function init_parse_buffers() to enable unitrc to be loaded before gimprc * app/gimage_cmds.[ch]: new PDB procedures which set/return an image's unit * app/install.c: mention unitrc installation * app/xcf.c: new xcf property for user defined units. An image's unit is saved as either an integer ID (built in units) or as a full unit definition without any ID * libgimp/Makefile.am: moved gimpunit.o from libgimpi.a to libgimp.a * libgimp/gimp.h * libgimp/gimpimage.c: get/set an image's unit with PDB calls * libgimp/gimpunit.h: this file is now the header for both app/gimpunit.c and libgimp/gimpunit.c * libgimp/gimpunit.c: does the unit calls as PDB calls now * libgimp/gimpunitmenu.[ch]: enable user unit functionality and a unit selection dialog * libgimp/gimpsizeentry.c: disble hilighting on focus_in_event and minor bugfixes * plug-ins/tiff/tiff.c: set image unit to "mm" if tiff unit is "cm", save "cm" if image unit is metric
1999-03-17 04:14:07 +08:00
gchar *format;
GimpUnit unit;
gint pixel_digits;
gboolean show_pixels;
gboolean show_percent;
/* private */
GtkWidget *selection;
GtkWidget *tv;
};
struct _GimpUnitMenuClass
{
2001-08-04 03:52:08 +08:00
GtkOptionMenuClass parent_class;
void (* unit_changed) (GimpUnitMenu *menu);
/* Padding for future expansion */
void (* _gimp_reserved1) (void);
void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
};
GType gimp_unit_menu_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_unit_menu_new (const gchar *format,
GimpUnit unit,
gboolean show_pixels,
gboolean show_percent,
gboolean show_custom);
void gimp_unit_menu_set_unit (GimpUnitMenu *menu,
GimpUnit unit);
GimpUnit gimp_unit_menu_get_unit (GimpUnitMenu *menu);
void gimp_unit_menu_set_pixel_digits (GimpUnitMenu *menu,
gint digits);
gint gimp_unit_menu_get_pixel_digits (GimpUnitMenu *menu);
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
G_END_DECLS
#endif /* __GIMP_UNIT_MENU_H__ */