diff --git a/ChangeLog b/ChangeLog index 20744081ca..265ed4c82a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +Sun Jun 7 11:04:38 1998 Tim Janik + + * app/gradient.c (cpopup_create_menu_item_with_label): use GtkAccelLabel + when creating a menuitems label seperatedly. + + * app/commands.h: + * app/commands.c: + (tips_dialog_cmd_callback): + (filters_repeat_cmd_callback): + (tools_select_cmd_callback): make use of the callback_action argument. + + * app/main.c (main): removed gtk_accelerator_table_set_mod_mask(), + since gtk provides decent default values now. + + * app/layers_dialog.c: + * app/interface.c: + * app/indexed_palette.c: + * app/channels_dialog.c: + * app/buildmenu.c: + conversions for use of GtkAccelGroup. + + * app/buildmenu.c: + * app/gradient.c: + installed accelerators are locked, because these code portions don't + support accelerator saving. + + * ChangeLog: + * ChangeLog.pre-1-0: ChangeLog split up. + Sun Jun 7 01:21:43 PDT 1998 Manish Singh * plug-ins/script-fu/script-fu.c: fixed param passing for @@ -86,3328 +115,3 @@ Tue Jun 2 16:40:33 PDT 1998 Manish Singh * Made 1.0.0 release -Tue Jun 2 16:15:51 PDT 1998 Manish Singh - - * Makefile.am: install gtkrc.forest2 in $prefix/share/gimp - - * plug-ins/CEL/CEL.c: change bzero to memset for portability - - * plug-ins/gfli/fli.c: #include to get inline defintion - -Mon Jun 1 01:05:52 EDT 1998 Matthew Wilson - - * plug-ins/grid.c: fix a comment. :) - * ChangeLog: fix my last entry - -Sun May 31 21:50:12 EDT 1998 Matthew Wilson - - * plug-ins/deinterlace/deinterlace.c: patch from sjburges - to prevent out of bounds indexing array (anyone see a pattern - here?) - -Sun May 31 15:35:33 PDT 1998 Manish Singh - - * gimptool.in: use test -r instead of test -e for portability - -Sun May 31 08:03:54 EDT 1998 Matthew Wilson - - * plug-ins/exchange/exchange.c: fix from sjburges to stop - out of bounds indexing of array. - -Sun May 31 01:58:36 PDT 1998 Manish Singh - - * README - * INSTALL: make info a bit more current - - * gimptool.in: update usage message - - * gtkrc.forest2: sample gtkrc file with cool stuff from tigert - - * gimp.1 - * gimptool.1: updated/rewrote some - - * app/fileops.c: removed the "might have tried to save an RGB - image with an indexed plugin" since g_message gives nice user - feedback now - - * app/interface.c: fix the mem leak properly - -Sat May 30 23:42:12 PDT 1998 Manish Singh - - * app/interface.c: plug mem leak in message_box - - * plug-ins/mail/mail.c: use g_message - - * plug-ins/script-fu/scripts/carve-it.scm: fix for gimp-layer-new - params from Kevin Cozens - - * plug-ins/CEL/CEL.c - * plug-ins/pcx/pcx.c - * plug-ins/tiff/tiff.c: updates from author - - * plug-ins/png/png.c: correct copyright - - * plug-ins/print/print.h: use correct version - -Fri May 29 23:54:42 PDT 1998 Manish Singh - - * more changes to use g_message. All of app uses it now, plus - the major file plugins. - - * plug-ins/CEL/CEL.c: update from author - - * INSTALL: info about why optional plugins won't build - -Sat May 30 02:03:19 EDT 1998 Matthew Wilson - - * plug-ins/grid/grid.c: fix by sjburges to fix grid on selections. - -Fri May 29 23:34:07 EDT 1998 Matthew Wilson - - * plug-ins/gaus_iir/gauss_iir.c: fix by sjburges to fix horiz - only blur. Funky bug! - -Fri May 29 21:36:36 MEST 1998 Sven Neumann - - * app/xcf.c: changed fopen parameters for better portability - -Thu May 28 20:12:02 MEST 1998 Sven Neumann - - * scripts/blend-anim.scm: use gimp-message to output an - error message - -Thu May 28 19:05:13 MEST 1998 Sven Neumann - - * plug-ins/rotate/rotate.c - * plug-ins/screenshot/screenshot.c: adapted to the new - way of error message handling - -Thu May 28 01:16:26 PDT 1998 Manish Singh - - * redid the error message handling. g_message now calls - message_box or prints to console depending on whether the - no_interface is set or not. gimp-message is also exported - to the PDB as a wrapper to g_message, and libgimp has a new - API: gimp_message. libgimp also overrides g_message for all - plugins. Converted lots of messages in app/* to g_message. - Made script-fu a little friendlier. - - * updated the regex code from grep 2.2 - -Wed May 27 11:22:46 MEST 1998 Sven Neumann - - * plug-ins/ifscompose/ifscompose.h: removed definition of TRUE - and FALSE - -Tue May 26 17:20:26 EDT 1998 Adrian Likins - - * plug-ins/sript-fu/scripts/predator.scm: made insensitive on - greyscale images - -Tue May 26 12:03:07 PDT 1998 Manish Singh - - * app/batch.c: do "-" to "_" conversion after an failed pdb - lookup, just to make sure - - * app/paint_core.c: fix for some uninitialized vars - -Tue May 26 01:17:14 PDT 1998 Manish Singh - - * gimptool.in: added --install-script. Use @INSTALL@ stuff - - * libgimp/gimpimage.c - * libgimp/gimplayer.c: fixes for silly errors from Marc Lehmann - - * libgimp/gimpchannel.c: implemented gimp_channel_set_show_masked - and gimp_channel_get_show_masked (already in gimp.h) - - * plug-ins/blinds/blinds.c - * plug-ins/bmp/bmp.h - * plug-ins/mosaic/mosaic.c - * plug-ins/ripple/ripple.c - * plug-ins/tga/tga.c - * plug-ins/tileit/tileit.c: remove definitions of TRUE and FALSE - since glib does it for us - -Sun May 24 08:41:34 EST 1998 Stephen Norris - - * plug-ins/displace/displace.c: Fix to GUI bug. - -Fri May 22 19:23:59 MEST 1998 Sven Neumann - - * docs/gimp_quick_reference.*: some small fixes and additions - -Fri May 22 00:46:18 EDT 1998 Matthew Wilson - - * app/batch.c: removed global conversion from '-' to '_' - -Thu May 21 13:03:50 PDT 1998 Manish Singh - - * updated Adam's stuff - - * app/app_procs.c: squleched warning - - * gimptool.in: quote stuff to be flexible about our CC settings - -Wed May 20 20:21:45 EST 1998 Stephen Norris - - * plug-ins/bz2/bz2.c: Check return code from fopen. - * plug-ins/gz/gz.c: Check return code from fopen. - -Tue May 19 14:02:41 MET DST 1998 Sven Neumann - - * added a new script from Wolfgang Hofer (fade-outline.scm) - -Mon May 18 20:30:44 MEST 1998 Sven Neumann - - * updated the gfli plug-in to the version on the registry and - folded the "chunk-type-7-bug"-patch back in - -Sun May 17 23:06:38 EDT 1998 Matthew Wilson - - * app/app_procs.c: applied patch from Michael Sweet to correct - NULL deref in splash screen. - -Mon May 18 02:50:03 MEST 1998 Sven Neumann - - * plug-ins/tiff/tiff.c: updated tiff plug-in - -Sun May 17 17:31:05 PDT 1998 Manish Singh - - * plug-ins/maze: updated maze plugin - - * plug-ins/script-fu/scripts/circuit.scm: reflected maze pdb - interface change - -Sun May 17 14:44:32 PDT 1998 Manish Singh - - * app/gimage.c: fix for merging indexed and indexed-alpha - layers (from Raph) - -Sun May 17 14:02:44 PDT 1998 Manish Singh - - * app/app_procs.c: reverted the splash screen idle loop changes - since they expose some weird GtkLabel redraw bugs - -Sun May 17 00:15:40 PDT 1998 Manish Singh - - * Made 0.99.31 release - - * updated print plugin - -Fri May 15 23:35:43 PDT 1998 Manish Singh - - * app/fileops.c: made url plugin autodetect work again - -Fri May 15 03:54:48 EDT 1998 Matthew Wilson - - * gimp_tips.txt: fixed typo - -Fri May 15 03:03:00 EDT 1998 Matthew Wilson - - * app/iscissors.c: fixed bezierify on offset layers - -Thu May 14 21:18:27 EDT 1998 Matthew Wilson - - * app/iscissors.c: a very sad attempt to fix some iscissors - lockups/segfaults - -Thu May 14 18:10:38 EDT 1998 Matthew Wilson - - * app/app_procs.c: made the splash screen a GTK_WINDOW_POPUP, - changed the hackish gtk_main_iteration with a null idle - loop to a more stylish while (gtk_events_pending()) - gtk_main_iteration(); - -Wed May 13 23:58:20 EDT 1998 Matthew Wilson - - * app/fileops.c (file_overwrite_yes_callback): destroy the - Overwrite dialog's window before running the save. - -Wed May 13 17:31:27 PDT 1998 Manish Singh - - * app/frac.c: stubbed out nonworking code - - * updated print plugin - -Wed May 13 00:03:18 MEST 1998 Sven Neumann - - * added nine new scripts from Chris Gutteridge - (asc2img.scm, camo.scm, coffee.scm, distress_selection.scm, - fuzzyborder.scm, old_photo.scm, rendermap.scm - spinning_globe.scm, tileblur.scm) - - * added two gradients that are used by the new scripts - (Coffee, Land_and_Sea) - -Tue May 12 02:49:12 PDT 1998 Manish Singh - - * app/app_procs.c: create tips dialog after loading files on the - command line, instead of in an idle function. Lamer hack, but it - works better. - - * app/gdisplay_ops.c: fix for new view on zoomed image - - * Makefile.am - * gimptool.1: added man page for gimptool by Ben Gertzfield - -Mon May 11 16:59:18 PDT 1998 Manish Singh - - * gimptool.in: added --install-bin options for installing already - built plugins - - * app/convolve.c: check for indexed images properly - - * app/layer.c: fix tile refcount oversight - - * app/text_tool.c: fix for unlikely memleak - - * libgimp/gimpimage.c: stupid ytpo ;) - - * plug-ins/gfli/gfli.c: applied gimp-wh-980507-0 to fix - "chunk-type-7-bug" - -Mon May 11 23:28:20 MEST 1998 Sven Neumanns - - * added two new scripts from Hrvoje Horvat - (glossy.scm, 3d-outline.scm) - -Mon May 11 21:40:25 MEST 1998 Sven Neumann - - * updated print plug-in - -Fri May 8 20:51:24 PDT 1998 Manish Singh - - * plug-ins/script-fu/script-fu-console.c: workaround for text - widget crash from Owen - -Thu May 7 16:32:15 PDT 1998 Manish Singh - - * gimptool.in: added --install and --install-admin options - to build and install a plug-in automagically - -Thu May 7 15:24:31 EDT 1998 Matthew Wilson - - * app/fileops.c: more changes to fileselection - -Tue May 5 11:40:28 PDT 1998 Manish Singh - - * plug-ins/psd/psd.c: updates from Adam - - * plug-ins/script-fu/scripts/text-circle.scm: new version - -Mon May 4 21:24:03 PDT 1998 Manish Singh - - * Made 0.99.29 release - -Mon May 4 19:32:54 PDT 1998 Manish Singh - - * app/plug_in.c: make repeat last and re-show plugin menu - sensitive to image type - -Mon May 4 04:12:54 PDT 1998 Manish Singh - - * configure.in: define and export version number parts. Check for - gtk 1.0.1 - - * gimptool.in: do some arg check for --build - - * app/fileops.c: handle file overwrite dialog too - -Sun May 3 22:10:05 EDT 1998 Matthew Wilson - - * app/fileops.c: make fileselectors insensitive during - loading and saving - -Sun May 3 00:24:31 MEST 1998 Sven Neumann - - * app/channels_dialog.c: minimalistic change to the interface, - makes it possible to set the channel opacity to 100.0% - (was 99.0% before) - -Sat May 2 14:31:46 PDT 1998 Manish Singh - - * app/about_dialog.c - * app/app_procs.c - * app/main.c: use GIMP_VERSION from config.h now - - * gimptool made to ease plug-in development and installation - -Sat May 2 16:10:05 EDT 1998 Matthew Wilson - - * app/channels_dialog.c: removed my broken fix, put in a fix - that works - -Sat May 2 15:20:54 EDT 1998 Matthew Wilson - - * app/channels_dialog.c: check to be sure that the gimage still - exists when editing a channel - fixes bug report from Sven - -Sat May 2 00:59:23 PDT 1998 Manish Singh - - * gimp.1: spelling corrections from Tamito Kajiyama - -Sat May 2 00:41:36 PDT 1998 Manish Singh - - * plug-ins/tiff/tiff.c: another special case fix from Nick Lamb. - I said it before, and I'll say it again: TIFF sucks - - * app/fuzzy_select.c: find_boundary works nicer in indexed mode - (from Adrian) - - * app/paint_funcs.c: generate dissolve random number table better - (thanks Owen) - - * README: bring up to date - -Fri May 1 23:09:33 EDT 1998 Matthew Wilson - - * app/channels_dialog.c: handle double click on our own since - channels_dialog_flush nukes the widgets and we never get - 2BUTTON events - -Fri May 1 13:22:21 1998 Tim Janik - - * app/channels_dialog.c: keep the channel list uptodate - on position changes. unref list items on destruction. - - the app/channels_dialog.c app/layers_dialog.c code for dealing - with GtkList is a MESS, it needs to be completely reworked - somewhen. this is *no* fun: the selection is changed so update - the list (causing the selection to change again: the selection - is changed so update the list (causing the selection to change - again: the selection is changed so update the list (.... oops, - sorry got caught in a recursive loop there ;) ))). - -Thu Apr 30 16:49:41 PDT 1998 Manish Singh - - * app/channels_dialog.c: fix for off-by-one error in channel - position from Andy Thomas - -Thu Apr 30 16:38:59 PDT 1998 Manish Singh - - * updated randomize and blur plugins, split out libgpc into - it's own dir - -Thu Apr 30 14:32:16 PDT 1998 Manish Singh - - * upgraded to libtool 1.2 - -Thu Apr 30 01:45:03 PDT 1998 Manish Singh - - * plug-ins/xd/xd.c: selection logic fix from Gordon - Matzigkeit - -Thu Apr 30 03:15:51 EDT 1998 Matthew Wilson - - * app/curves.c: Another small change to keep the segfaults away - * app/disp_callbacks.c: An attempt to squelch some warnings - -Thu Apr 30 02:08:23 EDT 1998 Matthew Wilson - - * app/channels_dialog.c - * app/layers_dialog.c: Modified event handlers to bring up the - popup menu anywhere on layer/channel widget - -Wed Apr 29 22:29:16 PDT 1998 Manish Singh - - * app/app_procs.c: make splash screen honor gtkrc - -Wed Apr 29 16:49:27 PDT 1998 Manish Singh - - * plug-ins/CEL/CEL.c: reverted gimp-joke-980427-0 changes, they - broke things - -Wed Apr 29 15:38:55 PDT 1998 Manish Singh - - * plug-ins/tiler/tiler.c: fix width > height case - - * plug-ins/blinds/blinds.c - * plug-ins/convmatrix/convmatrix.c - * plug-ins/tileit/tileit.c: removed spurious gtk_container_add's - -Wed Apr 29 07:50:26 EDT 1998 Adrian Likins - - * gimp.1: updated man page to reflect new --debug-handlers - argument - -Wed Apr 29 04:05:34 PDT 1998 Manish Singh - - * configure.in: tightened png header check - -Wed Apr 29 03:46:44 PDT 1998 Manish Singh - - * plug-ins/animationplay/animationplay.c - * plug-ins/gif/gif.c - * plug-ins/psd/psd.c: updates from Adam - -Wed Apr 29 01:43:30 PDT 1998 Manish Singh - - * app/text_tool.c: don't die on corrupted fonts. Give some - error messages instead. - -Tue Apr 28 23:17:37 PDT 1998 Manish Singh - - * app/gradient.c: enable adjustment of the gradient list box - for scrolling - -Wed Apr 29 00:56:19 1998 Tim Janik - - * app/text_tool.c (text_create_dialog): enable adjustment of the - scrolled window to keep the focused font visible. - -Tue Apr 28 15:09:02 PDT 1998 Manish Singh - - * plug-ins/CEL/CEL.c - * plug-ins/psd/psd.c: portability fix for SunOS 4 - -Mon Apr 27 20:43:14 PDT 1998 Manish Singh - - * plug-ins/animationplay/animationplay.c - * plug-ins/CEL/CEL.c - * plug-ins/psd/psd.c - * plug-ins/xd/xd.c: applied gimp-joke-980427-0, warning cleanups - - * app/temp_buf.c: applied gimp-entity-980427-0, temp_buf swap - speedups and more robust tempfile handling - -Mon Apr 27 20:57:26 1998 EDT Matthew Wilson - - * app/curves: Initialize data that is referenced in event handlers - in the curves_new_dialog function. Be on the look out for this - kind of stuff in other dialogs. - -Tue Apr 28 00:16:31 1998 Tim Janik - - * app/channels_dialog.c (channels_dialog_create): adjust the scrolled - window to always show the currently focused channel item. - - * app/layers_dialog.c (layers_dialog_create): adjust the scrolled - window to always show the currently focused layer item. - -Mon Apr 27 23:29:10 MEST 1998 Sven Neumann - - * updated despeckle and sharpen plug-ins - -Mon Apr 27 18:09:01 MEST 1998 Sven Neumann - - * updated bmp plug-in - -Sun Apr 26 16:31:06 PDT 1998 Manish Singh - - * Made 0.99.28 release - -Sun Apr 26 16:17:46 PDT 1998 Manish Singh - - * app/procedural_db.c - * app/text_tool.c: applied mem leak patch from Mattias Gronlund - - * plug-ins/tiff/tiff.c: fix for indexed save from Dan Mitchell - -Sun Apr 26 15:11:06 PDT 1998 Manish Singh - - * plug-ins/oilify/oilify.c: folded optimizations back in - -Sun Apr 26 18:14:28 MEST 1998 Sven Neumann - - * gimp_tips.txt: added yet another tip - -Sun Apr 26 17:50:36 MEST 1998 Sven Neumann - - * updated engrave plug-in - - * updated oilify plug-in - * changed the call to plug-in-oilify in circuit.scm and lava.scm - -Sun Apr 26 03:06:16 PDT 1998 Manish Singh - - * oh goodie, the PSD plugin doesn't relay on endian junk anymore - -Sun Apr 26 02:34:21 PDT 1998 Manish Singh - - * updated CEL plugin - - * added PSD plugin and autoconf for byte order - -Thu Apr 23 19:08:16 PDT 1998 Manish Singh - - * Added sharpen to stable dist - - * updated sgi and despeckle plugins - - * plug-ins/xd/xd.c: works with xdelta 0.18. The use of xdelta - versions prior to this is not-supported. - - * plug-in/gfig/gfig.c: spelling corrections :) - - * app/fileops.c: applied gimp-gord-980420-0, fixes stale save - procs in the file dialog - - * app/text_tool.c: applied gimp-egger-980420-0, text tool - optimization - -Thu Apr 23 21:27:23 EDT 1998 Matthew Wilson - - * app/gimage.c: set srcPR2.[xy] to srcPR1.[xy] in - gimage_construct_composite_preview (fixes hangs in preview creation) - -Tue Apr 21 15:11:21 EDT 1998 Matthew Wilson - - * app/disp_callbacks.c: removed the tool reset when changing gdisplays - * app/bezier_select.c: stop draw_core when changing gdisplays - -Tue Apr 21 01:59:12 EDT 1998 Matthew Wilson - - * app/iscissors.c: Remove the iscissors outline by stopping the - draw_core before bezierifying the selection. There may be - memory leaks here (the iscissors stuff does not appear to be freed - on bezierify) - -Mon Apr 20 18:15:54 PDT 1998 Manish Singh - - * app/main.c - * app/errors.c: added --debug-handlers switch to get stack traces - on all signals again (not all sigabrts and sigpipes are normal - things) - - * plug-ins/animoptimize/animoptimze.c: updated - -1998-04-20 Marc Ewing - - * added RPM/* files and use them in gimp.spec - -Mon Apr 20 01:24:10 PDT 1998 Manish Singh - - * plug-ins/faxg3/g3.h - * plug-ins/faxg3/run_tbl.c: commented out #ident's, since some - compilers complain - -Mon Apr 20 00:01:26 PDT 1998 Manish Singh - - * app/disp_callbacks.c: we get events in a funny order sometimes, - so don't try to remove nonexistent signal handlers - -Sun Apr 19 20:18:29 PDT 1998 Manish Singh - - * added screenshot plug-in - - * plug-ins/animationplay/animationplay.c: fix sigsegv on close - -Sun Apr 19 14:16:44 MEST 1998 Sven Neumann - - * app/app_procs.c: truncate labels in the splash screen if they - are too long to be displayed without resizing the window; this - should fix the problems with 100dpi fonts - -Sat Apr 18 22:19:10 PDT 1998 Manish Singh - - * app/gimprc.c: don't dereference NULL pointer when a gimprc - variable is used before it's defined. Exit gracefully - -Sat Apr 18 11:45:04 PDT 1998 Manish Singh - - * Made 0.99.27 release - -Sat Apr 18 11:37:46 PDT 1998 Manish Singh - - * plug-ins/dbbrowser/dbbrowser_util.c: make text entry for function - name read-only - - * plug-ins/film/film.c - * plug-ins/animationplay/animationplay.c: minor cleanups - -Thu Apr 16 19:46:46 MEST 1998 Sven Neumann - - * plug-ins/script-fu/interp_slib.c: changed the link to - the script-fu resources to point to www.gimp.org - -Wed Apr 15 13:18:47 EDT 1998 Matthew Wilson - - * app/disp_callbacks.c: restart current tool when changing - gdisplays - -Wed Apr 15 17:40:55 MEST 1998 Sven Neumann - - * app/iscissors.c: changed toggle_buttons to check_buttons since - all tools use them in the options dialog - -Wed Apr 15 02:44:58 1998 George Lebl - - * plug-ins/film/film.c: del_list_item_callback was calling - gtk_widget_destroy on an already unrefed widget - -Wed Apr 15 02:03:25 PDT 1998 Manish Singh - - * app/disp_callbacks.c: disable keyboard accelerators - during mouse image operations, so nothing funky happens - in the middle of a motion (like converting image types - or running a plugin) - -Wed Apr 15 01:58:12 EDT 1998 Matthew Wilson - - * app/gdisplay.c: made a change to gdisplays_update_area to - update _all_ gdisplays that point at the gimage ID. This - (should) fix the paint on the second layer of a second view bug. - -Tue Apr 14 16:15:52 PDT 1998 Manish Singh - - * app/iscissors.c: partially applied gimp-monniaux-980413-0, - corrects nonfunctional interface elements - -Tue Apr 14 18:01:50 EDT 1998 Matthew Wilson - - * app/gdisplay.c: Set active_tool->drawable to NULL when destroying - the gdisplay that the active tool points to. - * app/giamge.c: Fixed spacing... - -Tue Apr 14 13:40:07 PDT 1998 Manish Singh - - * gradient.c: handle delete_event for color selector properly - - * plug-ins/webbrowser/web-browser.scm: updated link to the bugs - page - -Tue Apr 14 20:36:26 MEST 1998 Sven Neumann - - * gimp_tips.txt: applied gimp-quinet-980414-0; adds new tips - * plug-ins/pagecurl/pagecurl.c: applied gimp-quinet-980414-1; - defines M_PI - * app/app_procs.c: applied gimp-quinet-980414-2; adds more - information to the startup screen - * app/regex.c - * plugins/script-fu/regex.c: partially applied - gimp-jbuhler-980412-0; adds braces to nested if/else - -Tue Apr 14 10:11:04 MEST 1998 Sven Neumann - - * app/global_edit.c: Named cut and copy are now performed after - the user is asked for a name, so cancelling the dialog works - correctly. - -Mon Apr 13 15:17:51 PDT 1998 Manish Singh - - * moved man page from docs to top-level so it's always installed - -Mon Apr 13 23:48:31 MEST 1998 Sven Neumann - - * app/histogram_tool.c: changed the Ok and Cancel buttons in the - histogram dialog to a simple Close, because that's what they were - actually doing - -Mon Apr 13 13:09:32 EDT 1998 Matthew Wilson - - * app/commands.c: Fixed prefs to save stingy memory - -Mon Apr 13 16:22:38 MEST 1998 Sven Neumann - - * app/convert.c: converting an empty image from grayscale to - indexed used to crash the gimp - -Mon Apr 13 15:37:42 MEST 1998 Sven Neumann - - * app/gdisplay.c: correctly update the menu-sensitivity; you can't - paste into an empty image - * global_edit.c: flush the displays when pasting from a named buffer - -Mon Apr 13 13:40:50 MEST 1998 Sven Neumann - - *docs/gimp.1: fixes and updates to the man-page - -Mon Apr 13 13:00:20 MEST 1998 Sven Neumann - - * gimp_tips.txt: more tips and nicer line wrap - * app/tips_dialog.c: the last character (the final dot) was cut off - -Mon Apr 13 02:12:21 PDT 1998 Manish Singh - - * app/xcf.c: fix a tiny bug in the xcf loader that would have - caused gimp to crash on a corrupt xcf file - -Mon Apr 13 01:47:22 PDT 1998 Manish Singh - - * plug-ins/flarefx/flarefx.c: applied gimp-timecop-980412-0 - and tweaked it a bit to make it have proper behavior - - * plug-ins/snoise/snoise.c: updated plug-in - -Sun Apr 12 22:31:11 PDT 1998 Manish Singh - - * Changed address for FSF in all .h and .c files - - * app/configure.in: check for freebsd tiff libs - -Mon Apr 13 00:41:50 EDT 1998 Matthew Wilson - - * app/command.c: Duh. We have a message_box. Why not use it for - the prefs code. - -Mon Apr 13 00:27:45 EDT 1998 Matthew Wilson - - * app/gdisplay.c: Set the current tool's gdisplay pointer to NULL - when destroying a gdisplay - - * app/interface.c: Use "clicked" as the signal to handle for menu - based tools. This lets us pop by_color_select back up. - -Sun Apr 12 22:51:31 MEST 1998 Sven Neumann - - * gimp_tips.txt: added a few more tips - * plugins/webbrowser/webbrowser.scm: updated the URL to the - GIMP Bugs page - -Sun Apr 12 15:49:25 MEST 1998 Sven Neumann - - * app/palette.c: fixed a typo in the menu - * gimprc.in: removed the systemwide palettes directory from the - palettes searchpath - -Sun Apr 12 02:23:05 PDT 1998 Manish Singh - - * configure.in: I guess it didn't end... an attempt to try to - recognize all types of tiff configs - - * app/gdisplay_ops.c: resize on zoom fix for naught window - positioning from Kevin Cozens - - * app/errors.c: gdk_exit needs to be prototyped - -Sun Apr 12 01:19:35 PDT 1998 Manish Singh - - * configure.in: more fixes... when will it all end... - - * plug-ins/xd/xd.c: compile with >= 0.15 now - - * app/transform.[ch]: applied gimp-alt-980412, fixes control - point selection for transforms - -Sat Apr 11 15:23:26 PDT 1998 Manish Singh - - * Made 0.99.26 release - -Sat Apr 11 15:03:43 PDT 1998 Manish Singh - - * app/gdisplay.c: reverted cosmetic fix below, broke zoomed - updates - - * configure.in: changes to xdelta and jpeg checks - - * updated bmp plugin - - * portability patch for polar - - * minor bugfix to vpropagate - - * fix for memory problem in xwd - -Sat Apr 11 00:03:33 PDT 1998 Manish Singh - - * Made 0.99.25 release - -Fri Apr 10 21:59:18 PDT 1998 Manish Singh - - * app/app_procs.c: fixed up idle handler for file open - (look like testgtk idle demo) - - * app/colomaps.c: fixup for visual test and use of gdk_color_alloc - for some fixed colors (from Owen Taylor) - - * app/errors.h - * app/errors.c - * app/main.c - * libgimp/gimp.c: redid the signal handlers so we only get a - debug prompt on SIGSEGV, SIGBUS, and SIGFPE. - - * applied gimp-jbuhler-980408-0 and gimp-joke-980409-0 (warning - fixups) - - * applied gimp-monnaux-980409-0 for configurable plugin path for - multiarch setups - -Fri Apr 10 00:17:23 EDT 1998 Matthew Wilson - - * app/commands.c: Fixed (hopefully) the preferences code. Added - a warning to restart GIMP for those changes that require restarts. - -Fri Apr 10 01:55:50 MEST 1998 Sven Neumann - - * added three new logo-scripts from keebler@wco.com: - bovinated-logo.scm, comic-logo.scm and gradient-bevel-logo.scm - -Thu Apr 9 09:28:04 1998 Scott Goehring - - * libgimp/gimp.c (gimp_main): strict C requires that function - pointers be preceded by '&'. SGI compilers seem to not like it - when they're not. - - * app/gdisplay.c: fixed updating to not clip display updates to - image boundary (so that layer boundaries that hang over will be - erased properly when the layer is removed); fixes a long-standing - cosmetic bug. - -Thu Apr 9 01:54:19 PDT 1998 Manish Singh - - * configure.in: fix jpeg check. Add config for sendmail - - * plug-ins/mail/Makefile.am: use autoconf MAILER - - * plug-ins/script-fu: s/\/my_err/g for portability - -Thu Apr 9 02:53:14 EST 1998 Matthew Wilson - - * app/app_procs.c: Added a little wrapper when loading files from - command line that loads the files after gtk_main starts. This - fixes the segfault from the tips dialog when you load images on - the command line. Cudos to Owen for the fix. - -Wed Apr 8 23:47:59 PDT 1998 Manish Singh - - * configure.in: add AC_FUNC_ALLOCA for regex - -Wed Apr 8 21:12:01 PDT 1998 Manish Singh - - * configure.in: redid libjpeg check to make sure old versions - aren't used. Also #undef PACKAGE and VERSION since some - jconfig.h's define it - - * updated included regex.[ch] to the one in GNU grep - - * plug-ins/script-fu/interp_regex.c: we don't need to kludge - around OSF1 anymore, since we use our own regex stuff - -Wed Apr 8 17:55:38 EDT 1998 Adrian Likins - - *plugins/script-fu/scripts/grid-system.scm - *plugins/script-fu/scripts/hsv-graph.scm - *plugins/script-fu/scripts/image-structure.scm - *plugins/script-fu/scripts/line-nova.scm - *plugins/script-fu/scripts/text-circle.scm - *plugins/script-fu/scripts/unsharp-mask.scm: - *data/palettes/Named_colors: - script and palette updates from Shuji Narazaki - -Wed Apr 8 00:14:29 PDT 1998 Manish Singh - - * Made 0.99.24 release - -Wed Apr 8 00:04:31 PDT 1998 Manish Singh - - * app/batch.c: fixup for script-fu in batch mode from - Christian Maegaard - - * added pagecurl plug-in - -Wed Apr 8 01:40:45 EDT 1998 Matthew Wilson - - * app/by_color_select.c: Don't destroy tool. - -Tue Apr 7 22:36:22 PDT 1998 Manish Singh - - * added regex.[ch] to app/ and plug-ins/script-fu/ so we REALLY - have proper regex functions on all platforms - - * updated gfig plugin - -Mon Apr 6 20:38:49 PDT 1998 Manish Singh - - * configure.in: fix for $srcdir != $builddir for data. Tightened - check for random() and add -lucb on systems that need it. Fix for - xdelta.h check. Find xemacs as well as emacs. Properly define - settings for print plugin. - - * app/Makefile.am: ditch -DNDEBUG, since nothing uses it - - * plug-ins/flame/Makefile.am - * plug-ins/flame/cmap.c - * plug-ins/flame/flame.c - * plug-ins/flame/libifs.c: properly handle random() and friends - - * plug-ins/pnm/pnm.c: workaround for systems with old sprintfs - - * plug-ins/print/Makefile.am - * plug-ins/print/print-escp2.c - * plug-ins/print/print-pcl.c - * plug-ins/print/print-ps.c - * plug-ins/print/print-util.c - * plug-ins/print/print.c: fold in portability fixes with the new - source. Handle defs from configure in the Makefile - - * plug-ins/sgi/sgi.c - * plug-ins/sgi/sgi.h: fold in portability fixes with the new source - - * plug-ins/threshold_alpha/threshold_alpha.c: properly get params - in non-interactive mode - - * updated bmp plugin, folded in portability fixes - -Sun Apr 5 17:43:50 EDT 1998 Matthew Wilson - - * app/bezier_select.c: Destroy the tool when changing displays. - * app/command.c: initialize pointers to drawables when selecting - tools - * app/disp_callbacks.c: initialize pointers to drawables on first - click of a gdisplay - * app/gimage.c: removed extra tool destruction - * app/tools.c: make a fallback case when starting tools so that - you'll always have an active tool. - -Sat Apr 4 15:43:28 MEST 1998 Sven Neumann - - * app/ops_buttons.[c|h] - * app/channels_dialog.c - * app/layers_dialog.c: The sensitivity of the buttons wasn't set - correctly when deleting an image. - -Fri Apr 3 13:49:38 MEST 1998 Sven Neumann - - * app/menus.c - * app/gdisplay.c - * app/commands.[c|h]: Added a "Add Alpha Channel" menu-entry to - the Image-menu. Now it is possible to work on a single-layer image - without opening the Layers-dialog for adding an alpha channel. - -Fri Apr 3 12:22:40 MEST 1998 Sven Neumann - - * app/Makefile.am - * tools/*.xpm - * app/ops_buttons.[c|h] - * app/channels_dialog.c - * app/layers_dialog.c: Added buttons to access the menu functions - in the Layers&Channels-dialog more directly. They are connected to - the menu-item-callback-functions. - -Thu Apr 2 04:06:50 EST 1998 Matthew Wilson - - * app/disp_callbacks.c: Always ungrab the pointer on button release. - This is a quick and dirty hack to try to nuke the pointer grab - bug. - -Thu Apr 2 01:49:34 EST 1998 Matthew Wilson - - * app/transform_core.c: added a change to make a note of the - current drawable in the button_release. This prevents the tool - from being restarted when the transform_core makes a floating - selection. - * app/tools.c: Initialize the current drawable to NULL if - there is gdisp == NULL. - -Thu Apr 2 23:52:54 EST 1998 Matthew Wilson - - * app/channels_dialog.c: the impossibility of duplicating a - non-auxillary channel is now reflected by the menu-sensitivity - -Thu Apr 2 15:34:22 MEST 1998 Sven Neumann - - * updated iwarp to the version on the registry and reapplied - (hopefully) all portability-patches that were applied in between - -Wed Apr 1 11:10:15 EST 1998 Matthew Wilson - - * app/brightness_contrast.c - * app/by_color_select.c - * app/color_balance.c - * app/color_picker.c - * app/curves.c - * app/histogram_tool.c - * app/hue_saturation.c - * app/levels.c - * app/posterize.c - * app/threshold.c - * app/transform_core.c: modified to call the cancel callback - instead of the ok callback when freed. modified to save the - last used drawable so that we might be able to check later - and restart the tool if need be. - - * app/disp_callbacks.c - * app/gimage.c: modified tool restart/destruction code - - * app/tools.c - * app/tools.h: added tools_initialize, made changes to - be able save the last used drawable in the tool. - -Wed Apr 1 23:14:42 MEST 1998 Sven Neumann - - * configure.in: added checks for print-systems as suggested by - Michael Sweet - * plugins/print - * plugins/sgi: updated to the version on the registry - -Wed Apr 1 20:04:26 MEST 1998 Sven Neumann - - * app/layers_dialog.c: applied gimp-simon-980331-0 - * app/blend.c: change the repeat_mode_menu to insensitive when - gradient_type is Shapeburst* - -Wed Apr 01 04:07:29 EST 1998 Matthew Wilson - - * app/disp_callbacks.c: Only destroy the current tool if you change - gdisplays and the tool caches image data. - -Wed Apr 01 03:40:15 EST 1998 Matthew Wilson - - * app/disp_callbacks.c: If the current gdisp->ID does not match - the ID of the gdisp_ptr in the active_tool, restart it. - -Tue Mar 31 03:10:12 EST 1998 Matthew Wilson - - * app/iscissors.c: Set tool->preserve to TRUE in tools_new_iscissors. - -Tue Mar 31 02:21:15 EST 1998 Matthew Wilson - - * app/gimage.c - * app/tools.c - * app/tools.h: Added a field in the Tools struct, preserve. - During gimage_dirty, if this flag is not set the tool will be - reset. This is good for tools that keep a copy of the image - in cache for local manipulation like transform_core. - - * app/bezier_select.c - * app/blend.c - * app/brightness_contrast.c - * app/bucket_fill.c - * app/color_balance.c - * app/color_picker.c - * app/crop.c - * app/curves.c - * app/ellipse_select.c - * app/free_select.c - * app/histogram_tool.c - * app/hue_saturation.c - * app/levels.c - * app/move.c - * app/paint_core.c - * app/posterize.c - * app/rect_select.c - * app/text_tool.c - * app/transform_core.c: Set the preserve flag to the correct - values in the new functions and wrapped calls to functions that - dirty the gimage to prevent tool restarts. - - * app/disp_callbacks.c - * app/menus.c: Removed Nether's tool patch. - - -Mon Mar 30 21:58:34 PST 1998 Manish Singh - - * app/brush_select.c - * app/iscissors.c: get rid of unused variable warnings - - * app/fileops.c: refresh the filesel better - - * app/plug_in.c: make sure everything gets initialized to something - in the plug-in struct - -Mon Mar 30 13:52:50 EST 1998 Adrian Likins - - *plug-ins/png/png.c: changed nparams it expected - so it would work non-ineractively - -Mon Mar 30 14:04:26 MEST 1998 Sven Neumann - - * app/by_color_select.c: now checks if the image it is - operating on still exists. - -Sun Mar 29 14:29:34 PST 1998 Manish Singh - - * plug-ins/sparkle/sparkle.c: fixed improper use of types; - works now - -Sun Mar 29 11:47:02 EST 1998 Adrian Likins - - *app/brushes.c: changed gimp-brushes-refresh so - that it actually refreshes again after i broke it. - -Sat Mar 28 22:42:49 1998 Owen Taylor - - * configure.in (gimpdir): Removed duplicate saving of - cflags. Add GTK_CFLAGS to CPPFLAGS for library tests, - instead of to CFLAGS. - -Fri Mar 27 13:41:55 EST 1998 Matthew Wilson - - * app/floating_sel.c: Always update the drawable when converting - a floating selection to a layer - -Fri Mar 27 11:41:30 EST 1998 Adrian Likins - - *plug-ins/palette/*: added the save palette plugin - -Fri Mar 27 14:33:42 MET 1998 Sven Neumann - - * plugins/dbbrowser/dbbrowser_utils.c - * plugins/sparkle/sparkle.c: small changes to make it compile - on irix-6.4 with the native compiler. - -Fri Mar 27 00:19:38 PST 1998 Manish Singh - - * Made 0.99.23 release - -Fri Mar 26 03:13:15 EST 1998 Matthew Wilson - * app/paint_core.c: Offset brush buffer when painting on edges - of the canvas. - * app/text_tool.c: Set window to auto_shrink = FALSE - -Fri Mar 26 01:30:45 EST 1998 Matthew Wilson - * app/iscissors.c - * app/bezier_select.c: Change to select the bezier tool properly - when converting from iscissors to bezier - -Thu Mar 26 17:41:55 MST 1998 Nathan Summers - * app/iscissors.c: fixed the sigsegv if the layer is offset! - -Thu Mar 26 16:32:05 MST 1998 Nathan Summers - * app/iscissors.c: fix a typo (i where a j should be) - -Thu Mar 26 15:26:18 MST 1998 Nathan Summers - * app/iscissors.c: This version works much better. - outstanding bugs : - - 1. the edgemap does not seem to be constructed quite right - (construct_edge_map) -- uncomment #define - ISCISSORS_STILL_DOES_NOT_WORK and take a look at the edgemap -- it - will be saved to the file "dump" - - 2. sigsegvs if the layer offset isn't 0,0. dunno why. - - 3. convert to bezier still does not work! Any tools experts wanna - help me with it? (it converts to bezier fine, it just doesn't set - the active tool to bezier currectly.) - -Thu Mar 26 12:15:38 MST 1998 Nathan Summers - - * app/iscissors.c: fixes the display artifact where the preview - outline of the selected area would not appear or would appear in the - wrong place or have the wrong shape - -Thu Mar 26 12:00:47 MST 1998 Nathan Summers - - * app/iscissors.c: This should hopefully fix most of the UMRs - (uninitialized memory reads) found with Purify. No noticable - change in iscissors's behavior, unfortunately. - -Thu Mar 26 13:03:18 EST 1998 Adrian Likins - - * app/app_procs.c app/brush_select.c app/brushes.c - app/brushes.h app/convert.c app/gradient.c app/gradient.h - app/palette.c app/palette.h app/pattern_select.c app/patterns.c - app/patterns.h: Fixed up --no-data so that the various *_init() - routines always get called, and so that when in interactive mode - the data can be loaded by the user even when started with --no-data. - Fixes the blend bug too... - -Thu Mar 26 18:38:54 MET 1998 Sven Neumann - - app/gradient.c: fixed another --no-data problem; also the - editor now behaves better when it is resized - -Wed Mar 25 22:46:36 MST 1998 Nathan Summers - - * app/iscissors.c: fixed a problem with unintialized variables - -Wed Mar 25 19:29:09 PST 1998 Manish Singh - - * app/gimprc.c: support for parsing env vars in gimprc - -Wed Mar 25 18:06:39 PST 1998 Manish Singh - - * applied gimp-quinet-980122-0 and tweaked the tests a bit, - this makes the optional library tests in configure. - - * applied gimp-jbuhler-980321-0, fixes more warnings in plug-ins - -1998-03-25 Federico Mena Quintero - - * app/asupsample.c (adaptive_supersample_area): Removed Sopwith's - "speed optimizations", as they introduced bugs (exposed by using a - high threshold value for supersampling). They weren't much of a - speed improvement, anyway (memcpy on very small regions, etc.). - Also, assuming that all-bytes-zero is a floating-point 0 value is - not portable. - -Wed Mar 25 16:22:00 EST 1998 Matthew Wilson - - * app/app_procs.c: now prints messages when starting up --no-splash - - * app/gimprc.c: now prints messages when starting up --no-splash - - * app/plug-in.c: does not print messages when starting up with - splash screen - -Tue Mar 24 20:32:53 PST 1998 Manish Singh - - * app/fileops.c: refresh the open/save as dialogs upon open - - * applied gimp-quinet-980323-0, fixing more M_PI madness - - * applied gimp-quinet-980323-1 which fixes redundant inline - checks - - * plug-ins/gfig/gfig.c: changed stipple to type unsigned char to - quell warnings - -Tue Mar 24 18:03:37 PST 1998 Manish Singh - - * configure.in: corrected test for libXmu for some systems; added - test for difftime - - * app/main.c: use glib ATEXIT macro - - * app/text_tool.c: applied gimp-stric-980321-0 (text preview - refresh) - - * plug-ins/script-fu/script-fu-console.c: don't need to init - gtkpreview stuff, since we don't use them - - * plug-ins/script-fu/*: many portability fixes - - * plug-ins/pnm/pnm.c: sprintf portability patch - - * plug-ins now #define RAND_MAX if needed - - * plug-ins/sparkle/sparkle.c: applied gimp-joke-980322-1 - -Tue Mar 24 04:19:55 PST 1998 Manish Singh - - * app/convert.c: fix for fencepost error from Adam - -Mon Mar 23 18:08:59 PST 1998 Manish Singh - - * app/gimage_mask.c - * app/paint_core.c: applied patch from Ben Jackson to fix - fractional pixel errors and reverted the old fix. - - * app/paint_funcs.h: changed the #defines for ERASE_MODE and - REPLACE_MODE to correctly match layer_modes[] - -Mon Mar 23 20:51:53 1998 Owen Taylor - - * INSTALL configure.in: Added some documentation - about why the configuration for GTK could be failing, - and pointed to it in the failure message. - -Sun Mar 22 18:27:57 EST 1998 Adrian Likins - - * plugins/dbbrowser/dbbrowser_utils.c: - * plugins/dbbrowser/dbbrowser_utils.h: Fix from - Matt Wilson (msw) to fix the crash with script-fu - pdbs in dbbrowser. - - * app/fileops.c: another patch from matt, this one to - fix the bug with saving images with no layers. - -Sun Mar 22 14:23:03 EST 1998 Adrian Likins - - * app/iscissors.c, app/tips_dialog.c, app/gradient.c, - libgimp/gimp.c, plug-ins/AlienMap/AlienMap.c, - plug-ins/bmp/bmp.c, plug-ins/fits/fitsrw.h, - plug-ins/fits/fitsrw.c, plug-ins/flarefx/flarefx.c, - plug-ins/gfig/gfig.c, plug-ins/gfli/gfli.c, - plug-ins/gicon/gicon.c, plug-ins/gqbist/gqbist.c, - plug-ins/gtm/gtm.c, plug-ins/hot/hot.c, - plug-ins/ifscompose/ifscompose.c, - plug-ins/ifscompose/ifscompose_utils.c - plug-ins/max_rgb/max_rgb.c, plug-ins/nlfilt/nlfilt.c, - plug-ins/pat/pat.c, plug-ins/pcx/pcx.c, plug-ins/rotate/rotate.c, - plug-ins/script-fu/script-fu-server.c, plug-ins/snoise/snoise.c, - plug-ins/threshold_alpha/threshold_alpha.c, - plug-ins/zealouscrop/zealouscrop.c :gimp-joke-980321 - - plug-ins/CML_explorer, plug-ins/autocrop, - plug-ins/align_layers, plug-ins/blinds, - plug-ins/bmp, plug-ins/megawidget: gimp-joke-980322 - - Applied gimp-joke-980322-0.patch and gimp-joke-980321-0.patch - from Yasuhiro SHIRASAKI . Mostly - portability for DEC osf1's cc. Lots of MAIN();'s, trailing - commas in enums, and guchar/gchar madness. - - -Sun Mar 22 01:59:31 PST 1998 Manish Singh - - * autoconfed for random/lrand48/rand madness - - * dbbrowser uses clist now, thanks to msw - - * gfig.c: minor fix for buggy compilers - - * plasma.c, snoise.c: applied gimp-kmt-980321-[0,1] - - * tiff.c: minor fix - -Sat Mar 21 18:34:56 MET 1998 Sven Neumann - - * fixed ripply-anim.scm and readded it - -Sat Mar 21 16:26:08 MET 1998 Sven Neumann - - * docs/gimp.1 - * app/install.c: small changes to reflect the fact that a gfig - directory is created in the users gimp-directory. - -Sat Mar 21 15:43:34 MET 1998 Sven Neumann - - * gimprc.in - * app/commands.c: removed auto-save from preferences and marked - it as not implemented in gimprc. The code is still there for later - reuse. - * app/gdisplay_ops.c: changed the WMCLASS on the image close - confirmation dialog to 'really_close' - -Sat Mar 21 14:43:06 MET 1998 Sven Neumann - - * docs/gimp_quick_reference.[ps|tar.gz]: - Changes to the reference sheet. - -Fri Mar 20 18:15:06 PST 1998 Manish Singh - - * s/bzero/memset/ and s/bcopy/memcpy/ in plug-ins - -Fri Mar 20 16:54:47 EST 1998 Adrian Likins - - * app/palette.c: - * app/palette.h: - * app/internal_procs.c: Fixed some brokenness in palette refreshing. - -Mar 19 21:36:41 PST 1998 Manish Singh - - * Made 0.99.22 release - * app/undo.c: handle exposure correctly - -Thu Mar 19 22:05:56 CST 1998 Larry Ewing - - * app/palette.c: fixed out of bounds reference in pallete_create. - The dialogs are a mess. - -Thu Mar 19 18:36:09 PST 1998 Manish Singh - - * ltmain.sh: libtool patch for Solaris - * added libgck, MapObject, and gfig back in - * gimprc.in: entry for gfig patterns - -Thu Mar 19 14:13:33 EST 1998 Adrian Likins - - * applied patch from Andy Thomas to brushes.c to - improve brush loading via pdb. Fixes problems with - bruses of the same name. - - *plugins/script-fu/scripts/ripply-anim.scm: removed - until someone fixes it. - -Thu Mar 19 13:21:28 MET 1998 Sven Neumann - - * docs/gimp_quick_reference.[tex|ps]: added a - single-paged reference sheet with most of the hotkeys - -Thu Mar 19 03:28:29 PST 1998 Manish Singh - - * plug-ins/script-fu/script-fu-scripts.c: handle delete - event for colorsel correctly - * plug-ins/polar/polar.c: minor cleanups - -Thu Mar 19 01:04:56 PST 1998 Manish Singh - - * applied gimp-jbuhler-980315-0 (quelled warnings) - -Wed Mar 18 20:57:55 EST 1998 Adrian Likins - - * AlienMap/AlienMap.c CEL/CEL.c CML_explorer/CML_explorer.c - align_layers/align_layers.c animationplay/animationplay.c - bmp/bmpwrite.c dbbrowser/dbbrowser.c emboss/emboss.c - exchange/exchange.c faxg3/faxg3.c faxg3/g3.c gbr/gbr.c - gif/gif.c gqbist/gqbist.c hot/hot.c ifscompose/ifscompose.c - iwarp/iwarp.c max_rgb/max_rgb.c maze/maze_face.c - megawidget/megawidget.c mpeg/mpeg.c nlfilt/nlfilt.c pcx/pcx.c - plasma/plasma.c pnm/pnm.c print/print-escp2.c - print/print-pcl.c print/print.c scatter_hsv/scatter_hsv.c - script-fu/script-fu-scripts.c script-fu/script-fu.c - sinus/sinus.c tga/tga.c tileit/tileit.c - vpropagate/vpropagate.c xpm/xpm.c: - More picky picky ansi type - stuff from gimp-hpux-980316.patch. - -Wed Mar 18 15:06:13 PST 1998 Manish Singh - - * define M_PI if it's not already defined in lots of - source files - -Wed Mar 18 16:57:52 EST 1998 Adrian Likins - - * blend.c brightness_contrast.c brush_select.c brushes.c - bucket_fill.c by_color_select.c channels_dialog.c - color_balance.c convolve.c crop.c curves.c eraser.c fileops.c - frac.c gradient.c histogram_tool.c hue_saturation.c - image_render.c indexed_palette.c layers_dialog.c levels.c - move.c paintbrush.c pattern_select.c pencil.c - perspective_tool.c posterize.c rect_select.c scale_tool.c - threshold.c tips_dialog.c: - appied most of gimp-hpux-980316-0.patch - from ???? Mostly added static's here and there - and casting stuff. - - * app/indexed_palette.c: made dialog non-resizeable - -Wed Mar 18 21:16:14 MET 1998 Sven Neumann - - * app/crop.c: fixed an indented #define - -Wed Mar 18 19:11:01 MET 1998 Sven Neumann - - * app/app_procs.c: split the "Brought to you by S&P" line in - two to avoid problems with 100dpi fonts - -Wed Mar 18 00:06:50 MET 1998 Sven Neumann - - * gradient.c: fixed a problem in the gradient editor - when gimp is started with the no-data option and no - gradients are load. - -Tue Mar 17 01:38:18 PST 1998 Manish Singh - - * updated gif, animationplay, animoptimize, and bmp plugins - -Mon Mar 16 21:52:46 CST 1998 Larry Ewing - - * app/convert.c (indexed_ok_callback): added gimage_ID to the - dialog struct to check if the gimage was still around. - - * app/commands.c: fixed border/grow/shrink to check for valid - gimage. (Once again object if you don't like this method). - -Mon Mar 16 16:31:11 PST 1998 Manish Singh - - * updated xpm plugin - -Mon Mar 16 15:57:08 PST 1998 Manish Singh - - * app/iscissors.c: more iscissors fun - -Mon Mar 16 17:05:54 CST 1998 Larry Ewing - - * app/commands.c: changed select_feather_cmd_callback to pass the - gimage->ID rather than the gimage to prevent a fatal error. If - you have objections to this speak now. - -Mon Mar 16 17:50:56 EST 1998 Adrian Likins - - * plugins/illusion/illusion.c: - * plugins/papertile/papertile.c: - * plugins/fractaltrace/fractaltrace.c: - * plugins/flame/flame.c: Changed MAIN(); to MAIN() - - *gimprc_user: added a commented out (install-colormap) - option - - *app/install.c: comsetic update to show info about .gimp/scripts - - *plugins/sparkle/sparkle.c: - *plugins/despeckle/despeckle.c: made a local MIN/MAX instead - of redefining the normal one (causes problems on some compilers) - -Mon Mar 16 05:12:00 CST 1998 Larry Ewing - - * app/move.c: - * app/gdisplay.c: - * app/gimage.c: Reworked the guide drawing and picking code to - remove all known guide artifacts. - -Mon Mar 16 12:20:12 EET 1998 Lauri Alanko - - * app/menus.c: Fixed the tool options disappearing at undo. - -Mon Mar 16 02:03:47 PST 1998 Manish Singh - - * updated gif and animationplay plugins - -Sun Mar 15 22:32:17 PST 1998 Manish Singh - - * all plugins parse gtkrc now - - * configure.in: save CFLAGS properly - -Mon Mar 16 00:28:16 CST 1998 Larry Ewing - - * app/undo.c: added back in the "extra" update I removed earlier. - -Sun Mar 15 20:39:12 CST 1998 Larry Ewing - - * app/undo.c (undo_pop_layer_displace): removed what seemed to be - an extra call to drawable_update on the layer, and added a call to - update the layer->mask. - -Sun Mar 15 14:50:21 CST 1998 Larry Ewing - - * app/fileops.c (file_save_as_callback): fixed file Save As - cancel callback to use gtk_signal_connect_object. - -Sun Mar 15 13:37:22 MET 1998 Sven Neumann - - * libgimp/gimpwire.c: applied Raphael Quinet's patch that - changes the wire_read error message to something slightly more - useful. - -Sun Mar 15 01:12:06 PST 1998 Manish Singh - - * made 0.99.21 release - -Sun Mar 15 02:06:18 CST 1998 Larry Ewing - - * app/layers_dialog.c: pass layer_ID instead of layer_widget to - rename funtion to prevent dereferencing freed mem. Fixes layer - rename bug. - -Sun Mar 15 06:15:37 1998 Tim Janik - - * app/gimage.c (gimage_remove_layer): check whether the removed layer - is floating_sel *and* check whether it is active_layer. - - * plug-ins/exchange/exchange.c (doDialog): also destroy the main dialog - if the "Cancel" button is clicked. - - * plug-ins/flame/flame.c: use gtk_quit_add_destroy instead of - gtk_quit_add (,gtk_widget_destroy,), i should have really known - better since i wrote gtk_quit_add_destroy() exclusively for the gimp ;) - * app/tips_dialog.c (tips_dialog_create): likewise. - * app/indexed_palette.c (indexed_palette_create): likewise. - * app/fileops.c (file_open_callback): likewise. - * app/fileops.c (file_save_as_callback): likewise. - -Sun Mar 15 03:54:58 1998 Tim Janik - - * plug-ins/AlienMap/AlienMap.c: show/hide about dialog, don't affect - the main dialog. - - * plug-ins/flame/flame.c (edit_callback): hide the dialog on delete. - (make_file_dlg): hide the dialog on delete. - - * plug-ins/ifscompose/ifscompose.c (ifs_options_dialog): hide the dialog - on delete. - - * app/interface.c (toolbox_delete): handle WM delete of toolbox - correctly. - (gdisplay_delete): don't close image window without confirmation. - -Sat Mar 14 18:38:26 PST 1998 Manish Singh - - * app/iscissors.c: new, improved, still buggy iscissors! - - * app/fileops.c: correctly hide the file selector - - * app/transform_core.c: a better fix for the display artifacts - - * added aa plugin back in - -Sat Mar 14 20:52:06 EST 1998 Adrian Likins - - * doc/gimp.1 - * app/main.c: some updates to reflect that none of - "valid debugging options" do anything anymore - -Sat Mar 14 15:14:16 PST 1998 Manish Singh - - * updated to use libtool 1.1 - - * app/transform_core.c: fixed display artifacts for the - transform tools, sorta. - - * plug-ins/pcx/pcx.c: updated pcx plug-in - -Sat Mar 14 18:50:29 MET 1998 Sven Neumann - - * app/main.c: applied gimp-ovchinnikov-970312-0.patch which - initializes locale. - -Sat Mar 14 17:17:31 MET 1998 Sven Neumann - - * app/internal_procs.c - * app/text_tool.c - * app/text_tool.h: applied gimp-edas-980305-0.patch (after a small - fix). Now registry and encoding can be choosen in the text tool - and two new pdb-functions are available to access this - functionality. - * plugins/script-fu/scripts/i26-gunya2.scm: changed to make it - follow the naming-convention - -Fri Mar 13 21:11:59 PST 1998 Manish Singh - - * configure.in: use gtk-config now - * app/gimage.c: gtk is paranoid. Must appease the warning gods. - -Sat Mar 14 00:50:31 1998 Tim Janik - - * plug-ins/script-fu/script-fu-scripts.c: only destroy the dialog at - the end of gtk_main() if it still exists. - -Fri Mar 13 16:54:12 CST 1998 Larry Ewing - - * app/image_render.c: added some g_return_if_fails to the render - funcs until I can come up with a better fix. - -Fri Mar 13 12:53:22 1998 Tim Janik - - - * app/layers_dialog.c: proper destruct at the end of gtk_main(). - (layer_widget_delete): unreference the layer widget's list item. - (layers_dialog_free): instead of destroying the menu, sink it since - it is still floating because we didn't attach it to some other widget. - (layers_dialog_free): sink the preview, destroy doesn't work since it's - still floating. wonder what the preview is created for if it is never - used?. - - * app/channels_dialog.c (channel_widget_delete): unreference the channel - widget's list item. - * app/channels_dialog.c (channels_dialog_free): sink the menu. - * app/channels_dialog.c (channels_dialog_free): sink the preview. - - * app/indexed_palette.c (indexed_palette_create): update the image list - even on initial creation. fixed the option menu warning. - - * plug-ins/script-fu/script-fu-console.c (script_fu_browse_callback): - properly destroy the browser when gtk_main() quits. - - * plug-ins/dbbrowser/dbbrowser_utils.c (gimp_db_browser): pass a widget - pointer back to our caller, for enabling proper destruction. - - * plug-ins/script-fu/script-fu-console.c (script_fu_console_interface): - only destroy the dialog on exit if it is still existing. - -Fri Mar 13 17:22:46 MET 1998 Sven Neumann - - * docs/gimp.1: fixed some typos in the man-page - -Fri Mar 13 10:21:21 1998 Scott Goehring - - * app/convert.c (generate_histogram_rgb): fixed buffer overrun in - convert.c correctly; the previous "fix" forced quantization when - it wasn't necessary in some cases (and made Adam very mad). - -Fri Mar 13 00:51:37 PST 1998 Manish Singh - - * app/color_picker.c: added display of hex triplets for HTML - people - -Thu Mar 12 18:51:09 PST 1998 Manish Singh - - * app/gdisplay.c - * app/by_color_select.c: Fix for indexed selection for multiple - layers by Ben Jackson. Reenabled select by color for indexed - images - -Thu Mar 12 21:25:51 1998 Scott Goehring - - * app/undo.c (undo_pop_layer_mod): Fixed a desynch bug when - undoing "add alpha layer". - -Thu Mar 12 22:52:47 1998 Tim Janik - - * about_dialog.c: - * app_procs.c: - * brightness_contrast.c: - * brush_select.c: - * by_color_select.c: - * channel_ops.c: - * channels_dialog.c: - * color_balance.c: - * color_select.c: - * commands.c: - * convert.c: - * curves.c: - * fileops.c: - * gdisplay_ops.c: - * global_edit.c: - * gradient.c: - * histogram_tool.c: - * hue_saturation.c: - * indexed_palette.c: - * info_dialog.c: - * install.c: - * interface.c: - * layers_dialog.c: - * levels.c: - * main.c: - * palette.c: - * pattern_select.c: - * posterize.c: - * text_tool.c: - * threshold.c: - * tips_dialog.c: - * tools.c: - fixed a lot of the destroy handlers and delete_event handlers, still - not everything perfect, though. - -Wed Mar 11 22:02:03 PST 1998 Manish Singh - - * Made 0.99.20 release - -Wed Mar 11 21:42:15 PST 1998 Manish Singh - - * app/iscissors.c: another iscissors patch, don't know - if it does any good though - -Wed Mar 11 19:30:54 EST 1998 Adrian Likins - - *docs/gimp.1: added gimp man page - - *app/gdisplay.c: disables by-color-select for indexed images - - *plugins/webbrowse/web-browser.scm: updated some urls - - *plugins/script-fu/sripts/circuit.scm: update for change in maze - -Wed Mar 11 18:03:38 CST 1998 Larry Ewing - - * app/disp_callbacks.c: added checks to recreate the active tool - if need be. - -Wed Mar 11 02:49:14 PST 1998 Manish Singh - - * app/fileops.c: no need to hide the help button for fileops, - since it doesn't exist anymore - -Wed Mar 11 02:26:51 PST 1998 Manish Singh - - * added animoptimize plugin - -Wed Mar 11 00:27:35 PST 1998 Manish Singh - - * app/convert.c: fixed memory overrun error - - * app/gdisplay.c - * app/menus.c: reapplied the tools patch from Nether, looks - like it doesn't trip up anymore. Added some sanity checks - anyway - - * app/disp_callbacks.c - * app/transform_core.c: plugged some harmless build warnings - -1998-03-11 Larry Ewing - - * app/undo.c - * app/gimage.h - * app/gimage.c: added a simple reference count to the guides so that - undo does not free them too early... - -Tue Mar 10 21:31:21 PST 1998 Manish Singh - - * app/interface.c: scrollbars in the drawing area shouldn't - autofocus - -Tue Mar 10 17:09:27 PST 1998 Manish Singh - - * app/app_procs.c - * app/colormaps.c: Do the preview_reset properly this time - -Tue Mar 10 00:38:31 PST 1998 Manish Singh - - * app/transform_core.c: transform tools add alpha channel - properly, fixing that really nasty painting bug - -Sun Mar 8 17:44:05 PST 1998 Manish Singh - - * app/app_procs.c: fix for (install-colormap) and splash screen - using gtk_preview_reset() - - * configure.in: on some platforms libXmu doesn't require libSM and - libICE. configure should know this now. - - * app/gradient.c: corrected WM_CLASS typo - - * plug-ins/gfli/gfli.c: fix for load handler magic - - * plug-ins/gtm/gtm.c: don't use naughty gccisms. - - * plug-ins/gqbist - * plug-ins/maze: updated from registry - -Tue Mar 3 01:02:30 1998 Larry Ewing - - * app/scale.c: Fixed a long standing bug in the scale factor - computation so that the scale labels all agree. - -Sun Mar 1 18:45:09 PST 1998 Manish Singh - - * Made 0.99.19 release - -Sun Mar 1 20:28:54 MET 1998 Sven Neumann - - * app/internal_procs.c - * app/palette.c - * app/palette.h - * app/commands.c - * app/commands.h - * app/menus.c - * libgimp/gimppalette.c: - implemented gimp_palette_set_default_colors and - gimp_palette_swap_colors as pdb-calls and bound menu-entries and - keybindings to them (gimp-sven-980216-0.patch) - -Sat Feb 28 22:05:15 PST 1998 Manish Singh - - * autoconfed the data stuff - -Sat Feb 28 23:38:30 EST 1998 Adrian Likins - - * at yosh's suggestion, merged gimp-data-min - back into the main gimp tree under gimp/data - -Sat Feb 28 16:57:49 PST 1998 Manish Singh - - * Makefile.am: don't do docs generation by default - - * configure.in: -lXt for webbrowser plugin - - * libgimp/gimp.c - * libgimp/gimpprotocol.c - * libgimp/gimptile.c - * libgimp/gimpwire.c - * app/plug_in.c: applied memory leak patch from Mattias Gronlund - - * app/eraser.c - * app/eraser.h - * app/internal_procs.c - * app/paintbrush.c - * app/paintbrush.h: incremental modes for eraser and paintbrush, - as well as a "hard eraser" - - * plug-ins/ifscompose/ifscompose.c: pixmap visual fixups - -Sat Feb 28 00:09:46 1998 Scott Goehring - - * app/gimage_cmds.c (duplicate): Duplicate image wasn't copying - channels to the new image. Fixed. - -Fri Feb 27 23:02:10 MET 1998 Sven Neumann (sven@gimp.org) - - * app/about_dialog.c: (about_dialog_load_logo) - use a correct gc - -1998-02-26 Federico Mena Quintero - - * app/app_procs.c (make_initialization_status_window): Push/pop - correct visuals for drawing area creation. - (splash_logo_load): Use a correct gc. - -Thu Feb 26 12:19:44 EET 1998 Lauri Alanko - - * Another patch in gimp.h to name more GParam-types for gimple. - -Wed Feb 25 02:46:28 PST 1998 Manish Singh - - * added webbrowser plugin for gimp help - -Tue Feb 24 22:14:06 PST 1998 Manish Singh - - * plug-ins/xpm/xpm.c: update. Hopefully this fixes all - those problems we were having - -Tue Feb 24 04:14:36 PST 1998 Manish Singh - - * configure.in: change to detect GTK 0.99.4 or higher - -Sun Feb 22 02:43:12 PST 1998 Manish Singh - - * app/text_tool.c: use our own sort function to appease - the gtk gods - -Sat Feb 21 16:40:47 EST 1998 Adrian Likins - - * plugins/destripe/detripe: updated destripe - - *plugins/gtm/*: - plugins/semiflatten/*: added these plugins - - -Fri Feb 20 02:38:24 PST 1998 Manish Singh - - * initial plug-in stable/unstable split - -Wed Feb 18 16:46:37 1998 Owen Taylor - - * plug-ins/ifscompose/ifscompose.c: refcounting fixups - plug-ins/ifscompose/REAMDE.ifscompose: changed web address - -Wed Feb 18 17:56:40 MET 1998 Sven Neumann - * app/app_procs.c: fixed refcounting for the splash-image - -Tue Feb 17 21:23:20 MET 1998 Sven Neumann - - * app/fileops.c: hide the help buttons since we have no - help (yet) - -Tue Feb 17 20:55:12 MET 1998 Sven Neumann - - * gimp_splash.ppm: added the splash-screen image drawn - by Jens Lauterbacher to the distribution - - * app/appenv.h - * app/app_procs.c - * app/main.c: added the splash-image to the startup-window; - new command-line options: --no-splash, --no-splash-image - - * ps_menurc: changed to reflect changes to the - menu-structure - -Tue Feb 17 09:24:44 EST 1998 Adrian Likins - - * updated all of Sven Neumanns scripts. Including - blend-anim.scm, waves-anim.scm, drop-shadows.scm, - perspective-shadow.scm, round-corners.scm, slide.scm, - and selection-round.scm. - -Sat Feb 14 15:34:08 PST 1998 Manish Singh - - * app/iscissors.c: iscissors released for initial public - consumption - -Sat Feb 14 15:01:46 PST 1998 Manish Singh - - * Fixed up docs and autoconf interaction (part of - gimp-rrh-980125-0) - -Fri Feb 13 02:00:01 PST 1998 Manish Singh - - * libgimp/gimp.c - * app/menus.c: fixes for the g_string -> g_str change in glib - - * updated gfig - -Thu Feb 12 13:10:50 EST 1998 Adrian Likins - - *libgimp/gimp.h - applied a patch from Lauri Alanko to make - libgimp/pdb bindings for some languages a little easier - -Wed Feb 4 19:04:35 1998 Scott Goehring - - * channel.c - * channel.h - * disp_callbacks.c - * gimage.c - * layer.c - * layer.h - * layers_dialog.c - * undo.c: More GTK refcount-related changes. (We're not there - yet, but we're getting closer.) - -Tue Feb 3 17:52:34 1998 Scott Goehring - - * app/interface.[ch] app/app_procs.[ch]: Changes to deal with new - GTK refcounting regime. - -Mon Feb 2 19:19:16 1998 Scott Goehring - - * app/channels_dialog.c: - * app/layers_dialog.c: Added gtk_widget_ref and gtk_widget_unref - calls to keep channel & layer widgets from dying when reordering - the channel/layer stacks. - -Sat Jan 31 20:49:11 EST 1998 Adrian Likins - - * plug-ins/edge.c: added a check so it wouldnt segfault when - passed a non-existent drawable - - * plug-ins/threshold_alpha.c: added a non-interactive mode - - * app/brightness_contrast.c - * app/color_balance.c - * app/colormaps.c - * app/curves.c - * app/hue_saturation.c - * app/posterize.c - * app/threshold.c : added a check so it wouldnt except - a indexed drawable. This was previosly possible via the pdb. - -Sat Jan 31 00:16:22 PST 1998 Manish Singh - - * plug-ins/xpm/xpm.c: Changed to use g_strcasecmp - -Fri Jan 30 13:47:57 1998 Federico Mena - - * app/gradient.c: Applied patch from Wolfgang Hofer - to let the user load the segment - endpoint color from the current foreground color. It also makes - the preview un-resizable, which is not a complete fix for the - preview resizing bug. - -Fri Jan 30 11:48:04 EST 1998 Adrian Likins - - * More plugin non-interactive fixes: - DigitalSignature, hot, sinus, smooth_palette - -Thu Jan 29 19:25:52 EST 1998 Adrian Likins - - * fixed the non-iteractive modes for plugins: - exchange, holes, grid, deinterlace - (mainly expecting wrong number of arguments or just ingome - non-interactive mood entirely) - -Thu Jan 29 01:05:10 PST 1998 Manish Singh - - * updated refract and warp plugins - * changed the INSTALL file to reflect the fact that gtk is a - separate package - * app/text_tool.c: small patch for indexed images and - antialiased toggle - -Thu Jan 29 00:00:54 PST 1998 Manish Singh - - * removed all usage of linked.[ch] and switched to GSLists - -Wed Jan 28 22:03:42 EST 1998 Adrian Likins - - * Fixed carve-it.scm and circuit.scm (circuit broke due - to a plugin update, carve-it broke due to the add-layer stuff) - - * Added a close button to the color picker info window - - * changed index_palette.c a bit...now if you click with - MB11, it changes the current active color, clicking with MB3 - opens the color in the color selector for editing - - * Made some of the /Color/* menus sensitive to the image - type (gdisplay.c) - -Wed Jan 28 13:17:06 1998 Scott Goehring - - * app/gimage.c (gimage_add_channel): Added safety code for add - channel so you can't add a channel twice or to the wrong image. - (Same thing as I did for layers a few months ago.) - -Tue Jan 27 22:31:00 PST 1998 Raph Levien - - * app/gimage_mask.c: hacked around fractional pixel errors in - paint_core_subsample_mask, fixing the "Stroked pixel bug" posted - by Ben Jackson on 14 Jan 1998 to gimp-developer. - -Tue Jan 27 10:21:00 PST 1998 Raph Levien - - * app/gimage.c: fixed bug in image display with all channels - turned off - -Tue Jan 27 00:18:28 PST 1998 Manish Singh - - * app/xcf.c: fixes an off by one error in xcf_tile_save_rle() - -Sun Jan 25 18:41:17 PST 1998 Manish Singh - - * app/about_dialog.c: Added a couple names here - - * app/color_area.c - * app/color_panel.c - * app/color_select.c - * app/color_select.h - * app/indexed_palette.c - * app/palette.c: Changed COLOR_UPDATE functionality, along with - cosmetic changes (gimp-quinet-980120-0) - - * .cvsignore - * Makefile.am - * configure.in - * gimprc.in - * gimprc_user.in - * user_install: makes gimprc_user, splitting user and system-wide - settings. (gimp-quinet-980121-1) - -Sun Jan 25 16:56:49 1998 Scott Goehring - - * app/gimage.c (gimage_merge_layers): Added a missing call to - drawable_offsets, fixing the "merge bug". - - * app/gimage_cmds.c (duplicate): Fixed a bug in duplicate that was - entirely my fault. :) - -Sun Jan 25 16:51:56 EST 1998 Adrian Likins - - * added the gtk_window_set_wmclass to most of the gimp - dialogs so they set the XA_WM_CLASS properties. - -Sun Jan 25 13:28:28 PST 1998 Manish Singh - - * libgimp/gimppixelrgn.c - * plug-ins/iwarp/iwarp.c - * plug-ins/sparkle/sparkle.c: Misc portability fixes for - DEC OSF1 (gimp-joke-980109-0) - -Sun Jan 25 02:24:03 PST 1998 Manish Singh - - * libgimp/*: Placed libgimp under the LGPL - -Sun Jan 25 01:25:55 PST 1998 Manish Singh - - * plugin updates from the registry (align_layers, - despeckle, mathmap, print) - - * plug-ins/script-fu/script-fu-scripts.c - * plug-ins/script-fu/scripts/copy-visible.scm: - Applied Sven's no arguments script patch and copy-visible - fix - -Sun Jan 25 00:12:15 EST 1998 Adrian Likins - - * added plug-ins/script-fu-scripts/chip-away.scm - -Sat Jan 24 18:16:35 PST 1998 Manish Singh - - * applied Sven's menu patch - -Sat Jan 24 17:23:13 PST 1998 Manish Singh - - * app/indexed_palette.c: fix for wrong color selected in indexed - palette dialog - - * app/xcf.c: don't crash on bad input (0 byte files) - - * app/plug_in.h - * app/plug_in.c: fixes Gimp's most obscure bug. Failed plugin - queries are handle correctly now - - * app/commands.c: added marching ants speed to preferences - - * plug-ins/tiff/tiff.c: correction for inversion for MINISWHITE - images without alpha - - * plug-ins/pcx/pcx.c: updated to new version - - * app/paint_funcs.h: changed OPAQUE and TRANSPARENT to - OPAQUE_OPACITY and TRANSPARENT_OPACITY to avoid possible - conflicts. All affects .c files changed. - -Sat Jan 24 15:16:40 1998 Scott Goehring - - * app/app_procs.c (make_initialization_status_window): Changed - resize policy of the init status window so it doesn't constantly - resize itself. - -Wed Jan 21 23:59:02 PST 1998 Manish Singh - - * Fixed up the change below to use the SetArg/GetArg stuff - -Thu Jan 22 01:54:17 1998 Scott Goehring - - * Rework of drawables, images, and layers to use GtkObjects. Lots - and lots of secondary changes. - -Sun Jan 18 18:07:23 EST 1998 Adrian Likins - - * added plugins/gflare/gflares and edited the makefiles - so that the gfalres and gfig-examples would get installed - into share/gimp/gflares and share/gimp/gfig - - -Tue Jan 13 21:36:07 PST 1998 Manish Singh - - * ltconfig - * ltmain.sh: downgraded to libtool 1.0f at Jay's suggestion - - * plug-ins/fractaltrace/fractaltrace.c (query): ymax argument was - listed twice. Fixed. - -Fri Jan 9 01:15:51 PST 1998 Manish Singh - - * INSTALL: updated to properly reflect installation procedure - - * app/text_tool.c: Fixed bad string in tool description - - * libgimp/gimppixelrgn.c: tiles aren't marked dirty in - gimp_pixel_rgn_get_pixel - - * plug-ins/edge/edge.c - * plug-ins/edge/emboss.c - * plug-ins/edge/laplace.c - * plug-ins/edge/sobel.c: DEC OSF1 cannont handle reference to - array element with a negative arugment with an unsigned int - (gimp-joke-980108-0) - - * plug-ins/sinus/sinus_logo.h: got rid of really long string - - * plug-ins/refract/Makefile.am - * plug-ins/refract/refmain.c: fixed megawidget reference - - * plug-ins/xpm/xpm.c: made our own case-insenstive strcmp - for checking for transperancy - -Tue Jan 6 14:17:02 PST 1998 Manish Singh - - * configure.in: make it *really* check for gtk >= 0.99.1 this - time - - * plug-ins/gbr/gbr.c: check image type before save to prevent - image corruption. Only allow saves to non-alpha grayscale images - - * app/install.c: reduce the size of the install info dialog so it - fits better on 640x480 screen - -Mon Jan 5 19:30:38 PST 1998 Manish Singh - - * app/by_color_select.c: fix for indexed images - - * plug-ins/script-fu/scripts/i26-gunya2.scm: proper registration - - * plug-ins/xpm.c: fix for transparent images - - * Updated to libtool 1.0h - - * libgimp/Makefile.am: removed spurious -rpath - -Sun Jan 4 17:43:32 PST 1998 Manish Singh - - * app/by_color_select.c: Prevent divide-by-zero error when - fuzzy threshold in select by color is 0 - - * app/tile_swap.c: Minor bugfix for tile saves - - * app/text_tool.c: better handling when there are no fonts - - * Updated PNG plugin from registry - - * Added the FlareFX plugin - -Sun Jan 4 14:24:05 1998 Scott Goehring - - * plug-ins/despeckle/despeckle.c: realloc buffers when the radius - of effect changes; save all values (not just radius) in plugin - data store; adjusted parameter handling to match PDB registration. - The algorithm still generates artifacts in the top rows of the - image. - -Sat Jan 3 16:48:02 PST 1998 Manish Singh - - * app/colormaps.c: check for NULL pointer access when not enough - colormaps for standard colormaps (gimp-joke-971219-0) - - * app/fileops.c: fix for saving files in the wrong place - - * app/fuzzy_select.c: now less aggressive (doesn't grab the whole - image with diagonal 1-pixel wide line) Too conservative now? - - * app/text_tool.c: negative border-value disables autocropping - of text - - * libgimp/gimplayer.c: gimp_layer_copy pdb called with correct args - - * docs/Wilber.xcf.gz: added logo to docs dir :) - - * Added DigitalSignature, FractalExplorer (not made by default), - facesaver (not made by default), and Stegano plugins - - * Updated Encrypt_Decrypt, changing the dir name (no more - Encript_Decript) - - * Updated plugins with their new registry versions - -Thu Dec 25 23:04:00 PST 1997 Manish Singh - - * Updates from the plugin registry: Compose, Film, FITS, ps, - refract, sunras, twist - -Thu Dec 18 11:15:17 1997 Scott Goehring - - * app/main.c (main): Freeing arguments to putenv afterwards is - naughty. Fixed. Plug-ins work now. - -Wed Dec 17 23:51:30 CST 1997 Shawn T. Amundson - - * All these changes are from Owen Taylor to make GIMP work - with reference changes make in GTK. This mainly affects - functions gtk_pixmap_destroy, gdk_colormap_destroy, - gdk_font(set)_free; they have disappeared and where - changed to *_unref. These simple changes affected: - app/about_dialog.c, app/channels_dialog.c, - app/curves.c, app/gradient.c, app/layer_select.c, - app/text_tool.c, plug-ins/gfig/gfig.c, - plug-ins/ifscompose/ifscompose.c, - plug-ins/libgck/gck/gckcolor.c, - plug-ins/libgck/gck/gcknotebook.c - - * app/color_area.c: check for initial expose before drawing - * app/disp_callbacks.c: gc for scrolling - * app/gdisplay.c: destroy gc, event now pointer - * app/scroll.c: use scroll_gc, make sure graphics expose events - are processed before scrolling again - * gimp/app/gdisplay.h: add scroll_gc to struct - -Wed Dec 17 23:23:05 1997 Ray Lehtiniemi - - * app/brush_select.c (brush_popup_open): fix memory leak - - * app/pattern_select.c (pattern_popup_open): fix memory leak - -Wed Dec 17 15:33:23 PST 1997 Manish Singh - - * plug-ins/pcx/pcx.c: Applied patch to fix PCX saving from - Nicholas Lamb - - * app/main.c: Plugins now get a proper DISPLAY through - gdk_get_display - -Wed Dec 17 13:24:48 1997 Scott Goehring - - * app/convert.c (convert_image): Closed a rather nasty memory - leak. - - * plug-ins/xpm/xpm.c (run): Added access to the alpha cutoff via - the PDB. Added a missing break in the run_mode switch. - -Tue Dec 16 16:55:04 PST 1997 Manish Singh - - * app/convert.c: no more crashes with indexed conversion and no - palettes - -Tue Dec 16 15:24:36 EST 1997 Adrian Likins - - * modified user-isntall to make a scripts and gflares dir - - * added path to gflares in the gimprc - - -Tue Dec 16 12:32:30 1997 Scott Goehring - - * app/xcf.c (xcf_load_invoker): Shuji's xcf load close patch. - -Mon Dec 15 19:03:59 EST 1997 Adrian Likins - - * fixed a few broken tips in gimp_tips.txt - - * updated add-bevel.scm - -Sun Dec 14 19:47:59 PST 1997 Manish Singh - - * Configured in the flame plugin by default - * updated the ripply-anim script (still broken though) - -Sun Dec 14 20:57:46 1997 Ray Lehtiniemi - - * app/tools.c (tools_options_dialog_show): fix a problem where - the tools options dialog will appear empty because the - active tool was destroyed by menus_activate_callback(). - - * app/blend.c fixed cores when using custom gradients with - offset of 100 - -Sun Dec 14 16:56:33 PST 1997 Manish Singh - - * backed out of the tools fix, cause problems with - rmb script-fu - -Sun Dec 14 03:41:27 PST 1997 Manish Singh - - * Support for dithering to custom palettes - - * a proper PDB entry for indexed conversion - (gimp-convert-indexed-palette) - -Sun Dec 14 00:08:00 PST 1997 Raph Levien - * a minor patch to make the file selection dialog not always - select the first file in a directory - -Sat Dec 13 23:37:59 PST 1997 Manish Singh - - * mkbrush.scm updated - - * Added support for tooltips in preferences - -Sun Dec 14 00:06:00 CST 1997 Shawn T. Amundson - - * configure.in: Changed gimp lib dir to lib/gimp/MAJOR.MINOR - instead of lib/gimp/MAJOR.MINOR.MICRO - * script-fu/scripts: removed piechart, kanji-circle, kanji-neon - * configure.in: change check for EMACS to allow emacs to not - exist (in which case, no error results, but pdb docs don't - get made) - -Sat Dec 13 19:41:35 CST 1997 Shawn T. Amundson - - * plug-ins/fuse/Makefile.am: fuse.c couldn't find gck/gck.h - -Fri Dec 12 02:07:26 PST 1997 Manish Singh - - * Updated gif and animationplay with the new versions - -Thu Dec 11 20:56:09 PST 1997 Manish Singh - - * Removed dgimp (it never worked anyway) - -Wed Dec 10 16:59:56 PST 1997 Manish Singh - - * Added gimprc option for enabling/disabling tooltips - - * Fixed up about dialog - - * Added Fractaltrace plugin - -Tue Dec 9 15:26:48 PST 1997 Manish Singh - - * Added Lauri Alanko's tools patch - - * Clarified the units in the tile cache size field in the - preferences dialog - -Tue Dec 9 15:21:16 PST 1997 Raph Levien - - * app/gimprc.c, app/commands.c: committed the preferences patch I - posted to gimp-developer on 4 Nov 1997. This patch fixes some - stability problems, as well as makes the preferences saving - functionality more complete. - -Tue Dec 9 00:52:15 EST 1997 Adrian Likins - - * added illusion, papertile, colorify, and glasstile - plugins - - * updated despeckle, and math map - -Mon Dec 8 21:59:03 PST 1997 Manish Singh - - * updated CML_explorer - -Mon Dec 8 16:30:29 EST 1997 Adrian Likins - - * udpdate gqbist, warp, randomize, fuse, gfig plugins - - * removed gflare-tar.gz from the plugins dir - -Mon Dec 8 11:43:17 EST 1997 Adrian Likins - - * updated iwarp to latest version - - * added Sven Neumans patch for 32-bit color in gck - - * fixed gimp_tips.txt (the tip about the "add alpha") - - -Mon Dec 8 02:13:36 PST 1997 Manish Singh - - * app/about_dialog.c: Added Nathan Summers patch to make it - work better - - * app/menus.c: Added Michael Natterer's patch to save menu - accelerators with chars that need to be escaped properly - - * app/undo.c: Added Andy Thomas's patch to check for a NULL - active_tool in the undo (so it can work with plugins) - -Sun Dec 7 17:05:32 PST 1997 Manish Singh - - * added Sven Neumann's patch to the scale and resize dialogs for ratio input fields (app/resize.h, app/resize.c) - - * added Raph Levien's patch for the transperancy blur problem - (app/convolve.c, app/gimage.h, app/gimage.c, paint_core.h, - paint_core.c, paint_funcs.h, paint_funcs.c) - -Sun Dec 7 15:27:14 EST 1997 Adrian Likins - - * fixed refract.c to look for megawidget.h in the proper place - - * fixed the makefile.am in plugins/script-fu/script to install - the texture files too - - * added a check in channels_dialog.c to make the aspect ratio - really go away - - * fixed a minor error in the alien-glow-* scripts with an - extra parenthesis - - * added the new wilber.h - - * patched convert.c with Adam D. Moss's patch to avoid color counting when - not needed - - * patched gif.c with Adam D. Moss's patch to fix some weirdness with - transparncy in anim gifs - -Sat Dec 6 15:27:23 EST 1997 Adrian Likins - - * Added a check in some of the layer/channel preview code - to keep stuff from breaking when it got ) values for size - - * Removed all the old stale *.[ch] files fom plug-ins/ dir - - * Added a work around for the weirdness resulting from - rezing the palette dialog - -Wed Nov 26 14:38:30 1997 Larry Ewing - - * Added a bounds check to undo_push_image* to fix drawing - outside the image undo bug - - * Desensitized Add Layer Mask when layer has no alpha channel - - * Wrapped the calls to gtk_list_clear_items with - suspend_gimage_notify in app/channels_dialog.c to prevent - erroneously deactivating channels. Fixes "out of paint" bug - - * replaced calls to info_window_update in app/magnify.c and - app/scale.c with a single call in gdisplay_flush () so that - the info window reflects the current status - -Wed Nov 19 13:22:09 EST 1997 Adrian Likins - - * updated vpropagate.c and align_layers.c - -Tue Nov 18 16:40:22 1997 Christoph Hoegl - - * Larry Ewing fixed a bug which caused multible confirm-on close - Windows to appear and took GIMP with them on close - - * plug-ins/iwarp added - - -Mon Nov 17 14:29:00 1997 Christoph Hoegl - - * plug-ins/gqbist/gqbist.c updated from registry - - * plug-ins/fuse/fuse.c updated from registry - - * plug-ins/fp/fp.c fixed buggy feature list - (now handles also layered images, patch resubmitted by - Daniel R Risacher ) - -Mon Nov 17 15:14:14 EST 1997 Adrian Likins - - * Finally fixed the scripts that broke with the last - release. This includes crystal-logo.scm, sota-chrome-logo.scm, - and chome-it.scm. - -Sun Nov 16 20:39:26 1997 Christoph Hoegl - - * applied all patches of these Mails (or improved ones) - - <0000094A.1892@dril-quip.com> - (special thanks to Art_Haas@dril-quip.com (Art HAAS) - addresses bzero and other compatibility/style problems) - - * speedup of script-fu start - <199710312031.MAA05318@callisto.hip.berkeley.edu> - (thanks to Raph Levien ) - - * fixes a PI to M_PI in twist.c - (not sure if this is what we want)) - - (thanks to Trond Eivind Glomsrxd ) - - * fixes preview for megawidgetbased plug-ins / speed up - <19971105154336.33004@dca.fee.unicamp.br> - <19971105155848.26367@dca.fee.unicamp.br> - <19971105160238.05244@dca.fee.unicamp.br> - (big thanks to Marcelo Malheiros ) - - * fixes some "returning pointers to stack" - <00000A37.1892@dril-quip.com> - (special thanks to Art_Haas@dril-quip.com (Art HAAS) - and Nathan Carl Summers ) - - * moved all plug-ins to dirs of their own (finally) - and reconfigured - - -Fri Nov 14 23:27:01 1997 Scott Goehring - - * app/tools.c (tools_options_dialog_show): Fixed the tool dialog - raise code to only raise it if its shown, and only show if it's - not already shown. (Probably not important, but can't hurt.) - - * app/interface.c (create_toolbox): Fixed an uninitialized static - variable error, was causing the "raise toolbox" menu option to - fail miserably. (Not sure when this happened; option used to - work.) - -Tue Nov 11 14:57:16 1997 Scott Goehring - - * app/xcf.c (xcf_save_image): Added versioning for XCF file - format. Coded support for XCF version 1, which fixes the problem - in version 0 with only saving 1/3 of the colormap of images with - colormaps (i.e. indexed images). - -Fri Nov 7 00:27:44 CST 1997 Adrian Likins - - * added docs/cheat_sheet.txt and docs/keybindings.txt - -Thu Nov 6 14:08:35 1997 Federico Mena - - * configure.in (gimpdatadir): Changed gimpdatadir to be - $datadir/$PACKAGE instead of $datadir/$PACKAGE/$VERSION. - Datafiles are version-independent. - -Tue Nov 4 08:46:19 1997 Federico Mena - - * app/commands.c app/gimprc.c: Patch from Raph Levien to fix the - preferences and gimprc mechanism. - - * app/convert.c: Adam's patch to fix web and mono palette modes. - - * app/selection.h app/selection.c: Updated the USE_XDRAWPOINTS patch. - - * plug-ins/script-fu/script-fu.c (init_procedures): Patch from - Raph Levien to do fast loading of the pdb procedures. - - * app/gdisplay.c app/menus.c: Another patch from Lauri Alanko to - fix the tools mechanism. - - * app/tips_dialog.c: New look for the tip-of-the-day dialog, by - Raphael Quinet and Tuomas Kuosmanen. - - * app/interface.c: Patch from Andreas Dilger to enable tooltips. - - * INSTALL: Updated INSTALL file from Owen Taylor. - - * plug-ins/displace.c (displace_dialog): Removed printf() of PID. - - * plug-ins/emboss.c: Patch from Spencer to fix grayscale images - and number of arguments in non-interactive mode. - -Thu Oct 30 14:57:32 1997 Scott Goehring - - * configure and makefile tweaking for christoph's new plugins - -Wed Oct 29 17:52:57 1997 Christoph Hoegl - - * added and autoconfigured plug-ins/{twist,fuse,refract,warp,struc} - (Keep in mind that these are new, alpha plug-ins (esp. warp which - is not yet ready for general consumption according to author - John Beale ) - - * added plug-ins/{flame,mathmap,rcm,user_filter} - - * plug-ins/gqbist.c: updated to v1.7 - - -Tue Oct 28 22:30:32 1997 Scott Goehring - - * plug-ins/MapObject/mapobject_main.c (run): removed an - inappropriate cast of radius from float to int - -Mon Oct 27 07:45:23 EST 1997 Adrian Likins ,adrian@gimp.org - - * updated title-header.scm to not add a layer twice - - * remove t-o-p.scm, it was a duplicate of t-o-p-logo.scm - jsut registered under a different name - -Sun Oct 26 22:28:15 EST 1997 Adrian Likins - - * added Spencer's patch to the brush and patterns dialog. Now - instead of scrolling the object around to see all of, a small - window popups showing the entire brush or pattern. - - * added Spencers patch to add pop-up help to the toolbar. - - -Sun Oct 26 18:01:36 1997 Scott Goehring - - * configure: finished adding the xpm plug-in (someone else added - it to the makefiles, but forgot to ensure that its makefile was - built...) - - * app/about_dialog.c (about_dialog_create): About dialog now shows - "true" version (instead of 1.0) and randomizes the names in the - scrollbar instead of showing them in alphabetical order. - -Sat Oct 25 14:53:27 1997 Scott Goehring - - * plug-ins/MapObject/mapobject_main.c: Eliminated use of - FLOATARRAYs in arguments due to shortcoming of argument passing - protocol. - - * app/plug_in.c (plug_in_handle_proc_install): Added code to - sanitize plugins for compliance with the array passing - convention restriction. Noncompliant plugins will be rejected. - - * app/layers_dialog.c: Fixed layers dialog resize bug - now - resizes interior of dialog instead of the close button. :) - -Sat Oct 25 02:56:15 1997 Scott Goehring - - * Added auto-raise for most dialogs (if selected when already - "visible"). Also added a "Toolbox" menu entry to the Tools menu - that raises the Toolbox (no default binding cuz I can't think of - one). Fixed the off-by-one-month timestamp bug. - -Fri Oct 24 21:45:11 1997 Federico Mena - - * Made 0.99.15 release. - -Fri Oct 24 17:54:54 EDT 1997 Adrian Likins - - * Applied a patch by Josh Parsons - by way of Adam Moss to gif.c so that it works while - trying to save non-interactively. The comment string - wasnt being handled well in non-interactive mode. - -Fri Oct 24 11:49:55 1997 Federico Mena - - * app/fileops.c: Will Wagner's patch to fix the file dialog. - - * app/convert.c: Adam Moss's patch to add color counting. - - * Applied Lauri Alanko's patches to fix the curves tool and some of - the general tools mechanism. - - * plug-ins/blinds.c plug-ins/sharpen.c: Art Haas's patch to clean - up several warnings in plug-ins. - - * libgimp/gimppixelrgn.c: #ifndef'ed out some variables according - to Adam's MEMCPY_IS_NICE stuff so that the compiler emits no - warnings about unused variables. - - * plug-ins/header.c: Raphael Quinet's patch to fix green channel - and save reasonably-sized lines instead of a single enormous - string. Broken compilers barf on them. - - * app/layers_dialog.c (lc_dialog_create): Patch to raise the - layers dialog if it is invoked when it was already shown. - - * app/commands.c (file_new_cmd_callback): Patch to not let the - file/new dialog create indexed images. - - * app/tips_dialog.c (read_tips_file): Added fclose(fp). - - * app/gimprc.c (save_gimprc): Added g_free(cur_line). It was - missing and thus causing a memory leak. - - * README: Added reference to the plug-in registry. - -Thu Oct 23 11:20:05 1997 Federico Mena - - * app/layers_dialog.c: Removed layer_widget_raise_callback() and - layer_widget_lower_callback(), they were not used. - - * app/frac.c (xcf_save_compress_frac_init): Fixed double printf format. - (xcf_save_frac_compressed_tile): Fixed pointer printf args. - - * Fixed a *lot* of uninitialized variables in the app/ directory, - mainly in the pdb function invoker procedures. This should - supress a trillion compiler warnings. - - * app/brush_select.c: removed brush_select_cancel_callback(); it - was never being used. - - * app/disp_callbacks.c (gdisplay_canvas_events): Changed the type - of tmask to be GdkModifierType. - - * app/channels_dialog.c: Removed channel_widget_raise_callback() - and channel_widget_lower_callback(); they were not being used. - - * app/brushes.c: Removed the declaration of int_value (it is never used). - - * app/gimprc.c app/gimprc.h app/commands.c app/tips_dialog.c: - save_gimprc() may modify the lists it gets passed (by - adding/removing elements). Changed the prototype to take GList** - values instead of just GList*. Changed the calls to save_gimprc() - accordingly. - -Thu Oct 23 01:46:28 CDT 1997 Shawn T. Amundson - - * app/menus.c: applied patch malheiro-970917 which - prevents installing bogus accelerator handlers for the - menu separators. - - * All the rest of these are from Eiichi Takamori - - - * plug-ins/gicon.c: fixed the number of return values on save - - * plug-ins/gicon.c: fixed the number of return values on save - - * libgimp/gimpprotocol.c fixed GPProcrun/GPProcReturn typo and - freed params in _gp_params_destroy() - - * libgimp/gimp.c: gimp_run_procedure() now frees proc_run.params, - since it is allocated in that function and no longer used - - * app/plug_in.c: fixed memory overrun in plug_in.c when - nargs < current_return_nvals, in case the plug-in returns bad - number of return values. - - * app/plug_in.c: destroy arguments when PDB lookup failed. - - * app/plug_in.c: fixed memory leak in plug_in_params_destroy() - and plug_in_args_destroy() - -Wed Oct 22 20:38:46 EDT 1997 Adrian Likins - - * Added the www.gimp.org web page look scripts (gimp-labels.scm - and gimp-headers.scm)to the dist - - * also added a handful of scripts (predator.scm, circuit.scm, - xach-effect.scm, copy-visible.scm, select_to_brush.scm, - select_to_image.scm, and glow.scm). - see www.gimp.org/~adrian/scripts.html - - * patched maze.c to work better interactively - - * patched noisify.c to show more informative labels and to - correct a bug with values of 0 for a channel still allowing - some noise to be added. - - * changed some of the alien-glow-* scripts to have better defaults - - * moving script-fu wasnt entirely my idea :-) - -Wed Oct 22 18:48:28 1997 Shawn T. Amundson - - * this was actually all Adrian's idea -- moved all the - scripts from /Filters/Script-Fu to just - /Script-Fu - -Fri Oct 17 15:59:58 1997 Christoph Hoegl - - * changed and autoconfigured gimptcl (needs further integration, - works only with -ldl), gfig (click 2 buttons bug) - - * plug-ins/gimptcl/gtclenums.h: fixed a typo - - * added gimptcl (1.0), gfig (0.9) - -Thu Oct 16 17:05:32 1997 Christoph Hoegl - - * translated c++-style comments to c-style ones - - * plug-ins/{CentralReflection,Anamorphose}: update to 1.02 - - * plug-ins/rotate.c: Sven Neumanns update to 0.4 (selection support) - -Wed Oct 22 11:42:50 1997 Federico Mena - - * plug-ins/polar.c: Updates by Sven Neumann. - - * app/about_dialog.c (scroll_text): Added missing people to the - credits list. This is still incomplete, though. - - * Raphael Quinet's and Tristan Tarrant's big patch to add - preferences saving, tip of the day, and some bugfixes to the - gimprc code. Thanks! - - * Adam Moss's patch to fix scaling of indexed images and the - transform tool. - - * app/main.c: Miles O'Neal's patch to send error when an invalid - command line switch is used. - - * app/paintbrush.c (paintbrush_invoker): Removed division by 2 of - num_strokes. This fixes calls to the paintbrush from the pdb - (patch by Andy Thomas). - - * plug-ins/MapObject/mapobject_preview.c: Added prototype for - clear_wireframe(). - - * app/gimage.c: Scott Goehring's patch to disallow adding a layer - to the wrong image, or adding the same layer twice to the same image. - - * app/global_edit.c: Applied Owen Taylor's patch to fix edit_clear - when the image has no layers. - - * app/app_procs.c: Applied Jason Riedy's patch to fix gimpdir checking. - - * app/layers_dialog.c: Applied Scott Goehring's patch to avoid - desensitizing the Close button when there are no images. - -Fri Oct 17 13:34:22 1997 Federico Mena - - * plug-ins/emboss.c: Applied Eric Hernes's patch to fix the - crashes in the plug-in. - -Thu Oct 16 10:30:15 1997 Federico Mena - - * app/channel.c app/paint_funcs.c app/paint_funcs.h: Applied Scott - Goehring's patch to fix the feathering with 0 radius. - - * plug-ins/waves.c: Applied Lauri Alanko's patch to make the - plug-in not store its past drawable and image and operate in the - "normal" way. - - * app/xcf.c (xcf_save_image): Applied Scott Goehring's patch to - fix "disk full" error. - - * plug-ins/script-fu/script-fu-scripts.c (script_fu_interface): - Applied Adrian Likins's patch to fix the toggle buttons with - incorrect state. - - * app/disp_callbacks.c: Applied Lauri Alanko's patch to reset the - tool when the active drawable changes (this fixes the flip tool - bug, for example). - - * app/color_area.c: Applied Lauri Alanko's patch to fix the cancel - function on the color dialog. - - * plug-ins/destripe.c plug-ins/emboss.c plug-ins/gfli.c - plug-ins/nlfilt.c plug-ins/sinus.c plug-ins/zealouscrop.c: fixed - "inline" functions. PLEASE DO NOT USE THIS. - - * plug-ins/dgimp/dgimp.c: Added inclusion of if necessary. - - * libgimp/gimp.c: Added inclusion of if necessary. - - * plug-ins/emboss.c (run): Fixed the check for the number of - parameters --- this was causing the plug-in to crash when being - called non-interactively. Also changed accepted drawable types to - RGB*; it was missing the *. - -Wed Oct 15 08:52:23 1997 Federico Mena - - * plug-ins/png/Makefile.am (LDADD): Added -lm to LDADD. - - * plug-ins/AlienMap/AlienMap.c plug-ins/Curtain/Curtain.c - plug-ins/Encript_Decript/Encript_Decript.c plug-ins/Julia/Julia.c - plug-ins/Mandelbrot/Mandelbrot.c: Removed C++-style comments. - PLEASE DON'T PUT IN THIS KIND OF COMMENTS! - - * plug-ins/MapObject/mapobject_preview.c: Added prototypes for - draw_wireframe_plane() and draw_wireframe_sphere(). - - * Added -I$(includedir) to the Makefile.am's in all directories. - - * plug-ins/fp.c plug-ins/engrave.c plug-ins/hot.c - plug-ins/magiceye.c plug-ins/universal.c: Changed registered - procedure names to follow the plug-in convetion. - - * app/magnify.c: Added "info_window.h" to #includes. - - * app/app_procs.c (really_quit_delete_callback): casted widget to - GTK_BUTTON to avoid warning. - - * plug-ins/tiff/tiff.c plug-ins/gqbist.c plug-ins/sgi.c - plug-ins/snp.c plug-ins/tileit.c plug-ins/sharpen.c - plug-ins/sgilib.c plug-ins/ifscompose_utils.c: Added to - includes to avoid warnings. - - * libgimp/gimpwire.c: Added to includes to avoid warnings. - - * app/convert.c (compute_color_rgb): Applied Adam's patch to fix - division by zero on completely transparent images. - - * libgimp/gimpenums.h (enum): Fixed SUBTRACT_MODE typo. Oops :-) - -Mon Oct 13 14:28:20 1997 Federico Mena - - * libgimp/gimpmenu.h libgimp/gimp.h: Applied Tom Bech's patch to - make ld not puke on plug-ins written in C++. - -Sun Oct 12 09:19:19 1997 Tim Janik - - * acconfig.h: - * configure.in: - * app/plug_in.c: Added configure check for IPC_RMID_DEFERRED_RELEASE, - because shmat() fails after a shmctl(..., IPC_RMID,...) for OSF1 V3.2, - SunOS 4.1.1, 5.5, 5.5.1, 5.6, IRIX 5.2 and 6.2. - -Sat Oct 11 11:03:30 1997 Federico Mena - - * app/gdisplay_ops.c: Applied Shuji Narazaki's patch to fix the - behavior of shrink-wrap and auto-resize window. - - * plug-ins/script-fu/script-fu.c (init_constants): Applied Shuji - Narazaki's patch to replace SUBTRACTION for SUBTRACT, to be - consistent with the rest of the program. - -Thu Oct 9 19:32:17 1997 Federico Mena - - * app/fileops.c (file_open_callback): Applied Tom Bech's patch to - fix disappearing file list items. - - * app/gimprc.c (gimp_directory): Applied Raphael Quinet's patch to - fix NULL home directory. - - * app/brush_select.c, app/pattern_select.c: Applied Tom Bech's - patch to allow proper resizing of the windows. - -Wed Oct 8 21:33:50 1997 Christoph Hoegl - - * plug-ins/ - added MapObject (0.32) plugin (still requires libgck to be installed) - written by Tom Bech - added, updated (all 1.01 now) and autoconfigured (ADUPAC) following - AlienMap, Anamorphose, CentralReflection, Curtain, Encript_Decript, - Julia, Mandelbrot by Daniel Cotting (CSP) - plug-ins/aa/aa.c: upgraded to v1.0 - plug-ins/xd: noticed upgrade by Josh - applied inline patch by Tim Mooney - (reduces gcc-ism a bit and makes use of autoconf features) - reflecting plugin changes within managementfiles (configure.in) - -Mon Oct 6 13:22:01 1997 Federico Mena - - * plug-ins/pat.c, plug-ins/gbr.c: Applied Lauri Alanko's patch to - fix number of returned arguments. - - * configure.in: Applied Tim Mooney's patch to allow passing of - extra linker options to X and Gtk tests. - Applied Kaz Sasayama's patch to allow use of the srcdir option in - configure. - -Mon Oct 6 01:15:21 CDT 1997 Tim Mooney - - * configure.in, config.h.in, plug-ins/destripe.c, plug-ins/emboss.c, - plug-ins/gfli.c, plug-ins/nlfilt.c, plug-ins/sinus.c, - plug-ins/zealouscrop.c: added a call to AC_C_INLINE in configure.in - to test for the appropriate flavor of the inline keyword, and changed - all plug-ins currently using __inline__ to use just `inline', which will - be defined to something in the toplevel config.h - -Fri Oct 3 19:36:50 1997 Federico Mena - - * app/fileops.c: Applied Kevin Turner's patch to fix resizing of - the file open/save dialogs. - -Thu Oct 2 17:41:51 1997 Federico Mena - - * app/color_select.c (color_select_update_hue_value): Applied - Laury Alanko's patch to fix hue calculation. - - * libgimp/gimppixelrgn.c: Applied Adam Moss's patch to use - memcpy() instead of for() loops to copy tile data. - -Wed Oct 1 01:25:38 1997 Federico Mena - - * app/gdisplay_ops.c: Applied Lauri Alanko's patch for optional - confirmation when closing dirty images. - -Tue Sep 30 17:18:52 1997 Federico Mena - - * plug-ins/sinus.c: replaced rint() by the ROUND_TO_INT() macro. - - * app/commands.c (file_new_ok_callback): Applied Lauri Alanko's - patch to mark new images as non-dirty. - - * app/color_select.c: Applied Lauri Alanko's patch to make color - selection update immediate. - - * libgimp/gimplayer.c (gimp_layer_copy): fixed pdb run procedure. - - * main.c (main): Applied Miles O'Neal's patch to change the help output. - -Mon Sep 29 13:08:47 1997 Federico Mena - - * configure.in: Applied Jason Riedy's patch for non-GNUish systems. - - * configure.in: Changed second function for testing of libtiff so - that the previous cached result is not used. - - * plug-ins/Makefile.am: Fixed linking of libraries for some - plug-ins (Peter). - - * configure.in: Changed linking order of gtk and X libraries (Peter). - -Fri Sep 26 14:57:12 1997 Federico Mena - - * Made 0.99.12 release. Whew! :-) - - * app/paint_core.c (paint_core_button_press): Applied Ray - Lehtiniemi's patch for pointer motion tracking when pressing MOD1. - - * app/disp_callbacks.c (gdisplay_canvas_events): Applied Owen - Taylor's patch (sent by Adam Moss) to fix pointer tracking. - -Thu Sep 25 17:16:47 1997 Federico Mena - - * plug-ins/lic.c: added the LIC plug-in. - - * plug-ins/tga.c: updated the TGA plug-in to the new version. - - * Added the xd plug-in by Josh MacDonald. - - * Separated Gtk+ from GIMP. Hope the chainsawing was correct :-) - - * plug-ins/apply_lens.c: Morten Eriksen authorized the removal of - the additional licensing restriction, so I removed it. Thanks!!! - - * plug-ins/gflare/gtkmultioptionmenu.c: Changed "restrict" to - "restrict_area" to avoid name collision. - -Wed Sep 24 13:47:31 1997 Federico Mena - - * plug-ins/script-fu/script-fu-scripts.c: Applied Owen Taylor's - patch to avoid multiple initializations of the Gtk. - - * plug-ins/smooth_palette.c: srandom(), random() replaced by - srand() and rand(). - - * plug-ins/sinus.c: PI replaced by M_PI. - - * plug-ins/gqbist.c: srandom(), random() replaced by srand() and rand(). - - * plug-ins/laplace.c: ROUND_TO_INT() macro removed because it is - not used. - - * plug-ins: Removed MIN/MAX/BOUNDS macros and replaced them by the - appropriate ones from glib.h. - - * Now plug-ins that require special libraries reside in their own - subdirectories. This is sort of a kluge to make optional - compilation work. - - * app/: Applied Larry Ewing's big patch to properly handle - delete_event in all windows. - - * app/about_dialog.c: Applied Owen Taylor's patch to avoid eating - infinite CPU time when the about dialog is resized. - -Tue Sep 23 12:22:52 1997 Federico Mena - - * libgimp/gimp.c: From Tim Janik's patch; now _shm_ID = -1. - - * app/plug_in.c: Applied Tim Janik's patch to mark shm segments - with IPC_RMID so that they are automatically removed always. - - * app/gdisplay.c (gdisplay_delete): Applied Nick Lamb's patch to - fix file/open bug. - - * plug-ins/psd.c: Commented out "#include ". It does - not seem to be required, but I'm not sure. - - * app/procedural_db.c (procedural_db_execute): Applied Gordon - Matzigkeit's patch to avoid memory leak when calling plug-ins. - - * app/plug_in.h: Applied Gordon Matzigkeit's patch to avoid memory - leak when calling plug-ins. - - * app/plug_in.c: Applied Gordon Matzigkeit's patch to avoid memory - leak when calling plug-ins. - - * app/fileops.c (file_open): Applied Gordon Matzigkeit's patch to avoid - memory leak when freeing arguments. - - * app/plug_in.c: Applied Gordon Matzigkeit's patch for plug-in return args. - - * plug-ins/dbbrowser/dbbrowser.c: Removed the X includes; they are - not needed. - - * plug-ins/maze.c (run): Removed string from putchar() call and - replaced it with fprintf(). - - * app/layers_dialog.c (layers_dialog_set_menu_sensitivity): Fixed - bug which would lead to crashes when layer == NULL. - - * plug-ins/script-fu/scripts/clothify.scm: Fixed "gratuitous - vulgarity". Bleh. - - * Fixed calls to plug-in-bump-map in all scripts that needed it. - - * app/brushes.c (brushes_refresh_brush_proc =): Fixed unterminated - strings. - - * plug-ins/mblur.c (mblur): Fixed bad default case on switch(). - - * plug-ins/hot.c: Fixed unterminated strings. - - * plug-ins: removed trailing semicolon from all MAIN() macro calls. - - * plug-ins/dbbrowser/dbbrowser.c (run): Changed values[0] to values[1]. - - * plug-ins/sgi.c: Updated the sgi plug-in. - - * plug-ins/png.c: Updated the png plug-in. - - * Applied Lauri Alanko's patch to remove gcc-isms. - -Mon Sep 22 21:19:14 1997 Federico Mena - - * Added the mpeg plug-in. - - * Made configure.in and plug-ins/Makefile.am properly detect - whether file format libraries are installed and thus decide - whether to build some plug-ins or not. - - -Wed Sep 24 13:47:31 1997 Federico Mena - - * plug-ins/script-fu/script-fu-scripts.c: Applied Owen Taylor's - patch to avoid multiple initializations of the Gtk. - - * plug-ins/smooth_palette.c: srandom(), random() replaced by - srand() and rand(). - - * plug-ins/sinus.c: PI replaced by M_PI. - - * plug-ins/gqbist.c: srandom(), random() replaced by srand() and rand(). - - * plug-ins/laplace.c: ROUND_TO_INT() macro removed because it is - not used. - - * plug-ins: Removed MIN/MAX/BOUNDS macros and replaced them by the - appropriate ones from glib.h. - - * Now plug-ins that require special libraries reside in their own - subdirectories. This is sort of a kluge to make optional - compilation work. - - * app/: Applied Larry Ewing's big patch to properly handle - delete_event in all windows. - - * app/about_dialog.c: Applied Owen Taylor's patch to avoid eating - infinite CPU time when the about dialog is resized. - -Tue Sep 23 12:22:52 1997 Federico Mena - - * libgimp/gimp.c: From Tim Janik's patch; now _shm_ID = -1. - - * app/plug_in.c: Applied Tim Janik's patch to mark shm segments - with IPC_RMID so that they are automatically removed always. - - * app/gdisplay.c (gdisplay_delete): Applied Nick Lamb's patch to - fix file/open bug. - - * plug-ins/psd.c: Commented out "#include ". It does - not seem to be required, but I'm not sure. - - * app/procedural_db.c (procedural_db_execute): Applied Gordon - Matzigkeit's patch to avoid memory leak when calling plug-ins. - - * app/plug_in.h: Applied Gordon Matzigkeit's patch to avoid memory - leak when calling plug-ins. - - * app/plug_in.c: Applied Gordon Matzigkeit's patch to avoid memory - leak when calling plug-ins. - - * app/fileops.c (file_open): Applied Gordon Matzigkeit's patch to avoid - memory leak when freeing arguments. - - * app/plug_in.c: Applied Gordon Matzigkeit's patch for plug-in return args. - - * plug-ins/dbbrowser/dbbrowser.c: Removed the X includes; they are - not needed. - - * plug-ins/maze.c (run): Removed string from putchar() call and - replaced it with fprintf(). - - * app/layers_dialog.c (layers_dialog_set_menu_sensitivity): Fixed - bug which would lead to crashes when layer == NULL. - - * plug-ins/script-fu/scripts/clothify.scm: Fixed "gratuitous - vulgarity". Bleh. - - * Fixed calls to plug-in-bump-map in all scripts that needed it. - - * app/brushes.c (brushes_refresh_brush_proc =): Fixed unterminated - strings. - - * plug-ins/mblur.c (mblur): Fixed bad default case on switch(). - - * plug-ins/hot.c: Fixed unterminated strings. - - * plug-ins: removed trailing semicolon from all MAIN() macro calls. - - * plug-ins/dbbrowser/dbbrowser.c (run): Changed values[0] to values[1]. - - * plug-ins/sgi.c: Updated the sgi plug-in. - - * plug-ins/png.c: Updated the png plug-in. - - * Applied Lauri Alanko's patch to remove gcc-isms. - -Mon Sep 22 21:19:14 1997 Federico Mena - - * Added the mpeg plug-in. - - * Made configure.in and plug-ins/Makefile.am properly detect - whether file format libraries are installed and thus decide - whether to build some plug-ins or not. - - -Mon Sep 22 17:34:09 1997 Federico Mena - - * Made 0.99.11 release. See the files NOTES and TODO-DIST for - more info. diff --git a/app/actions/help-commands.c b/app/actions/help-commands.c index 9323a9d8f8..481738db00 100644 --- a/app/actions/help-commands.c +++ b/app/actions/help-commands.c @@ -373,7 +373,6 @@ file_new_resolution_callback (GtkWidget *widget, gchar *newvalue; NewImageValues *vals; - float new_resolution; float temp_units; float temp_pixels; char buffer[12]; @@ -406,8 +405,9 @@ file_new_resolution_callback (GtkWidget *widget, } void -file_new_cmd_callback (GtkWidget *widget, - gpointer client_data) +file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { GDisplay *gdisp; NewImageValues *vals; @@ -418,7 +418,6 @@ file_new_cmd_callback (GtkWidget *widget, GtkWidget *table; GtkWidget *frame; GtkWidget *radio_box; - GtkWidget *units_box; GtkWidget *menu; GtkWidget *menuitem; GtkWidget *optionmenu; @@ -439,7 +438,7 @@ file_new_cmd_callback (GtkWidget *widget, /* Before we try to determine the responsible gdisplay, * make sure this wasn't called from the toolbox */ - if ((long) client_data) + if (callback_action) gdisp = gdisplay_active (); else gdisp = NULL; @@ -2621,13 +2620,14 @@ tools_swap_colors_cmd_callback (GtkWidget *widget, } void -tools_select_cmd_callback (GtkWidget *widget, - gpointer client_data) +tools_select_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { GDisplay * gdisp; /* Activate the approriate widget */ - gtk_widget_activate (tool_widgets[tool_info[(long) client_data].toolbar_position]); + gtk_widget_activate (tool_widgets[tool_info[callback_action].toolbar_position]); gdisp = gdisplay_active (); @@ -2635,10 +2635,11 @@ tools_select_cmd_callback (GtkWidget *widget, } void -filters_repeat_cmd_callback (GtkWidget *widget, - gpointer client_data) +filters_repeat_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { - plug_in_repeat ((long) client_data); + plug_in_repeat (callback_action); } void diff --git a/app/actions/help-commands.h b/app/actions/help-commands.h index 645262543a..cc25ce75f6 100644 --- a/app/actions/help-commands.h +++ b/app/actions/help-commands.h @@ -4,7 +4,9 @@ #include "gtk/gtk.h" -void file_new_cmd_callback (GtkWidget *, gpointer); +void file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); void file_open_cmd_callback (GtkWidget *, gpointer); void file_save_cmd_callback (GtkWidget *, gpointer); void file_save_as_cmd_callback (GtkWidget *, gpointer); @@ -80,8 +82,12 @@ void layers_mask_select_cmd_callback (GtkWidget *, gpointer); void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer); void tools_default_colors_cmd_callback (GtkWidget *, gpointer); void tools_swap_colors_cmd_callback (GtkWidget *, gpointer); -void tools_select_cmd_callback (GtkWidget *, gpointer); -void filters_repeat_cmd_callback (GtkWidget *, gpointer); +void tools_select_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); +void filters_repeat_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); void dialogs_brushes_cmd_callback (GtkWidget *, gpointer); void dialogs_patterns_cmd_callback (GtkWidget *, gpointer); void dialogs_palette_cmd_callback (GtkWidget *, gpointer); diff --git a/app/buildmenu.c b/app/buildmenu.c index 42028f4ecb..74eec5c9c9 100644 --- a/app/buildmenu.c +++ b/app/buildmenu.c @@ -21,13 +21,13 @@ GtkWidget * build_menu (MenuItem *items, - GtkAcceleratorTable *table) + GtkAccelGroup *accel_group) { GtkWidget *menu; GtkWidget *menu_item; menu = gtk_menu_new (); - gtk_menu_set_accelerator_table (GTK_MENU (menu), table); + gtk_menu_set_accel_group (GTK_MENU (menu), accel_group); while (items->label) { @@ -41,12 +41,13 @@ build_menu (MenuItem *items, menu_item = gtk_menu_item_new_with_label (items->label); gtk_container_add (GTK_CONTAINER (menu), menu_item); - if (items->accelerator_key && table) - gtk_widget_install_accelerator (menu_item, - table, - "activate", - items->accelerator_key, - items->accelerator_mods); + if (items->accelerator_key && accel_group) + gtk_widget_add_accelerator (menu_item, + "activate", + accel_group, + items->accelerator_key, + items->accelerator_mods, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); } if (items->callback) @@ -55,7 +56,7 @@ build_menu (MenuItem *items, items->user_data); if (items->subitems) - gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), build_menu (items->subitems, table)); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), build_menu (items->subitems, accel_group)); gtk_widget_show (menu_item); items->widget = menu_item; diff --git a/app/buildmenu.h b/app/buildmenu.h index 1f902d02a8..1af69a4dcf 100644 --- a/app/buildmenu.h +++ b/app/buildmenu.h @@ -31,9 +31,9 @@ typedef void (*MenuItemCallback) (GtkWidget *widget, struct _MenuItem { - char *label; - char accelerator_key; - int accelerator_mods; + gchar *label; + guint accelerator_key; + guint accelerator_mods; MenuItemCallback callback; gpointer user_data; MenuItem *subitems; @@ -42,6 +42,6 @@ struct _MenuItem /* Function declarations */ -GtkWidget * build_menu (MenuItem *, GtkAcceleratorTable *); +GtkWidget * build_menu (MenuItem *, GtkAccelGroup *); #endif /* BUILDMENU_H */ diff --git a/app/channels_dialog.c b/app/channels_dialog.c index ef1207a50a..a3ed80f0b0 100644 --- a/app/channels_dialog.c +++ b/app/channels_dialog.c @@ -92,7 +92,7 @@ struct _ChannelsDialog { GtkWidget *channel_list; GtkWidget *preview; GtkWidget *ops_menu; - GtkAcceleratorTable *accel_table; + GtkAccelGroup *accel_group; int num_components; int base_type; @@ -204,7 +204,7 @@ channels_dialog_create () channelsD->active_channel = NULL; channelsD->floating_sel = NULL; channelsD->channel_widgets = NULL; - channelsD->accel_table = gtk_accelerator_table_new (); + channelsD->accel_group = gtk_accel_group_new (); if (preview_size) { @@ -217,7 +217,7 @@ channels_dialog_create () gtk_container_border_width (GTK_CONTAINER (vbox), 2); /* The layers commands pulldown menu */ - channelsD->ops_menu = build_menu (channels_ops, channelsD->accel_table); + channelsD->ops_menu = build_menu (channels_ops, channelsD->accel_group); /* The channels listbox */ listbox = gtk_scrolled_window_new (NULL, NULL); @@ -830,8 +830,8 @@ channels_dialog_map_callback (GtkWidget *w, if (!channelsD) return; - gtk_window_add_accelerator_table (GTK_WINDOW (lc_shell), - channelsD->accel_table); + gtk_window_add_accel_group (GTK_WINDOW (lc_shell), + channelsD->accel_group); } static void @@ -841,8 +841,8 @@ channels_dialog_unmap_callback (GtkWidget *w, if (!channelsD) return; - gtk_window_remove_accelerator_table (GTK_WINDOW (lc_shell), - channelsD->accel_table); + gtk_window_remove_accel_group (GTK_WINDOW (lc_shell), + channelsD->accel_group); } static void diff --git a/app/commands.c b/app/commands.c index 9323a9d8f8..481738db00 100644 --- a/app/commands.c +++ b/app/commands.c @@ -373,7 +373,6 @@ file_new_resolution_callback (GtkWidget *widget, gchar *newvalue; NewImageValues *vals; - float new_resolution; float temp_units; float temp_pixels; char buffer[12]; @@ -406,8 +405,9 @@ file_new_resolution_callback (GtkWidget *widget, } void -file_new_cmd_callback (GtkWidget *widget, - gpointer client_data) +file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { GDisplay *gdisp; NewImageValues *vals; @@ -418,7 +418,6 @@ file_new_cmd_callback (GtkWidget *widget, GtkWidget *table; GtkWidget *frame; GtkWidget *radio_box; - GtkWidget *units_box; GtkWidget *menu; GtkWidget *menuitem; GtkWidget *optionmenu; @@ -439,7 +438,7 @@ file_new_cmd_callback (GtkWidget *widget, /* Before we try to determine the responsible gdisplay, * make sure this wasn't called from the toolbox */ - if ((long) client_data) + if (callback_action) gdisp = gdisplay_active (); else gdisp = NULL; @@ -2621,13 +2620,14 @@ tools_swap_colors_cmd_callback (GtkWidget *widget, } void -tools_select_cmd_callback (GtkWidget *widget, - gpointer client_data) +tools_select_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { GDisplay * gdisp; /* Activate the approriate widget */ - gtk_widget_activate (tool_widgets[tool_info[(long) client_data].toolbar_position]); + gtk_widget_activate (tool_widgets[tool_info[callback_action].toolbar_position]); gdisp = gdisplay_active (); @@ -2635,10 +2635,11 @@ tools_select_cmd_callback (GtkWidget *widget, } void -filters_repeat_cmd_callback (GtkWidget *widget, - gpointer client_data) +filters_repeat_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { - plug_in_repeat ((long) client_data); + plug_in_repeat (callback_action); } void diff --git a/app/commands.h b/app/commands.h index 645262543a..cc25ce75f6 100644 --- a/app/commands.h +++ b/app/commands.h @@ -4,7 +4,9 @@ #include "gtk/gtk.h" -void file_new_cmd_callback (GtkWidget *, gpointer); +void file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); void file_open_cmd_callback (GtkWidget *, gpointer); void file_save_cmd_callback (GtkWidget *, gpointer); void file_save_as_cmd_callback (GtkWidget *, gpointer); @@ -80,8 +82,12 @@ void layers_mask_select_cmd_callback (GtkWidget *, gpointer); void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer); void tools_default_colors_cmd_callback (GtkWidget *, gpointer); void tools_swap_colors_cmd_callback (GtkWidget *, gpointer); -void tools_select_cmd_callback (GtkWidget *, gpointer); -void filters_repeat_cmd_callback (GtkWidget *, gpointer); +void tools_select_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); +void filters_repeat_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); void dialogs_brushes_cmd_callback (GtkWidget *, gpointer); void dialogs_patterns_cmd_callback (GtkWidget *, gpointer); void dialogs_palette_cmd_callback (GtkWidget *, gpointer); diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index d2aeb537b5..f79dfa8236 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -565,7 +565,7 @@ create_toolbox () GtkWidget *vbox; GtkWidget *menubar; GList *device_list; - GtkAcceleratorTable *table; + GtkAccelGroup *table; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_wmclass (GTK_WINDOW (window), "toolbox", "Gimp"); @@ -626,7 +626,7 @@ create_toolbox () gtk_widget_show (menubar); /* Install the accelerator table in the main window */ - gtk_window_add_accelerator_table (GTK_WINDOW (window), table); + gtk_window_add_accel_group (GTK_WINDOW (window), table); vbox = gtk_vbox_new (FALSE, 1); gtk_box_pack_start (GTK_BOX (main_vbox), vbox, TRUE, TRUE, 0); @@ -673,7 +673,7 @@ create_display_shell (int gdisp_id, int type) { static GtkWidget *image_popup_menu = NULL; - static GtkAcceleratorTable *image_accelerator_table = NULL; + static GtkAccelGroup *image_accel_group = NULL; GDisplay *gdisp; GtkWidget *table; int n_width, n_height; @@ -798,13 +798,13 @@ create_display_shell (int gdisp_id, GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); if (! image_popup_menu) - menus_get_image_menu (&image_popup_menu, &image_accelerator_table); + menus_get_image_menu (&image_popup_menu, &image_accel_group); /* the popup menu */ gdisp->popup = image_popup_menu; /* the accelerator table for images */ - gtk_window_add_accelerator_table (GTK_WINDOW (gdisp->shell), image_accelerator_table); + gtk_window_add_accel_group (GTK_WINDOW (gdisp->shell), image_accel_group); gtk_widget_show (gdisp->hsb); gtk_widget_show (gdisp->vsb); diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index d2aeb537b5..f79dfa8236 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -565,7 +565,7 @@ create_toolbox () GtkWidget *vbox; GtkWidget *menubar; GList *device_list; - GtkAcceleratorTable *table; + GtkAccelGroup *table; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_wmclass (GTK_WINDOW (window), "toolbox", "Gimp"); @@ -626,7 +626,7 @@ create_toolbox () gtk_widget_show (menubar); /* Install the accelerator table in the main window */ - gtk_window_add_accelerator_table (GTK_WINDOW (window), table); + gtk_window_add_accel_group (GTK_WINDOW (window), table); vbox = gtk_vbox_new (FALSE, 1); gtk_box_pack_start (GTK_BOX (main_vbox), vbox, TRUE, TRUE, 0); @@ -673,7 +673,7 @@ create_display_shell (int gdisp_id, int type) { static GtkWidget *image_popup_menu = NULL; - static GtkAcceleratorTable *image_accelerator_table = NULL; + static GtkAccelGroup *image_accel_group = NULL; GDisplay *gdisp; GtkWidget *table; int n_width, n_height; @@ -798,13 +798,13 @@ create_display_shell (int gdisp_id, GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); if (! image_popup_menu) - menus_get_image_menu (&image_popup_menu, &image_accelerator_table); + menus_get_image_menu (&image_popup_menu, &image_accel_group); /* the popup menu */ gdisp->popup = image_popup_menu; /* the accelerator table for images */ - gtk_window_add_accelerator_table (GTK_WINDOW (gdisp->shell), image_accelerator_table); + gtk_window_add_accel_group (GTK_WINDOW (gdisp->shell), image_accel_group); gtk_widget_show (gdisp->hsb); gtk_widget_show (gdisp->vsb); diff --git a/app/gimprc.c b/app/gimprc.c index d491553ca4..d5f06a6cc3 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -1339,7 +1339,7 @@ parse_menu_path (gpointer val1p, goto error; token = get_next_token (); - menus_add_path (menu_path, accelerator); + // FIXME menus_add_path (menu_path, accelerator); return OK; diff --git a/app/gradient.c b/app/gradient.c index ba4b1fdd93..919a40fe24 100644 --- a/app/gradient.c +++ b/app/gradient.c @@ -320,7 +320,7 @@ typedef struct { GtkWidget *control_coloring_popup; /* Coloring type menu */ GtkWidget *control_sel_ops_popup; /* Selection ops menu */ - GtkAcceleratorTable *accelerator_table; + GtkAccelGroup *accel_group; /* Blending and coloring menus */ @@ -1015,7 +1015,7 @@ grad_create_gradient_editor(void) g_editor->control_coloring_popup = NULL; g_editor->control_sel_ops_popup = NULL; - g_editor->accelerator_table = NULL; + g_editor->accel_group = NULL; for (i = 0; i < (sizeof(g_editor->control_blending_items) / sizeof(g_editor->control_blending_items[0])); @@ -2871,16 +2871,15 @@ cpopup_create_main_menu(void) GtkWidget *menu; GtkWidget *menuitem; GtkWidget *label; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; menu = gtk_menu_new(); - acc_table = gtk_accelerator_table_new(); + accel_group = gtk_accel_group_new(); - g_editor->accelerator_table = acc_table; + g_editor->accel_group = accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); - gtk_window_add_accelerator_table(GTK_WINDOW(g_editor->shell), acc_table); - gtk_window_add_accelerator_table(GTK_WINDOW(g_editor->shell), acc_table); + gtk_menu_set_accel_group (GTK_MENU(menu), accel_group); + gtk_window_add_accel_group (GTK_WINDOW (g_editor->shell), accel_group); /* Left endpoint */ @@ -2891,7 +2890,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'L', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'L', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Load from"); g_editor->control_left_load_popup = cpopup_create_load_menu(g_editor->left_load_color_boxes, @@ -2929,7 +2932,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'R', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'R', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Load from"); g_editor->control_right_load_popup = cpopup_create_load_menu(g_editor->right_load_color_boxes, @@ -2988,7 +2995,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'S', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'S', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Split uniformly */ @@ -2998,7 +3009,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'U', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'U', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Delete */ @@ -3009,7 +3024,11 @@ cpopup_create_main_menu(void) gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); g_editor->control_delete_menu_item = menuitem; - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'D', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'D', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Recenter */ @@ -3019,7 +3038,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'C', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'C', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Redistribute */ @@ -3029,7 +3052,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'C', GDK_CONTROL_MASK); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'C', GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Selection ops */ @@ -3376,17 +3403,18 @@ static GtkWidget * cpopup_create_menu_item_with_label(char *str, GtkWidget **label) { GtkWidget *menuitem; - GtkWidget *wlabel; + GtkWidget *accel_label; menuitem = gtk_menu_item_new(); - wlabel = gtk_label_new(str); - gtk_misc_set_alignment(GTK_MISC(wlabel), 0.0, 0.5); - gtk_container_add(GTK_CONTAINER(menuitem), wlabel); - gtk_widget_show(wlabel); + accel_label = gtk_accel_label_new(str); + gtk_misc_set_alignment(GTK_MISC(accel_label), 0.0, 0.5); + gtk_container_add(GTK_CONTAINER(menuitem), accel_label); + gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), menuitem); + gtk_widget_show(accel_label); if (label) - *label = wlabel; + *label = accel_label; return menuitem; } /* cpopup_create_menu_item_with_label */ @@ -3476,13 +3504,13 @@ cpopup_create_load_menu(GtkWidget **color_boxes, GtkWidget **labels, { GtkWidget *menu; GtkWidget *menuitem; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; int i; menu = gtk_menu_new(); - acc_table = g_editor->accelerator_table; + accel_group = g_editor->accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); + gtk_menu_set_accel_group (GTK_MENU (menu), accel_group); /* Create items */ @@ -3502,23 +3530,32 @@ cpopup_create_load_menu(GtkWidget **color_boxes, GtkWidget **labels, gtk_widget_show(menuitem); switch (i) { - case 0: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_0, accel_mods_0); - break; - - case 1: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_1, accel_mods_1); - break; - - case 2: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_2, accel_mods_2); - break; - - default: - break; + case 0: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_0, accel_mods_0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + case 1: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_1, accel_mods_1, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + case 2: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_2, accel_mods_2, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + default: + break; } /* switch */ } /* for */ @@ -3886,12 +3923,12 @@ cpopup_create_sel_ops_menu(void) { GtkWidget *menu; GtkWidget *menuitem; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; menu = gtk_menu_new(); - acc_table = g_editor->accelerator_table; + accel_group = g_editor->accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); + gtk_menu_set_accel_group (GTK_MENU (menu), accel_group); /* Flip */ @@ -3901,7 +3938,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'F', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'F', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Replicate */ @@ -3911,7 +3952,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'M', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'M', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Blend colors / opacity */ @@ -3926,7 +3971,11 @@ cpopup_create_sel_ops_menu(void) gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); g_editor->control_blend_colors_menu_item = menuitem; - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'B', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'B', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Blend endpoints' opacity"); gtk_signal_connect(GTK_OBJECT(menuitem), "activate", @@ -3934,7 +3983,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'B', GDK_CONTROL_MASK); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'B', GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); g_editor->control_blend_opacity_menu_item = menuitem; return menu; diff --git a/app/gradient_editor.c b/app/gradient_editor.c index ba4b1fdd93..919a40fe24 100644 --- a/app/gradient_editor.c +++ b/app/gradient_editor.c @@ -320,7 +320,7 @@ typedef struct { GtkWidget *control_coloring_popup; /* Coloring type menu */ GtkWidget *control_sel_ops_popup; /* Selection ops menu */ - GtkAcceleratorTable *accelerator_table; + GtkAccelGroup *accel_group; /* Blending and coloring menus */ @@ -1015,7 +1015,7 @@ grad_create_gradient_editor(void) g_editor->control_coloring_popup = NULL; g_editor->control_sel_ops_popup = NULL; - g_editor->accelerator_table = NULL; + g_editor->accel_group = NULL; for (i = 0; i < (sizeof(g_editor->control_blending_items) / sizeof(g_editor->control_blending_items[0])); @@ -2871,16 +2871,15 @@ cpopup_create_main_menu(void) GtkWidget *menu; GtkWidget *menuitem; GtkWidget *label; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; menu = gtk_menu_new(); - acc_table = gtk_accelerator_table_new(); + accel_group = gtk_accel_group_new(); - g_editor->accelerator_table = acc_table; + g_editor->accel_group = accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); - gtk_window_add_accelerator_table(GTK_WINDOW(g_editor->shell), acc_table); - gtk_window_add_accelerator_table(GTK_WINDOW(g_editor->shell), acc_table); + gtk_menu_set_accel_group (GTK_MENU(menu), accel_group); + gtk_window_add_accel_group (GTK_WINDOW (g_editor->shell), accel_group); /* Left endpoint */ @@ -2891,7 +2890,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'L', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'L', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Load from"); g_editor->control_left_load_popup = cpopup_create_load_menu(g_editor->left_load_color_boxes, @@ -2929,7 +2932,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'R', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'R', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Load from"); g_editor->control_right_load_popup = cpopup_create_load_menu(g_editor->right_load_color_boxes, @@ -2988,7 +2995,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'S', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'S', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Split uniformly */ @@ -2998,7 +3009,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'U', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'U', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Delete */ @@ -3009,7 +3024,11 @@ cpopup_create_main_menu(void) gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); g_editor->control_delete_menu_item = menuitem; - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'D', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'D', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Recenter */ @@ -3019,7 +3038,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'C', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'C', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Redistribute */ @@ -3029,7 +3052,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'C', GDK_CONTROL_MASK); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'C', GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Selection ops */ @@ -3376,17 +3403,18 @@ static GtkWidget * cpopup_create_menu_item_with_label(char *str, GtkWidget **label) { GtkWidget *menuitem; - GtkWidget *wlabel; + GtkWidget *accel_label; menuitem = gtk_menu_item_new(); - wlabel = gtk_label_new(str); - gtk_misc_set_alignment(GTK_MISC(wlabel), 0.0, 0.5); - gtk_container_add(GTK_CONTAINER(menuitem), wlabel); - gtk_widget_show(wlabel); + accel_label = gtk_accel_label_new(str); + gtk_misc_set_alignment(GTK_MISC(accel_label), 0.0, 0.5); + gtk_container_add(GTK_CONTAINER(menuitem), accel_label); + gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), menuitem); + gtk_widget_show(accel_label); if (label) - *label = wlabel; + *label = accel_label; return menuitem; } /* cpopup_create_menu_item_with_label */ @@ -3476,13 +3504,13 @@ cpopup_create_load_menu(GtkWidget **color_boxes, GtkWidget **labels, { GtkWidget *menu; GtkWidget *menuitem; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; int i; menu = gtk_menu_new(); - acc_table = g_editor->accelerator_table; + accel_group = g_editor->accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); + gtk_menu_set_accel_group (GTK_MENU (menu), accel_group); /* Create items */ @@ -3502,23 +3530,32 @@ cpopup_create_load_menu(GtkWidget **color_boxes, GtkWidget **labels, gtk_widget_show(menuitem); switch (i) { - case 0: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_0, accel_mods_0); - break; - - case 1: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_1, accel_mods_1); - break; - - case 2: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_2, accel_mods_2); - break; - - default: - break; + case 0: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_0, accel_mods_0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + case 1: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_1, accel_mods_1, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + case 2: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_2, accel_mods_2, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + default: + break; } /* switch */ } /* for */ @@ -3886,12 +3923,12 @@ cpopup_create_sel_ops_menu(void) { GtkWidget *menu; GtkWidget *menuitem; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; menu = gtk_menu_new(); - acc_table = g_editor->accelerator_table; + accel_group = g_editor->accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); + gtk_menu_set_accel_group (GTK_MENU (menu), accel_group); /* Flip */ @@ -3901,7 +3938,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'F', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'F', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Replicate */ @@ -3911,7 +3952,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'M', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'M', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Blend colors / opacity */ @@ -3926,7 +3971,11 @@ cpopup_create_sel_ops_menu(void) gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); g_editor->control_blend_colors_menu_item = menuitem; - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'B', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'B', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Blend endpoints' opacity"); gtk_signal_connect(GTK_OBJECT(menuitem), "activate", @@ -3934,7 +3983,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'B', GDK_CONTROL_MASK); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'B', GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); g_editor->control_blend_opacity_menu_item = menuitem; return menu; diff --git a/app/gui/channels-dialog.c b/app/gui/channels-dialog.c index ef1207a50a..a3ed80f0b0 100644 --- a/app/gui/channels-dialog.c +++ b/app/gui/channels-dialog.c @@ -92,7 +92,7 @@ struct _ChannelsDialog { GtkWidget *channel_list; GtkWidget *preview; GtkWidget *ops_menu; - GtkAcceleratorTable *accel_table; + GtkAccelGroup *accel_group; int num_components; int base_type; @@ -204,7 +204,7 @@ channels_dialog_create () channelsD->active_channel = NULL; channelsD->floating_sel = NULL; channelsD->channel_widgets = NULL; - channelsD->accel_table = gtk_accelerator_table_new (); + channelsD->accel_group = gtk_accel_group_new (); if (preview_size) { @@ -217,7 +217,7 @@ channels_dialog_create () gtk_container_border_width (GTK_CONTAINER (vbox), 2); /* The layers commands pulldown menu */ - channelsD->ops_menu = build_menu (channels_ops, channelsD->accel_table); + channelsD->ops_menu = build_menu (channels_ops, channelsD->accel_group); /* The channels listbox */ listbox = gtk_scrolled_window_new (NULL, NULL); @@ -830,8 +830,8 @@ channels_dialog_map_callback (GtkWidget *w, if (!channelsD) return; - gtk_window_add_accelerator_table (GTK_WINDOW (lc_shell), - channelsD->accel_table); + gtk_window_add_accel_group (GTK_WINDOW (lc_shell), + channelsD->accel_group); } static void @@ -841,8 +841,8 @@ channels_dialog_unmap_callback (GtkWidget *w, if (!channelsD) return; - gtk_window_remove_accelerator_table (GTK_WINDOW (lc_shell), - channelsD->accel_table); + gtk_window_remove_accel_group (GTK_WINDOW (lc_shell), + channelsD->accel_group); } static void diff --git a/app/gui/commands.c b/app/gui/commands.c index 9323a9d8f8..481738db00 100644 --- a/app/gui/commands.c +++ b/app/gui/commands.c @@ -373,7 +373,6 @@ file_new_resolution_callback (GtkWidget *widget, gchar *newvalue; NewImageValues *vals; - float new_resolution; float temp_units; float temp_pixels; char buffer[12]; @@ -406,8 +405,9 @@ file_new_resolution_callback (GtkWidget *widget, } void -file_new_cmd_callback (GtkWidget *widget, - gpointer client_data) +file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { GDisplay *gdisp; NewImageValues *vals; @@ -418,7 +418,6 @@ file_new_cmd_callback (GtkWidget *widget, GtkWidget *table; GtkWidget *frame; GtkWidget *radio_box; - GtkWidget *units_box; GtkWidget *menu; GtkWidget *menuitem; GtkWidget *optionmenu; @@ -439,7 +438,7 @@ file_new_cmd_callback (GtkWidget *widget, /* Before we try to determine the responsible gdisplay, * make sure this wasn't called from the toolbox */ - if ((long) client_data) + if (callback_action) gdisp = gdisplay_active (); else gdisp = NULL; @@ -2621,13 +2620,14 @@ tools_swap_colors_cmd_callback (GtkWidget *widget, } void -tools_select_cmd_callback (GtkWidget *widget, - gpointer client_data) +tools_select_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { GDisplay * gdisp; /* Activate the approriate widget */ - gtk_widget_activate (tool_widgets[tool_info[(long) client_data].toolbar_position]); + gtk_widget_activate (tool_widgets[tool_info[callback_action].toolbar_position]); gdisp = gdisplay_active (); @@ -2635,10 +2635,11 @@ tools_select_cmd_callback (GtkWidget *widget, } void -filters_repeat_cmd_callback (GtkWidget *widget, - gpointer client_data) +filters_repeat_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { - plug_in_repeat ((long) client_data); + plug_in_repeat (callback_action); } void diff --git a/app/gui/commands.h b/app/gui/commands.h index 645262543a..cc25ce75f6 100644 --- a/app/gui/commands.h +++ b/app/gui/commands.h @@ -4,7 +4,9 @@ #include "gtk/gtk.h" -void file_new_cmd_callback (GtkWidget *, gpointer); +void file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); void file_open_cmd_callback (GtkWidget *, gpointer); void file_save_cmd_callback (GtkWidget *, gpointer); void file_save_as_cmd_callback (GtkWidget *, gpointer); @@ -80,8 +82,12 @@ void layers_mask_select_cmd_callback (GtkWidget *, gpointer); void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer); void tools_default_colors_cmd_callback (GtkWidget *, gpointer); void tools_swap_colors_cmd_callback (GtkWidget *, gpointer); -void tools_select_cmd_callback (GtkWidget *, gpointer); -void filters_repeat_cmd_callback (GtkWidget *, gpointer); +void tools_select_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); +void filters_repeat_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); void dialogs_brushes_cmd_callback (GtkWidget *, gpointer); void dialogs_patterns_cmd_callback (GtkWidget *, gpointer); void dialogs_palette_cmd_callback (GtkWidget *, gpointer); diff --git a/app/gui/gradient-editor.c b/app/gui/gradient-editor.c index ba4b1fdd93..919a40fe24 100644 --- a/app/gui/gradient-editor.c +++ b/app/gui/gradient-editor.c @@ -320,7 +320,7 @@ typedef struct { GtkWidget *control_coloring_popup; /* Coloring type menu */ GtkWidget *control_sel_ops_popup; /* Selection ops menu */ - GtkAcceleratorTable *accelerator_table; + GtkAccelGroup *accel_group; /* Blending and coloring menus */ @@ -1015,7 +1015,7 @@ grad_create_gradient_editor(void) g_editor->control_coloring_popup = NULL; g_editor->control_sel_ops_popup = NULL; - g_editor->accelerator_table = NULL; + g_editor->accel_group = NULL; for (i = 0; i < (sizeof(g_editor->control_blending_items) / sizeof(g_editor->control_blending_items[0])); @@ -2871,16 +2871,15 @@ cpopup_create_main_menu(void) GtkWidget *menu; GtkWidget *menuitem; GtkWidget *label; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; menu = gtk_menu_new(); - acc_table = gtk_accelerator_table_new(); + accel_group = gtk_accel_group_new(); - g_editor->accelerator_table = acc_table; + g_editor->accel_group = accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); - gtk_window_add_accelerator_table(GTK_WINDOW(g_editor->shell), acc_table); - gtk_window_add_accelerator_table(GTK_WINDOW(g_editor->shell), acc_table); + gtk_menu_set_accel_group (GTK_MENU(menu), accel_group); + gtk_window_add_accel_group (GTK_WINDOW (g_editor->shell), accel_group); /* Left endpoint */ @@ -2891,7 +2890,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'L', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'L', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Load from"); g_editor->control_left_load_popup = cpopup_create_load_menu(g_editor->left_load_color_boxes, @@ -2929,7 +2932,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'R', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'R', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Load from"); g_editor->control_right_load_popup = cpopup_create_load_menu(g_editor->right_load_color_boxes, @@ -2988,7 +2995,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'S', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'S', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Split uniformly */ @@ -2998,7 +3009,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'U', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'U', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Delete */ @@ -3009,7 +3024,11 @@ cpopup_create_main_menu(void) gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); g_editor->control_delete_menu_item = menuitem; - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'D', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'D', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Recenter */ @@ -3019,7 +3038,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'C', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'C', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Redistribute */ @@ -3029,7 +3052,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'C', GDK_CONTROL_MASK); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'C', GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Selection ops */ @@ -3376,17 +3403,18 @@ static GtkWidget * cpopup_create_menu_item_with_label(char *str, GtkWidget **label) { GtkWidget *menuitem; - GtkWidget *wlabel; + GtkWidget *accel_label; menuitem = gtk_menu_item_new(); - wlabel = gtk_label_new(str); - gtk_misc_set_alignment(GTK_MISC(wlabel), 0.0, 0.5); - gtk_container_add(GTK_CONTAINER(menuitem), wlabel); - gtk_widget_show(wlabel); + accel_label = gtk_accel_label_new(str); + gtk_misc_set_alignment(GTK_MISC(accel_label), 0.0, 0.5); + gtk_container_add(GTK_CONTAINER(menuitem), accel_label); + gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), menuitem); + gtk_widget_show(accel_label); if (label) - *label = wlabel; + *label = accel_label; return menuitem; } /* cpopup_create_menu_item_with_label */ @@ -3476,13 +3504,13 @@ cpopup_create_load_menu(GtkWidget **color_boxes, GtkWidget **labels, { GtkWidget *menu; GtkWidget *menuitem; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; int i; menu = gtk_menu_new(); - acc_table = g_editor->accelerator_table; + accel_group = g_editor->accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); + gtk_menu_set_accel_group (GTK_MENU (menu), accel_group); /* Create items */ @@ -3502,23 +3530,32 @@ cpopup_create_load_menu(GtkWidget **color_boxes, GtkWidget **labels, gtk_widget_show(menuitem); switch (i) { - case 0: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_0, accel_mods_0); - break; - - case 1: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_1, accel_mods_1); - break; - - case 2: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_2, accel_mods_2); - break; - - default: - break; + case 0: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_0, accel_mods_0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + case 1: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_1, accel_mods_1, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + case 2: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_2, accel_mods_2, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + default: + break; } /* switch */ } /* for */ @@ -3886,12 +3923,12 @@ cpopup_create_sel_ops_menu(void) { GtkWidget *menu; GtkWidget *menuitem; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; menu = gtk_menu_new(); - acc_table = g_editor->accelerator_table; + accel_group = g_editor->accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); + gtk_menu_set_accel_group (GTK_MENU (menu), accel_group); /* Flip */ @@ -3901,7 +3938,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'F', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'F', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Replicate */ @@ -3911,7 +3952,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'M', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'M', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Blend colors / opacity */ @@ -3926,7 +3971,11 @@ cpopup_create_sel_ops_menu(void) gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); g_editor->control_blend_colors_menu_item = menuitem; - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'B', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'B', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Blend endpoints' opacity"); gtk_signal_connect(GTK_OBJECT(menuitem), "activate", @@ -3934,7 +3983,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'B', GDK_CONTROL_MASK); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'B', GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); g_editor->control_blend_opacity_menu_item = menuitem; return menu; diff --git a/app/gui/help-commands.c b/app/gui/help-commands.c index 9323a9d8f8..481738db00 100644 --- a/app/gui/help-commands.c +++ b/app/gui/help-commands.c @@ -373,7 +373,6 @@ file_new_resolution_callback (GtkWidget *widget, gchar *newvalue; NewImageValues *vals; - float new_resolution; float temp_units; float temp_pixels; char buffer[12]; @@ -406,8 +405,9 @@ file_new_resolution_callback (GtkWidget *widget, } void -file_new_cmd_callback (GtkWidget *widget, - gpointer client_data) +file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { GDisplay *gdisp; NewImageValues *vals; @@ -418,7 +418,6 @@ file_new_cmd_callback (GtkWidget *widget, GtkWidget *table; GtkWidget *frame; GtkWidget *radio_box; - GtkWidget *units_box; GtkWidget *menu; GtkWidget *menuitem; GtkWidget *optionmenu; @@ -439,7 +438,7 @@ file_new_cmd_callback (GtkWidget *widget, /* Before we try to determine the responsible gdisplay, * make sure this wasn't called from the toolbox */ - if ((long) client_data) + if (callback_action) gdisp = gdisplay_active (); else gdisp = NULL; @@ -2621,13 +2620,14 @@ tools_swap_colors_cmd_callback (GtkWidget *widget, } void -tools_select_cmd_callback (GtkWidget *widget, - gpointer client_data) +tools_select_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { GDisplay * gdisp; /* Activate the approriate widget */ - gtk_widget_activate (tool_widgets[tool_info[(long) client_data].toolbar_position]); + gtk_widget_activate (tool_widgets[tool_info[callback_action].toolbar_position]); gdisp = gdisplay_active (); @@ -2635,10 +2635,11 @@ tools_select_cmd_callback (GtkWidget *widget, } void -filters_repeat_cmd_callback (GtkWidget *widget, - gpointer client_data) +filters_repeat_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action) { - plug_in_repeat ((long) client_data); + plug_in_repeat (callback_action); } void diff --git a/app/gui/help-commands.h b/app/gui/help-commands.h index 645262543a..cc25ce75f6 100644 --- a/app/gui/help-commands.h +++ b/app/gui/help-commands.h @@ -4,7 +4,9 @@ #include "gtk/gtk.h" -void file_new_cmd_callback (GtkWidget *, gpointer); +void file_new_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); void file_open_cmd_callback (GtkWidget *, gpointer); void file_save_cmd_callback (GtkWidget *, gpointer); void file_save_as_cmd_callback (GtkWidget *, gpointer); @@ -80,8 +82,12 @@ void layers_mask_select_cmd_callback (GtkWidget *, gpointer); void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer); void tools_default_colors_cmd_callback (GtkWidget *, gpointer); void tools_swap_colors_cmd_callback (GtkWidget *, gpointer); -void tools_select_cmd_callback (GtkWidget *, gpointer); -void filters_repeat_cmd_callback (GtkWidget *, gpointer); +void tools_select_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); +void filters_repeat_cmd_callback (GtkWidget *widget, + gpointer callback_data, + guint callback_action); void dialogs_brushes_cmd_callback (GtkWidget *, gpointer); void dialogs_patterns_cmd_callback (GtkWidget *, gpointer); void dialogs_palette_cmd_callback (GtkWidget *, gpointer); diff --git a/app/gui/layers-dialog.c b/app/gui/layers-dialog.c index d53c355241..2cf4ceded7 100644 --- a/app/gui/layers-dialog.c +++ b/app/gui/layers-dialog.c @@ -87,7 +87,7 @@ struct _LayersDialog { GtkWidget *mode_box; GtkWidget *opacity_box; GtkWidget *ops_menu; - GtkAcceleratorTable *accel_table; + GtkAccelGroup *accel_group; GtkAdjustment *opacity_data; GdkGC *red_gc; /* for non-applied layer masks */ GdkGC *green_gc; /* for visible layer masks */ @@ -629,7 +629,7 @@ layers_dialog_create () layersD->active_channel = NULL; layersD->floating_sel = NULL; layersD->layer_widgets = NULL; - layersD->accel_table = gtk_accelerator_table_new (); + layersD->accel_group = gtk_accel_group_new (); layersD->green_gc = NULL; layersD->red_gc = NULL; @@ -644,7 +644,7 @@ layers_dialog_create () gtk_container_border_width (GTK_CONTAINER (vbox), 2); /* The layers commands pulldown menu */ - layersD->ops_menu = build_menu (layers_ops, layersD->accel_table); + layersD->ops_menu = build_menu (layers_ops, layersD->accel_group); /* The Mode option menu, and the preserve transparency */ layersD->mode_box = util_box = gtk_hbox_new (FALSE, 1); @@ -1527,9 +1527,9 @@ layers_dialog_map_callback (GtkWidget *w, { if (!layersD) return; - - gtk_window_add_accelerator_table (GTK_WINDOW (lc_shell), - layersD->accel_table); + + gtk_window_add_accel_group (GTK_WINDOW (lc_shell), + layersD->accel_group); } static void @@ -1538,9 +1538,9 @@ layers_dialog_unmap_callback (GtkWidget *w, { if (!layersD) return; - - gtk_window_remove_accelerator_table (GTK_WINDOW (lc_shell), - layersD->accel_table); + + gtk_window_remove_accel_group (GTK_WINDOW (lc_shell), + layersD->accel_group); } static void diff --git a/app/gui/menus.c b/app/gui/menus.c index 86a0f91e0d..6483ca3781 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -32,324 +32,298 @@ #include "gdisplay.h" static void menus_init (void); -static void menus_foreach (gpointer key, - gpointer value, - gpointer user_data); -static gint menus_install_accel (GtkWidget *widget, - gchar *signal_name, - gchar key, - gchar modifiers, - gchar *path); -static void menus_remove_accel (GtkWidget *widget, - gchar *signal_name, - gchar *path); -static GtkMenuEntry menu_items[] = +static GtkItemFactoryEntry toolbox_entries[] = { - { "/File/New", "N", file_new_cmd_callback, NULL }, - { "/File/Open", "O", file_open_cmd_callback, NULL }, - { "/File/About...", NULL, about_dialog_cmd_callback, NULL }, - { "/File/Preferences...", NULL, file_pref_cmd_callback, NULL }, - { "/File/Tip of the day", NULL, tips_dialog_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - { "/File/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, NULL }, - { "/File/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, NULL }, - { "/File/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, NULL }, - { "/File/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, NULL }, - { "/File/Dialogs/Tool Options...", "T", dialogs_tools_options_cmd_callback, NULL }, - { "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, NULL }, - { "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, NULL }, - - { "/File/",NULL,NULL,NULL}, - - { "/File/Quit", "Q", file_quit_cmd_callback, NULL }, - - { "/File/New", "N", file_new_cmd_callback, (gpointer) 1 }, - { "/File/Open", "O", file_open_cmd_callback, NULL }, - { "/File/Save", "S", file_save_cmd_callback, NULL }, - { "/File/Save as", NULL, file_save_as_cmd_callback, NULL }, - { "/File/Preferences...", NULL, file_pref_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - - - { "/File/Close", "W", file_close_cmd_callback, NULL }, - { "/File/Quit", "Q", file_quit_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - - { "/Edit/Cut", "X", edit_cut_cmd_callback, NULL }, - { "/Edit/Copy", "C", edit_copy_cmd_callback, NULL }, - { "/Edit/Paste", "V", edit_paste_cmd_callback, NULL }, - { "/Edit/Paste Into", NULL, edit_paste_into_cmd_callback, NULL }, - { "/Edit/Clear", "K", edit_clear_cmd_callback, NULL }, - { "/Edit/Fill", ".", edit_fill_cmd_callback, NULL }, - { "/Edit/Stroke", NULL, edit_stroke_cmd_callback, NULL }, - { "/Edit/Undo", "Z", edit_undo_cmd_callback, NULL }, - { "/Edit/Redo", "R", edit_redo_cmd_callback, NULL }, - { "/Edit/", NULL, NULL, NULL }, - { "/Edit/Cut Named", "X", edit_named_cut_cmd_callback, NULL }, - { "/Edit/Copy Named", "C", edit_named_copy_cmd_callback, NULL }, - { "/Edit/Paste Named", "V", edit_named_paste_cmd_callback, NULL }, - { "/Edit/", NULL, NULL, NULL }, - - { "/Select/Toggle", "T", select_toggle_cmd_callback, NULL }, - { "/Select/Invert", "I", select_invert_cmd_callback, NULL }, - { "/Select/All", "A", select_all_cmd_callback, NULL }, - { "/Select/None", "A", select_none_cmd_callback, NULL }, - { "/Select/Float", "L", select_float_cmd_callback, NULL }, - { "/Select/Sharpen", "H", select_sharpen_cmd_callback, NULL }, - { "/Select/Border", "B", select_border_cmd_callback, NULL }, - { "/Select/Feather", "F", select_feather_cmd_callback, NULL }, - { "/Select/Grow", NULL, select_grow_cmd_callback, NULL }, - { "/Select/Shrink", NULL, select_shrink_cmd_callback, NULL }, - { "/Select/Save To Channel", NULL, select_save_cmd_callback, NULL }, - { "/Select/By Color...", NULL, select_by_color_cmd_callback, NULL }, - - { "/View/Zoom In", "=", view_zoomin_cmd_callback, NULL }, - { "/View/Zoom Out", "-", view_zoomout_cmd_callback, NULL }, - { "/View/Zoom/16:1", NULL, view_zoom_16_1_callback, NULL }, - { "/View/Zoom/8:1", NULL, view_zoom_8_1_callback, NULL }, - { "/View/Zoom/4:1", NULL, view_zoom_4_1_callback, NULL }, - { "/View/Zoom/2:1", NULL, view_zoom_2_1_callback, NULL }, - { "/View/Zoom/1:1", "1", view_zoom_1_1_callback, NULL }, - { "/View/Zoom/1:2", NULL, view_zoom_1_2_callback, NULL }, - { "/View/Zoom/1:4", NULL, view_zoom_1_4_callback, NULL }, - { "/View/Zoom/1:8", NULL, view_zoom_1_8_callback, NULL }, - { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, NULL }, - { "/View/Window Info...", "I", view_window_info_cmd_callback, NULL }, - { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, NULL }, - { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, NULL }, - { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, NULL }, - { "/View/", NULL, NULL, NULL }, - { "/View/New View", NULL, view_new_view_cmd_callback, NULL }, - { "/View/Shrink Wrap", "E", view_shrink_wrap_cmd_callback, NULL }, - - { "/Image/Colors/Equalize", NULL, image_equalize_cmd_callback, NULL }, - { "/Image/Colors/Invert", NULL, image_invert_cmd_callback, NULL }, - { "/Image/Colors/Posterize", NULL, image_posterize_cmd_callback, NULL }, - { "/Image/Colors/Threshold", NULL, image_threshold_cmd_callback, NULL }, - { "/Image/Colors/", NULL, NULL, NULL }, - { "/Image/Colors/Color Balance", NULL, image_color_balance_cmd_callback, NULL }, - { "/Image/Colors/Brightness-Contrast", NULL, image_brightness_contrast_cmd_callback, NULL }, - { "/Image/Colors/Hue-Saturation", NULL, image_hue_saturation_cmd_callback, NULL }, - { "/Image/Colors/Curves", NULL, image_curves_cmd_callback, NULL }, - { "/Image/Colors/Levels", NULL, image_levels_cmd_callback, NULL }, - { "/Image/Colors/", NULL, NULL, NULL }, - { "/Image/Colors/Desaturate", NULL, image_desaturate_cmd_callback, NULL }, - { "/Image/Channel Ops/Duplicate", "D", channel_ops_duplicate_cmd_callback, NULL }, - { "/Image/Channel Ops/Offset", "O", channel_ops_offset_cmd_callback, NULL }, - { "/Image/Alpha/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, NULL }, - - { "/Image/", NULL, NULL, NULL }, - { "/Image/RGB", NULL, image_convert_rgb_cmd_callback, NULL }, - { "/Image/Grayscale", NULL, image_convert_grayscale_cmd_callback, NULL }, - { "/Image/Indexed", NULL, image_convert_indexed_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - { "/Image/Resize", NULL, image_resize_cmd_callback, NULL }, - { "/Image/Scale", NULL, image_scale_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - { "/Image/Histogram", NULL, image_histogram_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - - { "/Layers/Layers & Channels...", "L", dialogs_lc_cmd_callback, NULL }, - { "/Layers/Raise Layer", "F", layers_raise_cmd_callback, NULL }, - { "/Layers/Lower Layer", "B", layers_lower_cmd_callback, NULL }, - { "/Layers/Anchor Layer", "H", layers_anchor_cmd_callback, NULL }, - { "/Layers/Merge Visible Layers", "M", layers_merge_cmd_callback, NULL }, - { "/Layers/Flatten Image", NULL, layers_flatten_cmd_callback, NULL }, - { "/Layers/Alpha To Selection", NULL, layers_alpha_select_cmd_callback, NULL }, - { "/Layers/Mask To Selection", NULL, layers_mask_select_cmd_callback, NULL }, - { "/Layers/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, NULL }, - - { "/Tools/Rect Select", "R", tools_select_cmd_callback, (gpointer) RECT_SELECT }, - { "/Tools/Ellipse Select", "E", tools_select_cmd_callback, (gpointer) ELLIPSE_SELECT }, - { "/Tools/Free Select", "F", tools_select_cmd_callback, (gpointer) FREE_SELECT }, - { "/Tools/Fuzzy Select", "Z", tools_select_cmd_callback, (gpointer) FUZZY_SELECT }, - { "/Tools/Bezier Select", "B", tools_select_cmd_callback, (gpointer) BEZIER_SELECT }, - { "/Tools/Intelligent Scissors", "I", tools_select_cmd_callback, (gpointer) ISCISSORS }, - { "/Tools/Move", "M", tools_select_cmd_callback, (gpointer) MOVE }, - { "/Tools/Magnify", "M", tools_select_cmd_callback, (gpointer) MAGNIFY }, - { "/Tools/Crop", "C", tools_select_cmd_callback, (gpointer) CROP }, - { "/Tools/Transform", "T", tools_select_cmd_callback, (gpointer) ROTATE }, - { "/Tools/Flip", "F", tools_select_cmd_callback, (gpointer) FLIP_HORZ }, - { "/Tools/Text", "T", tools_select_cmd_callback, (gpointer) TEXT }, - { "/Tools/Color Picker", "O", tools_select_cmd_callback, (gpointer) COLOR_PICKER }, - { "/Tools/Bucket Fill", "B", tools_select_cmd_callback, (gpointer) BUCKET_FILL }, - { "/Tools/Blend", "L", tools_select_cmd_callback, (gpointer) BLEND }, - { "/Tools/Paintbrush", "P", tools_select_cmd_callback, (gpointer) PAINTBRUSH }, - { "/Tools/Pencil", "P", tools_select_cmd_callback, (gpointer) PENCIL }, - { "/Tools/Eraser", "E", tools_select_cmd_callback, (gpointer) ERASER }, - { "/Tools/Airbrush", "A", tools_select_cmd_callback, (gpointer) AIRBRUSH }, - { "/Tools/Clone", "C", tools_select_cmd_callback, (gpointer) CLONE }, - { "/Tools/Convolve", "V", tools_select_cmd_callback, (gpointer) CONVOLVE }, - { "/Tools/Default Colors", "D", tools_default_colors_cmd_callback, NULL}, - { "/Tools/Swap Colors", "X", tools_swap_colors_cmd_callback, NULL}, - { "/Tools/", NULL, NULL, NULL }, - { "/Tools/Toolbox", NULL, toolbox_raise_callback, NULL }, - - { "/Filters/", NULL, NULL, NULL }, - { "/Filters/Repeat last", "F", filters_repeat_cmd_callback, (gpointer) 0x0 }, - { "/Filters/Re-show last", "F", filters_repeat_cmd_callback, (gpointer) - 0x1 }, - { "/Filters/", NULL, NULL, NULL }, - - { "/Script-Fu/", NULL, NULL, NULL }, - - { "/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, NULL }, - { "/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, NULL }, - { "/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, NULL }, - { "/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, NULL }, - { "/Dialogs/Layers & Channels...", "L", dialogs_lc_cmd_callback, NULL }, - { "/Dialogs/Indexed Palette...", NULL, dialogs_indexed_palette_cmd_callback, NULL }, - { "/Dialogs/Tool Options...", NULL, dialogs_tools_options_cmd_callback, NULL }, - { "/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, NULL }, - { "/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, NULL }, - - { "/Automatic", NULL, file_load_by_extension_callback, NULL }, - { "/", NULL, NULL, NULL }, - - { "/By extension", NULL, file_save_by_extension_callback, NULL }, - { "/", NULL, NULL, NULL }, + { "/File/New", "N", file_new_cmd_callback, 0 }, + { "/File/Open", "O", file_open_cmd_callback, 0 }, + { "/File/About...", NULL, about_dialog_cmd_callback, 0 }, + { "/File/Preferences...", NULL, file_pref_cmd_callback, 0 }, + { "/File/Tip of the day", NULL, tips_dialog_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + { "/File/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, 0 }, + { "/File/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, 0 }, + { "/File/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, 0 }, + { "/File/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, 0 }, + { "/File/Dialogs/Tool Options...", "T", dialogs_tools_options_cmd_callback, 0 }, + { "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 }, + { "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, }; -static int nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]); +static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); +static GtkItemFactory *toolbox_factory = NULL; + +static GtkItemFactoryEntry image_entries[] = +{ + { "/File/New", "N", file_new_cmd_callback, 1 }, + { "/File/Open", "O", file_open_cmd_callback, 0 }, + { "/File/Save", "S", file_save_cmd_callback, 0 }, + { "/File/Save as", NULL, file_save_as_cmd_callback, 0 }, + { "/File/Preferences...", NULL, file_pref_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + + + { "/File/Close", "W", file_close_cmd_callback, 0 }, + { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + + { "/Edit/Cut", "X", edit_cut_cmd_callback, 0 }, + { "/Edit/Copy", "C", edit_copy_cmd_callback, 0 }, + { "/Edit/Paste", "V", edit_paste_cmd_callback, 0 }, + { "/Edit/Paste Into", NULL, edit_paste_into_cmd_callback, 0 }, + { "/Edit/Clear", "K", edit_clear_cmd_callback, 0 }, + { "/Edit/Fill", ".", edit_fill_cmd_callback, 0 }, + { "/Edit/Stroke", NULL, edit_stroke_cmd_callback, 0 }, + { "/Edit/Undo", "Z", edit_undo_cmd_callback, 0 }, + { "/Edit/Redo", "R", edit_redo_cmd_callback, 0 }, + { "/Edit/", NULL, NULL, 0 }, + { "/Edit/Cut Named", "X", edit_named_cut_cmd_callback, 0 }, + { "/Edit/Copy Named", "C", edit_named_copy_cmd_callback, 0 }, + { "/Edit/Paste Named", "V", edit_named_paste_cmd_callback, 0 }, + { "/Edit/---", NULL, NULL, 0, "" }, + + { "/Select/Toggle", "T", select_toggle_cmd_callback, 0 }, + { "/Select/Invert", "I", select_invert_cmd_callback, 0 }, + { "/Select/All", "A", select_all_cmd_callback, 0 }, + { "/Select/None", "A", select_none_cmd_callback, 0 }, + { "/Select/Float", "L", select_float_cmd_callback, 0 }, + { "/Select/Sharpen", "H", select_sharpen_cmd_callback, 0 }, + { "/Select/Border", "B", select_border_cmd_callback, 0 }, + { "/Select/Feather", "F", select_feather_cmd_callback, 0 }, + { "/Select/Grow", NULL, select_grow_cmd_callback, 0 }, + { "/Select/Shrink", NULL, select_shrink_cmd_callback, 0 }, + { "/Select/Save To Channel", NULL, select_save_cmd_callback, 0 }, + { "/Select/By Color...", NULL, select_by_color_cmd_callback, 0 }, + + { "/View/Zoom In", "=", view_zoomin_cmd_callback, 0 }, + { "/View/Zoom Out", "-", view_zoomout_cmd_callback, 0 }, + { "/View/Zoom/16:1", NULL, view_zoom_16_1_callback, 0 }, + { "/View/Zoom/8:1", NULL, view_zoom_8_1_callback, 0 }, + { "/View/Zoom/4:1", NULL, view_zoom_4_1_callback, 0 }, + { "/View/Zoom/2:1", NULL, view_zoom_2_1_callback, 0 }, + { "/View/Zoom/1:1", "1", view_zoom_1_1_callback, 0 }, + { "/View/Zoom/1:2", NULL, view_zoom_1_2_callback, 0 }, + { "/View/Zoom/1:4", NULL, view_zoom_1_4_callback, 0 }, + { "/View/Zoom/1:8", NULL, view_zoom_1_8_callback, 0 }, + { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, 0 }, + { "/View/Window Info...", "I", view_window_info_cmd_callback, 0 }, + { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, 0, "" }, + { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, 0, "" }, + { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, 0, "" }, + { "/View/---", NULL, NULL, 0, "" }, + { "/View/New View", NULL, view_new_view_cmd_callback, 0 }, + { "/View/Shrink Wrap", "E", view_shrink_wrap_cmd_callback, 0 }, + + { "/Image/Colors/Equalize", NULL, image_equalize_cmd_callback, 0 }, + { "/Image/Colors/Invert", NULL, image_invert_cmd_callback, 0 }, + { "/Image/Colors/Posterize", NULL, image_posterize_cmd_callback, 0 }, + { "/Image/Colors/Threshold", NULL, image_threshold_cmd_callback, 0 }, + { "/Image/Colors/---", NULL, NULL, 0, "" }, + { "/Image/Colors/Color Balance", NULL, image_color_balance_cmd_callback, 0 }, + { "/Image/Colors/Brightness-Contrast", NULL, image_brightness_contrast_cmd_callback, 0 }, + { "/Image/Colors/Hue-Saturation", NULL, image_hue_saturation_cmd_callback, 0 }, + { "/Image/Colors/Curves", NULL, image_curves_cmd_callback, 0 }, + { "/Image/Colors/Levels", NULL, image_levels_cmd_callback, 0 }, + { "/Image/Colors/---", NULL, NULL, 0, "" }, + { "/Image/Colors/Desaturate", NULL, image_desaturate_cmd_callback, 0 }, + { "/Image/Channel Ops/Duplicate", "D", channel_ops_duplicate_cmd_callback, 0 }, + { "/Image/Channel Ops/Offset", "O", channel_ops_offset_cmd_callback, 0 }, + { "/Image/Alpha/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, 0 }, + + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/RGB", NULL, image_convert_rgb_cmd_callback, 0 }, + { "/Image/Grayscale", NULL, image_convert_grayscale_cmd_callback, 0 }, + { "/Image/Indexed", NULL, image_convert_indexed_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/Resize", NULL, image_resize_cmd_callback, 0 }, + { "/Image/Scale", NULL, image_scale_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/Histogram", NULL, image_histogram_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + + { "/Layers/Layers & Channels...", "L", dialogs_lc_cmd_callback, 0 }, + { "/Layers/Raise Layer", "F", layers_raise_cmd_callback, 0 }, + { "/Layers/Lower Layer", "B", layers_lower_cmd_callback, 0 }, + { "/Layers/Anchor Layer", "H", layers_anchor_cmd_callback, 0 }, + { "/Layers/Merge Visible Layers", "M", layers_merge_cmd_callback, 0 }, + { "/Layers/Flatten Image", NULL, layers_flatten_cmd_callback, 0 }, + { "/Layers/Alpha To Selection", NULL, layers_alpha_select_cmd_callback, 0 }, + { "/Layers/Mask To Selection", NULL, layers_mask_select_cmd_callback, 0 }, + { "/Layers/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, 0 }, + + { "/Tools/Rect Select", "R", tools_select_cmd_callback, RECT_SELECT }, + { "/Tools/Ellipse Select", "E", tools_select_cmd_callback, ELLIPSE_SELECT }, + { "/Tools/Free Select", "F", tools_select_cmd_callback, FREE_SELECT }, + { "/Tools/Fuzzy Select", "Z", tools_select_cmd_callback, FUZZY_SELECT }, + { "/Tools/Bezier Select", "B", tools_select_cmd_callback, BEZIER_SELECT }, + { "/Tools/Intelligent Scissors", "I", tools_select_cmd_callback, ISCISSORS }, + { "/Tools/Move", "M", tools_select_cmd_callback, MOVE }, + { "/Tools/Magnify", "M", tools_select_cmd_callback, MAGNIFY }, + { "/Tools/Crop", "C", tools_select_cmd_callback, CROP }, + { "/Tools/Transform", "T", tools_select_cmd_callback, ROTATE }, + { "/Tools/Flip", "F", tools_select_cmd_callback, FLIP_HORZ }, + { "/Tools/Text", "T", tools_select_cmd_callback, TEXT }, + { "/Tools/Color Picker", "O", tools_select_cmd_callback, COLOR_PICKER }, + { "/Tools/Bucket Fill", "B", tools_select_cmd_callback, BUCKET_FILL }, + { "/Tools/Blend", "L", tools_select_cmd_callback, BLEND }, + { "/Tools/Paintbrush", "P", tools_select_cmd_callback, PAINTBRUSH }, + { "/Tools/Pencil", "P", tools_select_cmd_callback, PENCIL }, + { "/Tools/Eraser", "E", tools_select_cmd_callback, ERASER }, + { "/Tools/Airbrush", "A", tools_select_cmd_callback, AIRBRUSH }, + { "/Tools/Clone", "C", tools_select_cmd_callback, CLONE }, + { "/Tools/Convolve", "V", tools_select_cmd_callback, CONVOLVE }, + { "/Tools/Default Colors", "D", tools_default_colors_cmd_callback, 0 }, + { "/Tools/Swap Colors", "X", tools_swap_colors_cmd_callback, 0 }, + { "/Tools/---", NULL, NULL, 0, "" }, + { "/Tools/Toolbox", NULL, toolbox_raise_callback, 0 }, + + { "/Filters/", NULL, NULL, 0 }, + { "/Filters/Repeat last", "F", filters_repeat_cmd_callback, 0x0 }, + { "/Filters/Re-show last", "F", filters_repeat_cmd_callback, 0x1 }, + { "/Filters/---", NULL, NULL, 0, "" }, + + { "/Script-Fu/", NULL, NULL, 0 }, + + { "/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, 0 }, + { "/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, 0 }, + { "/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, 0 }, + { "/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, 0 }, + { "/Dialogs/Layers & Channels...", "L", dialogs_lc_cmd_callback, 0 }, + { "/Dialogs/Indexed Palette...", NULL, dialogs_indexed_palette_cmd_callback, 0 }, + { "/Dialogs/Tool Options...", NULL, dialogs_tools_options_cmd_callback, 0 }, + { "/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 }, + { "/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 }, +}; +static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]); +static GtkItemFactory *image_factory = NULL; + +static GtkItemFactoryEntry load_entries[] = +{ + { "/Automatic", NULL, file_load_by_extension_callback, 0 }, + { "/---", NULL, NULL, 0, "" }, +}; +static guint n_load_entries = sizeof (load_entries) / sizeof (load_entries[0]); +static GtkItemFactory *load_factory = NULL; + +static GtkItemFactoryEntry save_entries[] = +{ + { "/By extension", NULL, file_save_by_extension_callback, 0 }, + { "/---", NULL, NULL, 0, "" }, +}; +static guint n_save_entries = sizeof (save_entries) / sizeof (save_entries[0]); +static GtkItemFactory *save_factory = NULL; static int initialize = TRUE; -static GtkMenuFactory *factory = NULL; -static GtkMenuFactory *subfactories[4]; -static GHashTable *entry_ht = NULL; void menus_get_toolbox_menubar (GtkWidget **menubar, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); - + if (menubar) - *menubar = subfactories[0]->widget; - if (table) - *table = subfactories[0]->table; + *menubar = toolbox_factory->widget; + if (accel_group) + *accel_group = toolbox_factory->accel_group; } void menus_get_image_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[1]->widget; - if (table) - *table = subfactories[1]->table; + *menu = image_factory->widget; + if (accel_group) + *accel_group = image_factory->accel_group; } void menus_get_load_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[2]->widget; - if (table) - *table = subfactories[2]->table; + *menu = load_factory->widget; + if (accel_group) + *accel_group = load_factory->accel_group; } void menus_get_save_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[3]->widget; - if (table) - *table = subfactories[3]->table; + *menu = save_factory->widget; + if (accel_group) + *accel_group = save_factory->accel_group; } void menus_create (GtkMenuEntry *entries, int nmenu_entries) { - char *accelerator; - int i; - if (initialize) menus_init (); - if (entry_ht) - for (i = 0; i < nmenu_entries; i++) - { - accelerator = g_hash_table_lookup (entry_ht, entries[i].path); - if (accelerator) - { - if (accelerator[0] == '\0') - entries[i].accelerator = NULL; - else - entries[i].accelerator = accelerator; - } - } - - gtk_menu_factory_add_entries (factory, entries, nmenu_entries); - - for (i = 0; i < nmenu_entries; i++) - if (entries[i].widget && GTK_BIN (entries[i].widget)->child) - { - gtk_signal_connect (GTK_OBJECT (entries[i].widget), "install_accelerator", - (GtkSignalFunc) menus_install_accel, - entries[i].path); - gtk_signal_connect (GTK_OBJECT (entries[i].widget), "remove_accelerator", - (GtkSignalFunc) menus_remove_accel, - entries[i].path); - } + gtk_item_factory_create_menu_entries (nmenu_entries, entries); } void menus_set_sensitive (char *path, int sensitive) { - GtkMenuPath *menu_path; + GtkItemFactory *ifactory; + GtkWidget *widget = NULL; if (initialize) menus_init (); - menu_path = gtk_menu_factory_find (factory, path); - if (menu_path) - gtk_widget_set_sensitive (menu_path->widget, sensitive); - else - g_message ("Unable to set sensitivity for menu which doesn't exist: %s", path); + ifactory = gtk_item_factory_from_path (path); + + if (ifactory) + { + widget = gtk_item_factory_get_widget (ifactory, path); + + gtk_widget_set_sensitive (widget, sensitive); + } + if (!ifactory || !widget) + printf ("Unable to set sensitivity for menu which doesn't exist:\n%s", path); } void menus_set_state (char *path, int state) { - GtkMenuPath *menu_path; + GtkItemFactory *ifactory; + GtkWidget *widget = NULL; if (initialize) menus_init (); - menu_path = gtk_menu_factory_find (factory, path); - if (menu_path) + ifactory = gtk_item_factory_from_path (path); + + if (ifactory) { - if (GTK_IS_CHECK_MENU_ITEM (menu_path->widget)) - gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (menu_path->widget), state); + widget = gtk_item_factory_get_widget (ifactory, path); + + if (widget && GTK_IS_CHECK_MENU_ITEM (widget)) + gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (widget), state); + else + widget = NULL; } - else - g_message ("Unable to set state for menu which doesn't exist: %s", path); -} - -void -menus_add_path (char *path, - char *accelerator) -{ - if (!entry_ht) - entry_ht = g_hash_table_new (g_str_hash, g_str_equal); - - g_hash_table_insert (entry_ht, path, accelerator); + if (!ifactory || !widget) + printf ("Unable to set state for menu which doesn't exist:\n%s", path); } void @@ -358,35 +332,24 @@ menus_destroy (char *path) if (initialize) menus_init (); - gtk_menu_factory_remove_paths (factory, &path, 1); + gtk_item_factories_path_delete (NULL, path); } void menus_quit () { - FILE *fp; - char filename[512]; - char *gimp_dir; + gchar *filename; + + filename = g_strconcat (gimp_directory (), "/menurc", NULL); + gtk_item_factory_dump_rc (filename, NULL, TRUE); + g_free (filename); - if (entry_ht) - { - gimp_dir = gimp_directory (); - if ('\000' != gimp_dir[0]) - { - sprintf (filename, "%s/menurc", gimp_dir); - - fp = fopen (filename, "w"); - if (fp) - { - g_hash_table_foreach (entry_ht, menus_foreach, fp); - fclose (fp); - } - } - } - if (!initialize) { - gtk_menu_factory_destroy (factory); + gtk_object_destroy (GTK_OBJECT (toolbox_factory)); + gtk_object_destroy (GTK_OBJECT (image_factory)); + gtk_object_destroy (GTK_OBJECT (load_factory)); + gtk_object_destroy (GTK_OBJECT (save_factory)); } } @@ -395,101 +358,35 @@ menus_quit () static void menus_init () { - char filename[512]; - if (initialize) { + gchar *filename; + initialize = FALSE; - factory = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU_BAR); + toolbox_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "", NULL); + gtk_item_factory_create_items_ac (toolbox_factory, + n_toolbox_entries, + toolbox_entries, + NULL, 2); + image_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (image_factory, + n_image_entries, + image_entries, + NULL, 2); + load_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (load_factory, + n_load_entries, + load_entries, + NULL, 2); + save_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (save_factory, + n_save_entries, + save_entries, + NULL, 2); - subfactories[0] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU_BAR); - gtk_menu_factory_add_subfactory (factory, subfactories[0], ""); - - subfactories[1] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[1], ""); - - subfactories[2] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[2], ""); - - subfactories[3] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[3], ""); - - sprintf (filename, "%s/menurc", gimp_directory ()); - parse_gimprc_file (filename); - - menus_create (menu_items, nmenu_items); + filename = g_strconcat (gimp_directory (), "/menurc", NULL); + gtk_item_factory_parse_rc (filename); + g_free (filename); } } - -static void -menus_foreach (gpointer key, - gpointer value, - gpointer user_data) -{ - char accel[64]; - int i, j; - - for (i = j = 0; ((char*) value)[i] != '\0'; i++, j++) - { - if (((char *) value)[i] == '"' || ((char *) value)[i] == '\\') - accel[j++] = '\\'; - accel[j] = ((char *) value)[i]; - } - - accel[j] = '\0'; - - fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, accel); -} - -static gint -menus_install_accel (GtkWidget *widget, - gchar *signal_name, - gchar key, - gchar modifiers, - gchar *path) -{ - char accel[64]; - char *t1, t2[2]; - - accel[0] = '\0'; - if (modifiers & GDK_CONTROL_MASK) - strcat (accel, ""); - if (modifiers & GDK_SHIFT_MASK) - strcat (accel, ""); - if (modifiers & GDK_MOD1_MASK) - strcat (accel, ""); - - t2[0] = key; - t2[1] = '\0'; - strcat (accel, t2); - - if (entry_ht) - { - t1 = g_hash_table_lookup (entry_ht, path); - g_free (t1); - } - else - entry_ht = g_hash_table_new (g_str_hash, g_str_equal); - - g_hash_table_insert (entry_ht, path, g_strdup (accel)); - - return TRUE; -} - -static void -menus_remove_accel (GtkWidget *widget, - gchar *signal_name, - gchar *path) -{ - char *t; - - if (entry_ht) - { - t = g_hash_table_lookup (entry_ht, path); - g_free (t); - - g_hash_table_insert (entry_ht, path, g_strdup ("")); - } -} - diff --git a/app/gui/menus.h b/app/gui/menus.h index de8edb1852..a86491addf 100644 --- a/app/gui/menus.h +++ b/app/gui/menus.h @@ -23,21 +23,19 @@ void menus_get_toolbox_menubar (GtkWidget **menubar, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_image_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_load_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_save_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_create (GtkMenuEntry *entries, int nmenu_entries); void menus_set_sensitive (char *path, int sensitive); void menus_set_state (char *path, int state); -void menus_add_path (char *path, - char *accelerator); void menus_destroy (char *path); void menus_quit (void); diff --git a/app/indexed_palette.c b/app/indexed_palette.c index b8a326fb51..adf6178ce6 100644 --- a/app/indexed_palette.c +++ b/app/indexed_palette.c @@ -119,7 +119,7 @@ indexed_palette_create (int gimage_id) GtkWidget *menu_bar; GtkWidget *menu_bar_item; GtkWidget *hbox; - GtkAcceleratorTable *table; + GtkAccelGroup *accel_group; int default_index; if (!indexedP) @@ -127,14 +127,14 @@ indexed_palette_create (int gimage_id) indexedP = g_malloc (sizeof (IndexedPalette)); indexedP->gimage_id = -1; - table = gtk_accelerator_table_new (); + accel_group = gtk_accel_group_new (); /* The shell and main vbox */ indexedP->shell = gtk_dialog_new (); gtk_window_set_wmclass (GTK_WINDOW (indexedP->shell), "indexed_color_palette", "Gimp"); gtk_window_set_policy (GTK_WINDOW (indexedP->shell), FALSE, FALSE, FALSE); gtk_window_set_title (GTK_WINDOW (indexedP->shell), "Indexed Color Palette"); - gtk_window_add_accelerator_table (GTK_WINDOW (indexedP->shell), table); + gtk_window_add_accel_group (GTK_WINDOW (indexedP->shell), accel_group); gtk_signal_connect (GTK_OBJECT (indexedP->shell), "delete_event", GTK_SIGNAL_FUNC (gtk_widget_hide_on_delete), NULL); @@ -161,7 +161,7 @@ indexed_palette_create (int gimage_id) gtk_widget_show (label); /* The indexed palette commands pulldown menu */ - ops_menu = build_menu (indexed_color_ops, table); + ops_menu = build_menu (indexed_color_ops, accel_group); menu_bar = gtk_menu_bar_new (); gtk_box_pack_start (GTK_BOX (util_box), menu_bar, FALSE, FALSE, 2); diff --git a/app/interface.c b/app/interface.c index d2aeb537b5..f79dfa8236 100644 --- a/app/interface.c +++ b/app/interface.c @@ -565,7 +565,7 @@ create_toolbox () GtkWidget *vbox; GtkWidget *menubar; GList *device_list; - GtkAcceleratorTable *table; + GtkAccelGroup *table; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_wmclass (GTK_WINDOW (window), "toolbox", "Gimp"); @@ -626,7 +626,7 @@ create_toolbox () gtk_widget_show (menubar); /* Install the accelerator table in the main window */ - gtk_window_add_accelerator_table (GTK_WINDOW (window), table); + gtk_window_add_accel_group (GTK_WINDOW (window), table); vbox = gtk_vbox_new (FALSE, 1); gtk_box_pack_start (GTK_BOX (main_vbox), vbox, TRUE, TRUE, 0); @@ -673,7 +673,7 @@ create_display_shell (int gdisp_id, int type) { static GtkWidget *image_popup_menu = NULL; - static GtkAcceleratorTable *image_accelerator_table = NULL; + static GtkAccelGroup *image_accel_group = NULL; GDisplay *gdisp; GtkWidget *table; int n_width, n_height; @@ -798,13 +798,13 @@ create_display_shell (int gdisp_id, GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); if (! image_popup_menu) - menus_get_image_menu (&image_popup_menu, &image_accelerator_table); + menus_get_image_menu (&image_popup_menu, &image_accel_group); /* the popup menu */ gdisp->popup = image_popup_menu; /* the accelerator table for images */ - gtk_window_add_accelerator_table (GTK_WINDOW (gdisp->shell), image_accelerator_table); + gtk_window_add_accel_group (GTK_WINDOW (gdisp->shell), image_accel_group); gtk_widget_show (gdisp->hsb); gtk_widget_show (gdisp->vsb); diff --git a/app/layers_dialog.c b/app/layers_dialog.c index d53c355241..2cf4ceded7 100644 --- a/app/layers_dialog.c +++ b/app/layers_dialog.c @@ -87,7 +87,7 @@ struct _LayersDialog { GtkWidget *mode_box; GtkWidget *opacity_box; GtkWidget *ops_menu; - GtkAcceleratorTable *accel_table; + GtkAccelGroup *accel_group; GtkAdjustment *opacity_data; GdkGC *red_gc; /* for non-applied layer masks */ GdkGC *green_gc; /* for visible layer masks */ @@ -629,7 +629,7 @@ layers_dialog_create () layersD->active_channel = NULL; layersD->floating_sel = NULL; layersD->layer_widgets = NULL; - layersD->accel_table = gtk_accelerator_table_new (); + layersD->accel_group = gtk_accel_group_new (); layersD->green_gc = NULL; layersD->red_gc = NULL; @@ -644,7 +644,7 @@ layers_dialog_create () gtk_container_border_width (GTK_CONTAINER (vbox), 2); /* The layers commands pulldown menu */ - layersD->ops_menu = build_menu (layers_ops, layersD->accel_table); + layersD->ops_menu = build_menu (layers_ops, layersD->accel_group); /* The Mode option menu, and the preserve transparency */ layersD->mode_box = util_box = gtk_hbox_new (FALSE, 1); @@ -1527,9 +1527,9 @@ layers_dialog_map_callback (GtkWidget *w, { if (!layersD) return; - - gtk_window_add_accelerator_table (GTK_WINDOW (lc_shell), - layersD->accel_table); + + gtk_window_add_accel_group (GTK_WINDOW (lc_shell), + layersD->accel_group); } static void @@ -1538,9 +1538,9 @@ layers_dialog_unmap_callback (GtkWidget *w, { if (!layersD) return; - - gtk_window_remove_accelerator_table (GTK_WINDOW (lc_shell), - layersD->accel_table); + + gtk_window_remove_accel_group (GTK_WINDOW (lc_shell), + layersD->accel_group); } static void diff --git a/app/main.c b/app/main.c index 6edfc9074c..7db3219f89 100644 --- a/app/main.c +++ b/app/main.c @@ -90,9 +90,10 @@ main (int argc, char **argv) gtk_set_locale (); setlocale(LC_NUMERIC, "C"); /* must use dot, not comma, as decimal separator */ gtk_init (&argc, &argv); - gtk_accelerator_table_set_mod_mask (NULL, GDK_SHIFT_MASK | - GDK_CONTROL_MASK | - GDK_MOD1_MASK); + +#ifdef HAVE_LIBGLE + gle_init (&argc, &argv); +#endif /* !HAVE_LIBGLE */ display_name = gdk_get_display (); display_env = g_new (gchar, strlen (display_name) + 9); diff --git a/app/menus.c b/app/menus.c index 86a0f91e0d..6483ca3781 100644 --- a/app/menus.c +++ b/app/menus.c @@ -32,324 +32,298 @@ #include "gdisplay.h" static void menus_init (void); -static void menus_foreach (gpointer key, - gpointer value, - gpointer user_data); -static gint menus_install_accel (GtkWidget *widget, - gchar *signal_name, - gchar key, - gchar modifiers, - gchar *path); -static void menus_remove_accel (GtkWidget *widget, - gchar *signal_name, - gchar *path); -static GtkMenuEntry menu_items[] = +static GtkItemFactoryEntry toolbox_entries[] = { - { "/File/New", "N", file_new_cmd_callback, NULL }, - { "/File/Open", "O", file_open_cmd_callback, NULL }, - { "/File/About...", NULL, about_dialog_cmd_callback, NULL }, - { "/File/Preferences...", NULL, file_pref_cmd_callback, NULL }, - { "/File/Tip of the day", NULL, tips_dialog_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - { "/File/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, NULL }, - { "/File/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, NULL }, - { "/File/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, NULL }, - { "/File/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, NULL }, - { "/File/Dialogs/Tool Options...", "T", dialogs_tools_options_cmd_callback, NULL }, - { "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, NULL }, - { "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, NULL }, - - { "/File/",NULL,NULL,NULL}, - - { "/File/Quit", "Q", file_quit_cmd_callback, NULL }, - - { "/File/New", "N", file_new_cmd_callback, (gpointer) 1 }, - { "/File/Open", "O", file_open_cmd_callback, NULL }, - { "/File/Save", "S", file_save_cmd_callback, NULL }, - { "/File/Save as", NULL, file_save_as_cmd_callback, NULL }, - { "/File/Preferences...", NULL, file_pref_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - - - { "/File/Close", "W", file_close_cmd_callback, NULL }, - { "/File/Quit", "Q", file_quit_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - - { "/Edit/Cut", "X", edit_cut_cmd_callback, NULL }, - { "/Edit/Copy", "C", edit_copy_cmd_callback, NULL }, - { "/Edit/Paste", "V", edit_paste_cmd_callback, NULL }, - { "/Edit/Paste Into", NULL, edit_paste_into_cmd_callback, NULL }, - { "/Edit/Clear", "K", edit_clear_cmd_callback, NULL }, - { "/Edit/Fill", ".", edit_fill_cmd_callback, NULL }, - { "/Edit/Stroke", NULL, edit_stroke_cmd_callback, NULL }, - { "/Edit/Undo", "Z", edit_undo_cmd_callback, NULL }, - { "/Edit/Redo", "R", edit_redo_cmd_callback, NULL }, - { "/Edit/", NULL, NULL, NULL }, - { "/Edit/Cut Named", "X", edit_named_cut_cmd_callback, NULL }, - { "/Edit/Copy Named", "C", edit_named_copy_cmd_callback, NULL }, - { "/Edit/Paste Named", "V", edit_named_paste_cmd_callback, NULL }, - { "/Edit/", NULL, NULL, NULL }, - - { "/Select/Toggle", "T", select_toggle_cmd_callback, NULL }, - { "/Select/Invert", "I", select_invert_cmd_callback, NULL }, - { "/Select/All", "A", select_all_cmd_callback, NULL }, - { "/Select/None", "A", select_none_cmd_callback, NULL }, - { "/Select/Float", "L", select_float_cmd_callback, NULL }, - { "/Select/Sharpen", "H", select_sharpen_cmd_callback, NULL }, - { "/Select/Border", "B", select_border_cmd_callback, NULL }, - { "/Select/Feather", "F", select_feather_cmd_callback, NULL }, - { "/Select/Grow", NULL, select_grow_cmd_callback, NULL }, - { "/Select/Shrink", NULL, select_shrink_cmd_callback, NULL }, - { "/Select/Save To Channel", NULL, select_save_cmd_callback, NULL }, - { "/Select/By Color...", NULL, select_by_color_cmd_callback, NULL }, - - { "/View/Zoom In", "=", view_zoomin_cmd_callback, NULL }, - { "/View/Zoom Out", "-", view_zoomout_cmd_callback, NULL }, - { "/View/Zoom/16:1", NULL, view_zoom_16_1_callback, NULL }, - { "/View/Zoom/8:1", NULL, view_zoom_8_1_callback, NULL }, - { "/View/Zoom/4:1", NULL, view_zoom_4_1_callback, NULL }, - { "/View/Zoom/2:1", NULL, view_zoom_2_1_callback, NULL }, - { "/View/Zoom/1:1", "1", view_zoom_1_1_callback, NULL }, - { "/View/Zoom/1:2", NULL, view_zoom_1_2_callback, NULL }, - { "/View/Zoom/1:4", NULL, view_zoom_1_4_callback, NULL }, - { "/View/Zoom/1:8", NULL, view_zoom_1_8_callback, NULL }, - { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, NULL }, - { "/View/Window Info...", "I", view_window_info_cmd_callback, NULL }, - { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, NULL }, - { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, NULL }, - { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, NULL }, - { "/View/", NULL, NULL, NULL }, - { "/View/New View", NULL, view_new_view_cmd_callback, NULL }, - { "/View/Shrink Wrap", "E", view_shrink_wrap_cmd_callback, NULL }, - - { "/Image/Colors/Equalize", NULL, image_equalize_cmd_callback, NULL }, - { "/Image/Colors/Invert", NULL, image_invert_cmd_callback, NULL }, - { "/Image/Colors/Posterize", NULL, image_posterize_cmd_callback, NULL }, - { "/Image/Colors/Threshold", NULL, image_threshold_cmd_callback, NULL }, - { "/Image/Colors/", NULL, NULL, NULL }, - { "/Image/Colors/Color Balance", NULL, image_color_balance_cmd_callback, NULL }, - { "/Image/Colors/Brightness-Contrast", NULL, image_brightness_contrast_cmd_callback, NULL }, - { "/Image/Colors/Hue-Saturation", NULL, image_hue_saturation_cmd_callback, NULL }, - { "/Image/Colors/Curves", NULL, image_curves_cmd_callback, NULL }, - { "/Image/Colors/Levels", NULL, image_levels_cmd_callback, NULL }, - { "/Image/Colors/", NULL, NULL, NULL }, - { "/Image/Colors/Desaturate", NULL, image_desaturate_cmd_callback, NULL }, - { "/Image/Channel Ops/Duplicate", "D", channel_ops_duplicate_cmd_callback, NULL }, - { "/Image/Channel Ops/Offset", "O", channel_ops_offset_cmd_callback, NULL }, - { "/Image/Alpha/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, NULL }, - - { "/Image/", NULL, NULL, NULL }, - { "/Image/RGB", NULL, image_convert_rgb_cmd_callback, NULL }, - { "/Image/Grayscale", NULL, image_convert_grayscale_cmd_callback, NULL }, - { "/Image/Indexed", NULL, image_convert_indexed_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - { "/Image/Resize", NULL, image_resize_cmd_callback, NULL }, - { "/Image/Scale", NULL, image_scale_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - { "/Image/Histogram", NULL, image_histogram_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - - { "/Layers/Layers & Channels...", "L", dialogs_lc_cmd_callback, NULL }, - { "/Layers/Raise Layer", "F", layers_raise_cmd_callback, NULL }, - { "/Layers/Lower Layer", "B", layers_lower_cmd_callback, NULL }, - { "/Layers/Anchor Layer", "H", layers_anchor_cmd_callback, NULL }, - { "/Layers/Merge Visible Layers", "M", layers_merge_cmd_callback, NULL }, - { "/Layers/Flatten Image", NULL, layers_flatten_cmd_callback, NULL }, - { "/Layers/Alpha To Selection", NULL, layers_alpha_select_cmd_callback, NULL }, - { "/Layers/Mask To Selection", NULL, layers_mask_select_cmd_callback, NULL }, - { "/Layers/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, NULL }, - - { "/Tools/Rect Select", "R", tools_select_cmd_callback, (gpointer) RECT_SELECT }, - { "/Tools/Ellipse Select", "E", tools_select_cmd_callback, (gpointer) ELLIPSE_SELECT }, - { "/Tools/Free Select", "F", tools_select_cmd_callback, (gpointer) FREE_SELECT }, - { "/Tools/Fuzzy Select", "Z", tools_select_cmd_callback, (gpointer) FUZZY_SELECT }, - { "/Tools/Bezier Select", "B", tools_select_cmd_callback, (gpointer) BEZIER_SELECT }, - { "/Tools/Intelligent Scissors", "I", tools_select_cmd_callback, (gpointer) ISCISSORS }, - { "/Tools/Move", "M", tools_select_cmd_callback, (gpointer) MOVE }, - { "/Tools/Magnify", "M", tools_select_cmd_callback, (gpointer) MAGNIFY }, - { "/Tools/Crop", "C", tools_select_cmd_callback, (gpointer) CROP }, - { "/Tools/Transform", "T", tools_select_cmd_callback, (gpointer) ROTATE }, - { "/Tools/Flip", "F", tools_select_cmd_callback, (gpointer) FLIP_HORZ }, - { "/Tools/Text", "T", tools_select_cmd_callback, (gpointer) TEXT }, - { "/Tools/Color Picker", "O", tools_select_cmd_callback, (gpointer) COLOR_PICKER }, - { "/Tools/Bucket Fill", "B", tools_select_cmd_callback, (gpointer) BUCKET_FILL }, - { "/Tools/Blend", "L", tools_select_cmd_callback, (gpointer) BLEND }, - { "/Tools/Paintbrush", "P", tools_select_cmd_callback, (gpointer) PAINTBRUSH }, - { "/Tools/Pencil", "P", tools_select_cmd_callback, (gpointer) PENCIL }, - { "/Tools/Eraser", "E", tools_select_cmd_callback, (gpointer) ERASER }, - { "/Tools/Airbrush", "A", tools_select_cmd_callback, (gpointer) AIRBRUSH }, - { "/Tools/Clone", "C", tools_select_cmd_callback, (gpointer) CLONE }, - { "/Tools/Convolve", "V", tools_select_cmd_callback, (gpointer) CONVOLVE }, - { "/Tools/Default Colors", "D", tools_default_colors_cmd_callback, NULL}, - { "/Tools/Swap Colors", "X", tools_swap_colors_cmd_callback, NULL}, - { "/Tools/", NULL, NULL, NULL }, - { "/Tools/Toolbox", NULL, toolbox_raise_callback, NULL }, - - { "/Filters/", NULL, NULL, NULL }, - { "/Filters/Repeat last", "F", filters_repeat_cmd_callback, (gpointer) 0x0 }, - { "/Filters/Re-show last", "F", filters_repeat_cmd_callback, (gpointer) - 0x1 }, - { "/Filters/", NULL, NULL, NULL }, - - { "/Script-Fu/", NULL, NULL, NULL }, - - { "/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, NULL }, - { "/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, NULL }, - { "/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, NULL }, - { "/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, NULL }, - { "/Dialogs/Layers & Channels...", "L", dialogs_lc_cmd_callback, NULL }, - { "/Dialogs/Indexed Palette...", NULL, dialogs_indexed_palette_cmd_callback, NULL }, - { "/Dialogs/Tool Options...", NULL, dialogs_tools_options_cmd_callback, NULL }, - { "/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, NULL }, - { "/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, NULL }, - - { "/Automatic", NULL, file_load_by_extension_callback, NULL }, - { "/", NULL, NULL, NULL }, - - { "/By extension", NULL, file_save_by_extension_callback, NULL }, - { "/", NULL, NULL, NULL }, + { "/File/New", "N", file_new_cmd_callback, 0 }, + { "/File/Open", "O", file_open_cmd_callback, 0 }, + { "/File/About...", NULL, about_dialog_cmd_callback, 0 }, + { "/File/Preferences...", NULL, file_pref_cmd_callback, 0 }, + { "/File/Tip of the day", NULL, tips_dialog_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + { "/File/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, 0 }, + { "/File/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, 0 }, + { "/File/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, 0 }, + { "/File/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, 0 }, + { "/File/Dialogs/Tool Options...", "T", dialogs_tools_options_cmd_callback, 0 }, + { "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 }, + { "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, }; -static int nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]); +static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); +static GtkItemFactory *toolbox_factory = NULL; + +static GtkItemFactoryEntry image_entries[] = +{ + { "/File/New", "N", file_new_cmd_callback, 1 }, + { "/File/Open", "O", file_open_cmd_callback, 0 }, + { "/File/Save", "S", file_save_cmd_callback, 0 }, + { "/File/Save as", NULL, file_save_as_cmd_callback, 0 }, + { "/File/Preferences...", NULL, file_pref_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + + + { "/File/Close", "W", file_close_cmd_callback, 0 }, + { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + + { "/Edit/Cut", "X", edit_cut_cmd_callback, 0 }, + { "/Edit/Copy", "C", edit_copy_cmd_callback, 0 }, + { "/Edit/Paste", "V", edit_paste_cmd_callback, 0 }, + { "/Edit/Paste Into", NULL, edit_paste_into_cmd_callback, 0 }, + { "/Edit/Clear", "K", edit_clear_cmd_callback, 0 }, + { "/Edit/Fill", ".", edit_fill_cmd_callback, 0 }, + { "/Edit/Stroke", NULL, edit_stroke_cmd_callback, 0 }, + { "/Edit/Undo", "Z", edit_undo_cmd_callback, 0 }, + { "/Edit/Redo", "R", edit_redo_cmd_callback, 0 }, + { "/Edit/", NULL, NULL, 0 }, + { "/Edit/Cut Named", "X", edit_named_cut_cmd_callback, 0 }, + { "/Edit/Copy Named", "C", edit_named_copy_cmd_callback, 0 }, + { "/Edit/Paste Named", "V", edit_named_paste_cmd_callback, 0 }, + { "/Edit/---", NULL, NULL, 0, "" }, + + { "/Select/Toggle", "T", select_toggle_cmd_callback, 0 }, + { "/Select/Invert", "I", select_invert_cmd_callback, 0 }, + { "/Select/All", "A", select_all_cmd_callback, 0 }, + { "/Select/None", "A", select_none_cmd_callback, 0 }, + { "/Select/Float", "L", select_float_cmd_callback, 0 }, + { "/Select/Sharpen", "H", select_sharpen_cmd_callback, 0 }, + { "/Select/Border", "B", select_border_cmd_callback, 0 }, + { "/Select/Feather", "F", select_feather_cmd_callback, 0 }, + { "/Select/Grow", NULL, select_grow_cmd_callback, 0 }, + { "/Select/Shrink", NULL, select_shrink_cmd_callback, 0 }, + { "/Select/Save To Channel", NULL, select_save_cmd_callback, 0 }, + { "/Select/By Color...", NULL, select_by_color_cmd_callback, 0 }, + + { "/View/Zoom In", "=", view_zoomin_cmd_callback, 0 }, + { "/View/Zoom Out", "-", view_zoomout_cmd_callback, 0 }, + { "/View/Zoom/16:1", NULL, view_zoom_16_1_callback, 0 }, + { "/View/Zoom/8:1", NULL, view_zoom_8_1_callback, 0 }, + { "/View/Zoom/4:1", NULL, view_zoom_4_1_callback, 0 }, + { "/View/Zoom/2:1", NULL, view_zoom_2_1_callback, 0 }, + { "/View/Zoom/1:1", "1", view_zoom_1_1_callback, 0 }, + { "/View/Zoom/1:2", NULL, view_zoom_1_2_callback, 0 }, + { "/View/Zoom/1:4", NULL, view_zoom_1_4_callback, 0 }, + { "/View/Zoom/1:8", NULL, view_zoom_1_8_callback, 0 }, + { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, 0 }, + { "/View/Window Info...", "I", view_window_info_cmd_callback, 0 }, + { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, 0, "" }, + { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, 0, "" }, + { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, 0, "" }, + { "/View/---", NULL, NULL, 0, "" }, + { "/View/New View", NULL, view_new_view_cmd_callback, 0 }, + { "/View/Shrink Wrap", "E", view_shrink_wrap_cmd_callback, 0 }, + + { "/Image/Colors/Equalize", NULL, image_equalize_cmd_callback, 0 }, + { "/Image/Colors/Invert", NULL, image_invert_cmd_callback, 0 }, + { "/Image/Colors/Posterize", NULL, image_posterize_cmd_callback, 0 }, + { "/Image/Colors/Threshold", NULL, image_threshold_cmd_callback, 0 }, + { "/Image/Colors/---", NULL, NULL, 0, "" }, + { "/Image/Colors/Color Balance", NULL, image_color_balance_cmd_callback, 0 }, + { "/Image/Colors/Brightness-Contrast", NULL, image_brightness_contrast_cmd_callback, 0 }, + { "/Image/Colors/Hue-Saturation", NULL, image_hue_saturation_cmd_callback, 0 }, + { "/Image/Colors/Curves", NULL, image_curves_cmd_callback, 0 }, + { "/Image/Colors/Levels", NULL, image_levels_cmd_callback, 0 }, + { "/Image/Colors/---", NULL, NULL, 0, "" }, + { "/Image/Colors/Desaturate", NULL, image_desaturate_cmd_callback, 0 }, + { "/Image/Channel Ops/Duplicate", "D", channel_ops_duplicate_cmd_callback, 0 }, + { "/Image/Channel Ops/Offset", "O", channel_ops_offset_cmd_callback, 0 }, + { "/Image/Alpha/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, 0 }, + + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/RGB", NULL, image_convert_rgb_cmd_callback, 0 }, + { "/Image/Grayscale", NULL, image_convert_grayscale_cmd_callback, 0 }, + { "/Image/Indexed", NULL, image_convert_indexed_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/Resize", NULL, image_resize_cmd_callback, 0 }, + { "/Image/Scale", NULL, image_scale_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/Histogram", NULL, image_histogram_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + + { "/Layers/Layers & Channels...", "L", dialogs_lc_cmd_callback, 0 }, + { "/Layers/Raise Layer", "F", layers_raise_cmd_callback, 0 }, + { "/Layers/Lower Layer", "B", layers_lower_cmd_callback, 0 }, + { "/Layers/Anchor Layer", "H", layers_anchor_cmd_callback, 0 }, + { "/Layers/Merge Visible Layers", "M", layers_merge_cmd_callback, 0 }, + { "/Layers/Flatten Image", NULL, layers_flatten_cmd_callback, 0 }, + { "/Layers/Alpha To Selection", NULL, layers_alpha_select_cmd_callback, 0 }, + { "/Layers/Mask To Selection", NULL, layers_mask_select_cmd_callback, 0 }, + { "/Layers/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, 0 }, + + { "/Tools/Rect Select", "R", tools_select_cmd_callback, RECT_SELECT }, + { "/Tools/Ellipse Select", "E", tools_select_cmd_callback, ELLIPSE_SELECT }, + { "/Tools/Free Select", "F", tools_select_cmd_callback, FREE_SELECT }, + { "/Tools/Fuzzy Select", "Z", tools_select_cmd_callback, FUZZY_SELECT }, + { "/Tools/Bezier Select", "B", tools_select_cmd_callback, BEZIER_SELECT }, + { "/Tools/Intelligent Scissors", "I", tools_select_cmd_callback, ISCISSORS }, + { "/Tools/Move", "M", tools_select_cmd_callback, MOVE }, + { "/Tools/Magnify", "M", tools_select_cmd_callback, MAGNIFY }, + { "/Tools/Crop", "C", tools_select_cmd_callback, CROP }, + { "/Tools/Transform", "T", tools_select_cmd_callback, ROTATE }, + { "/Tools/Flip", "F", tools_select_cmd_callback, FLIP_HORZ }, + { "/Tools/Text", "T", tools_select_cmd_callback, TEXT }, + { "/Tools/Color Picker", "O", tools_select_cmd_callback, COLOR_PICKER }, + { "/Tools/Bucket Fill", "B", tools_select_cmd_callback, BUCKET_FILL }, + { "/Tools/Blend", "L", tools_select_cmd_callback, BLEND }, + { "/Tools/Paintbrush", "P", tools_select_cmd_callback, PAINTBRUSH }, + { "/Tools/Pencil", "P", tools_select_cmd_callback, PENCIL }, + { "/Tools/Eraser", "E", tools_select_cmd_callback, ERASER }, + { "/Tools/Airbrush", "A", tools_select_cmd_callback, AIRBRUSH }, + { "/Tools/Clone", "C", tools_select_cmd_callback, CLONE }, + { "/Tools/Convolve", "V", tools_select_cmd_callback, CONVOLVE }, + { "/Tools/Default Colors", "D", tools_default_colors_cmd_callback, 0 }, + { "/Tools/Swap Colors", "X", tools_swap_colors_cmd_callback, 0 }, + { "/Tools/---", NULL, NULL, 0, "" }, + { "/Tools/Toolbox", NULL, toolbox_raise_callback, 0 }, + + { "/Filters/", NULL, NULL, 0 }, + { "/Filters/Repeat last", "F", filters_repeat_cmd_callback, 0x0 }, + { "/Filters/Re-show last", "F", filters_repeat_cmd_callback, 0x1 }, + { "/Filters/---", NULL, NULL, 0, "" }, + + { "/Script-Fu/", NULL, NULL, 0 }, + + { "/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, 0 }, + { "/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, 0 }, + { "/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, 0 }, + { "/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, 0 }, + { "/Dialogs/Layers & Channels...", "L", dialogs_lc_cmd_callback, 0 }, + { "/Dialogs/Indexed Palette...", NULL, dialogs_indexed_palette_cmd_callback, 0 }, + { "/Dialogs/Tool Options...", NULL, dialogs_tools_options_cmd_callback, 0 }, + { "/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 }, + { "/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 }, +}; +static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]); +static GtkItemFactory *image_factory = NULL; + +static GtkItemFactoryEntry load_entries[] = +{ + { "/Automatic", NULL, file_load_by_extension_callback, 0 }, + { "/---", NULL, NULL, 0, "" }, +}; +static guint n_load_entries = sizeof (load_entries) / sizeof (load_entries[0]); +static GtkItemFactory *load_factory = NULL; + +static GtkItemFactoryEntry save_entries[] = +{ + { "/By extension", NULL, file_save_by_extension_callback, 0 }, + { "/---", NULL, NULL, 0, "" }, +}; +static guint n_save_entries = sizeof (save_entries) / sizeof (save_entries[0]); +static GtkItemFactory *save_factory = NULL; static int initialize = TRUE; -static GtkMenuFactory *factory = NULL; -static GtkMenuFactory *subfactories[4]; -static GHashTable *entry_ht = NULL; void menus_get_toolbox_menubar (GtkWidget **menubar, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); - + if (menubar) - *menubar = subfactories[0]->widget; - if (table) - *table = subfactories[0]->table; + *menubar = toolbox_factory->widget; + if (accel_group) + *accel_group = toolbox_factory->accel_group; } void menus_get_image_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[1]->widget; - if (table) - *table = subfactories[1]->table; + *menu = image_factory->widget; + if (accel_group) + *accel_group = image_factory->accel_group; } void menus_get_load_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[2]->widget; - if (table) - *table = subfactories[2]->table; + *menu = load_factory->widget; + if (accel_group) + *accel_group = load_factory->accel_group; } void menus_get_save_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[3]->widget; - if (table) - *table = subfactories[3]->table; + *menu = save_factory->widget; + if (accel_group) + *accel_group = save_factory->accel_group; } void menus_create (GtkMenuEntry *entries, int nmenu_entries) { - char *accelerator; - int i; - if (initialize) menus_init (); - if (entry_ht) - for (i = 0; i < nmenu_entries; i++) - { - accelerator = g_hash_table_lookup (entry_ht, entries[i].path); - if (accelerator) - { - if (accelerator[0] == '\0') - entries[i].accelerator = NULL; - else - entries[i].accelerator = accelerator; - } - } - - gtk_menu_factory_add_entries (factory, entries, nmenu_entries); - - for (i = 0; i < nmenu_entries; i++) - if (entries[i].widget && GTK_BIN (entries[i].widget)->child) - { - gtk_signal_connect (GTK_OBJECT (entries[i].widget), "install_accelerator", - (GtkSignalFunc) menus_install_accel, - entries[i].path); - gtk_signal_connect (GTK_OBJECT (entries[i].widget), "remove_accelerator", - (GtkSignalFunc) menus_remove_accel, - entries[i].path); - } + gtk_item_factory_create_menu_entries (nmenu_entries, entries); } void menus_set_sensitive (char *path, int sensitive) { - GtkMenuPath *menu_path; + GtkItemFactory *ifactory; + GtkWidget *widget = NULL; if (initialize) menus_init (); - menu_path = gtk_menu_factory_find (factory, path); - if (menu_path) - gtk_widget_set_sensitive (menu_path->widget, sensitive); - else - g_message ("Unable to set sensitivity for menu which doesn't exist: %s", path); + ifactory = gtk_item_factory_from_path (path); + + if (ifactory) + { + widget = gtk_item_factory_get_widget (ifactory, path); + + gtk_widget_set_sensitive (widget, sensitive); + } + if (!ifactory || !widget) + printf ("Unable to set sensitivity for menu which doesn't exist:\n%s", path); } void menus_set_state (char *path, int state) { - GtkMenuPath *menu_path; + GtkItemFactory *ifactory; + GtkWidget *widget = NULL; if (initialize) menus_init (); - menu_path = gtk_menu_factory_find (factory, path); - if (menu_path) + ifactory = gtk_item_factory_from_path (path); + + if (ifactory) { - if (GTK_IS_CHECK_MENU_ITEM (menu_path->widget)) - gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (menu_path->widget), state); + widget = gtk_item_factory_get_widget (ifactory, path); + + if (widget && GTK_IS_CHECK_MENU_ITEM (widget)) + gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (widget), state); + else + widget = NULL; } - else - g_message ("Unable to set state for menu which doesn't exist: %s", path); -} - -void -menus_add_path (char *path, - char *accelerator) -{ - if (!entry_ht) - entry_ht = g_hash_table_new (g_str_hash, g_str_equal); - - g_hash_table_insert (entry_ht, path, accelerator); + if (!ifactory || !widget) + printf ("Unable to set state for menu which doesn't exist:\n%s", path); } void @@ -358,35 +332,24 @@ menus_destroy (char *path) if (initialize) menus_init (); - gtk_menu_factory_remove_paths (factory, &path, 1); + gtk_item_factories_path_delete (NULL, path); } void menus_quit () { - FILE *fp; - char filename[512]; - char *gimp_dir; + gchar *filename; + + filename = g_strconcat (gimp_directory (), "/menurc", NULL); + gtk_item_factory_dump_rc (filename, NULL, TRUE); + g_free (filename); - if (entry_ht) - { - gimp_dir = gimp_directory (); - if ('\000' != gimp_dir[0]) - { - sprintf (filename, "%s/menurc", gimp_dir); - - fp = fopen (filename, "w"); - if (fp) - { - g_hash_table_foreach (entry_ht, menus_foreach, fp); - fclose (fp); - } - } - } - if (!initialize) { - gtk_menu_factory_destroy (factory); + gtk_object_destroy (GTK_OBJECT (toolbox_factory)); + gtk_object_destroy (GTK_OBJECT (image_factory)); + gtk_object_destroy (GTK_OBJECT (load_factory)); + gtk_object_destroy (GTK_OBJECT (save_factory)); } } @@ -395,101 +358,35 @@ menus_quit () static void menus_init () { - char filename[512]; - if (initialize) { + gchar *filename; + initialize = FALSE; - factory = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU_BAR); + toolbox_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "", NULL); + gtk_item_factory_create_items_ac (toolbox_factory, + n_toolbox_entries, + toolbox_entries, + NULL, 2); + image_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (image_factory, + n_image_entries, + image_entries, + NULL, 2); + load_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (load_factory, + n_load_entries, + load_entries, + NULL, 2); + save_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (save_factory, + n_save_entries, + save_entries, + NULL, 2); - subfactories[0] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU_BAR); - gtk_menu_factory_add_subfactory (factory, subfactories[0], ""); - - subfactories[1] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[1], ""); - - subfactories[2] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[2], ""); - - subfactories[3] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[3], ""); - - sprintf (filename, "%s/menurc", gimp_directory ()); - parse_gimprc_file (filename); - - menus_create (menu_items, nmenu_items); + filename = g_strconcat (gimp_directory (), "/menurc", NULL); + gtk_item_factory_parse_rc (filename); + g_free (filename); } } - -static void -menus_foreach (gpointer key, - gpointer value, - gpointer user_data) -{ - char accel[64]; - int i, j; - - for (i = j = 0; ((char*) value)[i] != '\0'; i++, j++) - { - if (((char *) value)[i] == '"' || ((char *) value)[i] == '\\') - accel[j++] = '\\'; - accel[j] = ((char *) value)[i]; - } - - accel[j] = '\0'; - - fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, accel); -} - -static gint -menus_install_accel (GtkWidget *widget, - gchar *signal_name, - gchar key, - gchar modifiers, - gchar *path) -{ - char accel[64]; - char *t1, t2[2]; - - accel[0] = '\0'; - if (modifiers & GDK_CONTROL_MASK) - strcat (accel, ""); - if (modifiers & GDK_SHIFT_MASK) - strcat (accel, ""); - if (modifiers & GDK_MOD1_MASK) - strcat (accel, ""); - - t2[0] = key; - t2[1] = '\0'; - strcat (accel, t2); - - if (entry_ht) - { - t1 = g_hash_table_lookup (entry_ht, path); - g_free (t1); - } - else - entry_ht = g_hash_table_new (g_str_hash, g_str_equal); - - g_hash_table_insert (entry_ht, path, g_strdup (accel)); - - return TRUE; -} - -static void -menus_remove_accel (GtkWidget *widget, - gchar *signal_name, - gchar *path) -{ - char *t; - - if (entry_ht) - { - t = g_hash_table_lookup (entry_ht, path); - g_free (t); - - g_hash_table_insert (entry_ht, path, g_strdup ("")); - } -} - diff --git a/app/menus.h b/app/menus.h index de8edb1852..a86491addf 100644 --- a/app/menus.h +++ b/app/menus.h @@ -23,21 +23,19 @@ void menus_get_toolbox_menubar (GtkWidget **menubar, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_image_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_load_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_save_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_create (GtkMenuEntry *entries, int nmenu_entries); void menus_set_sensitive (char *path, int sensitive); void menus_set_state (char *path, int state); -void menus_add_path (char *path, - char *accelerator); void menus_destroy (char *path); void menus_quit (void); diff --git a/app/menus/menus.c b/app/menus/menus.c index 86a0f91e0d..6483ca3781 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -32,324 +32,298 @@ #include "gdisplay.h" static void menus_init (void); -static void menus_foreach (gpointer key, - gpointer value, - gpointer user_data); -static gint menus_install_accel (GtkWidget *widget, - gchar *signal_name, - gchar key, - gchar modifiers, - gchar *path); -static void menus_remove_accel (GtkWidget *widget, - gchar *signal_name, - gchar *path); -static GtkMenuEntry menu_items[] = +static GtkItemFactoryEntry toolbox_entries[] = { - { "/File/New", "N", file_new_cmd_callback, NULL }, - { "/File/Open", "O", file_open_cmd_callback, NULL }, - { "/File/About...", NULL, about_dialog_cmd_callback, NULL }, - { "/File/Preferences...", NULL, file_pref_cmd_callback, NULL }, - { "/File/Tip of the day", NULL, tips_dialog_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - { "/File/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, NULL }, - { "/File/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, NULL }, - { "/File/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, NULL }, - { "/File/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, NULL }, - { "/File/Dialogs/Tool Options...", "T", dialogs_tools_options_cmd_callback, NULL }, - { "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, NULL }, - { "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, NULL }, - - { "/File/",NULL,NULL,NULL}, - - { "/File/Quit", "Q", file_quit_cmd_callback, NULL }, - - { "/File/New", "N", file_new_cmd_callback, (gpointer) 1 }, - { "/File/Open", "O", file_open_cmd_callback, NULL }, - { "/File/Save", "S", file_save_cmd_callback, NULL }, - { "/File/Save as", NULL, file_save_as_cmd_callback, NULL }, - { "/File/Preferences...", NULL, file_pref_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - - - { "/File/Close", "W", file_close_cmd_callback, NULL }, - { "/File/Quit", "Q", file_quit_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - - { "/Edit/Cut", "X", edit_cut_cmd_callback, NULL }, - { "/Edit/Copy", "C", edit_copy_cmd_callback, NULL }, - { "/Edit/Paste", "V", edit_paste_cmd_callback, NULL }, - { "/Edit/Paste Into", NULL, edit_paste_into_cmd_callback, NULL }, - { "/Edit/Clear", "K", edit_clear_cmd_callback, NULL }, - { "/Edit/Fill", ".", edit_fill_cmd_callback, NULL }, - { "/Edit/Stroke", NULL, edit_stroke_cmd_callback, NULL }, - { "/Edit/Undo", "Z", edit_undo_cmd_callback, NULL }, - { "/Edit/Redo", "R", edit_redo_cmd_callback, NULL }, - { "/Edit/", NULL, NULL, NULL }, - { "/Edit/Cut Named", "X", edit_named_cut_cmd_callback, NULL }, - { "/Edit/Copy Named", "C", edit_named_copy_cmd_callback, NULL }, - { "/Edit/Paste Named", "V", edit_named_paste_cmd_callback, NULL }, - { "/Edit/", NULL, NULL, NULL }, - - { "/Select/Toggle", "T", select_toggle_cmd_callback, NULL }, - { "/Select/Invert", "I", select_invert_cmd_callback, NULL }, - { "/Select/All", "A", select_all_cmd_callback, NULL }, - { "/Select/None", "A", select_none_cmd_callback, NULL }, - { "/Select/Float", "L", select_float_cmd_callback, NULL }, - { "/Select/Sharpen", "H", select_sharpen_cmd_callback, NULL }, - { "/Select/Border", "B", select_border_cmd_callback, NULL }, - { "/Select/Feather", "F", select_feather_cmd_callback, NULL }, - { "/Select/Grow", NULL, select_grow_cmd_callback, NULL }, - { "/Select/Shrink", NULL, select_shrink_cmd_callback, NULL }, - { "/Select/Save To Channel", NULL, select_save_cmd_callback, NULL }, - { "/Select/By Color...", NULL, select_by_color_cmd_callback, NULL }, - - { "/View/Zoom In", "=", view_zoomin_cmd_callback, NULL }, - { "/View/Zoom Out", "-", view_zoomout_cmd_callback, NULL }, - { "/View/Zoom/16:1", NULL, view_zoom_16_1_callback, NULL }, - { "/View/Zoom/8:1", NULL, view_zoom_8_1_callback, NULL }, - { "/View/Zoom/4:1", NULL, view_zoom_4_1_callback, NULL }, - { "/View/Zoom/2:1", NULL, view_zoom_2_1_callback, NULL }, - { "/View/Zoom/1:1", "1", view_zoom_1_1_callback, NULL }, - { "/View/Zoom/1:2", NULL, view_zoom_1_2_callback, NULL }, - { "/View/Zoom/1:4", NULL, view_zoom_1_4_callback, NULL }, - { "/View/Zoom/1:8", NULL, view_zoom_1_8_callback, NULL }, - { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, NULL }, - { "/View/Window Info...", "I", view_window_info_cmd_callback, NULL }, - { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, NULL }, - { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, NULL }, - { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, NULL }, - { "/View/", NULL, NULL, NULL }, - { "/View/New View", NULL, view_new_view_cmd_callback, NULL }, - { "/View/Shrink Wrap", "E", view_shrink_wrap_cmd_callback, NULL }, - - { "/Image/Colors/Equalize", NULL, image_equalize_cmd_callback, NULL }, - { "/Image/Colors/Invert", NULL, image_invert_cmd_callback, NULL }, - { "/Image/Colors/Posterize", NULL, image_posterize_cmd_callback, NULL }, - { "/Image/Colors/Threshold", NULL, image_threshold_cmd_callback, NULL }, - { "/Image/Colors/", NULL, NULL, NULL }, - { "/Image/Colors/Color Balance", NULL, image_color_balance_cmd_callback, NULL }, - { "/Image/Colors/Brightness-Contrast", NULL, image_brightness_contrast_cmd_callback, NULL }, - { "/Image/Colors/Hue-Saturation", NULL, image_hue_saturation_cmd_callback, NULL }, - { "/Image/Colors/Curves", NULL, image_curves_cmd_callback, NULL }, - { "/Image/Colors/Levels", NULL, image_levels_cmd_callback, NULL }, - { "/Image/Colors/", NULL, NULL, NULL }, - { "/Image/Colors/Desaturate", NULL, image_desaturate_cmd_callback, NULL }, - { "/Image/Channel Ops/Duplicate", "D", channel_ops_duplicate_cmd_callback, NULL }, - { "/Image/Channel Ops/Offset", "O", channel_ops_offset_cmd_callback, NULL }, - { "/Image/Alpha/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, NULL }, - - { "/Image/", NULL, NULL, NULL }, - { "/Image/RGB", NULL, image_convert_rgb_cmd_callback, NULL }, - { "/Image/Grayscale", NULL, image_convert_grayscale_cmd_callback, NULL }, - { "/Image/Indexed", NULL, image_convert_indexed_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - { "/Image/Resize", NULL, image_resize_cmd_callback, NULL }, - { "/Image/Scale", NULL, image_scale_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - { "/Image/Histogram", NULL, image_histogram_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - - { "/Layers/Layers & Channels...", "L", dialogs_lc_cmd_callback, NULL }, - { "/Layers/Raise Layer", "F", layers_raise_cmd_callback, NULL }, - { "/Layers/Lower Layer", "B", layers_lower_cmd_callback, NULL }, - { "/Layers/Anchor Layer", "H", layers_anchor_cmd_callback, NULL }, - { "/Layers/Merge Visible Layers", "M", layers_merge_cmd_callback, NULL }, - { "/Layers/Flatten Image", NULL, layers_flatten_cmd_callback, NULL }, - { "/Layers/Alpha To Selection", NULL, layers_alpha_select_cmd_callback, NULL }, - { "/Layers/Mask To Selection", NULL, layers_mask_select_cmd_callback, NULL }, - { "/Layers/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, NULL }, - - { "/Tools/Rect Select", "R", tools_select_cmd_callback, (gpointer) RECT_SELECT }, - { "/Tools/Ellipse Select", "E", tools_select_cmd_callback, (gpointer) ELLIPSE_SELECT }, - { "/Tools/Free Select", "F", tools_select_cmd_callback, (gpointer) FREE_SELECT }, - { "/Tools/Fuzzy Select", "Z", tools_select_cmd_callback, (gpointer) FUZZY_SELECT }, - { "/Tools/Bezier Select", "B", tools_select_cmd_callback, (gpointer) BEZIER_SELECT }, - { "/Tools/Intelligent Scissors", "I", tools_select_cmd_callback, (gpointer) ISCISSORS }, - { "/Tools/Move", "M", tools_select_cmd_callback, (gpointer) MOVE }, - { "/Tools/Magnify", "M", tools_select_cmd_callback, (gpointer) MAGNIFY }, - { "/Tools/Crop", "C", tools_select_cmd_callback, (gpointer) CROP }, - { "/Tools/Transform", "T", tools_select_cmd_callback, (gpointer) ROTATE }, - { "/Tools/Flip", "F", tools_select_cmd_callback, (gpointer) FLIP_HORZ }, - { "/Tools/Text", "T", tools_select_cmd_callback, (gpointer) TEXT }, - { "/Tools/Color Picker", "O", tools_select_cmd_callback, (gpointer) COLOR_PICKER }, - { "/Tools/Bucket Fill", "B", tools_select_cmd_callback, (gpointer) BUCKET_FILL }, - { "/Tools/Blend", "L", tools_select_cmd_callback, (gpointer) BLEND }, - { "/Tools/Paintbrush", "P", tools_select_cmd_callback, (gpointer) PAINTBRUSH }, - { "/Tools/Pencil", "P", tools_select_cmd_callback, (gpointer) PENCIL }, - { "/Tools/Eraser", "E", tools_select_cmd_callback, (gpointer) ERASER }, - { "/Tools/Airbrush", "A", tools_select_cmd_callback, (gpointer) AIRBRUSH }, - { "/Tools/Clone", "C", tools_select_cmd_callback, (gpointer) CLONE }, - { "/Tools/Convolve", "V", tools_select_cmd_callback, (gpointer) CONVOLVE }, - { "/Tools/Default Colors", "D", tools_default_colors_cmd_callback, NULL}, - { "/Tools/Swap Colors", "X", tools_swap_colors_cmd_callback, NULL}, - { "/Tools/", NULL, NULL, NULL }, - { "/Tools/Toolbox", NULL, toolbox_raise_callback, NULL }, - - { "/Filters/", NULL, NULL, NULL }, - { "/Filters/Repeat last", "F", filters_repeat_cmd_callback, (gpointer) 0x0 }, - { "/Filters/Re-show last", "F", filters_repeat_cmd_callback, (gpointer) - 0x1 }, - { "/Filters/", NULL, NULL, NULL }, - - { "/Script-Fu/", NULL, NULL, NULL }, - - { "/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, NULL }, - { "/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, NULL }, - { "/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, NULL }, - { "/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, NULL }, - { "/Dialogs/Layers & Channels...", "L", dialogs_lc_cmd_callback, NULL }, - { "/Dialogs/Indexed Palette...", NULL, dialogs_indexed_palette_cmd_callback, NULL }, - { "/Dialogs/Tool Options...", NULL, dialogs_tools_options_cmd_callback, NULL }, - { "/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, NULL }, - { "/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, NULL }, - - { "/Automatic", NULL, file_load_by_extension_callback, NULL }, - { "/", NULL, NULL, NULL }, - - { "/By extension", NULL, file_save_by_extension_callback, NULL }, - { "/", NULL, NULL, NULL }, + { "/File/New", "N", file_new_cmd_callback, 0 }, + { "/File/Open", "O", file_open_cmd_callback, 0 }, + { "/File/About...", NULL, about_dialog_cmd_callback, 0 }, + { "/File/Preferences...", NULL, file_pref_cmd_callback, 0 }, + { "/File/Tip of the day", NULL, tips_dialog_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + { "/File/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, 0 }, + { "/File/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, 0 }, + { "/File/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, 0 }, + { "/File/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, 0 }, + { "/File/Dialogs/Tool Options...", "T", dialogs_tools_options_cmd_callback, 0 }, + { "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 }, + { "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, }; -static int nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]); +static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); +static GtkItemFactory *toolbox_factory = NULL; + +static GtkItemFactoryEntry image_entries[] = +{ + { "/File/New", "N", file_new_cmd_callback, 1 }, + { "/File/Open", "O", file_open_cmd_callback, 0 }, + { "/File/Save", "S", file_save_cmd_callback, 0 }, + { "/File/Save as", NULL, file_save_as_cmd_callback, 0 }, + { "/File/Preferences...", NULL, file_pref_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + + + { "/File/Close", "W", file_close_cmd_callback, 0 }, + { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + + { "/Edit/Cut", "X", edit_cut_cmd_callback, 0 }, + { "/Edit/Copy", "C", edit_copy_cmd_callback, 0 }, + { "/Edit/Paste", "V", edit_paste_cmd_callback, 0 }, + { "/Edit/Paste Into", NULL, edit_paste_into_cmd_callback, 0 }, + { "/Edit/Clear", "K", edit_clear_cmd_callback, 0 }, + { "/Edit/Fill", ".", edit_fill_cmd_callback, 0 }, + { "/Edit/Stroke", NULL, edit_stroke_cmd_callback, 0 }, + { "/Edit/Undo", "Z", edit_undo_cmd_callback, 0 }, + { "/Edit/Redo", "R", edit_redo_cmd_callback, 0 }, + { "/Edit/", NULL, NULL, 0 }, + { "/Edit/Cut Named", "X", edit_named_cut_cmd_callback, 0 }, + { "/Edit/Copy Named", "C", edit_named_copy_cmd_callback, 0 }, + { "/Edit/Paste Named", "V", edit_named_paste_cmd_callback, 0 }, + { "/Edit/---", NULL, NULL, 0, "" }, + + { "/Select/Toggle", "T", select_toggle_cmd_callback, 0 }, + { "/Select/Invert", "I", select_invert_cmd_callback, 0 }, + { "/Select/All", "A", select_all_cmd_callback, 0 }, + { "/Select/None", "A", select_none_cmd_callback, 0 }, + { "/Select/Float", "L", select_float_cmd_callback, 0 }, + { "/Select/Sharpen", "H", select_sharpen_cmd_callback, 0 }, + { "/Select/Border", "B", select_border_cmd_callback, 0 }, + { "/Select/Feather", "F", select_feather_cmd_callback, 0 }, + { "/Select/Grow", NULL, select_grow_cmd_callback, 0 }, + { "/Select/Shrink", NULL, select_shrink_cmd_callback, 0 }, + { "/Select/Save To Channel", NULL, select_save_cmd_callback, 0 }, + { "/Select/By Color...", NULL, select_by_color_cmd_callback, 0 }, + + { "/View/Zoom In", "=", view_zoomin_cmd_callback, 0 }, + { "/View/Zoom Out", "-", view_zoomout_cmd_callback, 0 }, + { "/View/Zoom/16:1", NULL, view_zoom_16_1_callback, 0 }, + { "/View/Zoom/8:1", NULL, view_zoom_8_1_callback, 0 }, + { "/View/Zoom/4:1", NULL, view_zoom_4_1_callback, 0 }, + { "/View/Zoom/2:1", NULL, view_zoom_2_1_callback, 0 }, + { "/View/Zoom/1:1", "1", view_zoom_1_1_callback, 0 }, + { "/View/Zoom/1:2", NULL, view_zoom_1_2_callback, 0 }, + { "/View/Zoom/1:4", NULL, view_zoom_1_4_callback, 0 }, + { "/View/Zoom/1:8", NULL, view_zoom_1_8_callback, 0 }, + { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, 0 }, + { "/View/Window Info...", "I", view_window_info_cmd_callback, 0 }, + { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, 0, "" }, + { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, 0, "" }, + { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, 0, "" }, + { "/View/---", NULL, NULL, 0, "" }, + { "/View/New View", NULL, view_new_view_cmd_callback, 0 }, + { "/View/Shrink Wrap", "E", view_shrink_wrap_cmd_callback, 0 }, + + { "/Image/Colors/Equalize", NULL, image_equalize_cmd_callback, 0 }, + { "/Image/Colors/Invert", NULL, image_invert_cmd_callback, 0 }, + { "/Image/Colors/Posterize", NULL, image_posterize_cmd_callback, 0 }, + { "/Image/Colors/Threshold", NULL, image_threshold_cmd_callback, 0 }, + { "/Image/Colors/---", NULL, NULL, 0, "" }, + { "/Image/Colors/Color Balance", NULL, image_color_balance_cmd_callback, 0 }, + { "/Image/Colors/Brightness-Contrast", NULL, image_brightness_contrast_cmd_callback, 0 }, + { "/Image/Colors/Hue-Saturation", NULL, image_hue_saturation_cmd_callback, 0 }, + { "/Image/Colors/Curves", NULL, image_curves_cmd_callback, 0 }, + { "/Image/Colors/Levels", NULL, image_levels_cmd_callback, 0 }, + { "/Image/Colors/---", NULL, NULL, 0, "" }, + { "/Image/Colors/Desaturate", NULL, image_desaturate_cmd_callback, 0 }, + { "/Image/Channel Ops/Duplicate", "D", channel_ops_duplicate_cmd_callback, 0 }, + { "/Image/Channel Ops/Offset", "O", channel_ops_offset_cmd_callback, 0 }, + { "/Image/Alpha/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, 0 }, + + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/RGB", NULL, image_convert_rgb_cmd_callback, 0 }, + { "/Image/Grayscale", NULL, image_convert_grayscale_cmd_callback, 0 }, + { "/Image/Indexed", NULL, image_convert_indexed_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/Resize", NULL, image_resize_cmd_callback, 0 }, + { "/Image/Scale", NULL, image_scale_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/Histogram", NULL, image_histogram_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + + { "/Layers/Layers & Channels...", "L", dialogs_lc_cmd_callback, 0 }, + { "/Layers/Raise Layer", "F", layers_raise_cmd_callback, 0 }, + { "/Layers/Lower Layer", "B", layers_lower_cmd_callback, 0 }, + { "/Layers/Anchor Layer", "H", layers_anchor_cmd_callback, 0 }, + { "/Layers/Merge Visible Layers", "M", layers_merge_cmd_callback, 0 }, + { "/Layers/Flatten Image", NULL, layers_flatten_cmd_callback, 0 }, + { "/Layers/Alpha To Selection", NULL, layers_alpha_select_cmd_callback, 0 }, + { "/Layers/Mask To Selection", NULL, layers_mask_select_cmd_callback, 0 }, + { "/Layers/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, 0 }, + + { "/Tools/Rect Select", "R", tools_select_cmd_callback, RECT_SELECT }, + { "/Tools/Ellipse Select", "E", tools_select_cmd_callback, ELLIPSE_SELECT }, + { "/Tools/Free Select", "F", tools_select_cmd_callback, FREE_SELECT }, + { "/Tools/Fuzzy Select", "Z", tools_select_cmd_callback, FUZZY_SELECT }, + { "/Tools/Bezier Select", "B", tools_select_cmd_callback, BEZIER_SELECT }, + { "/Tools/Intelligent Scissors", "I", tools_select_cmd_callback, ISCISSORS }, + { "/Tools/Move", "M", tools_select_cmd_callback, MOVE }, + { "/Tools/Magnify", "M", tools_select_cmd_callback, MAGNIFY }, + { "/Tools/Crop", "C", tools_select_cmd_callback, CROP }, + { "/Tools/Transform", "T", tools_select_cmd_callback, ROTATE }, + { "/Tools/Flip", "F", tools_select_cmd_callback, FLIP_HORZ }, + { "/Tools/Text", "T", tools_select_cmd_callback, TEXT }, + { "/Tools/Color Picker", "O", tools_select_cmd_callback, COLOR_PICKER }, + { "/Tools/Bucket Fill", "B", tools_select_cmd_callback, BUCKET_FILL }, + { "/Tools/Blend", "L", tools_select_cmd_callback, BLEND }, + { "/Tools/Paintbrush", "P", tools_select_cmd_callback, PAINTBRUSH }, + { "/Tools/Pencil", "P", tools_select_cmd_callback, PENCIL }, + { "/Tools/Eraser", "E", tools_select_cmd_callback, ERASER }, + { "/Tools/Airbrush", "A", tools_select_cmd_callback, AIRBRUSH }, + { "/Tools/Clone", "C", tools_select_cmd_callback, CLONE }, + { "/Tools/Convolve", "V", tools_select_cmd_callback, CONVOLVE }, + { "/Tools/Default Colors", "D", tools_default_colors_cmd_callback, 0 }, + { "/Tools/Swap Colors", "X", tools_swap_colors_cmd_callback, 0 }, + { "/Tools/---", NULL, NULL, 0, "" }, + { "/Tools/Toolbox", NULL, toolbox_raise_callback, 0 }, + + { "/Filters/", NULL, NULL, 0 }, + { "/Filters/Repeat last", "F", filters_repeat_cmd_callback, 0x0 }, + { "/Filters/Re-show last", "F", filters_repeat_cmd_callback, 0x1 }, + { "/Filters/---", NULL, NULL, 0, "" }, + + { "/Script-Fu/", NULL, NULL, 0 }, + + { "/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, 0 }, + { "/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, 0 }, + { "/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, 0 }, + { "/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, 0 }, + { "/Dialogs/Layers & Channels...", "L", dialogs_lc_cmd_callback, 0 }, + { "/Dialogs/Indexed Palette...", NULL, dialogs_indexed_palette_cmd_callback, 0 }, + { "/Dialogs/Tool Options...", NULL, dialogs_tools_options_cmd_callback, 0 }, + { "/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 }, + { "/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 }, +}; +static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]); +static GtkItemFactory *image_factory = NULL; + +static GtkItemFactoryEntry load_entries[] = +{ + { "/Automatic", NULL, file_load_by_extension_callback, 0 }, + { "/---", NULL, NULL, 0, "" }, +}; +static guint n_load_entries = sizeof (load_entries) / sizeof (load_entries[0]); +static GtkItemFactory *load_factory = NULL; + +static GtkItemFactoryEntry save_entries[] = +{ + { "/By extension", NULL, file_save_by_extension_callback, 0 }, + { "/---", NULL, NULL, 0, "" }, +}; +static guint n_save_entries = sizeof (save_entries) / sizeof (save_entries[0]); +static GtkItemFactory *save_factory = NULL; static int initialize = TRUE; -static GtkMenuFactory *factory = NULL; -static GtkMenuFactory *subfactories[4]; -static GHashTable *entry_ht = NULL; void menus_get_toolbox_menubar (GtkWidget **menubar, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); - + if (menubar) - *menubar = subfactories[0]->widget; - if (table) - *table = subfactories[0]->table; + *menubar = toolbox_factory->widget; + if (accel_group) + *accel_group = toolbox_factory->accel_group; } void menus_get_image_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[1]->widget; - if (table) - *table = subfactories[1]->table; + *menu = image_factory->widget; + if (accel_group) + *accel_group = image_factory->accel_group; } void menus_get_load_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[2]->widget; - if (table) - *table = subfactories[2]->table; + *menu = load_factory->widget; + if (accel_group) + *accel_group = load_factory->accel_group; } void menus_get_save_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[3]->widget; - if (table) - *table = subfactories[3]->table; + *menu = save_factory->widget; + if (accel_group) + *accel_group = save_factory->accel_group; } void menus_create (GtkMenuEntry *entries, int nmenu_entries) { - char *accelerator; - int i; - if (initialize) menus_init (); - if (entry_ht) - for (i = 0; i < nmenu_entries; i++) - { - accelerator = g_hash_table_lookup (entry_ht, entries[i].path); - if (accelerator) - { - if (accelerator[0] == '\0') - entries[i].accelerator = NULL; - else - entries[i].accelerator = accelerator; - } - } - - gtk_menu_factory_add_entries (factory, entries, nmenu_entries); - - for (i = 0; i < nmenu_entries; i++) - if (entries[i].widget && GTK_BIN (entries[i].widget)->child) - { - gtk_signal_connect (GTK_OBJECT (entries[i].widget), "install_accelerator", - (GtkSignalFunc) menus_install_accel, - entries[i].path); - gtk_signal_connect (GTK_OBJECT (entries[i].widget), "remove_accelerator", - (GtkSignalFunc) menus_remove_accel, - entries[i].path); - } + gtk_item_factory_create_menu_entries (nmenu_entries, entries); } void menus_set_sensitive (char *path, int sensitive) { - GtkMenuPath *menu_path; + GtkItemFactory *ifactory; + GtkWidget *widget = NULL; if (initialize) menus_init (); - menu_path = gtk_menu_factory_find (factory, path); - if (menu_path) - gtk_widget_set_sensitive (menu_path->widget, sensitive); - else - g_message ("Unable to set sensitivity for menu which doesn't exist: %s", path); + ifactory = gtk_item_factory_from_path (path); + + if (ifactory) + { + widget = gtk_item_factory_get_widget (ifactory, path); + + gtk_widget_set_sensitive (widget, sensitive); + } + if (!ifactory || !widget) + printf ("Unable to set sensitivity for menu which doesn't exist:\n%s", path); } void menus_set_state (char *path, int state) { - GtkMenuPath *menu_path; + GtkItemFactory *ifactory; + GtkWidget *widget = NULL; if (initialize) menus_init (); - menu_path = gtk_menu_factory_find (factory, path); - if (menu_path) + ifactory = gtk_item_factory_from_path (path); + + if (ifactory) { - if (GTK_IS_CHECK_MENU_ITEM (menu_path->widget)) - gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (menu_path->widget), state); + widget = gtk_item_factory_get_widget (ifactory, path); + + if (widget && GTK_IS_CHECK_MENU_ITEM (widget)) + gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (widget), state); + else + widget = NULL; } - else - g_message ("Unable to set state for menu which doesn't exist: %s", path); -} - -void -menus_add_path (char *path, - char *accelerator) -{ - if (!entry_ht) - entry_ht = g_hash_table_new (g_str_hash, g_str_equal); - - g_hash_table_insert (entry_ht, path, accelerator); + if (!ifactory || !widget) + printf ("Unable to set state for menu which doesn't exist:\n%s", path); } void @@ -358,35 +332,24 @@ menus_destroy (char *path) if (initialize) menus_init (); - gtk_menu_factory_remove_paths (factory, &path, 1); + gtk_item_factories_path_delete (NULL, path); } void menus_quit () { - FILE *fp; - char filename[512]; - char *gimp_dir; + gchar *filename; + + filename = g_strconcat (gimp_directory (), "/menurc", NULL); + gtk_item_factory_dump_rc (filename, NULL, TRUE); + g_free (filename); - if (entry_ht) - { - gimp_dir = gimp_directory (); - if ('\000' != gimp_dir[0]) - { - sprintf (filename, "%s/menurc", gimp_dir); - - fp = fopen (filename, "w"); - if (fp) - { - g_hash_table_foreach (entry_ht, menus_foreach, fp); - fclose (fp); - } - } - } - if (!initialize) { - gtk_menu_factory_destroy (factory); + gtk_object_destroy (GTK_OBJECT (toolbox_factory)); + gtk_object_destroy (GTK_OBJECT (image_factory)); + gtk_object_destroy (GTK_OBJECT (load_factory)); + gtk_object_destroy (GTK_OBJECT (save_factory)); } } @@ -395,101 +358,35 @@ menus_quit () static void menus_init () { - char filename[512]; - if (initialize) { + gchar *filename; + initialize = FALSE; - factory = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU_BAR); + toolbox_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "", NULL); + gtk_item_factory_create_items_ac (toolbox_factory, + n_toolbox_entries, + toolbox_entries, + NULL, 2); + image_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (image_factory, + n_image_entries, + image_entries, + NULL, 2); + load_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (load_factory, + n_load_entries, + load_entries, + NULL, 2); + save_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (save_factory, + n_save_entries, + save_entries, + NULL, 2); - subfactories[0] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU_BAR); - gtk_menu_factory_add_subfactory (factory, subfactories[0], ""); - - subfactories[1] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[1], ""); - - subfactories[2] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[2], ""); - - subfactories[3] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[3], ""); - - sprintf (filename, "%s/menurc", gimp_directory ()); - parse_gimprc_file (filename); - - menus_create (menu_items, nmenu_items); + filename = g_strconcat (gimp_directory (), "/menurc", NULL); + gtk_item_factory_parse_rc (filename); + g_free (filename); } } - -static void -menus_foreach (gpointer key, - gpointer value, - gpointer user_data) -{ - char accel[64]; - int i, j; - - for (i = j = 0; ((char*) value)[i] != '\0'; i++, j++) - { - if (((char *) value)[i] == '"' || ((char *) value)[i] == '\\') - accel[j++] = '\\'; - accel[j] = ((char *) value)[i]; - } - - accel[j] = '\0'; - - fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, accel); -} - -static gint -menus_install_accel (GtkWidget *widget, - gchar *signal_name, - gchar key, - gchar modifiers, - gchar *path) -{ - char accel[64]; - char *t1, t2[2]; - - accel[0] = '\0'; - if (modifiers & GDK_CONTROL_MASK) - strcat (accel, ""); - if (modifiers & GDK_SHIFT_MASK) - strcat (accel, ""); - if (modifiers & GDK_MOD1_MASK) - strcat (accel, ""); - - t2[0] = key; - t2[1] = '\0'; - strcat (accel, t2); - - if (entry_ht) - { - t1 = g_hash_table_lookup (entry_ht, path); - g_free (t1); - } - else - entry_ht = g_hash_table_new (g_str_hash, g_str_equal); - - g_hash_table_insert (entry_ht, path, g_strdup (accel)); - - return TRUE; -} - -static void -menus_remove_accel (GtkWidget *widget, - gchar *signal_name, - gchar *path) -{ - char *t; - - if (entry_ht) - { - t = g_hash_table_lookup (entry_ht, path); - g_free (t); - - g_hash_table_insert (entry_ht, path, g_strdup ("")); - } -} - diff --git a/app/menus/menus.h b/app/menus/menus.h index de8edb1852..a86491addf 100644 --- a/app/menus/menus.h +++ b/app/menus/menus.h @@ -23,21 +23,19 @@ void menus_get_toolbox_menubar (GtkWidget **menubar, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_image_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_load_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_save_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_create (GtkMenuEntry *entries, int nmenu_entries); void menus_set_sensitive (char *path, int sensitive); void menus_set_state (char *path, int state); -void menus_add_path (char *path, - char *accelerator); void menus_destroy (char *path); void menus_quit (void); diff --git a/app/widgets/gimpgradienteditor.c b/app/widgets/gimpgradienteditor.c index ba4b1fdd93..919a40fe24 100644 --- a/app/widgets/gimpgradienteditor.c +++ b/app/widgets/gimpgradienteditor.c @@ -320,7 +320,7 @@ typedef struct { GtkWidget *control_coloring_popup; /* Coloring type menu */ GtkWidget *control_sel_ops_popup; /* Selection ops menu */ - GtkAcceleratorTable *accelerator_table; + GtkAccelGroup *accel_group; /* Blending and coloring menus */ @@ -1015,7 +1015,7 @@ grad_create_gradient_editor(void) g_editor->control_coloring_popup = NULL; g_editor->control_sel_ops_popup = NULL; - g_editor->accelerator_table = NULL; + g_editor->accel_group = NULL; for (i = 0; i < (sizeof(g_editor->control_blending_items) / sizeof(g_editor->control_blending_items[0])); @@ -2871,16 +2871,15 @@ cpopup_create_main_menu(void) GtkWidget *menu; GtkWidget *menuitem; GtkWidget *label; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; menu = gtk_menu_new(); - acc_table = gtk_accelerator_table_new(); + accel_group = gtk_accel_group_new(); - g_editor->accelerator_table = acc_table; + g_editor->accel_group = accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); - gtk_window_add_accelerator_table(GTK_WINDOW(g_editor->shell), acc_table); - gtk_window_add_accelerator_table(GTK_WINDOW(g_editor->shell), acc_table); + gtk_menu_set_accel_group (GTK_MENU(menu), accel_group); + gtk_window_add_accel_group (GTK_WINDOW (g_editor->shell), accel_group); /* Left endpoint */ @@ -2891,7 +2890,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'L', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'L', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Load from"); g_editor->control_left_load_popup = cpopup_create_load_menu(g_editor->left_load_color_boxes, @@ -2929,7 +2932,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'R', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'R', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Load from"); g_editor->control_right_load_popup = cpopup_create_load_menu(g_editor->right_load_color_boxes, @@ -2988,7 +2995,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'S', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'S', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Split uniformly */ @@ -2998,7 +3009,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'U', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'U', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Delete */ @@ -3009,7 +3024,11 @@ cpopup_create_main_menu(void) gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); g_editor->control_delete_menu_item = menuitem; - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'D', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'D', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Recenter */ @@ -3019,7 +3038,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'C', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'C', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Redistribute */ @@ -3029,7 +3052,11 @@ cpopup_create_main_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'C', GDK_CONTROL_MASK); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'C', GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Selection ops */ @@ -3376,17 +3403,18 @@ static GtkWidget * cpopup_create_menu_item_with_label(char *str, GtkWidget **label) { GtkWidget *menuitem; - GtkWidget *wlabel; + GtkWidget *accel_label; menuitem = gtk_menu_item_new(); - wlabel = gtk_label_new(str); - gtk_misc_set_alignment(GTK_MISC(wlabel), 0.0, 0.5); - gtk_container_add(GTK_CONTAINER(menuitem), wlabel); - gtk_widget_show(wlabel); + accel_label = gtk_accel_label_new(str); + gtk_misc_set_alignment(GTK_MISC(accel_label), 0.0, 0.5); + gtk_container_add(GTK_CONTAINER(menuitem), accel_label); + gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), menuitem); + gtk_widget_show(accel_label); if (label) - *label = wlabel; + *label = accel_label; return menuitem; } /* cpopup_create_menu_item_with_label */ @@ -3476,13 +3504,13 @@ cpopup_create_load_menu(GtkWidget **color_boxes, GtkWidget **labels, { GtkWidget *menu; GtkWidget *menuitem; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; int i; menu = gtk_menu_new(); - acc_table = g_editor->accelerator_table; + accel_group = g_editor->accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); + gtk_menu_set_accel_group (GTK_MENU (menu), accel_group); /* Create items */ @@ -3502,23 +3530,32 @@ cpopup_create_load_menu(GtkWidget **color_boxes, GtkWidget **labels, gtk_widget_show(menuitem); switch (i) { - case 0: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_0, accel_mods_0); - break; - - case 1: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_1, accel_mods_1); - break; - - case 2: - gtk_widget_install_accelerator(menuitem, acc_table, "activate", - accel_key_2, accel_mods_2); - break; - - default: - break; + case 0: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_0, accel_mods_0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + case 1: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_1, accel_mods_1, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + case 2: + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + accel_key_2, accel_mods_2, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); + break; + + default: + break; } /* switch */ } /* for */ @@ -3886,12 +3923,12 @@ cpopup_create_sel_ops_menu(void) { GtkWidget *menu; GtkWidget *menuitem; - GtkAcceleratorTable *acc_table; + GtkAccelGroup *accel_group; menu = gtk_menu_new(); - acc_table = g_editor->accelerator_table; + accel_group = g_editor->accel_group; - gtk_menu_set_accelerator_table(GTK_MENU(menu), acc_table); + gtk_menu_set_accel_group (GTK_MENU (menu), accel_group); /* Flip */ @@ -3901,7 +3938,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'F', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'F', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Replicate */ @@ -3911,7 +3952,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'M', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'M', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); /* Blend colors / opacity */ @@ -3926,7 +3971,11 @@ cpopup_create_sel_ops_menu(void) gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); g_editor->control_blend_colors_menu_item = menuitem; - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'B', 0); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'B', 0, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); menuitem = gtk_menu_item_new_with_label("Blend endpoints' opacity"); gtk_signal_connect(GTK_OBJECT(menuitem), "activate", @@ -3934,7 +3983,11 @@ cpopup_create_sel_ops_menu(void) NULL); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); - gtk_widget_install_accelerator(menuitem, acc_table, "activate", 'B', GDK_CONTROL_MASK); + gtk_widget_add_accelerator(menuitem, + "activate", + accel_group, + 'B', GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); g_editor->control_blend_opacity_menu_item = menuitem; return menu; diff --git a/app/widgets/gimpitemfactory.c b/app/widgets/gimpitemfactory.c index 86a0f91e0d..6483ca3781 100644 --- a/app/widgets/gimpitemfactory.c +++ b/app/widgets/gimpitemfactory.c @@ -32,324 +32,298 @@ #include "gdisplay.h" static void menus_init (void); -static void menus_foreach (gpointer key, - gpointer value, - gpointer user_data); -static gint menus_install_accel (GtkWidget *widget, - gchar *signal_name, - gchar key, - gchar modifiers, - gchar *path); -static void menus_remove_accel (GtkWidget *widget, - gchar *signal_name, - gchar *path); -static GtkMenuEntry menu_items[] = +static GtkItemFactoryEntry toolbox_entries[] = { - { "/File/New", "N", file_new_cmd_callback, NULL }, - { "/File/Open", "O", file_open_cmd_callback, NULL }, - { "/File/About...", NULL, about_dialog_cmd_callback, NULL }, - { "/File/Preferences...", NULL, file_pref_cmd_callback, NULL }, - { "/File/Tip of the day", NULL, tips_dialog_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - { "/File/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, NULL }, - { "/File/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, NULL }, - { "/File/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, NULL }, - { "/File/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, NULL }, - { "/File/Dialogs/Tool Options...", "T", dialogs_tools_options_cmd_callback, NULL }, - { "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, NULL }, - { "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, NULL }, - - { "/File/",NULL,NULL,NULL}, - - { "/File/Quit", "Q", file_quit_cmd_callback, NULL }, - - { "/File/New", "N", file_new_cmd_callback, (gpointer) 1 }, - { "/File/Open", "O", file_open_cmd_callback, NULL }, - { "/File/Save", "S", file_save_cmd_callback, NULL }, - { "/File/Save as", NULL, file_save_as_cmd_callback, NULL }, - { "/File/Preferences...", NULL, file_pref_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - - - { "/File/Close", "W", file_close_cmd_callback, NULL }, - { "/File/Quit", "Q", file_quit_cmd_callback, NULL }, - { "/File/", NULL, NULL, NULL }, - - { "/Edit/Cut", "X", edit_cut_cmd_callback, NULL }, - { "/Edit/Copy", "C", edit_copy_cmd_callback, NULL }, - { "/Edit/Paste", "V", edit_paste_cmd_callback, NULL }, - { "/Edit/Paste Into", NULL, edit_paste_into_cmd_callback, NULL }, - { "/Edit/Clear", "K", edit_clear_cmd_callback, NULL }, - { "/Edit/Fill", ".", edit_fill_cmd_callback, NULL }, - { "/Edit/Stroke", NULL, edit_stroke_cmd_callback, NULL }, - { "/Edit/Undo", "Z", edit_undo_cmd_callback, NULL }, - { "/Edit/Redo", "R", edit_redo_cmd_callback, NULL }, - { "/Edit/", NULL, NULL, NULL }, - { "/Edit/Cut Named", "X", edit_named_cut_cmd_callback, NULL }, - { "/Edit/Copy Named", "C", edit_named_copy_cmd_callback, NULL }, - { "/Edit/Paste Named", "V", edit_named_paste_cmd_callback, NULL }, - { "/Edit/", NULL, NULL, NULL }, - - { "/Select/Toggle", "T", select_toggle_cmd_callback, NULL }, - { "/Select/Invert", "I", select_invert_cmd_callback, NULL }, - { "/Select/All", "A", select_all_cmd_callback, NULL }, - { "/Select/None", "A", select_none_cmd_callback, NULL }, - { "/Select/Float", "L", select_float_cmd_callback, NULL }, - { "/Select/Sharpen", "H", select_sharpen_cmd_callback, NULL }, - { "/Select/Border", "B", select_border_cmd_callback, NULL }, - { "/Select/Feather", "F", select_feather_cmd_callback, NULL }, - { "/Select/Grow", NULL, select_grow_cmd_callback, NULL }, - { "/Select/Shrink", NULL, select_shrink_cmd_callback, NULL }, - { "/Select/Save To Channel", NULL, select_save_cmd_callback, NULL }, - { "/Select/By Color...", NULL, select_by_color_cmd_callback, NULL }, - - { "/View/Zoom In", "=", view_zoomin_cmd_callback, NULL }, - { "/View/Zoom Out", "-", view_zoomout_cmd_callback, NULL }, - { "/View/Zoom/16:1", NULL, view_zoom_16_1_callback, NULL }, - { "/View/Zoom/8:1", NULL, view_zoom_8_1_callback, NULL }, - { "/View/Zoom/4:1", NULL, view_zoom_4_1_callback, NULL }, - { "/View/Zoom/2:1", NULL, view_zoom_2_1_callback, NULL }, - { "/View/Zoom/1:1", "1", view_zoom_1_1_callback, NULL }, - { "/View/Zoom/1:2", NULL, view_zoom_1_2_callback, NULL }, - { "/View/Zoom/1:4", NULL, view_zoom_1_4_callback, NULL }, - { "/View/Zoom/1:8", NULL, view_zoom_1_8_callback, NULL }, - { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, NULL }, - { "/View/Window Info...", "I", view_window_info_cmd_callback, NULL }, - { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, NULL }, - { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, NULL }, - { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, NULL }, - { "/View/", NULL, NULL, NULL }, - { "/View/New View", NULL, view_new_view_cmd_callback, NULL }, - { "/View/Shrink Wrap", "E", view_shrink_wrap_cmd_callback, NULL }, - - { "/Image/Colors/Equalize", NULL, image_equalize_cmd_callback, NULL }, - { "/Image/Colors/Invert", NULL, image_invert_cmd_callback, NULL }, - { "/Image/Colors/Posterize", NULL, image_posterize_cmd_callback, NULL }, - { "/Image/Colors/Threshold", NULL, image_threshold_cmd_callback, NULL }, - { "/Image/Colors/", NULL, NULL, NULL }, - { "/Image/Colors/Color Balance", NULL, image_color_balance_cmd_callback, NULL }, - { "/Image/Colors/Brightness-Contrast", NULL, image_brightness_contrast_cmd_callback, NULL }, - { "/Image/Colors/Hue-Saturation", NULL, image_hue_saturation_cmd_callback, NULL }, - { "/Image/Colors/Curves", NULL, image_curves_cmd_callback, NULL }, - { "/Image/Colors/Levels", NULL, image_levels_cmd_callback, NULL }, - { "/Image/Colors/", NULL, NULL, NULL }, - { "/Image/Colors/Desaturate", NULL, image_desaturate_cmd_callback, NULL }, - { "/Image/Channel Ops/Duplicate", "D", channel_ops_duplicate_cmd_callback, NULL }, - { "/Image/Channel Ops/Offset", "O", channel_ops_offset_cmd_callback, NULL }, - { "/Image/Alpha/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, NULL }, - - { "/Image/", NULL, NULL, NULL }, - { "/Image/RGB", NULL, image_convert_rgb_cmd_callback, NULL }, - { "/Image/Grayscale", NULL, image_convert_grayscale_cmd_callback, NULL }, - { "/Image/Indexed", NULL, image_convert_indexed_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - { "/Image/Resize", NULL, image_resize_cmd_callback, NULL }, - { "/Image/Scale", NULL, image_scale_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - { "/Image/Histogram", NULL, image_histogram_cmd_callback, NULL }, - { "/Image/", NULL, NULL, NULL }, - - { "/Layers/Layers & Channels...", "L", dialogs_lc_cmd_callback, NULL }, - { "/Layers/Raise Layer", "F", layers_raise_cmd_callback, NULL }, - { "/Layers/Lower Layer", "B", layers_lower_cmd_callback, NULL }, - { "/Layers/Anchor Layer", "H", layers_anchor_cmd_callback, NULL }, - { "/Layers/Merge Visible Layers", "M", layers_merge_cmd_callback, NULL }, - { "/Layers/Flatten Image", NULL, layers_flatten_cmd_callback, NULL }, - { "/Layers/Alpha To Selection", NULL, layers_alpha_select_cmd_callback, NULL }, - { "/Layers/Mask To Selection", NULL, layers_mask_select_cmd_callback, NULL }, - { "/Layers/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, NULL }, - - { "/Tools/Rect Select", "R", tools_select_cmd_callback, (gpointer) RECT_SELECT }, - { "/Tools/Ellipse Select", "E", tools_select_cmd_callback, (gpointer) ELLIPSE_SELECT }, - { "/Tools/Free Select", "F", tools_select_cmd_callback, (gpointer) FREE_SELECT }, - { "/Tools/Fuzzy Select", "Z", tools_select_cmd_callback, (gpointer) FUZZY_SELECT }, - { "/Tools/Bezier Select", "B", tools_select_cmd_callback, (gpointer) BEZIER_SELECT }, - { "/Tools/Intelligent Scissors", "I", tools_select_cmd_callback, (gpointer) ISCISSORS }, - { "/Tools/Move", "M", tools_select_cmd_callback, (gpointer) MOVE }, - { "/Tools/Magnify", "M", tools_select_cmd_callback, (gpointer) MAGNIFY }, - { "/Tools/Crop", "C", tools_select_cmd_callback, (gpointer) CROP }, - { "/Tools/Transform", "T", tools_select_cmd_callback, (gpointer) ROTATE }, - { "/Tools/Flip", "F", tools_select_cmd_callback, (gpointer) FLIP_HORZ }, - { "/Tools/Text", "T", tools_select_cmd_callback, (gpointer) TEXT }, - { "/Tools/Color Picker", "O", tools_select_cmd_callback, (gpointer) COLOR_PICKER }, - { "/Tools/Bucket Fill", "B", tools_select_cmd_callback, (gpointer) BUCKET_FILL }, - { "/Tools/Blend", "L", tools_select_cmd_callback, (gpointer) BLEND }, - { "/Tools/Paintbrush", "P", tools_select_cmd_callback, (gpointer) PAINTBRUSH }, - { "/Tools/Pencil", "P", tools_select_cmd_callback, (gpointer) PENCIL }, - { "/Tools/Eraser", "E", tools_select_cmd_callback, (gpointer) ERASER }, - { "/Tools/Airbrush", "A", tools_select_cmd_callback, (gpointer) AIRBRUSH }, - { "/Tools/Clone", "C", tools_select_cmd_callback, (gpointer) CLONE }, - { "/Tools/Convolve", "V", tools_select_cmd_callback, (gpointer) CONVOLVE }, - { "/Tools/Default Colors", "D", tools_default_colors_cmd_callback, NULL}, - { "/Tools/Swap Colors", "X", tools_swap_colors_cmd_callback, NULL}, - { "/Tools/", NULL, NULL, NULL }, - { "/Tools/Toolbox", NULL, toolbox_raise_callback, NULL }, - - { "/Filters/", NULL, NULL, NULL }, - { "/Filters/Repeat last", "F", filters_repeat_cmd_callback, (gpointer) 0x0 }, - { "/Filters/Re-show last", "F", filters_repeat_cmd_callback, (gpointer) - 0x1 }, - { "/Filters/", NULL, NULL, NULL }, - - { "/Script-Fu/", NULL, NULL, NULL }, - - { "/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, NULL }, - { "/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, NULL }, - { "/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, NULL }, - { "/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, NULL }, - { "/Dialogs/Layers & Channels...", "L", dialogs_lc_cmd_callback, NULL }, - { "/Dialogs/Indexed Palette...", NULL, dialogs_indexed_palette_cmd_callback, NULL }, - { "/Dialogs/Tool Options...", NULL, dialogs_tools_options_cmd_callback, NULL }, - { "/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, NULL }, - { "/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, NULL }, - - { "/Automatic", NULL, file_load_by_extension_callback, NULL }, - { "/", NULL, NULL, NULL }, - - { "/By extension", NULL, file_save_by_extension_callback, NULL }, - { "/", NULL, NULL, NULL }, + { "/File/New", "N", file_new_cmd_callback, 0 }, + { "/File/Open", "O", file_open_cmd_callback, 0 }, + { "/File/About...", NULL, about_dialog_cmd_callback, 0 }, + { "/File/Preferences...", NULL, file_pref_cmd_callback, 0 }, + { "/File/Tip of the day", NULL, tips_dialog_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + { "/File/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, 0 }, + { "/File/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, 0 }, + { "/File/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, 0 }, + { "/File/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, 0 }, + { "/File/Dialogs/Tool Options...", "T", dialogs_tools_options_cmd_callback, 0 }, + { "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 }, + { "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, }; -static int nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]); +static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); +static GtkItemFactory *toolbox_factory = NULL; + +static GtkItemFactoryEntry image_entries[] = +{ + { "/File/New", "N", file_new_cmd_callback, 1 }, + { "/File/Open", "O", file_open_cmd_callback, 0 }, + { "/File/Save", "S", file_save_cmd_callback, 0 }, + { "/File/Save as", NULL, file_save_as_cmd_callback, 0 }, + { "/File/Preferences...", NULL, file_pref_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + + + { "/File/Close", "W", file_close_cmd_callback, 0 }, + { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, + { "/File/---", NULL, NULL, 0, "" }, + + { "/Edit/Cut", "X", edit_cut_cmd_callback, 0 }, + { "/Edit/Copy", "C", edit_copy_cmd_callback, 0 }, + { "/Edit/Paste", "V", edit_paste_cmd_callback, 0 }, + { "/Edit/Paste Into", NULL, edit_paste_into_cmd_callback, 0 }, + { "/Edit/Clear", "K", edit_clear_cmd_callback, 0 }, + { "/Edit/Fill", ".", edit_fill_cmd_callback, 0 }, + { "/Edit/Stroke", NULL, edit_stroke_cmd_callback, 0 }, + { "/Edit/Undo", "Z", edit_undo_cmd_callback, 0 }, + { "/Edit/Redo", "R", edit_redo_cmd_callback, 0 }, + { "/Edit/", NULL, NULL, 0 }, + { "/Edit/Cut Named", "X", edit_named_cut_cmd_callback, 0 }, + { "/Edit/Copy Named", "C", edit_named_copy_cmd_callback, 0 }, + { "/Edit/Paste Named", "V", edit_named_paste_cmd_callback, 0 }, + { "/Edit/---", NULL, NULL, 0, "" }, + + { "/Select/Toggle", "T", select_toggle_cmd_callback, 0 }, + { "/Select/Invert", "I", select_invert_cmd_callback, 0 }, + { "/Select/All", "A", select_all_cmd_callback, 0 }, + { "/Select/None", "A", select_none_cmd_callback, 0 }, + { "/Select/Float", "L", select_float_cmd_callback, 0 }, + { "/Select/Sharpen", "H", select_sharpen_cmd_callback, 0 }, + { "/Select/Border", "B", select_border_cmd_callback, 0 }, + { "/Select/Feather", "F", select_feather_cmd_callback, 0 }, + { "/Select/Grow", NULL, select_grow_cmd_callback, 0 }, + { "/Select/Shrink", NULL, select_shrink_cmd_callback, 0 }, + { "/Select/Save To Channel", NULL, select_save_cmd_callback, 0 }, + { "/Select/By Color...", NULL, select_by_color_cmd_callback, 0 }, + + { "/View/Zoom In", "=", view_zoomin_cmd_callback, 0 }, + { "/View/Zoom Out", "-", view_zoomout_cmd_callback, 0 }, + { "/View/Zoom/16:1", NULL, view_zoom_16_1_callback, 0 }, + { "/View/Zoom/8:1", NULL, view_zoom_8_1_callback, 0 }, + { "/View/Zoom/4:1", NULL, view_zoom_4_1_callback, 0 }, + { "/View/Zoom/2:1", NULL, view_zoom_2_1_callback, 0 }, + { "/View/Zoom/1:1", "1", view_zoom_1_1_callback, 0 }, + { "/View/Zoom/1:2", NULL, view_zoom_1_2_callback, 0 }, + { "/View/Zoom/1:4", NULL, view_zoom_1_4_callback, 0 }, + { "/View/Zoom/1:8", NULL, view_zoom_1_8_callback, 0 }, + { "/View/Zoom/1:16", NULL, view_zoom_1_16_callback, 0 }, + { "/View/Window Info...", "I", view_window_info_cmd_callback, 0 }, + { "/View/Toggle Rulers", "R", view_toggle_rulers_cmd_callback, 0, "" }, + { "/View/Toggle Guides", "T", view_toggle_guides_cmd_callback, 0, "" }, + { "/View/Snap To Guides", NULL, view_snap_to_guides_cmd_callback, 0, "" }, + { "/View/---", NULL, NULL, 0, "" }, + { "/View/New View", NULL, view_new_view_cmd_callback, 0 }, + { "/View/Shrink Wrap", "E", view_shrink_wrap_cmd_callback, 0 }, + + { "/Image/Colors/Equalize", NULL, image_equalize_cmd_callback, 0 }, + { "/Image/Colors/Invert", NULL, image_invert_cmd_callback, 0 }, + { "/Image/Colors/Posterize", NULL, image_posterize_cmd_callback, 0 }, + { "/Image/Colors/Threshold", NULL, image_threshold_cmd_callback, 0 }, + { "/Image/Colors/---", NULL, NULL, 0, "" }, + { "/Image/Colors/Color Balance", NULL, image_color_balance_cmd_callback, 0 }, + { "/Image/Colors/Brightness-Contrast", NULL, image_brightness_contrast_cmd_callback, 0 }, + { "/Image/Colors/Hue-Saturation", NULL, image_hue_saturation_cmd_callback, 0 }, + { "/Image/Colors/Curves", NULL, image_curves_cmd_callback, 0 }, + { "/Image/Colors/Levels", NULL, image_levels_cmd_callback, 0 }, + { "/Image/Colors/---", NULL, NULL, 0, "" }, + { "/Image/Colors/Desaturate", NULL, image_desaturate_cmd_callback, 0 }, + { "/Image/Channel Ops/Duplicate", "D", channel_ops_duplicate_cmd_callback, 0 }, + { "/Image/Channel Ops/Offset", "O", channel_ops_offset_cmd_callback, 0 }, + { "/Image/Alpha/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, 0 }, + + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/RGB", NULL, image_convert_rgb_cmd_callback, 0 }, + { "/Image/Grayscale", NULL, image_convert_grayscale_cmd_callback, 0 }, + { "/Image/Indexed", NULL, image_convert_indexed_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/Resize", NULL, image_resize_cmd_callback, 0 }, + { "/Image/Scale", NULL, image_scale_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + { "/Image/Histogram", NULL, image_histogram_cmd_callback, 0 }, + { "/Image/---", NULL, NULL, 0, "" }, + + { "/Layers/Layers & Channels...", "L", dialogs_lc_cmd_callback, 0 }, + { "/Layers/Raise Layer", "F", layers_raise_cmd_callback, 0 }, + { "/Layers/Lower Layer", "B", layers_lower_cmd_callback, 0 }, + { "/Layers/Anchor Layer", "H", layers_anchor_cmd_callback, 0 }, + { "/Layers/Merge Visible Layers", "M", layers_merge_cmd_callback, 0 }, + { "/Layers/Flatten Image", NULL, layers_flatten_cmd_callback, 0 }, + { "/Layers/Alpha To Selection", NULL, layers_alpha_select_cmd_callback, 0 }, + { "/Layers/Mask To Selection", NULL, layers_mask_select_cmd_callback, 0 }, + { "/Layers/Add Alpha Channel", NULL, layers_add_alpha_channel_cmd_callback, 0 }, + + { "/Tools/Rect Select", "R", tools_select_cmd_callback, RECT_SELECT }, + { "/Tools/Ellipse Select", "E", tools_select_cmd_callback, ELLIPSE_SELECT }, + { "/Tools/Free Select", "F", tools_select_cmd_callback, FREE_SELECT }, + { "/Tools/Fuzzy Select", "Z", tools_select_cmd_callback, FUZZY_SELECT }, + { "/Tools/Bezier Select", "B", tools_select_cmd_callback, BEZIER_SELECT }, + { "/Tools/Intelligent Scissors", "I", tools_select_cmd_callback, ISCISSORS }, + { "/Tools/Move", "M", tools_select_cmd_callback, MOVE }, + { "/Tools/Magnify", "M", tools_select_cmd_callback, MAGNIFY }, + { "/Tools/Crop", "C", tools_select_cmd_callback, CROP }, + { "/Tools/Transform", "T", tools_select_cmd_callback, ROTATE }, + { "/Tools/Flip", "F", tools_select_cmd_callback, FLIP_HORZ }, + { "/Tools/Text", "T", tools_select_cmd_callback, TEXT }, + { "/Tools/Color Picker", "O", tools_select_cmd_callback, COLOR_PICKER }, + { "/Tools/Bucket Fill", "B", tools_select_cmd_callback, BUCKET_FILL }, + { "/Tools/Blend", "L", tools_select_cmd_callback, BLEND }, + { "/Tools/Paintbrush", "P", tools_select_cmd_callback, PAINTBRUSH }, + { "/Tools/Pencil", "P", tools_select_cmd_callback, PENCIL }, + { "/Tools/Eraser", "E", tools_select_cmd_callback, ERASER }, + { "/Tools/Airbrush", "A", tools_select_cmd_callback, AIRBRUSH }, + { "/Tools/Clone", "C", tools_select_cmd_callback, CLONE }, + { "/Tools/Convolve", "V", tools_select_cmd_callback, CONVOLVE }, + { "/Tools/Default Colors", "D", tools_default_colors_cmd_callback, 0 }, + { "/Tools/Swap Colors", "X", tools_swap_colors_cmd_callback, 0 }, + { "/Tools/---", NULL, NULL, 0, "" }, + { "/Tools/Toolbox", NULL, toolbox_raise_callback, 0 }, + + { "/Filters/", NULL, NULL, 0 }, + { "/Filters/Repeat last", "F", filters_repeat_cmd_callback, 0x0 }, + { "/Filters/Re-show last", "F", filters_repeat_cmd_callback, 0x1 }, + { "/Filters/---", NULL, NULL, 0, "" }, + + { "/Script-Fu/", NULL, NULL, 0 }, + + { "/Dialogs/Brushes...", "B", dialogs_brushes_cmd_callback, 0 }, + { "/Dialogs/Patterns...", "P", dialogs_patterns_cmd_callback, 0 }, + { "/Dialogs/Palette...", "P", dialogs_palette_cmd_callback, 0 }, + { "/Dialogs/Gradient Editor...", "G", dialogs_gradient_editor_cmd_callback, 0 }, + { "/Dialogs/Layers & Channels...", "L", dialogs_lc_cmd_callback, 0 }, + { "/Dialogs/Indexed Palette...", NULL, dialogs_indexed_palette_cmd_callback, 0 }, + { "/Dialogs/Tool Options...", NULL, dialogs_tools_options_cmd_callback, 0 }, + { "/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 }, + { "/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 }, +}; +static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]); +static GtkItemFactory *image_factory = NULL; + +static GtkItemFactoryEntry load_entries[] = +{ + { "/Automatic", NULL, file_load_by_extension_callback, 0 }, + { "/---", NULL, NULL, 0, "" }, +}; +static guint n_load_entries = sizeof (load_entries) / sizeof (load_entries[0]); +static GtkItemFactory *load_factory = NULL; + +static GtkItemFactoryEntry save_entries[] = +{ + { "/By extension", NULL, file_save_by_extension_callback, 0 }, + { "/---", NULL, NULL, 0, "" }, +}; +static guint n_save_entries = sizeof (save_entries) / sizeof (save_entries[0]); +static GtkItemFactory *save_factory = NULL; static int initialize = TRUE; -static GtkMenuFactory *factory = NULL; -static GtkMenuFactory *subfactories[4]; -static GHashTable *entry_ht = NULL; void menus_get_toolbox_menubar (GtkWidget **menubar, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); - + if (menubar) - *menubar = subfactories[0]->widget; - if (table) - *table = subfactories[0]->table; + *menubar = toolbox_factory->widget; + if (accel_group) + *accel_group = toolbox_factory->accel_group; } void menus_get_image_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[1]->widget; - if (table) - *table = subfactories[1]->table; + *menu = image_factory->widget; + if (accel_group) + *accel_group = image_factory->accel_group; } void menus_get_load_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[2]->widget; - if (table) - *table = subfactories[2]->table; + *menu = load_factory->widget; + if (accel_group) + *accel_group = load_factory->accel_group; } void menus_get_save_menu (GtkWidget **menu, - GtkAcceleratorTable **table) + GtkAccelGroup **accel_group) { if (initialize) menus_init (); if (menu) - *menu = subfactories[3]->widget; - if (table) - *table = subfactories[3]->table; + *menu = save_factory->widget; + if (accel_group) + *accel_group = save_factory->accel_group; } void menus_create (GtkMenuEntry *entries, int nmenu_entries) { - char *accelerator; - int i; - if (initialize) menus_init (); - if (entry_ht) - for (i = 0; i < nmenu_entries; i++) - { - accelerator = g_hash_table_lookup (entry_ht, entries[i].path); - if (accelerator) - { - if (accelerator[0] == '\0') - entries[i].accelerator = NULL; - else - entries[i].accelerator = accelerator; - } - } - - gtk_menu_factory_add_entries (factory, entries, nmenu_entries); - - for (i = 0; i < nmenu_entries; i++) - if (entries[i].widget && GTK_BIN (entries[i].widget)->child) - { - gtk_signal_connect (GTK_OBJECT (entries[i].widget), "install_accelerator", - (GtkSignalFunc) menus_install_accel, - entries[i].path); - gtk_signal_connect (GTK_OBJECT (entries[i].widget), "remove_accelerator", - (GtkSignalFunc) menus_remove_accel, - entries[i].path); - } + gtk_item_factory_create_menu_entries (nmenu_entries, entries); } void menus_set_sensitive (char *path, int sensitive) { - GtkMenuPath *menu_path; + GtkItemFactory *ifactory; + GtkWidget *widget = NULL; if (initialize) menus_init (); - menu_path = gtk_menu_factory_find (factory, path); - if (menu_path) - gtk_widget_set_sensitive (menu_path->widget, sensitive); - else - g_message ("Unable to set sensitivity for menu which doesn't exist: %s", path); + ifactory = gtk_item_factory_from_path (path); + + if (ifactory) + { + widget = gtk_item_factory_get_widget (ifactory, path); + + gtk_widget_set_sensitive (widget, sensitive); + } + if (!ifactory || !widget) + printf ("Unable to set sensitivity for menu which doesn't exist:\n%s", path); } void menus_set_state (char *path, int state) { - GtkMenuPath *menu_path; + GtkItemFactory *ifactory; + GtkWidget *widget = NULL; if (initialize) menus_init (); - menu_path = gtk_menu_factory_find (factory, path); - if (menu_path) + ifactory = gtk_item_factory_from_path (path); + + if (ifactory) { - if (GTK_IS_CHECK_MENU_ITEM (menu_path->widget)) - gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (menu_path->widget), state); + widget = gtk_item_factory_get_widget (ifactory, path); + + if (widget && GTK_IS_CHECK_MENU_ITEM (widget)) + gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (widget), state); + else + widget = NULL; } - else - g_message ("Unable to set state for menu which doesn't exist: %s", path); -} - -void -menus_add_path (char *path, - char *accelerator) -{ - if (!entry_ht) - entry_ht = g_hash_table_new (g_str_hash, g_str_equal); - - g_hash_table_insert (entry_ht, path, accelerator); + if (!ifactory || !widget) + printf ("Unable to set state for menu which doesn't exist:\n%s", path); } void @@ -358,35 +332,24 @@ menus_destroy (char *path) if (initialize) menus_init (); - gtk_menu_factory_remove_paths (factory, &path, 1); + gtk_item_factories_path_delete (NULL, path); } void menus_quit () { - FILE *fp; - char filename[512]; - char *gimp_dir; + gchar *filename; + + filename = g_strconcat (gimp_directory (), "/menurc", NULL); + gtk_item_factory_dump_rc (filename, NULL, TRUE); + g_free (filename); - if (entry_ht) - { - gimp_dir = gimp_directory (); - if ('\000' != gimp_dir[0]) - { - sprintf (filename, "%s/menurc", gimp_dir); - - fp = fopen (filename, "w"); - if (fp) - { - g_hash_table_foreach (entry_ht, menus_foreach, fp); - fclose (fp); - } - } - } - if (!initialize) { - gtk_menu_factory_destroy (factory); + gtk_object_destroy (GTK_OBJECT (toolbox_factory)); + gtk_object_destroy (GTK_OBJECT (image_factory)); + gtk_object_destroy (GTK_OBJECT (load_factory)); + gtk_object_destroy (GTK_OBJECT (save_factory)); } } @@ -395,101 +358,35 @@ menus_quit () static void menus_init () { - char filename[512]; - if (initialize) { + gchar *filename; + initialize = FALSE; - factory = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU_BAR); + toolbox_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "", NULL); + gtk_item_factory_create_items_ac (toolbox_factory, + n_toolbox_entries, + toolbox_entries, + NULL, 2); + image_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (image_factory, + n_image_entries, + image_entries, + NULL, 2); + load_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (load_factory, + n_load_entries, + load_entries, + NULL, 2); + save_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_item_factory_create_items_ac (save_factory, + n_save_entries, + save_entries, + NULL, 2); - subfactories[0] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU_BAR); - gtk_menu_factory_add_subfactory (factory, subfactories[0], ""); - - subfactories[1] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[1], ""); - - subfactories[2] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[2], ""); - - subfactories[3] = gtk_menu_factory_new (GTK_MENU_FACTORY_MENU); - gtk_menu_factory_add_subfactory (factory, subfactories[3], ""); - - sprintf (filename, "%s/menurc", gimp_directory ()); - parse_gimprc_file (filename); - - menus_create (menu_items, nmenu_items); + filename = g_strconcat (gimp_directory (), "/menurc", NULL); + gtk_item_factory_parse_rc (filename); + g_free (filename); } } - -static void -menus_foreach (gpointer key, - gpointer value, - gpointer user_data) -{ - char accel[64]; - int i, j; - - for (i = j = 0; ((char*) value)[i] != '\0'; i++, j++) - { - if (((char *) value)[i] == '"' || ((char *) value)[i] == '\\') - accel[j++] = '\\'; - accel[j] = ((char *) value)[i]; - } - - accel[j] = '\0'; - - fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, accel); -} - -static gint -menus_install_accel (GtkWidget *widget, - gchar *signal_name, - gchar key, - gchar modifiers, - gchar *path) -{ - char accel[64]; - char *t1, t2[2]; - - accel[0] = '\0'; - if (modifiers & GDK_CONTROL_MASK) - strcat (accel, ""); - if (modifiers & GDK_SHIFT_MASK) - strcat (accel, ""); - if (modifiers & GDK_MOD1_MASK) - strcat (accel, ""); - - t2[0] = key; - t2[1] = '\0'; - strcat (accel, t2); - - if (entry_ht) - { - t1 = g_hash_table_lookup (entry_ht, path); - g_free (t1); - } - else - entry_ht = g_hash_table_new (g_str_hash, g_str_equal); - - g_hash_table_insert (entry_ht, path, g_strdup (accel)); - - return TRUE; -} - -static void -menus_remove_accel (GtkWidget *widget, - gchar *signal_name, - gchar *path) -{ - char *t; - - if (entry_ht) - { - t = g_hash_table_lookup (entry_ht, path); - g_free (t); - - g_hash_table_insert (entry_ht, path, g_strdup ("")); - } -} - diff --git a/app/widgets/gimpitemfactory.h b/app/widgets/gimpitemfactory.h index de8edb1852..a86491addf 100644 --- a/app/widgets/gimpitemfactory.h +++ b/app/widgets/gimpitemfactory.h @@ -23,21 +23,19 @@ void menus_get_toolbox_menubar (GtkWidget **menubar, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_image_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_load_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_get_save_menu (GtkWidget **menu, - GtkAcceleratorTable **table); + GtkAccelGroup **accel_group); void menus_create (GtkMenuEntry *entries, int nmenu_entries); void menus_set_sensitive (char *path, int sensitive); void menus_set_state (char *path, int state); -void menus_add_path (char *path, - char *accelerator); void menus_destroy (char *path); void menus_quit (void);