1997-11-25 06:05:25 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
1999-03-07 20:56:03 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <stdlib.h>
|
1999-07-01 17:13:39 +08:00
|
|
|
#include <string.h>
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "appenv.h"
|
|
|
|
#include "actionarea.h"
|
|
|
|
#include "app_procs.h"
|
|
|
|
#include "colormaps.h"
|
|
|
|
#include "color_area.h"
|
|
|
|
#include "commands.h"
|
1998-06-06 11:49:01 +08:00
|
|
|
#include "devices.h"
|
1999-03-07 20:56:03 +08:00
|
|
|
#include "dialog_handler.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "disp_callbacks.h"
|
|
|
|
#include "errors.h"
|
1999-07-01 17:13:39 +08:00
|
|
|
#include "fileops.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gdisplay.h"
|
|
|
|
#include "gdisplay_ops.h"
|
|
|
|
#include "gimage.h"
|
|
|
|
#include "gimprc.h"
|
1999-06-02 13:55:02 +08:00
|
|
|
#include "indicator_area.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "interface.h"
|
|
|
|
#include "menus.h"
|
1999-07-07 11:18:54 +08:00
|
|
|
#include "qmask.h"
|
1998-06-23 01:30:40 +08:00
|
|
|
#include "session.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "tools.h"
|
|
|
|
|
|
|
|
#include "pixmaps.h"
|
1999-07-07 11:18:54 +08:00
|
|
|
#include "pixmaps/qmasksel.xpm"
|
|
|
|
#include "pixmaps/qmasknosel.xpm"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
#include "libgimp/gimpsizeentry.h"
|
1998-11-23 22:47:09 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* local functions */
|
|
|
|
static void tools_select_update (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static gint tools_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *bevent,
|
|
|
|
gpointer data);
|
|
|
|
static void gdisplay_destroy (GtkWidget *widget,
|
|
|
|
GDisplay *display);
|
|
|
|
|
|
|
|
static gint gdisplay_delete (GtkWidget *widget,
|
|
|
|
GdkEvent *,
|
|
|
|
GDisplay *display);
|
|
|
|
|
|
|
|
static void toolbox_destroy (void);
|
|
|
|
static gint toolbox_delete (GtkWidget *,
|
|
|
|
GdkEvent *,
|
|
|
|
gpointer);
|
1998-06-06 11:49:01 +08:00
|
|
|
static gint toolbox_check_device (GtkWidget *,
|
|
|
|
GdkEvent *,
|
|
|
|
gpointer);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
static GdkPixmap *create_pixmap (GdkWindow *parent,
|
|
|
|
GdkBitmap **mask,
|
|
|
|
char **data,
|
|
|
|
int width,
|
|
|
|
int height);
|
1999-07-01 17:13:39 +08:00
|
|
|
static void gimp_set_drop_open (GtkWidget *);
|
|
|
|
static void gimp_dnd_data_received (GtkWidget *,
|
|
|
|
GdkDragContext *,
|
|
|
|
gint,
|
|
|
|
gint,
|
|
|
|
GtkSelectionData *,
|
|
|
|
guint,
|
|
|
|
guint);
|
1999-08-03 03:17:02 +08:00
|
|
|
static void gimp_dnd_open_files (gchar *);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
static int pixmap_colors[8][3] =
|
|
|
|
{
|
|
|
|
{ 0x00, 0x00, 0x00 }, /* a - 0 */
|
|
|
|
{ 0x24, 0x24, 0x24 }, /* b - 36 */
|
|
|
|
{ 0x49, 0x49, 0x49 }, /* c - 73 */
|
|
|
|
{ 0x6D, 0x6D, 0x6D }, /* d - 109 */
|
|
|
|
{ 0x92, 0x92, 0x92 }, /* e - 146 */
|
|
|
|
{ 0xB6, 0xB6, 0xB6 }, /* f - 182 */
|
|
|
|
{ 0xDB, 0xDB, 0xDB }, /* g - 219 */
|
|
|
|
{ 0xFF, 0xFF, 0xFF }, /* h - 255 */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define COLUMNS 3
|
1998-06-15 06:42:36 +08:00
|
|
|
#define ROWS 8
|
1997-11-25 06:05:25 +08:00
|
|
|
#define MARGIN 2
|
|
|
|
|
|
|
|
/* Widgets for each tool button--these are used from command.c to activate on
|
|
|
|
* tool selection via both menus and keyboard accelerators.
|
|
|
|
*/
|
1999-06-21 07:29:34 +08:00
|
|
|
GtkWidget * tool_label;
|
|
|
|
GtkTooltips * tool_tips;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-06-21 07:29:34 +08:00
|
|
|
static GdkColor colors[12];
|
|
|
|
static GtkWidget * toolbox_shell = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-07-01 17:13:39 +08:00
|
|
|
enum {
|
|
|
|
TARGET_URI_LIST,
|
|
|
|
TARGET_TEXT_PLAIN,
|
1999-07-08 13:07:53 +08:00
|
|
|
TARGET_URL
|
1999-07-01 17:13:39 +08:00
|
|
|
} TargetType;
|
|
|
|
|
|
|
|
static
|
|
|
|
GtkTargetEntry dnd_target_table[] =
|
|
|
|
{
|
|
|
|
{ "text/uri-list", 0, TARGET_URI_LIST },
|
1999-07-08 13:07:53 +08:00
|
|
|
{ "text/plain", 0, TARGET_TEXT_PLAIN },
|
|
|
|
{ "_NETSCAPE_URL",0, TARGET_URL }
|
1999-07-01 17:13:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static guint
|
|
|
|
dnd_n_targets = sizeof(dnd_target_table) / sizeof(dnd_target_table[0]);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
tools_select_update (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
ToolType tool_type;
|
|
|
|
|
|
|
|
tool_type = (ToolType) data;
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
if ((tool_type != -1) && GTK_TOGGLE_BUTTON (widget)->active)
|
1997-11-25 06:05:25 +08:00
|
|
|
tools_select (tool_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
tools_button_press (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
GdkEventButton *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
1999-08-08 04:55:26 +08:00
|
|
|
GDisplay * gdisp;
|
|
|
|
gdisp = data;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if ((event->type == GDK_2BUTTON_PRESS) &&
|
|
|
|
(event->button == 1))
|
|
|
|
tools_options_dialog_show ();
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
toolbox_delete (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
1999-06-21 07:29:34 +08:00
|
|
|
gpointer data)
|
1998-02-04 06:54:35 +08:00
|
|
|
{
|
1998-03-15 11:15:35 +08:00
|
|
|
app_exit (0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-03-15 11:15:35 +08:00
|
|
|
return TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
toolbox_destroy ()
|
1998-02-04 06:54:35 +08:00
|
|
|
{
|
|
|
|
app_exit_finish ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
static gint
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
toolbox_check_device (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
1999-06-21 07:29:34 +08:00
|
|
|
gpointer data)
|
1998-06-06 11:49:01 +08:00
|
|
|
{
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
devices_check_change (event);
|
1998-06-07 12:22:57 +08:00
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gdisplay_destroy (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
GDisplay *gdisp)
|
|
|
|
{
|
|
|
|
gdisplay_remove_and_delete (gdisp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gdisplay_delete (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
1999-06-21 07:29:34 +08:00
|
|
|
GDisplay *gdisp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
gdisplay_close_window (gdisp, FALSE);
|
|
|
|
|
1998-03-15 11:15:35 +08:00
|
|
|
return TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
allocate_colors (GtkWidget *parent)
|
|
|
|
{
|
|
|
|
GdkColormap *colormap;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
gtk_widget_realize (parent);
|
|
|
|
colormap = gdk_window_get_colormap (parent->window);
|
|
|
|
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
colors[i].red = pixmap_colors[i][0] << 8;
|
|
|
|
colors[i].green = pixmap_colors[i][1] << 8;
|
|
|
|
colors[i].blue = pixmap_colors[i][2] << 8;
|
|
|
|
|
|
|
|
gdk_color_alloc (colormap, &colors[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
colors[8] = parent->style->bg[GTK_STATE_NORMAL];
|
|
|
|
gdk_color_alloc (colormap, &colors[8]);
|
|
|
|
|
|
|
|
colors[9] = parent->style->bg[GTK_STATE_ACTIVE];
|
|
|
|
gdk_color_alloc (colormap, &colors[9]);
|
|
|
|
|
|
|
|
colors[10] = parent->style->bg[GTK_STATE_PRELIGHT];
|
|
|
|
gdk_color_alloc (colormap, &colors[10]);
|
|
|
|
|
|
|
|
/* postit yellow (khaki) as background for tooltips */
|
|
|
|
colors[11].red = 61669;
|
|
|
|
colors[11].green = 59113;
|
|
|
|
colors[11].blue = 35979;
|
|
|
|
gdk_color_alloc (colormap, &colors[11]);
|
|
|
|
}
|
|
|
|
|
1999-06-02 13:55:02 +08:00
|
|
|
static void
|
|
|
|
create_indicator_area (GtkWidget *parent)
|
|
|
|
{
|
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *alignment;
|
|
|
|
GtkWidget *ind_area;
|
|
|
|
GdkPixmap *default_pixmap;
|
|
|
|
GdkPixmap *swap_pixmap;
|
|
|
|
|
|
|
|
gtk_widget_realize (parent);
|
|
|
|
|
|
|
|
default_pixmap = create_pixmap (parent->window, NULL, default_bits,
|
|
|
|
default_width, default_height);
|
|
|
|
swap_pixmap = create_pixmap (parent->window, NULL, swap_bits,
|
|
|
|
swap_width, swap_height);
|
|
|
|
|
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (parent), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_realize (frame);
|
|
|
|
|
|
|
|
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (alignment), 3);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), alignment);
|
|
|
|
|
|
|
|
ind_area = indicator_area_create (54, 42);
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment), ind_area);
|
|
|
|
gtk_widget_show (ind_area);
|
|
|
|
gtk_widget_show (alignment);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
|
|
|
create_color_area (GtkWidget *parent)
|
|
|
|
{
|
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *alignment;
|
|
|
|
GtkWidget *col_area;
|
|
|
|
GdkPixmap *default_pixmap;
|
|
|
|
GdkPixmap *swap_pixmap;
|
|
|
|
|
|
|
|
gtk_widget_realize (parent);
|
|
|
|
|
|
|
|
default_pixmap = create_pixmap (parent->window, NULL, default_bits,
|
|
|
|
default_width, default_height);
|
|
|
|
swap_pixmap = create_pixmap (parent->window, NULL, swap_bits,
|
|
|
|
swap_width, swap_height);
|
|
|
|
|
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (parent), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_realize (frame);
|
|
|
|
|
|
|
|
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
1999-03-12 11:44:59 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (alignment), 3);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), alignment);
|
|
|
|
|
|
|
|
col_area = color_area_create (54, 42, default_pixmap, swap_pixmap);
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment), col_area);
|
1998-12-26 02:22:01 +08:00
|
|
|
gtk_tooltips_set_tip (tool_tips, col_area, _("Foreground & background colors. The black "
|
|
|
|
"and white squares reset colors. The arrows swap colors. Double "
|
|
|
|
"click to select a color from a colorrequester."),
|
1998-02-21 11:42:10 +08:00
|
|
|
NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (col_area);
|
|
|
|
gtk_widget_show (alignment);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
}
|
|
|
|
|
1998-06-07 12:22:57 +08:00
|
|
|
GdkPixmap *
|
1999-06-21 07:29:34 +08:00
|
|
|
create_tool_pixmap (GtkWidget *parent,
|
|
|
|
ToolType type)
|
1998-06-06 11:49:01 +08:00
|
|
|
{
|
1998-06-22 04:17:21 +08:00
|
|
|
/*
|
|
|
|
* FIXME this really should be dones without using the #defined tool names
|
|
|
|
* but it should work this way for now
|
|
|
|
*/
|
1998-06-06 11:49:01 +08:00
|
|
|
if (type == SCALE || type == SHEAR || type == PERSPECTIVE)
|
|
|
|
type = ROTATE;
|
|
|
|
|
1999-04-27 10:09:03 +08:00
|
|
|
if (tool_info[(int) type].icon_data)
|
|
|
|
return create_pixmap (parent->window, NULL,
|
|
|
|
tool_info[(int) type].icon_data,
|
|
|
|
22, 22);
|
|
|
|
else
|
|
|
|
return create_pixmap (parent->window, NULL,
|
|
|
|
dialog_bits,
|
|
|
|
22, 22);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
g_return_val_if_fail (FALSE, NULL);
|
1998-06-07 12:22:57 +08:00
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
return NULL; /* not reached */
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
|
|
|
create_tools (GtkWidget *parent)
|
|
|
|
{
|
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *alignment;
|
|
|
|
GtkWidget *pixmap;
|
|
|
|
GSList *group;
|
1998-06-22 04:17:21 +08:00
|
|
|
gint i, j;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/*create_logo (parent);*/
|
|
|
|
table = gtk_table_new (ROWS, COLUMNS, TRUE);
|
|
|
|
gtk_box_pack_start (GTK_BOX (parent), table, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_realize (table);
|
|
|
|
|
|
|
|
group = NULL;
|
|
|
|
|
1998-06-22 04:17:21 +08:00
|
|
|
i = 0;
|
|
|
|
for (j = 0; j < num_tools; j++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1998-06-22 04:17:21 +08:00
|
|
|
if (tool_info[j].icon_data)
|
|
|
|
{
|
|
|
|
tool_info[j].tool_widget = button = gtk_radio_button_new (group);
|
1999-03-12 11:44:59 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (button), 0);
|
1998-06-22 04:17:21 +08:00
|
|
|
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1998-06-22 04:17:21 +08:00
|
|
|
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1998-06-22 04:17:21 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), button,
|
|
|
|
(i % 3), (i % 3) + 1,
|
|
|
|
(i / 3), (i / 3) + 1,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
0, 0);
|
|
|
|
|
|
|
|
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
1999-03-12 11:44:59 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (alignment), 0);
|
1998-06-22 04:17:21 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (button), alignment);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1998-06-22 04:17:21 +08:00
|
|
|
pixmap = create_pixmap_widget (table->window, tool_info[j].icon_data, 22, 22);
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment), pixmap);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1998-06-22 04:17:21 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
|
|
|
(GtkSignalFunc) tools_select_update,
|
|
|
|
(gpointer) tool_info[j].tool_id);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1998-06-22 04:17:21 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "button_press_event",
|
|
|
|
(GtkSignalFunc) tools_button_press,
|
|
|
|
(gpointer) tool_info[j].tool_id);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_tooltips_set_tip (tool_tips, button,
|
|
|
|
gettext(tool_info[j].tool_desc),
|
|
|
|
tool_info[i].private_tip);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1998-06-22 04:17:21 +08:00
|
|
|
gtk_widget_show (pixmap);
|
|
|
|
gtk_widget_show (alignment);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
i++;
|
|
|
|
}
|
1998-07-20 23:07:13 +08:00
|
|
|
else
|
1998-06-22 04:17:21 +08:00
|
|
|
{
|
|
|
|
tool_info[j].tool_widget = button = gtk_radio_button_new (group);
|
|
|
|
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-06-22 04:17:21 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) tools_select_update,
|
|
|
|
(gpointer) tool_info[j].tool_id);
|
|
|
|
}
|
1998-07-20 23:07:13 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GdkPixmap *
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
create_pixmap (GdkWindow *parent,
|
|
|
|
GdkBitmap **mask,
|
|
|
|
gchar **data,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GdkPixmap *pixmap;
|
|
|
|
GdkImage *image;
|
|
|
|
GdkGC *gc;
|
|
|
|
GdkVisual *visual;
|
|
|
|
GdkColormap *cmap;
|
|
|
|
gint r, s, t, cnt;
|
|
|
|
guchar *mem;
|
|
|
|
guchar value;
|
|
|
|
guint32 pixel;
|
|
|
|
|
|
|
|
visual = gdk_window_get_visual (parent);
|
|
|
|
cmap = gdk_window_get_colormap (parent);
|
1998-06-07 05:25:10 +08:00
|
|
|
image = gdk_image_new (GDK_IMAGE_NORMAL, visual, width, height);
|
1997-11-25 06:05:25 +08:00
|
|
|
pixmap = gdk_pixmap_new (parent, width, height, -1);
|
|
|
|
gc = NULL;
|
|
|
|
|
|
|
|
if (mask)
|
|
|
|
{
|
|
|
|
GdkColor tmp_color;
|
|
|
|
|
|
|
|
*mask = gdk_pixmap_new (parent, width, height, 1);
|
|
|
|
gc = gdk_gc_new (*mask);
|
|
|
|
gdk_draw_rectangle (*mask, gc, TRUE, 0, 0, -1, -1);
|
|
|
|
|
|
|
|
tmp_color.pixel = 1;
|
|
|
|
gdk_gc_set_foreground (gc, &tmp_color);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (r = 0; r < height; r++)
|
|
|
|
{
|
|
|
|
mem = image->mem;
|
|
|
|
mem += image->bpl * r;
|
|
|
|
|
|
|
|
for (s = 0, cnt = 0; s < width; s++)
|
|
|
|
{
|
|
|
|
value = data[r][s];
|
|
|
|
|
|
|
|
if (value == '.')
|
|
|
|
{
|
|
|
|
pixel = colors[8].pixel;
|
|
|
|
|
|
|
|
if (mask)
|
|
|
|
{
|
|
|
|
if (cnt < s)
|
|
|
|
gdk_draw_line (*mask, gc, cnt, r, s - 1, r);
|
|
|
|
cnt = s + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pixel = colors[value - 'a'].pixel;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (image->byte_order == GDK_LSB_FIRST)
|
|
|
|
{
|
|
|
|
for (t = 0; t < image->bpp; t++)
|
|
|
|
*mem++ = (unsigned char) ((pixel >> (t * 8)) & 0xFF);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (t = 0; t < image->bpp; t++)
|
|
|
|
*mem++ = (unsigned char) ((pixel >> ((image->bpp - t - 1) * 8)) & 0xFF);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mask && (cnt < s))
|
|
|
|
gdk_draw_line (*mask, gc, cnt, r, s - 1, r);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mask)
|
|
|
|
gdk_gc_destroy (gc);
|
|
|
|
|
|
|
|
gc = gdk_gc_new (parent);
|
|
|
|
gdk_draw_image (pixmap, gc, image, 0, 0, 0, 0, width, height);
|
|
|
|
gdk_gc_destroy (gc);
|
|
|
|
gdk_image_destroy (image);
|
|
|
|
|
|
|
|
return pixmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget*
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
create_pixmap_widget (GdkWindow *parent,
|
|
|
|
gchar **data,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GdkPixmap *pixmap;
|
|
|
|
GdkBitmap *mask;
|
|
|
|
|
|
|
|
pixmap = create_pixmap (parent, &mask, data, width, height);
|
|
|
|
|
|
|
|
return gtk_pixmap_new (pixmap, mask);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
create_toolbox ()
|
|
|
|
{
|
|
|
|
GtkWidget *window;
|
|
|
|
GtkWidget *main_vbox;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *menubar;
|
1998-06-06 11:49:01 +08:00
|
|
|
GList *device_list;
|
1998-06-07 21:55:36 +08:00
|
|
|
GtkAccelGroup *table;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
1999-01-11 07:20:33 +08:00
|
|
|
|
|
|
|
/* Register dialog */
|
|
|
|
dialog_register_toolbox(window);
|
|
|
|
|
1998-01-26 06:13:00 +08:00
|
|
|
gtk_window_set_wmclass (GTK_WINDOW (window), "toolbox", "Gimp");
|
1998-11-23 22:47:09 +08:00
|
|
|
gtk_window_set_title (GTK_WINDOW (window), _("The GIMP"));
|
1998-07-12 06:23:23 +08:00
|
|
|
session_set_window_geometry (window, &toolbox_session_info, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
|
|
|
|
GTK_SIGNAL_FUNC (toolbox_delete),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
|
|
|
(GtkSignalFunc) toolbox_destroy,
|
|
|
|
NULL);
|
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
/* We need to know when the current device changes, so we can update
|
|
|
|
* the correct tool - to do this we connect to motion events.
|
|
|
|
* We can't just use EXTENSION_EVENTS_CURSOR though, since that
|
|
|
|
* would get us extension events for the mouse pointer, and our
|
|
|
|
* device would change to that and not change back. So we check
|
|
|
|
* manually that all devices have a cursor, before establishing the check.
|
|
|
|
*/
|
|
|
|
device_list = gdk_input_list_devices ();
|
|
|
|
while (device_list)
|
|
|
|
{
|
|
|
|
if (!((GdkDeviceInfo *)(device_list->data))->has_cursor)
|
|
|
|
break;
|
1998-06-07 12:22:57 +08:00
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
device_list = device_list->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!device_list) /* all devices have cursor */
|
|
|
|
{
|
|
|
|
gtk_signal_connect (GTK_OBJECT (window), "motion_notify_event",
|
|
|
|
GTK_SIGNAL_FUNC (toolbox_check_device), NULL);
|
1998-06-07 12:22:57 +08:00
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
gtk_widget_set_events (window, GDK_POINTER_MOTION_MASK);
|
|
|
|
gtk_widget_set_extension_events (window, GDK_EXTENSION_EVENTS_CURSOR);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
main_vbox = gtk_vbox_new (FALSE, 1);
|
1999-03-12 11:44:59 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 1);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (window), main_vbox);
|
|
|
|
gtk_widget_show (main_vbox);
|
|
|
|
|
|
|
|
/* allocate the colors for creating pixmaps */
|
|
|
|
allocate_colors (main_vbox);
|
|
|
|
|
|
|
|
/* tooltips */
|
|
|
|
tool_tips = gtk_tooltips_new ();
|
|
|
|
gtk_tooltips_set_colors (tool_tips,
|
|
|
|
&colors[11],
|
|
|
|
&main_vbox->style->fg[GTK_STATE_NORMAL]);
|
1997-12-11 08:57:08 +08:00
|
|
|
if (!show_tool_tips)
|
|
|
|
gtk_tooltips_disable (tool_tips);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Build the menu bar with menus */
|
|
|
|
menus_get_toolbox_menubar (&menubar, &table);
|
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), menubar, FALSE, TRUE, 0);
|
|
|
|
gtk_widget_show (menubar);
|
|
|
|
|
|
|
|
/* Install the accelerator table in the main window */
|
1998-06-07 21:55:36 +08:00
|
|
|
gtk_window_add_accel_group (GTK_WINDOW (window), table);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), vbox, TRUE, TRUE, 0);
|
1999-03-12 11:44:59 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
|
|
|
create_tools (vbox);
|
|
|
|
/*create_tool_label (vbox);*/
|
|
|
|
/*create_progress_area (vbox);*/
|
|
|
|
create_color_area (vbox);
|
1999-06-18 12:22:19 +08:00
|
|
|
if (show_indicators && (!no_data) )
|
1999-06-14 10:23:53 +08:00
|
|
|
create_indicator_area (vbox);
|
1998-06-11 12:36:22 +08:00
|
|
|
gtk_widget_show (window);
|
1999-07-01 17:13:39 +08:00
|
|
|
gimp_set_drop_open (window);
|
1998-06-07 12:22:57 +08:00
|
|
|
|
1999-07-07 11:18:54 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
toolbox_shell = window;
|
|
|
|
}
|
|
|
|
|
1998-02-04 06:54:35 +08:00
|
|
|
void
|
|
|
|
toolbox_free ()
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
1998-07-12 06:23:23 +08:00
|
|
|
session_get_window_info (toolbox_shell, &toolbox_session_info);
|
1998-06-23 01:30:40 +08:00
|
|
|
|
1998-02-04 06:54:35 +08:00
|
|
|
gtk_widget_destroy (toolbox_shell);
|
1998-06-22 04:17:21 +08:00
|
|
|
for (i = 0; i < num_tools; i++)
|
1998-02-04 06:54:35 +08:00
|
|
|
{
|
1998-06-22 04:17:21 +08:00
|
|
|
if (!tool_info[i].icon_data)
|
|
|
|
gtk_object_sink (GTK_OBJECT (tool_info[i].tool_widget));
|
1998-06-07 12:22:57 +08:00
|
|
|
}
|
1998-02-04 06:54:35 +08:00
|
|
|
gtk_object_destroy (GTK_OBJECT (tool_tips));
|
|
|
|
gtk_object_unref (GTK_OBJECT (tool_tips));
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
toolbox_raise_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
gdk_window_raise(toolbox_shell->window);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-06-30 23:31:32 +08:00
|
|
|
create_display_shell (GDisplay* gdisp,
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gchar *title,
|
|
|
|
gint type)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
static GtkWidget *image_popup_menu = NULL;
|
1998-06-07 21:55:36 +08:00
|
|
|
static GtkAccelGroup *image_accel_group = NULL;
|
1999-07-07 11:18:54 +08:00
|
|
|
|
1998-06-15 12:46:32 +08:00
|
|
|
GtkWidget *vbox;
|
1997-11-25 06:05:25 +08:00
|
|
|
GtkWidget *table;
|
1998-06-15 12:46:32 +08:00
|
|
|
GtkWidget *table_inner;
|
1999-07-07 11:18:54 +08:00
|
|
|
GtkWidget *table_lower;
|
1998-07-16 11:23:14 +08:00
|
|
|
GtkWidget *frame;
|
1998-06-09 17:20:46 +08:00
|
|
|
GtkWidget *arrow;
|
1999-07-07 11:18:54 +08:00
|
|
|
GtkWidget *pixmap;
|
|
|
|
|
|
|
|
GSList *group = NULL;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
int n_width, n_height;
|
|
|
|
int s_width, s_height;
|
|
|
|
int scalesrc, scaledest;
|
1998-06-15 10:25:27 +08:00
|
|
|
int contextid;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
{
|
1998-11-20 04:20:46 +08:00
|
|
|
/* adjust the initial scale -- so that window fits on screen */
|
1997-11-25 06:05:25 +08:00
|
|
|
s_width = gdk_screen_width ();
|
|
|
|
s_height = gdk_screen_height ();
|
|
|
|
|
|
|
|
scalesrc = gdisp->scale & 0x00ff;
|
|
|
|
scaledest = gdisp->scale >> 8;
|
|
|
|
|
|
|
|
n_width = (width * scaledest) / scalesrc;
|
|
|
|
n_height = (height * scaledest) / scalesrc;
|
|
|
|
|
|
|
|
/* Limit to the size of the screen... */
|
|
|
|
while (n_width > s_width || n_height > s_height)
|
|
|
|
{
|
|
|
|
if (scaledest > 1)
|
|
|
|
scaledest--;
|
|
|
|
else
|
|
|
|
if (scalesrc < 0xff)
|
|
|
|
scalesrc++;
|
|
|
|
|
|
|
|
n_width = (width * scaledest) / scalesrc;
|
|
|
|
n_height = (height * scaledest) / scalesrc;
|
|
|
|
}
|
|
|
|
|
|
|
|
gdisp->scale = (scaledest << 8) + scalesrc;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The adjustment datums */
|
|
|
|
gdisp->hsbdata = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, width, 1, 1, width));
|
|
|
|
gdisp->vsbdata = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, height, 1, 1, height));
|
|
|
|
|
|
|
|
/* The toplevel shell */
|
|
|
|
gdisp->shell = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
1998-02-14 23:30:31 +08:00
|
|
|
gtk_widget_ref (gdisp->shell);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_window_set_title (GTK_WINDOW (gdisp->shell), title);
|
1998-01-26 06:13:00 +08:00
|
|
|
gtk_window_set_wmclass (GTK_WINDOW (gdisp->shell), "image_window", "Gimp");
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_window_set_policy (GTK_WINDOW (gdisp->shell), TRUE, TRUE, TRUE);
|
|
|
|
gtk_object_set_user_data (GTK_OBJECT (gdisp->shell), (gpointer) gdisp);
|
1999-06-04 02:28:39 +08:00
|
|
|
gtk_widget_set_events (gdisp->shell, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->shell), "delete_event",
|
|
|
|
GTK_SIGNAL_FUNC (gdisplay_delete),
|
|
|
|
gdisp);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->shell), "destroy",
|
|
|
|
(GtkSignalFunc) gdisplay_destroy,
|
|
|
|
gdisp);
|
|
|
|
|
1999-06-04 02:28:39 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->shell), "button_press_event",
|
|
|
|
(GtkSignalFunc) gdisplay_shell_events,
|
|
|
|
gdisp);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->shell), "key_press_event",
|
|
|
|
(GtkSignalFunc) gdisplay_shell_events,
|
|
|
|
gdisp);
|
|
|
|
|
1998-06-15 12:46:32 +08:00
|
|
|
/* the vbox, table containing all widgets */
|
1999-05-31 22:11:10 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (gdisp->shell), vbox);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
1998-06-15 12:46:32 +08:00
|
|
|
|
|
|
|
/* the table widget is pretty stupid so we need 2 tables
|
1998-07-20 23:07:13 +08:00
|
|
|
or it treats rulers and canvas with equal weight when
|
1998-06-15 12:46:32 +08:00
|
|
|
allocating space, ugh. */
|
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 1);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 1);
|
1998-07-20 23:07:13 +08:00
|
|
|
gtk_box_pack_start(GTK_BOX (vbox), table, TRUE, TRUE, 0);
|
1998-06-15 12:46:32 +08:00
|
|
|
|
|
|
|
table_inner = gtk_table_new (2, 2, FALSE);
|
1998-06-15 13:43:46 +08:00
|
|
|
gtk_table_set_col_spacing (GTK_TABLE (table_inner), 0, 1);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (table_inner), 0, 1);
|
1998-06-15 12:46:32 +08:00
|
|
|
|
1999-07-07 11:18:54 +08:00
|
|
|
table_lower = gtk_table_new (1,3,FALSE);
|
|
|
|
gtk_table_set_col_spacing (GTK_TABLE (table_lower), 0, 1);
|
|
|
|
/* gtk_table_set_row_spacing (GTK_TABLE (table_lower), 0, 1); */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-06-15 10:25:27 +08:00
|
|
|
/* hbox for statusbar area */
|
1999-05-31 22:11:10 +08:00
|
|
|
gdisp->statusarea = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), gdisp->statusarea, FALSE, TRUE, 0);
|
1998-06-15 10:25:27 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* scrollbars, rulers, canvas, menu popup button */
|
1998-06-09 17:20:46 +08:00
|
|
|
gdisp->origin = gtk_button_new ();
|
1999-06-04 02:28:39 +08:00
|
|
|
GTK_WIDGET_UNSET_FLAGS (gdisp->origin, GTK_CAN_FOCUS);
|
1998-06-09 17:20:46 +08:00
|
|
|
gtk_widget_set_events (GTK_WIDGET (gdisp->origin),
|
|
|
|
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->origin), "button_press_event",
|
|
|
|
(GtkSignalFunc) gdisplay_origin_button_press,
|
|
|
|
gdisp);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1998-06-09 17:20:46 +08:00
|
|
|
arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_OUT);
|
1999-03-12 11:44:59 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (gdisp->origin), 0);
|
1998-06-09 17:20:46 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (gdisp->origin), arrow);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gdisp->hrule = gtk_hruler_new ();
|
|
|
|
gtk_widget_set_events (GTK_WIDGET (gdisp->hrule),
|
|
|
|
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
|
|
|
gtk_signal_connect_object (GTK_OBJECT (gdisp->shell), "motion_notify_event",
|
|
|
|
(GtkSignalFunc) GTK_WIDGET_CLASS (GTK_OBJECT (gdisp->hrule)->klass)->motion_notify_event,
|
|
|
|
GTK_OBJECT (gdisp->hrule));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->hrule), "button_press_event",
|
|
|
|
(GtkSignalFunc) gdisplay_hruler_button_press,
|
|
|
|
gdisp);
|
|
|
|
|
|
|
|
gdisp->vrule = gtk_vruler_new ();
|
|
|
|
gtk_widget_set_events (GTK_WIDGET (gdisp->vrule),
|
|
|
|
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
|
|
|
gtk_signal_connect_object (GTK_OBJECT (gdisp->shell), "motion_notify_event",
|
|
|
|
(GtkSignalFunc) GTK_WIDGET_CLASS (GTK_OBJECT (gdisp->vrule)->klass)->motion_notify_event,
|
|
|
|
GTK_OBJECT (gdisp->vrule));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->vrule), "button_press_event",
|
|
|
|
(GtkSignalFunc) gdisplay_vruler_button_press,
|
|
|
|
gdisp);
|
|
|
|
|
|
|
|
gdisp->hsb = gtk_hscrollbar_new (gdisp->hsbdata);
|
1998-03-11 13:38:45 +08:00
|
|
|
GTK_WIDGET_UNSET_FLAGS (gdisp->hsb, GTK_CAN_FOCUS);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisp->vsb = gtk_vscrollbar_new (gdisp->vsbdata);
|
1998-03-11 13:38:45 +08:00
|
|
|
GTK_WIDGET_UNSET_FLAGS (gdisp->vsb, GTK_CAN_FOCUS);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-07-07 11:18:54 +08:00
|
|
|
|
|
|
|
gdisp->qmaskoff = gtk_radio_button_new(group);
|
|
|
|
group = gtk_radio_button_group (GTK_RADIO_BUTTON (gdisp->qmaskoff));
|
|
|
|
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (gdisp->qmaskoff), FALSE);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->qmaskoff), "toggled",
|
|
|
|
(GtkSignalFunc) qmask_deactivate,
|
|
|
|
gdisp);
|
1999-08-08 04:55:26 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->qmaskoff), "button_press_event",
|
|
|
|
(GtkSignalFunc) qmask_click_handler,
|
|
|
|
gdisp);
|
1999-07-07 11:18:54 +08:00
|
|
|
|
|
|
|
gdisp->qmaskon = gtk_radio_button_new(group);
|
|
|
|
group = gtk_radio_button_group (GTK_RADIO_BUTTON (gdisp->qmaskon));
|
|
|
|
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (gdisp->qmaskon), FALSE);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->qmaskon), "toggled",
|
|
|
|
(GtkSignalFunc) qmask_activate,
|
|
|
|
gdisp);
|
1999-08-08 04:55:26 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->qmaskon), "button_press_event",
|
|
|
|
(GtkSignalFunc) qmask_click_handler,
|
|
|
|
gdisp);
|
1999-07-07 11:18:54 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff), TRUE);
|
|
|
|
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
|
|
|
|
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
|
1999-07-07 11:18:54 +08:00
|
|
|
/* Draw pixmaps - note: you must realize the parent prior to doing the
|
|
|
|
rest! */
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
{
|
1999-07-07 11:18:54 +08:00
|
|
|
GdkPixmap *pxmp;
|
|
|
|
GdkBitmap *mask;
|
|
|
|
GtkStyle *style;
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_widget_realize (gdisp->shell);
|
|
|
|
style = gtk_widget_get_style (gdisp->shell);
|
1999-07-07 11:18:54 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
|
|
&style->bg[GTK_STATE_NORMAL],
|
|
|
|
qmasksel_xpm);
|
1999-07-07 11:18:54 +08:00
|
|
|
|
|
|
|
pixmap = gtk_pixmap_new (pxmp, mask);
|
|
|
|
gtk_container_add (GTK_CONTAINER (gdisp->qmaskon), pixmap);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_widget_show (pixmap);
|
1999-07-07 11:18:54 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
|
|
&style->bg[GTK_STATE_NORMAL],
|
|
|
|
qmasknosel_xpm);
|
1999-07-07 11:18:54 +08:00
|
|
|
pixmap = gtk_pixmap_new (pxmp, mask);
|
|
|
|
gtk_container_add (GTK_CONTAINER (gdisp->qmaskoff), pixmap);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_widget_show (pixmap);
|
|
|
|
}
|
1999-07-07 11:18:54 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisp->canvas = gtk_drawing_area_new ();
|
|
|
|
gtk_drawing_area_size (GTK_DRAWING_AREA (gdisp->canvas), n_width, n_height);
|
|
|
|
gtk_widget_set_events (gdisp->canvas, CANVAS_EVENT_MASK);
|
1998-06-06 11:49:01 +08:00
|
|
|
gtk_widget_set_extension_events (gdisp->canvas, GDK_EXTENSION_EVENTS_ALL);
|
1997-11-25 06:05:25 +08:00
|
|
|
GTK_WIDGET_SET_FLAGS (gdisp->canvas, GTK_CAN_FOCUS);
|
1999-06-26 19:16:47 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (gdisp->canvas), (gpointer) gdisp);
|
|
|
|
|
|
|
|
/* set the active display before doing any other canvas event processing */
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->canvas), "event",
|
1999-06-26 19:16:47 +08:00
|
|
|
(GtkSignalFunc) gdisplay_shell_events,
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisp);
|
|
|
|
|
1999-06-26 19:16:47 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (gdisp->canvas), "event",
|
|
|
|
(GtkSignalFunc) gdisplay_canvas_events,
|
|
|
|
gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* pack all the widgets */
|
1999-07-07 11:18:54 +08:00
|
|
|
|
1998-06-15 12:46:32 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), table_inner, 0, 1, 0, 1,
|
|
|
|
GTK_FILL | GTK_EXPAND | GTK_SHRINK,
|
|
|
|
GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0);
|
1999-07-07 11:18:54 +08:00
|
|
|
/* sneak in an extra table here */
|
|
|
|
gtk_table_attach (GTK_TABLE (table_lower), gdisp->hsb, 2, 3, 0, 1,
|
|
|
|
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table_lower), gdisp->qmaskoff, 0, 1, 0, 1,
|
|
|
|
GTK_SHRINK, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table_lower), gdisp->qmaskon, 1, 2, 0, 1,
|
|
|
|
GTK_SHRINK, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table), table_lower, 0, 1, 1, 2,
|
|
|
|
GTK_FILL | GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
|
|
|
|
|
1998-06-15 12:46:32 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), gdisp->vsb, 1, 2, 0, 1,
|
|
|
|
GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table_inner), gdisp->origin, 0, 1, 0, 1,
|
1997-11-25 06:05:25 +08:00
|
|
|
GTK_FILL, GTK_FILL, 0, 0);
|
1998-06-15 12:46:32 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table_inner), gdisp->hrule, 1, 2, 0, 1,
|
1997-11-25 06:05:25 +08:00
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
|
1998-06-15 12:46:32 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table_inner), gdisp->vrule, 0, 1, 1, 2,
|
1997-11-25 06:05:25 +08:00
|
|
|
GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
1998-06-15 12:46:32 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table_inner), gdisp->canvas, 1, 2, 1, 2,
|
1997-11-25 06:05:25 +08:00
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (! image_popup_menu)
|
1998-06-07 21:55:36 +08:00
|
|
|
menus_get_image_menu (&image_popup_menu, &image_accel_group);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-08-05 20:38:11 +08:00
|
|
|
gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusarea),
|
|
|
|
GTK_RESIZE_QUEUE);
|
1998-07-16 11:23:14 +08:00
|
|
|
|
|
|
|
/* cursor, statusbar, progressbar */
|
1998-08-05 20:38:11 +08:00
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
|
|
|
gtk_box_pack_start (GTK_BOX (gdisp->statusarea), frame, FALSE, TRUE, 0);
|
1998-07-16 11:23:14 +08:00
|
|
|
|
1998-11-20 04:20:46 +08:00
|
|
|
gdisp->cursor_label = gtk_label_new (" ");
|
1998-08-05 20:38:11 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), gdisp->cursor_label);
|
1998-07-16 11:23:14 +08:00
|
|
|
|
1998-12-14 02:52:34 +08:00
|
|
|
/* we need to realize the cursor_label widget here, so the size gets
|
|
|
|
computed correctly */
|
|
|
|
gtk_widget_realize (gdisp->cursor_label);
|
1998-12-13 01:41:41 +08:00
|
|
|
gdisplay_resize_cursor_label (gdisp);
|
|
|
|
|
1998-08-05 20:38:11 +08:00
|
|
|
gdisp->statusbar = gtk_statusbar_new ();
|
|
|
|
gtk_widget_set_usize (gdisp->statusbar, 1, -1);
|
1998-06-19 09:39:02 +08:00
|
|
|
gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusbar),
|
|
|
|
GTK_RESIZE_QUEUE);
|
1998-08-05 20:38:11 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->statusbar, TRUE, TRUE, 0);
|
1998-06-15 10:25:27 +08:00
|
|
|
contextid = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar),
|
|
|
|
"title");
|
1998-08-05 20:38:11 +08:00
|
|
|
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar),
|
|
|
|
contextid,
|
|
|
|
title);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1998-06-15 10:25:27 +08:00
|
|
|
gdisp->progressbar = gtk_progress_bar_new();
|
1998-08-05 20:38:11 +08:00
|
|
|
gtk_widget_set_usize (gdisp->progressbar, 80, -1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->progressbar, FALSE, TRUE, 0);
|
1998-07-20 23:07:13 +08:00
|
|
|
|
1998-11-23 22:47:09 +08:00
|
|
|
gdisp->cancelbutton = gtk_button_new_with_label(_("Cancel"));
|
1998-08-05 20:38:11 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->cancelbutton, FALSE, TRUE, 0);
|
1998-07-12 23:18:07 +08:00
|
|
|
gtk_widget_set_sensitive (gdisp->cancelbutton, FALSE);
|
1998-07-15 20:15:24 +08:00
|
|
|
|
1999-07-07 11:18:54 +08:00
|
|
|
/* the popup menu */
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisp->popup = image_popup_menu;
|
|
|
|
|
|
|
|
/* the accelerator table for images */
|
1998-06-07 21:55:36 +08:00
|
|
|
gtk_window_add_accel_group (GTK_WINDOW (gdisp->shell), image_accel_group);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-06-09 17:20:46 +08:00
|
|
|
gtk_widget_show (arrow);
|
1999-07-07 11:18:54 +08:00
|
|
|
gtk_widget_show (gdisp->qmaskon);
|
|
|
|
gtk_widget_show (gdisp->qmaskoff);
|
|
|
|
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (gdisp->hsb);
|
|
|
|
gtk_widget_show (gdisp->vsb);
|
1998-10-07 16:59:11 +08:00
|
|
|
|
1998-08-05 20:38:11 +08:00
|
|
|
if (show_rulers)
|
|
|
|
{
|
|
|
|
gtk_widget_show (gdisp->origin);
|
|
|
|
gtk_widget_show (gdisp->hrule);
|
|
|
|
gtk_widget_show (gdisp->vrule);
|
|
|
|
}
|
1998-10-07 16:59:11 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (gdisp->canvas);
|
1998-07-16 11:23:14 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
gtk_widget_show (gdisp->cursor_label);
|
1998-06-15 10:25:27 +08:00
|
|
|
gtk_widget_show (gdisp->statusbar);
|
|
|
|
gtk_widget_show (gdisp->progressbar);
|
1998-07-12 23:18:07 +08:00
|
|
|
gtk_widget_show (gdisp->cancelbutton);
|
1999-07-07 11:18:54 +08:00
|
|
|
|
|
|
|
gtk_widget_show (table_lower);
|
1998-06-15 12:46:32 +08:00
|
|
|
gtk_widget_show (table_inner);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (table);
|
1998-08-05 20:38:11 +08:00
|
|
|
if (show_statusbar)
|
|
|
|
{
|
|
|
|
gtk_widget_show (gdisp->statusarea);
|
|
|
|
}
|
1998-06-15 12:46:32 +08:00
|
|
|
gtk_widget_show (vbox);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-07-07 11:18:54 +08:00
|
|
|
gtk_widget_show (gdisp->shell);
|
1998-10-25 13:55:36 +08:00
|
|
|
#ifdef __GNUC__
|
1998-10-04 04:14:00 +08:00
|
|
|
#warning DODGY?
|
1999-07-07 11:18:54 +08:00
|
|
|
#endif /*__GNUC__ */
|
1998-10-04 04:14:00 +08:00
|
|
|
gtk_widget_realize (gdisp->canvas);
|
|
|
|
gdk_window_set_back_pixmap(gdisp->canvas->window, NULL, 0);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* set the focus to the canvas area */
|
|
|
|
gtk_widget_grab_focus (gdisp->canvas);
|
1999-07-07 11:18:54 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
1999-05-23 01:56:35 +08:00
|
|
|
* String, integer, double and size query boxes
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct _QueryBox QueryBox;
|
|
|
|
|
|
|
|
struct _QueryBox
|
|
|
|
{
|
|
|
|
GtkWidget *qbox;
|
1999-03-12 11:44:59 +08:00
|
|
|
GtkWidget *vbox;
|
1997-11-25 06:05:25 +08:00
|
|
|
GtkWidget *entry;
|
1999-03-12 11:44:59 +08:00
|
|
|
GtkWidget *ok_button;
|
|
|
|
GtkObject *object;
|
|
|
|
QueryFunc callback;
|
|
|
|
gpointer data;
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
1999-03-26 07:14:36 +08:00
|
|
|
static QueryBox * create_query_box (gchar *, gchar *, GtkObject *, gchar *,
|
|
|
|
QueryFunc, gpointer);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
static gint query_box_delete_callback (GtkWidget *, GdkEvent *, gpointer);
|
|
|
|
static void query_box_cancel_callback (GtkWidget *, gpointer);
|
|
|
|
static void string_query_box_ok_callback (GtkWidget *, gpointer);
|
|
|
|
static void int_query_box_ok_callback (GtkWidget *, gpointer);
|
|
|
|
static void double_query_box_ok_callback (GtkWidget *, gpointer);
|
|
|
|
static void size_query_box_ok_callback (GtkWidget *, gpointer);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
/* create a generic query box without any entry widget */
|
1999-06-21 07:29:34 +08:00
|
|
|
static QueryBox *
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
create_query_box (gchar *title,
|
|
|
|
gchar *message,
|
|
|
|
GtkObject *object,
|
|
|
|
gchar *signal,
|
|
|
|
QueryFunc callback,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
QueryBox *query_box;
|
|
|
|
GtkWidget *qbox;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *label;
|
1999-05-23 01:56:35 +08:00
|
|
|
|
|
|
|
static ActionAreaItem action_items[] =
|
|
|
|
{
|
|
|
|
{ N_("OK"), (ActionCallback) NULL, NULL, NULL },
|
|
|
|
{ N_("Cancel"), (ActionCallback) query_box_cancel_callback, NULL, NULL }
|
|
|
|
};
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
query_box = (QueryBox *) g_malloc (sizeof (QueryBox));
|
|
|
|
|
|
|
|
qbox = gtk_dialog_new ();
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_window_set_title (GTK_WINDOW (qbox), title);
|
1998-01-26 06:13:00 +08:00
|
|
|
gtk_window_set_wmclass (GTK_WINDOW (qbox), "query_box", "Gimp");
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_window_position (GTK_WINDOW (qbox), GTK_WIN_POS_MOUSE);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (qbox), "delete_event",
|
|
|
|
(GtkSignalFunc) query_box_delete_callback,
|
|
|
|
query_box);
|
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
/* if we are associated with an object, connect to the provided signal */
|
1999-03-26 07:14:36 +08:00
|
|
|
if (object && GTK_IS_OBJECT (object) && signal)
|
|
|
|
gtk_signal_connect (GTK_OBJECT (object), signal,
|
1999-03-12 11:44:59 +08:00
|
|
|
(GtkSignalFunc) query_box_cancel_callback,
|
|
|
|
query_box);
|
|
|
|
else
|
|
|
|
object = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-05-23 01:56:35 +08:00
|
|
|
/* The action area */
|
|
|
|
action_items[1].user_data = query_box;
|
|
|
|
build_action_area (GTK_DIALOG (qbox), action_items, 2, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (qbox)->vbox), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
label = gtk_label_new (message);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (label);
|
|
|
|
|
1999-03-12 11:44:59 +08:00
|
|
|
query_box->qbox = qbox;
|
|
|
|
query_box->vbox = vbox;
|
|
|
|
query_box->entry = NULL;
|
1999-05-23 01:56:35 +08:00
|
|
|
query_box->ok_button = action_items[0].widget;
|
1999-03-12 11:44:59 +08:00
|
|
|
query_box->object = object;
|
|
|
|
query_box->callback = callback;
|
|
|
|
query_box->data = data;
|
|
|
|
|
|
|
|
return query_box;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
1999-03-26 07:14:36 +08:00
|
|
|
query_string_box (gchar *title,
|
|
|
|
gchar *message,
|
|
|
|
gchar *initial,
|
1999-03-12 11:44:59 +08:00
|
|
|
GtkObject *object,
|
1999-03-26 07:14:36 +08:00
|
|
|
gchar *signal,
|
1999-03-12 11:44:59 +08:00
|
|
|
QueryFunc callback,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
QueryBox *query_box;
|
|
|
|
GtkWidget *entry;
|
|
|
|
|
1999-03-26 07:14:36 +08:00
|
|
|
query_box = create_query_box (title, message, object, signal, callback, data);
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (query_box->ok_button), "clicked",
|
|
|
|
(GtkSignalFunc) string_query_box_ok_callback,
|
|
|
|
query_box);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
entry = gtk_entry_new ();
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (query_box->vbox), entry, FALSE, FALSE, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
if (initial)
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_entry_set_text (GTK_ENTRY (entry), initial);
|
1999-03-15 02:03:58 +08:00
|
|
|
gtk_widget_grab_focus (entry);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (entry);
|
|
|
|
|
|
|
|
query_box->entry = entry;
|
|
|
|
|
1999-03-12 11:44:59 +08:00
|
|
|
return query_box->qbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
1999-03-26 07:14:36 +08:00
|
|
|
query_int_box (gchar *title,
|
|
|
|
gchar *message,
|
|
|
|
gint initial,
|
|
|
|
gint lower,
|
|
|
|
gint upper,
|
1999-03-12 11:44:59 +08:00
|
|
|
GtkObject *object,
|
1999-03-26 07:14:36 +08:00
|
|
|
gchar *signal,
|
1999-03-12 11:44:59 +08:00
|
|
|
QueryFunc callback,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
QueryBox *query_box;
|
|
|
|
GtkAdjustment* adjustment;
|
|
|
|
GtkWidget *spinbutton;
|
|
|
|
|
1999-03-26 07:14:36 +08:00
|
|
|
query_box = create_query_box (title, message, object, signal, callback, data);
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (query_box->ok_button), "clicked",
|
|
|
|
(GtkSignalFunc) int_query_box_ok_callback,
|
|
|
|
query_box);
|
1999-05-31 22:11:10 +08:00
|
|
|
adjustment =
|
|
|
|
GTK_ADJUSTMENT (gtk_adjustment_new (initial, lower, upper, 1, 10, 0));
|
1999-03-12 11:44:59 +08:00
|
|
|
spinbutton = gtk_spin_button_new (adjustment, 1.0, 0);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (query_box->vbox), spinbutton, FALSE, FALSE, 0);
|
1999-03-15 02:03:58 +08:00
|
|
|
gtk_widget_grab_focus (spinbutton);
|
1999-03-12 11:44:59 +08:00
|
|
|
gtk_widget_show (spinbutton);
|
|
|
|
|
|
|
|
query_box->entry = spinbutton;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-03-12 11:44:59 +08:00
|
|
|
return query_box->qbox;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-03-12 11:44:59 +08:00
|
|
|
GtkWidget *
|
1999-05-31 22:11:10 +08:00
|
|
|
query_double_box (gchar *title,
|
|
|
|
gchar *message,
|
|
|
|
gdouble initial,
|
|
|
|
gdouble lower,
|
|
|
|
gdouble upper,
|
|
|
|
gint digits,
|
|
|
|
GtkObject *object,
|
|
|
|
gchar *signal,
|
|
|
|
QueryFunc callback,
|
|
|
|
gpointer data)
|
1999-03-12 11:44:59 +08:00
|
|
|
{
|
|
|
|
QueryBox *query_box;
|
|
|
|
GtkAdjustment* adjustment;
|
|
|
|
GtkWidget *spinbutton;
|
|
|
|
|
1999-03-26 07:14:36 +08:00
|
|
|
query_box = create_query_box (title, message, object, signal, callback, data);
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (query_box->ok_button), "clicked",
|
1999-05-23 01:56:35 +08:00
|
|
|
(GtkSignalFunc) double_query_box_ok_callback,
|
1999-03-12 11:44:59 +08:00
|
|
|
query_box);
|
1999-05-31 22:11:10 +08:00
|
|
|
adjustment =
|
|
|
|
GTK_ADJUSTMENT (gtk_adjustment_new (initial, lower, upper, 1, 10, 0));
|
1999-03-12 11:44:59 +08:00
|
|
|
spinbutton = gtk_spin_button_new (adjustment, 1.0, digits);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (query_box->vbox), spinbutton, FALSE, FALSE, 0);
|
1999-03-15 02:03:58 +08:00
|
|
|
gtk_widget_grab_focus (spinbutton);
|
1999-03-12 11:44:59 +08:00
|
|
|
gtk_widget_show (spinbutton);
|
|
|
|
|
|
|
|
query_box->entry = spinbutton;
|
|
|
|
|
|
|
|
return query_box->qbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
1999-05-31 22:11:10 +08:00
|
|
|
query_size_box (gchar *title,
|
|
|
|
gchar *message,
|
|
|
|
gdouble initial,
|
|
|
|
gdouble lower,
|
|
|
|
gdouble upper,
|
|
|
|
gint digits,
|
|
|
|
GUnit unit,
|
|
|
|
gdouble resolution,
|
|
|
|
gint dot_for_dot,
|
|
|
|
GtkObject *object,
|
|
|
|
gchar *signal,
|
|
|
|
QueryFunc callback,
|
|
|
|
gpointer data)
|
1999-03-12 11:44:59 +08:00
|
|
|
{
|
|
|
|
QueryBox *query_box;
|
|
|
|
GtkWidget *sizeentry;
|
|
|
|
|
1999-03-26 07:14:36 +08:00
|
|
|
query_box = create_query_box (title, message, object, signal, callback, data);
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (query_box->ok_button), "clicked",
|
|
|
|
(GtkSignalFunc) size_query_box_ok_callback,
|
|
|
|
query_box);
|
|
|
|
|
1999-04-05 20:48:48 +08:00
|
|
|
sizeentry = gimp_size_entry_new (1, unit, "%p", TRUE, FALSE, FALSE, 100,
|
1999-03-12 11:44:59 +08:00
|
|
|
GIMP_SIZE_ENTRY_UPDATE_SIZE);
|
1999-05-31 22:11:10 +08:00
|
|
|
if (dot_for_dot)
|
|
|
|
gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (sizeentry), UNIT_PIXEL);
|
1999-03-12 11:44:59 +08:00
|
|
|
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 0,
|
|
|
|
resolution, FALSE);
|
|
|
|
gimp_size_entry_set_refval_digits (GIMP_SIZE_ENTRY (sizeentry), 0, digits);
|
|
|
|
gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 0,
|
|
|
|
lower, upper);
|
|
|
|
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, initial);
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (query_box->vbox), sizeentry, FALSE, FALSE, 0);
|
1999-03-15 02:03:58 +08:00
|
|
|
gimp_size_entry_grab_focus (GIMP_SIZE_ENTRY (sizeentry));
|
1999-03-12 11:44:59 +08:00
|
|
|
gtk_widget_show (sizeentry);
|
|
|
|
|
|
|
|
query_box->entry = sizeentry;
|
|
|
|
|
|
|
|
return query_box->qbox;
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static gint
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
query_box_delete_callback (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
query_box_cancel_callback (widget, client_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-03-13 06:01:43 +08:00
|
|
|
return TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
query_box_cancel_callback (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
QueryBox *query_box;
|
|
|
|
|
|
|
|
query_box = (QueryBox *) client_data;
|
|
|
|
|
1999-03-26 07:14:36 +08:00
|
|
|
/* disconnect, if we are connected to some signal */
|
1999-03-12 11:44:59 +08:00
|
|
|
if (query_box->object)
|
|
|
|
gtk_signal_disconnect_by_data (query_box->object, query_box);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Destroy the box */
|
|
|
|
gtk_widget_destroy (query_box->qbox);
|
|
|
|
|
|
|
|
g_free (query_box);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
string_query_box_ok_callback (GtkWidget *widget,
|
1999-03-12 11:44:59 +08:00
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
QueryBox *query_box;
|
1999-03-26 07:14:36 +08:00
|
|
|
gchar *string;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
query_box = (QueryBox *) client_data;
|
|
|
|
|
1999-06-04 02:28:39 +08:00
|
|
|
gtk_widget_set_sensitive (query_box->qbox, FALSE);
|
|
|
|
|
1999-03-26 07:14:36 +08:00
|
|
|
/* disconnect, if we are connected to some signal */
|
1999-03-12 11:44:59 +08:00
|
|
|
if (query_box->object)
|
|
|
|
gtk_signal_disconnect_by_data (query_box->object, query_box);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Get the entry data */
|
|
|
|
string = g_strdup (gtk_entry_get_text (GTK_ENTRY (query_box->entry)));
|
|
|
|
|
|
|
|
/* Call the user defined callback */
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
(* query_box->callback) (query_box->qbox, query_box->data, (gpointer) string);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Destroy the box */
|
|
|
|
gtk_widget_destroy (query_box->qbox);
|
|
|
|
|
|
|
|
g_free (query_box);
|
|
|
|
}
|
|
|
|
|
1999-03-12 11:44:59 +08:00
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
int_query_box_ok_callback (GtkWidget *widget,
|
1999-03-12 11:44:59 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
QueryBox *query_box;
|
1999-03-26 07:14:36 +08:00
|
|
|
gint *integer_value;
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
query_box = (QueryBox *) client_data;
|
|
|
|
|
1999-06-04 02:28:39 +08:00
|
|
|
gtk_widget_set_sensitive (query_box->qbox, FALSE);
|
|
|
|
|
1999-03-26 07:14:36 +08:00
|
|
|
/* disconnect, if we are connected to some signal */
|
1999-03-12 11:44:59 +08:00
|
|
|
if (query_box->object)
|
|
|
|
gtk_signal_disconnect_by_data (query_box->object, query_box);
|
|
|
|
|
|
|
|
/* Get the spinbutton data */
|
1999-03-26 07:14:36 +08:00
|
|
|
integer_value = g_malloc (sizeof (gint));
|
1999-03-12 11:44:59 +08:00
|
|
|
*integer_value =
|
1999-05-23 01:56:35 +08:00
|
|
|
gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (query_box->entry));
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
/* Call the user defined callback */
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
(* query_box->callback) (query_box->qbox, query_box->data,
|
|
|
|
(gpointer) integer_value);
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
/* Destroy the box */
|
|
|
|
gtk_widget_destroy (query_box->qbox);
|
|
|
|
|
|
|
|
g_free (query_box);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
double_query_box_ok_callback (GtkWidget *widget,
|
1999-05-23 01:56:35 +08:00
|
|
|
gpointer client_data)
|
1999-03-12 11:44:59 +08:00
|
|
|
{
|
|
|
|
QueryBox *query_box;
|
1999-05-23 01:56:35 +08:00
|
|
|
gdouble *double_value;
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
query_box = (QueryBox *) client_data;
|
|
|
|
|
1999-06-04 02:28:39 +08:00
|
|
|
gtk_widget_set_sensitive (query_box->qbox, FALSE);
|
|
|
|
|
1999-03-26 07:14:36 +08:00
|
|
|
/* disconnect, if we are connected to some signal */
|
1999-03-12 11:44:59 +08:00
|
|
|
if (query_box->object)
|
|
|
|
gtk_signal_disconnect_by_data (query_box->object, query_box);
|
|
|
|
|
|
|
|
/* Get the spinbutton data */
|
1999-05-23 01:56:35 +08:00
|
|
|
double_value = g_malloc (sizeof (gdouble));
|
|
|
|
*double_value =
|
|
|
|
gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (query_box->entry));
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
/* Call the user defined callback */
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
(* query_box->callback) (query_box->qbox, query_box->data,
|
|
|
|
(gpointer) double_value);
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
/* Destroy the box */
|
|
|
|
gtk_widget_destroy (query_box->qbox);
|
|
|
|
|
|
|
|
g_free (query_box);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
size_query_box_ok_callback (GtkWidget *widget,
|
1999-03-12 11:44:59 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
QueryBox *query_box;
|
1999-05-23 01:56:35 +08:00
|
|
|
gdouble *double_value;
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
query_box = (QueryBox *) client_data;
|
|
|
|
|
1999-06-04 02:28:39 +08:00
|
|
|
gtk_widget_set_sensitive (query_box->qbox, FALSE);
|
|
|
|
|
1999-03-26 07:14:36 +08:00
|
|
|
/* disconnect, if we are connected to some signal */
|
1999-03-12 11:44:59 +08:00
|
|
|
if (query_box->object)
|
|
|
|
gtk_signal_disconnect_by_data (query_box->object, query_box);
|
|
|
|
|
|
|
|
/* Get the sizeentry data */
|
1999-05-23 01:56:35 +08:00
|
|
|
double_value = g_malloc (sizeof (gdouble));
|
|
|
|
*double_value =
|
1999-03-12 11:44:59 +08:00
|
|
|
gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (query_box->entry), 0);
|
|
|
|
|
1999-05-07 07:10:29 +08:00
|
|
|
/* Pass the selected unit to the callback */
|
|
|
|
gtk_object_set_data
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
(GTK_OBJECT (widget), "size_query_unit",
|
1999-05-07 07:10:29 +08:00
|
|
|
(gpointer) gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (query_box->entry)));
|
|
|
|
|
1999-03-12 11:44:59 +08:00
|
|
|
/* Call the user defined callback */
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
(* query_box->callback) (query_box->qbox, query_box->data,
|
|
|
|
(gpointer) double_value);
|
1999-03-12 11:44:59 +08:00
|
|
|
|
|
|
|
/* Destroy the box */
|
|
|
|
gtk_widget_destroy (query_box->qbox);
|
|
|
|
|
|
|
|
g_free (query_box);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Message Boxes...
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct _MessageBox MessageBox;
|
|
|
|
|
|
|
|
struct _MessageBox
|
|
|
|
{
|
|
|
|
GtkWidget *mbox;
|
|
|
|
GtkCallback callback;
|
|
|
|
gpointer data;
|
|
|
|
};
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
static void message_box_close_callback (GtkWidget *, gpointer);
|
|
|
|
static gint message_box_delete_callback (GtkWidget *, GdkEvent *, gpointer);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
GtkWidget *
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
message_box (gchar *message,
|
1997-11-25 06:05:25 +08:00
|
|
|
GtkCallback callback,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
MessageBox *msg_box;
|
1999-03-12 11:44:59 +08:00
|
|
|
GtkWidget *mbox;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *button;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
if (! message)
|
1997-11-25 06:05:25 +08:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
msg_box = (MessageBox *) g_malloc (sizeof (MessageBox));
|
|
|
|
|
|
|
|
mbox = gtk_dialog_new ();
|
1998-01-26 06:13:00 +08:00
|
|
|
gtk_window_set_wmclass (GTK_WINDOW (mbox), "gimp_message", "Gimp");
|
1998-11-23 22:47:09 +08:00
|
|
|
gtk_window_set_title (GTK_WINDOW (mbox), _("GIMP Message"));
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_window_position (GTK_WINDOW (mbox), GTK_WIN_POS_MOUSE);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (mbox)->action_area), 2);
|
1999-05-23 01:56:35 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (mbox), "delete_event",
|
|
|
|
GTK_SIGNAL_FUNC (message_box_delete_callback),
|
|
|
|
msg_box);
|
|
|
|
|
1998-11-23 22:47:09 +08:00
|
|
|
button = gtk_button_new_with_label (_("OK"));
|
1997-11-25 06:05:25 +08:00
|
|
|
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) message_box_close_callback,
|
|
|
|
msg_box);
|
1999-05-31 22:11:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (mbox)->action_area), button,
|
|
|
|
TRUE, TRUE, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_grab_default (button);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
1999-05-31 22:11:10 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 0);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (mbox)->vbox), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
label = gtk_label_new (message);
|
1999-08-14 06:33:49 +08:00
|
|
|
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
1998-05-31 14:49:20 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
msg_box->mbox = mbox;
|
|
|
|
msg_box->callback = callback;
|
|
|
|
msg_box->data = data;
|
|
|
|
|
|
|
|
gtk_widget_show (mbox);
|
|
|
|
|
|
|
|
return mbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
message_box_delete_callback (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
message_box_close_callback (widget, client_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-03-13 06:01:43 +08:00
|
|
|
return TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
message_box_close_callback (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
MessageBox *msg_box;
|
|
|
|
|
|
|
|
msg_box = (MessageBox *) client_data;
|
|
|
|
|
|
|
|
/* If there is a valid callback, invoke it */
|
|
|
|
if (msg_box->callback)
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
(* msg_box->callback) (widget, msg_box->data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Destroy the box */
|
|
|
|
gtk_widget_destroy (msg_box->mbox);
|
|
|
|
|
|
|
|
g_free (msg_box);
|
|
|
|
}
|
1999-07-01 17:13:39 +08:00
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
|
1999-07-01 17:13:39 +08:00
|
|
|
/* DnD functions */
|
|
|
|
static void
|
|
|
|
gimp_set_drop_open (GtkWidget *object)
|
|
|
|
{
|
|
|
|
gtk_drag_dest_set (object,
|
|
|
|
GTK_DEST_DEFAULT_ALL,
|
|
|
|
dnd_target_table, dnd_n_targets,
|
|
|
|
GDK_ACTION_COPY);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (object),
|
|
|
|
"drag_data_received",
|
|
|
|
GTK_SIGNAL_FUNC (gimp_dnd_data_received),
|
|
|
|
object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_dnd_data_received (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkSelectionData *data,
|
|
|
|
guint info,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
switch (context->action)
|
|
|
|
{
|
|
|
|
case GDK_ACTION_DEFAULT:
|
|
|
|
case GDK_ACTION_COPY:
|
|
|
|
case GDK_ACTION_MOVE:
|
|
|
|
case GDK_ACTION_LINK:
|
|
|
|
case GDK_ACTION_ASK:
|
|
|
|
default:
|
|
|
|
gimp_dnd_open_files ((gchar *) data->data);
|
|
|
|
gtk_drag_finish (context, TRUE, FALSE, time);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1999-08-03 03:17:02 +08:00
|
|
|
static void
|
1999-08-04 04:26:44 +08:00
|
|
|
gimp_dnd_open_files (gchar *buffer)
|
1999-07-01 17:13:39 +08:00
|
|
|
{
|
1999-08-04 04:26:44 +08:00
|
|
|
gchar name_buffer[1024];
|
1999-07-01 17:13:39 +08:00
|
|
|
const gchar *data_type = "file:";
|
|
|
|
const gint sig_len = strlen (data_type);
|
|
|
|
|
1999-08-04 04:26:44 +08:00
|
|
|
while (*buffer)
|
|
|
|
{
|
|
|
|
gchar *name = name_buffer;
|
|
|
|
gint len = 0;
|
1999-07-01 17:13:39 +08:00
|
|
|
|
1999-08-04 04:26:44 +08:00
|
|
|
while ((*buffer != 0) && (*buffer != '\n') && len < 1024)
|
|
|
|
{
|
|
|
|
*name++ = *buffer++;
|
|
|
|
len++;
|
|
|
|
}
|
|
|
|
if (len == 0)
|
|
|
|
break;
|
1999-07-01 17:13:39 +08:00
|
|
|
|
1999-08-04 04:26:44 +08:00
|
|
|
if (*(name - 1) == 0xd) /* gmc uses RETURN+NEWLINE as delimiter */
|
|
|
|
*(name - 1) = '\0';
|
|
|
|
else
|
|
|
|
*name = '\0';
|
|
|
|
name = name_buffer;
|
|
|
|
if ((sig_len < len) && (! strncmp (name, data_type, sig_len)))
|
|
|
|
name += sig_len;
|
|
|
|
|
|
|
|
file_open (name, name);
|
|
|
|
|
|
|
|
if (*buffer)
|
|
|
|
buffer++;
|
|
|
|
}
|
1999-07-01 17:13:39 +08:00
|
|
|
}
|