mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-19 06:14:03 +00:00
Makefile.am cursors/crosshair.xbm new files.
2000-06-06 Michael Natterer <mitch@gimp.org> * Makefile.am * cursors/crosshair.xbm * cursors/crosshair_mask.xbm: new files. * app/cursorutil.[ch] * app/gdisplay.[ch] * app/gimprc.[ch] * app/preferences_dialog.c: Started to add the new set of consistent tool cursors. The crosshair one is the easy part but I wanted to see a result :) The other two options in the pref's cursor menu are still dummys.
This commit is contained in:
parent
a43f448b9d
commit
5d43ca6c21
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2000-06-06 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* Makefile.am
|
||||
* cursors/crosshair.xbm
|
||||
* cursors/crosshair_mask.xbm: new files.
|
||||
|
||||
* app/cursorutil.[ch]
|
||||
* app/gdisplay.[ch]
|
||||
* app/gimprc.[ch]
|
||||
* app/preferences_dialog.c: Started to add the new set of
|
||||
consistent tool cursors. The crosshair one is the easy part
|
||||
but I wanted to see a result :) The other two options in
|
||||
the pref's cursor menu are still dummys.
|
||||
|
||||
2000-06-05 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/paint_core.[ch]: indentation, no real changes
|
||||
|
|
|
@ -24,6 +24,8 @@ EXTRA_SCRIPTS = gimpinstall
|
|||
EXTRA_DIST = \
|
||||
cursors/mouse.xbm \
|
||||
cursors/mouse_mask.xbm \
|
||||
cursors/crosshair.xbm \
|
||||
cursors/crosshair_mask.xbm \
|
||||
cursors/mouse_add.xbm \
|
||||
cursors/mouse_add_mask.xbm \
|
||||
cursors/mouse_subtract.xbm \
|
||||
|
|
|
@ -1559,13 +1559,23 @@ void
|
|||
gdisplay_install_tool_cursor (GDisplay *gdisp,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
switch (cursor_mode)
|
||||
{
|
||||
case CURSOR_MODE_TOOL_ICON:
|
||||
case CURSOR_MODE_TOOL_CROSSHAIR:
|
||||
break;
|
||||
|
||||
case CURSOR_MODE_CROSSHAIR:
|
||||
cursor_type = GIMP_CROSSHAIR_CURSOR;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gdisp->current_cursor != (gint)cursor_type)
|
||||
{
|
||||
gdisp->current_cursor = (gint)cursor_type;
|
||||
|
||||
if (!gdisp->using_override_cursor)
|
||||
{
|
||||
change_win_cursor (gdisp->canvas->window, cursor_type);
|
||||
}
|
||||
change_win_cursor (gdisp->canvas->window, cursor_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,6 @@ void gdisplay_transform_coords_f (GDisplay *, gdouble, gdouble,
|
|||
void gdisplay_untransform_coords_f (GDisplay *, gdouble, gdouble,
|
||||
gdouble *, gdouble *, gboolean);
|
||||
void gdisplay_install_tool_cursor (GDisplay *, GdkCursorType);
|
||||
void gdisplay_install_gimp_tool_cursor (GDisplay *, gint);
|
||||
void gdisplay_remove_tool_cursor (GDisplay *);
|
||||
void gdisplay_install_override_cursor(GDisplay *, GdkCursorType);
|
||||
void gdisplay_remove_override_cursor (GDisplay *);
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "cursors/mouse.xbm"
|
||||
#include "cursors/mouse_mask.xbm"
|
||||
#include "cursors/crosshair.xbm"
|
||||
#include "cursors/crosshair_mask.xbm"
|
||||
#include "cursors/mouse_add.xbm"
|
||||
#include "cursors/mouse_add_mask.xbm"
|
||||
#include "cursors/mouse_subtract.xbm"
|
||||
|
@ -73,6 +75,11 @@ static BM_Cursor gimp_cursors[] =
|
|||
mouse_width, mouse_height,
|
||||
mouse_x_hot, mouse_y_hot, NULL
|
||||
},
|
||||
{
|
||||
crosshair_bits, crosshair_mask_bits,
|
||||
crosshair_width, crosshair_height,
|
||||
crosshair_x_hot, crosshair_y_hot, NULL
|
||||
},
|
||||
{
|
||||
mouse_add_bits, mouse_add_mask_bits,
|
||||
mouse_add_width, mouse_add_height,
|
||||
|
|
|
@ -28,12 +28,20 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
enum
|
||||
{
|
||||
CURSOR_MODE_TOOL_ICON,
|
||||
CURSOR_MODE_TOOL_CROSSHAIR,
|
||||
CURSOR_MODE_CROSSHAIR
|
||||
};
|
||||
|
||||
/* FIXME: gimp_busy HACK */
|
||||
extern gboolean gimp_busy;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2),
|
||||
GIMP_CROSSHAIR_CURSOR,
|
||||
GIMP_MOUSE_ADD_CURSOR,
|
||||
GIMP_MOUSE_SUBTRACT_CURSOR,
|
||||
GIMP_MOUSE_INTERSECT_CURSOR,
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
@ -22,6 +23,7 @@
|
|||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
|
@ -127,6 +129,7 @@ static gint old_use_help;
|
|||
static gint old_nav_window_per_display;
|
||||
static gint old_info_window_follows_mouse;
|
||||
static gint old_help_browser;
|
||||
static gint old_cursor_mode;
|
||||
static gint old_default_threshold;
|
||||
|
||||
/* variables which can't be changed on the fly */
|
||||
|
@ -673,6 +676,10 @@ file_prefs_save_callback (GtkWidget *widget,
|
|||
{
|
||||
update = g_list_append (update, "help-browser");
|
||||
}
|
||||
if (cursor_mode != old_cursor_mode)
|
||||
{
|
||||
update = g_list_append (update, "cursor-mode");
|
||||
}
|
||||
if (default_threshold != old_default_threshold)
|
||||
{
|
||||
update = g_list_append (update, "default-threshold");
|
||||
|
@ -852,6 +859,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
|
|||
trust_dirty_flag = old_trust_dirty_flag;
|
||||
use_help = old_use_help;
|
||||
help_browser = old_help_browser;
|
||||
cursor_mode = old_cursor_mode;
|
||||
default_threshold = old_default_threshold;
|
||||
|
||||
/* restore variables which need some magic */
|
||||
|
@ -945,6 +953,7 @@ file_prefs_toggle_callback (GtkWidget *widget,
|
|||
data == &interpolation_type ||
|
||||
data == &trust_dirty_flag ||
|
||||
data == &help_browser ||
|
||||
data == &cursor_mode ||
|
||||
data == &default_type)
|
||||
{
|
||||
*val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));
|
||||
|
@ -1411,6 +1420,7 @@ file_pref_cmd_callback (GtkWidget *widget,
|
|||
old_trust_dirty_flag = trust_dirty_flag;
|
||||
old_use_help = use_help;
|
||||
old_help_browser = help_browser;
|
||||
old_cursor_mode = cursor_mode;
|
||||
old_default_threshold = default_threshold;
|
||||
|
||||
file_prefs_strset (&old_image_title_format, image_title_format);
|
||||
|
@ -2058,6 +2068,28 @@ file_pref_cmd_callback (GtkWidget *widget,
|
|||
&no_cursor_updating);
|
||||
gtk_widget_show (button);
|
||||
|
||||
table = gtk_table_new (1, 2, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
optionmenu =
|
||||
gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback,
|
||||
&cursor_mode, (gpointer) cursor_mode,
|
||||
|
||||
_("Tool Icon"),
|
||||
(gpointer) CURSOR_MODE_TOOL_ICON, NULL,
|
||||
_("Tool Icon with Crosshair"),
|
||||
(gpointer) CURSOR_MODE_TOOL_CROSSHAIR, NULL,
|
||||
_("Crosshair only"),
|
||||
(gpointer) CURSOR_MODE_CROSSHAIR, NULL,
|
||||
|
||||
NULL);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Cursor Mode:"), 1.0, 0.5,
|
||||
optionmenu, 1, TRUE);
|
||||
|
||||
|
||||
/* Interface / Tool Options */
|
||||
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
|
|
|
@ -1559,13 +1559,23 @@ void
|
|||
gdisplay_install_tool_cursor (GDisplay *gdisp,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
switch (cursor_mode)
|
||||
{
|
||||
case CURSOR_MODE_TOOL_ICON:
|
||||
case CURSOR_MODE_TOOL_CROSSHAIR:
|
||||
break;
|
||||
|
||||
case CURSOR_MODE_CROSSHAIR:
|
||||
cursor_type = GIMP_CROSSHAIR_CURSOR;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gdisp->current_cursor != (gint)cursor_type)
|
||||
{
|
||||
gdisp->current_cursor = (gint)cursor_type;
|
||||
|
||||
if (!gdisp->using_override_cursor)
|
||||
{
|
||||
change_win_cursor (gdisp->canvas->window, cursor_type);
|
||||
}
|
||||
change_win_cursor (gdisp->canvas->window, cursor_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,6 @@ void gdisplay_transform_coords_f (GDisplay *, gdouble, gdouble,
|
|||
void gdisplay_untransform_coords_f (GDisplay *, gdouble, gdouble,
|
||||
gdouble *, gdouble *, gboolean);
|
||||
void gdisplay_install_tool_cursor (GDisplay *, GdkCursorType);
|
||||
void gdisplay_install_gimp_tool_cursor (GDisplay *, gint);
|
||||
void gdisplay_remove_tool_cursor (GDisplay *);
|
||||
void gdisplay_install_override_cursor(GDisplay *, GdkCursorType);
|
||||
void gdisplay_remove_override_cursor (GDisplay *);
|
||||
|
|
|
@ -1559,13 +1559,23 @@ void
|
|||
gdisplay_install_tool_cursor (GDisplay *gdisp,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
switch (cursor_mode)
|
||||
{
|
||||
case CURSOR_MODE_TOOL_ICON:
|
||||
case CURSOR_MODE_TOOL_CROSSHAIR:
|
||||
break;
|
||||
|
||||
case CURSOR_MODE_CROSSHAIR:
|
||||
cursor_type = GIMP_CROSSHAIR_CURSOR;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gdisp->current_cursor != (gint)cursor_type)
|
||||
{
|
||||
gdisp->current_cursor = (gint)cursor_type;
|
||||
|
||||
if (!gdisp->using_override_cursor)
|
||||
{
|
||||
change_win_cursor (gdisp->canvas->window, cursor_type);
|
||||
}
|
||||
change_win_cursor (gdisp->canvas->window, cursor_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,6 @@ void gdisplay_transform_coords_f (GDisplay *, gdouble, gdouble,
|
|||
void gdisplay_untransform_coords_f (GDisplay *, gdouble, gdouble,
|
||||
gdouble *, gdouble *, gboolean);
|
||||
void gdisplay_install_tool_cursor (GDisplay *, GdkCursorType);
|
||||
void gdisplay_install_gimp_tool_cursor (GDisplay *, gint);
|
||||
void gdisplay_remove_tool_cursor (GDisplay *);
|
||||
void gdisplay_install_override_cursor(GDisplay *, GdkCursorType);
|
||||
void gdisplay_remove_override_cursor (GDisplay *);
|
||||
|
|
50
app/gimprc.c
50
app/gimprc.c
|
@ -34,6 +34,7 @@
|
|||
|
||||
#include "app_procs.h"
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "devices.h"
|
||||
#include "errors.h"
|
||||
#include "fileops.h"
|
||||
|
@ -82,6 +83,7 @@ typedef enum
|
|||
TT_XPARASITE,
|
||||
TT_XNAVPREVSIZE,
|
||||
TT_XHELPBROWSER,
|
||||
TT_XCURSORMODE,
|
||||
TT_XCOMMENT
|
||||
} TokenType;
|
||||
|
||||
|
@ -170,6 +172,7 @@ gboolean use_help = TRUE;
|
|||
gboolean nav_window_per_display = FALSE;
|
||||
gboolean info_window_follows_mouse = TRUE;
|
||||
gint help_browser = HELP_BROWSER_GIMP;
|
||||
gint cursor_mode = CURSOR_MODE_TOOL_ICON;
|
||||
|
||||
extern char * module_db_load_inhibit;
|
||||
|
||||
|
@ -198,6 +201,7 @@ static gint parse_session_info (gpointer val1p, gpointer val2p);
|
|||
static gint parse_unit_info (gpointer val1p, gpointer val2p);
|
||||
static gint parse_parasite (gpointer val1p, gpointer val2p);
|
||||
static gint parse_help_browser (gpointer val1p, gpointer val2p);
|
||||
static gint parse_cursor_mode (gpointer val1p, gpointer val2p);
|
||||
|
||||
static gint parse_locale_def (PlugInDef *plug_in_def);
|
||||
static gint parse_help_def (PlugInDef *plug_in_def);
|
||||
|
@ -222,6 +226,7 @@ static inline gchar * preview_size_to_str (gpointer val1p, gpointer val2p)
|
|||
static inline gchar * nav_preview_size_to_str (gpointer val1p, gpointer val2p);
|
||||
static inline gchar * units_to_str (gpointer val1p, gpointer val2p);
|
||||
static inline gchar * help_browser_to_str (gpointer val1p, gpointer val2p);
|
||||
static inline gchar * cursor_mode_to_str (gpointer val1p, gpointer val2p);
|
||||
static inline gchar * comment_to_str (gpointer val1p, gpointer val2p);
|
||||
|
||||
static gchar *transform_path (gchar *path, gboolean destroy);
|
||||
|
@ -332,7 +337,8 @@ static ParseFunc funcs[] =
|
|||
{ "nav-window-follows-auto", TT_BOOLEAN, NULL, &nav_window_per_display },
|
||||
{ "info-window-follows-mouse", TT_BOOLEAN, &info_window_follows_mouse, NULL },
|
||||
{ "info-window-per-display", TT_BOOLEAN, NULL, &info_window_follows_mouse },
|
||||
{ "help-browser", TT_XHELPBROWSER, &help_browser, NULL }
|
||||
{ "help-browser", TT_XHELPBROWSER, &help_browser, NULL },
|
||||
{ "cursor-mode", TT_XCURSORMODE, &cursor_mode, NULL }
|
||||
};
|
||||
static int nfuncs = sizeof (funcs) / sizeof (funcs[0]);
|
||||
|
||||
|
@ -876,6 +882,8 @@ parse_statement (void)
|
|||
return parse_parasite (funcs[i].val1p, funcs[i].val2p);
|
||||
case TT_XHELPBROWSER:
|
||||
return parse_help_browser (funcs[i].val1p, funcs[i].val2p);
|
||||
case TT_XCURSORMODE:
|
||||
return parse_cursor_mode (funcs[i].val1p, funcs[i].val2p);
|
||||
case TT_XCOMMENT:
|
||||
return parse_string (funcs[i].val1p, funcs[i].val2p);
|
||||
}
|
||||
|
@ -2495,6 +2503,32 @@ parse_help_browser (gpointer val1p,
|
|||
return OK;
|
||||
}
|
||||
|
||||
static gint
|
||||
parse_cursor_mode (gpointer val1p,
|
||||
gpointer val2p)
|
||||
{
|
||||
gint token;
|
||||
|
||||
token = peek_next_token ();
|
||||
if (!token || token != TOKEN_SYMBOL)
|
||||
return ERROR;
|
||||
token = get_next_token ();
|
||||
|
||||
if (strcmp (token_sym, "tool-icon") == 0)
|
||||
cursor_mode = CURSOR_MODE_TOOL_ICON;
|
||||
else if (strcmp (token_sym, "tool-crosshair") == 0)
|
||||
cursor_mode = CURSOR_MODE_TOOL_CROSSHAIR;
|
||||
else if (strcmp (token_sym, "crosshair") == 0)
|
||||
cursor_mode = CURSOR_MODE_CROSSHAIR;
|
||||
|
||||
token = peek_next_token ();
|
||||
if (!token || (token != TOKEN_RIGHT_PAREN))
|
||||
return ERROR;
|
||||
token = get_next_token ();
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
static gint
|
||||
parse_unknown (gchar *token_sym)
|
||||
{
|
||||
|
@ -2592,6 +2626,8 @@ value_to_str (gchar *name)
|
|||
return units_to_str (funcs[i].val1p, funcs[i].val2p);
|
||||
case TT_XHELPBROWSER:
|
||||
return help_browser_to_str (funcs[i].val1p, funcs[i].val2p);
|
||||
case TT_XCURSORMODE:
|
||||
return cursor_mode_to_str (funcs[i].val1p, funcs[i].val2p);
|
||||
case TT_XCOMMENT:
|
||||
return comment_to_str (funcs[i].val1p, funcs[i].val2p);
|
||||
case TT_XPLUGIN:
|
||||
|
@ -2768,6 +2804,18 @@ help_browser_to_str (gpointer val1p,
|
|||
return g_strdup ("gimp");
|
||||
}
|
||||
|
||||
static inline gchar *
|
||||
cursor_mode_to_str (gpointer val1p,
|
||||
gpointer val2p)
|
||||
{
|
||||
if (cursor_mode == CURSOR_MODE_TOOL_ICON)
|
||||
return g_strdup ("tool-icon");
|
||||
else if (cursor_mode == CURSOR_MODE_TOOL_CROSSHAIR)
|
||||
return g_strdup ("tool-crosshair");
|
||||
else
|
||||
return g_strdup ("crosshair");
|
||||
}
|
||||
|
||||
static inline gchar *
|
||||
comment_to_str (gpointer val1p,
|
||||
gpointer val2p)
|
||||
|
|
|
@ -90,6 +90,7 @@ extern gboolean use_help;
|
|||
extern gboolean nav_window_per_display;
|
||||
extern gboolean info_window_follows_mouse;
|
||||
extern gint help_browser;
|
||||
extern gint cursor_mode;
|
||||
|
||||
/* function prototypes */
|
||||
gboolean parse_buffers_init (void); /* this has to be called before any file
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
@ -22,6 +23,7 @@
|
|||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
|
@ -127,6 +129,7 @@ static gint old_use_help;
|
|||
static gint old_nav_window_per_display;
|
||||
static gint old_info_window_follows_mouse;
|
||||
static gint old_help_browser;
|
||||
static gint old_cursor_mode;
|
||||
static gint old_default_threshold;
|
||||
|
||||
/* variables which can't be changed on the fly */
|
||||
|
@ -673,6 +676,10 @@ file_prefs_save_callback (GtkWidget *widget,
|
|||
{
|
||||
update = g_list_append (update, "help-browser");
|
||||
}
|
||||
if (cursor_mode != old_cursor_mode)
|
||||
{
|
||||
update = g_list_append (update, "cursor-mode");
|
||||
}
|
||||
if (default_threshold != old_default_threshold)
|
||||
{
|
||||
update = g_list_append (update, "default-threshold");
|
||||
|
@ -852,6 +859,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
|
|||
trust_dirty_flag = old_trust_dirty_flag;
|
||||
use_help = old_use_help;
|
||||
help_browser = old_help_browser;
|
||||
cursor_mode = old_cursor_mode;
|
||||
default_threshold = old_default_threshold;
|
||||
|
||||
/* restore variables which need some magic */
|
||||
|
@ -945,6 +953,7 @@ file_prefs_toggle_callback (GtkWidget *widget,
|
|||
data == &interpolation_type ||
|
||||
data == &trust_dirty_flag ||
|
||||
data == &help_browser ||
|
||||
data == &cursor_mode ||
|
||||
data == &default_type)
|
||||
{
|
||||
*val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));
|
||||
|
@ -1411,6 +1420,7 @@ file_pref_cmd_callback (GtkWidget *widget,
|
|||
old_trust_dirty_flag = trust_dirty_flag;
|
||||
old_use_help = use_help;
|
||||
old_help_browser = help_browser;
|
||||
old_cursor_mode = cursor_mode;
|
||||
old_default_threshold = default_threshold;
|
||||
|
||||
file_prefs_strset (&old_image_title_format, image_title_format);
|
||||
|
@ -2058,6 +2068,28 @@ file_pref_cmd_callback (GtkWidget *widget,
|
|||
&no_cursor_updating);
|
||||
gtk_widget_show (button);
|
||||
|
||||
table = gtk_table_new (1, 2, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
optionmenu =
|
||||
gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback,
|
||||
&cursor_mode, (gpointer) cursor_mode,
|
||||
|
||||
_("Tool Icon"),
|
||||
(gpointer) CURSOR_MODE_TOOL_ICON, NULL,
|
||||
_("Tool Icon with Crosshair"),
|
||||
(gpointer) CURSOR_MODE_TOOL_CROSSHAIR, NULL,
|
||||
_("Crosshair only"),
|
||||
(gpointer) CURSOR_MODE_CROSSHAIR, NULL,
|
||||
|
||||
NULL);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Cursor Mode:"), 1.0, 0.5,
|
||||
optionmenu, 1, TRUE);
|
||||
|
||||
|
||||
/* Interface / Tool Options */
|
||||
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
@ -22,6 +23,7 @@
|
|||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
|
@ -127,6 +129,7 @@ static gint old_use_help;
|
|||
static gint old_nav_window_per_display;
|
||||
static gint old_info_window_follows_mouse;
|
||||
static gint old_help_browser;
|
||||
static gint old_cursor_mode;
|
||||
static gint old_default_threshold;
|
||||
|
||||
/* variables which can't be changed on the fly */
|
||||
|
@ -673,6 +676,10 @@ file_prefs_save_callback (GtkWidget *widget,
|
|||
{
|
||||
update = g_list_append (update, "help-browser");
|
||||
}
|
||||
if (cursor_mode != old_cursor_mode)
|
||||
{
|
||||
update = g_list_append (update, "cursor-mode");
|
||||
}
|
||||
if (default_threshold != old_default_threshold)
|
||||
{
|
||||
update = g_list_append (update, "default-threshold");
|
||||
|
@ -852,6 +859,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
|
|||
trust_dirty_flag = old_trust_dirty_flag;
|
||||
use_help = old_use_help;
|
||||
help_browser = old_help_browser;
|
||||
cursor_mode = old_cursor_mode;
|
||||
default_threshold = old_default_threshold;
|
||||
|
||||
/* restore variables which need some magic */
|
||||
|
@ -945,6 +953,7 @@ file_prefs_toggle_callback (GtkWidget *widget,
|
|||
data == &interpolation_type ||
|
||||
data == &trust_dirty_flag ||
|
||||
data == &help_browser ||
|
||||
data == &cursor_mode ||
|
||||
data == &default_type)
|
||||
{
|
||||
*val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));
|
||||
|
@ -1411,6 +1420,7 @@ file_pref_cmd_callback (GtkWidget *widget,
|
|||
old_trust_dirty_flag = trust_dirty_flag;
|
||||
old_use_help = use_help;
|
||||
old_help_browser = help_browser;
|
||||
old_cursor_mode = cursor_mode;
|
||||
old_default_threshold = default_threshold;
|
||||
|
||||
file_prefs_strset (&old_image_title_format, image_title_format);
|
||||
|
@ -2058,6 +2068,28 @@ file_pref_cmd_callback (GtkWidget *widget,
|
|||
&no_cursor_updating);
|
||||
gtk_widget_show (button);
|
||||
|
||||
table = gtk_table_new (1, 2, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
optionmenu =
|
||||
gimp_option_menu_new2 (FALSE, file_prefs_toggle_callback,
|
||||
&cursor_mode, (gpointer) cursor_mode,
|
||||
|
||||
_("Tool Icon"),
|
||||
(gpointer) CURSOR_MODE_TOOL_ICON, NULL,
|
||||
_("Tool Icon with Crosshair"),
|
||||
(gpointer) CURSOR_MODE_TOOL_CROSSHAIR, NULL,
|
||||
_("Crosshair only"),
|
||||
(gpointer) CURSOR_MODE_CROSSHAIR, NULL,
|
||||
|
||||
NULL);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Cursor Mode:"), 1.0, 0.5,
|
||||
optionmenu, 1, TRUE);
|
||||
|
||||
|
||||
/* Interface / Tool Options */
|
||||
vbox = file_prefs_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "cursors/mouse.xbm"
|
||||
#include "cursors/mouse_mask.xbm"
|
||||
#include "cursors/crosshair.xbm"
|
||||
#include "cursors/crosshair_mask.xbm"
|
||||
#include "cursors/mouse_add.xbm"
|
||||
#include "cursors/mouse_add_mask.xbm"
|
||||
#include "cursors/mouse_subtract.xbm"
|
||||
|
@ -73,6 +75,11 @@ static BM_Cursor gimp_cursors[] =
|
|||
mouse_width, mouse_height,
|
||||
mouse_x_hot, mouse_y_hot, NULL
|
||||
},
|
||||
{
|
||||
crosshair_bits, crosshair_mask_bits,
|
||||
crosshair_width, crosshair_height,
|
||||
crosshair_x_hot, crosshair_y_hot, NULL
|
||||
},
|
||||
{
|
||||
mouse_add_bits, mouse_add_mask_bits,
|
||||
mouse_add_width, mouse_add_height,
|
||||
|
|
|
@ -28,12 +28,20 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
enum
|
||||
{
|
||||
CURSOR_MODE_TOOL_ICON,
|
||||
CURSOR_MODE_TOOL_CROSSHAIR,
|
||||
CURSOR_MODE_CROSSHAIR
|
||||
};
|
||||
|
||||
/* FIXME: gimp_busy HACK */
|
||||
extern gboolean gimp_busy;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2),
|
||||
GIMP_CROSSHAIR_CURSOR,
|
||||
GIMP_MOUSE_ADD_CURSOR,
|
||||
GIMP_MOUSE_SUBTRACT_CURSOR,
|
||||
GIMP_MOUSE_INTERSECT_CURSOR,
|
||||
|
|
17
cursors/crosshair.xbm
Normal file
17
cursors/crosshair.xbm
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* Created with The GIMP */
|
||||
#define crosshair_width 32
|
||||
#define crosshair_height 32
|
||||
#define crosshair_x_hot 15
|
||||
#define crosshair_y_hot 15
|
||||
static unsigned char crosshair_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xfc, 0x07, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
17
cursors/crosshair_mask.xbm
Normal file
17
cursors/crosshair_mask.xbm
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* Created with The GIMP */
|
||||
#define crosshair_mask_width 32
|
||||
#define crosshair_mask_height 32
|
||||
#define crosshair_mask_x_hot 15
|
||||
#define crosshair_mask_y_hot 15
|
||||
static unsigned char crosshair_mask_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00,
|
||||
0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
|
||||
0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
|
||||
0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xf0, 0x1f,
|
||||
0xfe, 0x0f, 0xf8, 0x3f, 0xfc, 0x07, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00,
|
||||
0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
|
||||
0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
|
||||
0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
Loading…
Reference in a new issue