Add locate-pointer. Initial attempt at locate-pointer. Don't understand

Tue Jan  8 15:50:59 2002  Jonathan Blandford  <jrb@redhat.com>

	* Makefile.am: Add locate-pointer.
	* gnome-settings-keyboard.c: Initial attempt at locate-pointer.
	Don't understand XKB enough to figure it out.
	* gnome-settings-locate-pointer.[ch]: Draw the locate pointer
	box.  Pretty snazzy for a useless (but fun) feature.
	* gnome-settings-mouse.c:  Move locate pointer to it's own file.

Tue Jan  8 15:49:15 2002  Jonathan Blandford  <jrb@redhat.com>

	* .cvsignore: update
	* Makefile.am: Add gnome-keyboard-properties.c
	* gnome-keyboard-properties.c: New, much nicer capplet.
	* gnome-keyboard-properties.glade: glade file for above.
	* keyboard-bell.png:
	* keyboard-cursor.png:
	* keyboard-repeat.png:
	* keyboard-volume.png: Images for above.  Note,
	keyboard-cursor.png is my pathetic attempt at artwork, and will
	prolly change in the future.

Tue Jan  8 15:47:24 2002  Jonathan Blandford  <jrb@redhat.com>

	* .cvsignore: New ignores.
	* gnome-mouse-properties.glade: Update of glade file for cursors
	* mouse-cursor-normal-large.png: New images
	* mouse-cursor-normal.png:
	* mouse-cursor-white-large.png:
	* mouse-cursor-white.png:
	* mouse-properties-capplet.c: (setup_dialog), (create_dialog),
	(main): Add support for new properties.  Don't fully work yet, but
	we'll get it later.
	* mouse-properties.glade: not sure what changed -- need to remove
	this file.
This commit is contained in:
Jonathan Blandford 2002-01-08 21:03:07 +00:00 committed by Jonathan Blandford
parent bb15c09c1d
commit d317e2704e
26 changed files with 2043 additions and 163 deletions

View file

@ -5,8 +5,7 @@ Makefile.in
*.lo
*.la
*.o
keyboard-properties
keyboard-properties-capplet
gnome-keyboard-properties
keyboard.desktop
keyboard.desktop.in
*.oaf

View file

@ -1,3 +1,16 @@
Tue Jan 8 15:49:15 2002 Jonathan Blandford <jrb@redhat.com>
* .cvsignore: update
* Makefile.am: Add gnome-keyboard-properties.c
* gnome-keyboard-properties.c: New, much nicer capplet.
* gnome-keyboard-properties.glade: glade file for above.
* keyboard-bell.png:
* keyboard-cursor.png:
* keyboard-repeat.png:
* keyboard-volume.png: Images for above. Note,
keyboard-cursor.png is my pathetic attempt at artwork, and will
prolly change in the future.
2001-12-20 Seth Nickell <snickell@stanford.edu>
* keyboard.desktop.in:

View file

@ -1,15 +1,19 @@
bin_PROGRAMS = gnome-keyboard-properties
gnome_keyboard_properties_LDADD = $(GNOMECC_CAPPLETS_LIBS)
gnome_keyboard_properties_SOURCES = keyboard-properties.c
gnome_keyboard_properties_SOURCES = gnome-keyboard-properties.c
@INTLTOOL_DESKTOP_RULE@
Gladedir = $(GNOMECC_GLADE_DIR)
Glade_DATA = keyboard-properties.glade
Glade_DATA = gnome-keyboard-properties.glade
iconsdir = $(GNOMECC_ICONS_DIR)
icons_DATA = keyboard-capplet.png
iconsdir = $(GNOMECC_PIXMAPS_DIR)
icons_DATA = keyboard-capplet.png \
keyboard-repeat.png \
keyboard-cursor.png \
keyboard-volume.png \
keyboard-bell.png
desktopdir = $(GNOMECC_DESKTOP_DIR)
desktop_DATA = keyboard.desktop

View file

@ -0,0 +1,300 @@
/* -*- mode: c; style: linux -*- */
/* keyboard-properties.c
* Copyright (C) 2000-2001 Ximian, Inc.
* Copyright (C) 2001 Jonathan Blandford
*
* Written by: Bradford Hovinen <hovinen@ximian.com>
* Richard Hestilow <hestilow@ximian.com>
* Jonathan Blandford <jrb@redhat.com>
*
* 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, 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gnome.h>
#include <gconf/gconf-client.h>
#include <glade/glade.h>
#include "capplet-util.h"
#include "gconf-property-editor.h"
static GladeXML *
create_dialog (void)
{
GladeXML *dialog;
dialog = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/gnome-keyboard-properties.glade", "keyboard_dialog", NULL);
return dialog;
}
static GConfValue *
rate_to_widget (GConfValue *value)
{
GConfValue *new_value;
int rate;
rate = gconf_value_get_int (value);
new_value = gconf_value_new (GCONF_VALUE_INT);
if (rate >= (255 + 192) / 2)
gconf_value_set_int (new_value, 0);
else if (rate >= (192 + 64) / 2)
gconf_value_set_int (new_value, 1);
else if (rate >= (64 + 1) / 2)
gconf_value_set_int (new_value, 2);
else
gconf_value_set_int (new_value, 3);
return new_value;
}
static GConfValue *
rate_from_widget (GConfValue *value)
{
static int rates[] = {
255, 192, 64, 1
};
GConfValue *new_value;
new_value = gconf_value_new (GCONF_VALUE_INT);
gconf_value_set_int (new_value, rates[gconf_value_get_int (value)]);
return new_value;
}
static GConfValue *
delay_to_widget (GConfValue *value)
{
GConfValue *new_value;
int delay;
delay = gconf_value_get_int (value);
new_value = gconf_value_new (GCONF_VALUE_INT);
if (delay >= (1000 + 700) / 2)
gconf_value_set_int (new_value, 0);
else if (delay >= (700 + 300) / 2)
gconf_value_set_int (new_value, 1);
else if (delay >= (300) / 2)
gconf_value_set_int (new_value, 2);
else
gconf_value_set_int (new_value, 3);
return new_value;
}
static GConfValue *
delay_from_widget (GConfValue *value)
{
static int delays[] = {
1000, 700, 300, 0
};
GConfValue *new_value;
new_value = gconf_value_new (GCONF_VALUE_INT);
gconf_value_set_int (new_value, delays[gconf_value_get_int (value)]);
return new_value;
}
static GConfEnumStringPair bell_enums[] = {
{ 0, "custom" },
{ 1, "on" },
{ 2, "off" }
};
static GConfValue *
bell_from_widget (GConfValue *value)
{
GConfValue *new_value;
new_value = gconf_value_new (GCONF_VALUE_STRING);
gconf_value_set_string (new_value,
gconf_enum_to_string (bell_enums, gconf_value_get_int (value)));
return new_value;
}
static GConfValue *
bell_to_widget (GConfValue *value)
{
GConfValue *new_value;
gint val = 2;
new_value = gconf_value_new (GCONF_VALUE_INT);
gconf_string_to_enum (bell_enums,
gconf_value_get_string (value),
&val);
gconf_value_set_int (new_value, val);
return new_value;
}
static void
bell_guard (GtkWidget *toggle,
GladeXML *dialog)
{
gtk_widget_set_sensitive (WID ("bell_custom_fileentry"), GTK_TOGGLE_BUTTON (toggle)->active);
}
gboolean
mnemonic_activate (GtkWidget *toggle,
gboolean group_cycling,
GtkWidget *entry)
{
if (! group_cycling)
gtk_widget_grab_focus (entry);
return FALSE;
}
static void
setup_dialog (GladeXML *dialog,
GConfChangeSet *changeset)
{
GObject *peditor;
GnomeProgram *program;
gchar *filename;
/* load all the images */
program = gnome_program_get ();
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "keyboard-repeat.png", TRUE, NULL);
gtk_image_set_from_file (GTK_IMAGE (WID ("repeat_image")), filename);
g_free (filename);
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "keyboard-cursor.png", TRUE, NULL);
gtk_image_set_from_file (GTK_IMAGE (WID ("cursor_image")), filename);
g_free (filename);
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "keyboard-volume.png", TRUE, NULL);
gtk_image_set_from_file (GTK_IMAGE (WID ("volume_image")), filename);
g_free (filename);
filename = gnome_program_locate_file (program, GNOME_FILE_DOMAIN_APP_PIXMAP, "keyboard-bell.png", TRUE, NULL);
gtk_image_set_from_file (GTK_IMAGE (WID ("bell_image")), filename);
g_free (filename);
peditor = gconf_peditor_new_boolean
(NULL, "/desktop/gnome/peripherals/keyboard/repeat", WID ("repeat_toggle"), NULL);
gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("repeat_table"));
gconf_peditor_new_select_menu
(NULL, "/gnome/desktop/peripherals/keyboard/delay", WID ("repeat_delay_omenu"),
"conv-to-widget-cb", delay_to_widget,
"conv-from-widget-cb", delay_from_widget,
NULL);
gconf_peditor_new_select_menu
(NULL, "/gnome/desktop/peripherals/keyboard/rate", WID ("repeat_speed_omenu"),
"conv-to-widget-cb", rate_to_widget,
"conv-from-widget-cb", rate_from_widget,
NULL);
peditor = gconf_peditor_new_boolean
(NULL, "/desktop/gnome/interface/cursor_blink", WID ("cursor_toggle"), NULL);
gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("cursor_hbox"));
gconf_peditor_new_numeric_range
(NULL, "/desktop/gnome/interface/cursor_blink_time", WID ("cursor_blink_time_scale"), NULL);
peditor = gconf_peditor_new_boolean
(NULL, "/desktop/gnome/peripherals/keyboard/click", WID ("volume_toggle"), NULL);
gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("volume_hbox"));
gconf_peditor_new_numeric_range
(NULL, "/desktop/gnome/peripherals/keyboard/clickvolume", WID ("volume_scale"), NULL);
g_signal_connect (G_OBJECT (WID ("bell_custom_radio")), "toggled", (GCallback) bell_guard, dialog);
peditor = gconf_peditor_new_select_radio
(NULL, "/desktop/gnome/peripherals/keyboard/bell_mode",
gtk_radio_button_get_group (GTK_RADIO_BUTTON (WID ("bell_disabled_radio"))),
"conv-to-widget-cb", bell_to_widget,
"conv-from-widget-cb", bell_from_widget,
NULL);
g_signal_connect (G_OBJECT (WID ("bell_custom_radio")), "mnemonic_activate", (GCallback) mnemonic_activate, WID ("bell_custom_entry"));
}
static void
get_legacy_settings (void)
{
GConfClient *client;
gboolean val_bool, def;
gulong val_int;
client = gconf_client_get_default ();
COPY_FROM_LEGACY (bool, "/gnome/desktop/peripherals/keyboard/repeat", "/Desktop/Keyboard/repeat=true");
COPY_FROM_LEGACY (bool, "/gnome/desktop/peripherals/keyboard/click", "/Desktop/Keyboard/click=true");
COPY_FROM_LEGACY (int, "/gnome/desktop/peripherals/keyboard/rate", "/Desktop/Keyboard/rate=30");
COPY_FROM_LEGACY (int, "/gnome/desktop/peripherals/keyboard/delay", "/Desktop/Keyboard/delay=500");
COPY_FROM_LEGACY (int, "/gnome/desktop/peripherals/keyboard/volume", "/Desktop/Keyboard/clickvolume=0");
COPY_FROM_LEGACY (int, "/gnome/desktop/peripherals/keyboard/bell_volume", "/Desktop/Bell/percent=50");
COPY_FROM_LEGACY (int, "/gnome/desktop/peripherals/keyboard/bell_pitch", "/Desktop/Bell/pitch=50");
COPY_FROM_LEGACY (int, "/gnome/desktop/peripherals/keyboard/bell_duration", "/Desktop/Bell/duration=100");
}
int
main (int argc, char **argv)
{
GConfClient *client;
GConfChangeSet *changeset;
GladeXML *dialog;
GtkWidget *dialog_win;
static gboolean apply_only;
static gboolean get_legacy;
static struct poptOption cap_options[] = {
{ "apply", '\0', POPT_ARG_NONE, &apply_only, 0,
N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL },
{ "init-session-settings", '\0', POPT_ARG_NONE, &apply_only, 0,
N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL },
{ "get-legacy", '\0', POPT_ARG_NONE, &get_legacy, 0,
N_("Retrieve and store legacy settings"), NULL },
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
};
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (PACKAGE, "UTF-8");
textdomain (PACKAGE);
gnome_program_init (argv[0], VERSION, LIBGNOMEUI_MODULE, argc, argv,
GNOME_PARAM_POPT_TABLE, cap_options,
GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
NULL);
client = gconf_client_get_default ();
gconf_client_add_dir (client, "/desktop/gnome/peripherals/keyboard", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
if (get_legacy) {
get_legacy_settings ();
} else {
changeset = gconf_change_set_new ();
dialog = create_dialog ();
setup_dialog (dialog, changeset);
gtk_widget_show_all (WID ("keyboard_dialog"));
gtk_main ();
gconf_change_set_unref (changeset);
}
return 0;
}

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -5,7 +5,7 @@ Makefile.in
*.o
*.lo
*.la
mouse-properties-capplet
gnome-mouse-properties
mouse.desktop
mouse.desktop.in
*.oaf

View file

@ -1,3 +1,17 @@
Tue Jan 8 15:47:24 2002 Jonathan Blandford <jrb@redhat.com>
* .cvsignore: New ignores.
* gnome-mouse-properties.glade: Update of glade file for cursors
* mouse-cursor-normal-large.png: New images
* mouse-cursor-normal.png:
* mouse-cursor-white-large.png:
* mouse-cursor-white.png:
* mouse-properties-capplet.c: (setup_dialog), (create_dialog),
(main): Add support for new properties. Don't fully work yet, but
we'll get it later.
* mouse-properties.glade: not sure what changed -- need to remove
this file.
2001-12-20 Seth Nickell <snickell@stanford.edu>
* mouse.desktop.in:

View file

@ -42,6 +42,13 @@ enum
DOUBLE_CLICK_TEST_ON,
};
enum
{
COLUMN_PIXBUF,
COLUMN_TEXT,
N_COLUMNS
};
/* We use this in at least half a dozen places, so it makes sense just to
* define the macro */
@ -54,11 +61,10 @@ GdkPixbuf *right_handed_pixbuf;
GdkPixbuf *double_click_on_pixbuf;
GdkPixbuf *double_click_maybe_pixbuf;
GdkPixbuf *double_click_off_pixbuf;
GConfClient *client;
/* State in testing the double-click speed. Global for a great deal of
* convenience
*/
gint double_click_state = DOUBLE_CLICK_TEST_OFF;
/* normalilzation routines */
@ -318,11 +324,15 @@ load_pixbufs (void)
static void
setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
{
GObject *peditor;
GConfValue *value;
GObject *peditor;
GtkWidget *tree_view;
GtkTreeModel *model;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
GtkTreeIter iter;
GConfValue *value;
/* Buttons page
*/
/* Buttons page */
/* Left-handed toggle */
peditor = gconf_peditor_new_boolean
(changeset, "/desktop/gnome/peripherals/mouse/left_handed", WID ("left_handed_toggle"), NULL);
@ -336,6 +346,48 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
/* Double-click time */
g_signal_connect (WID ("double_click_darea"), "expose_event", (GCallback) drawing_area_expose_event, changeset);
/* Cursors page */
tree_view = WID ("cursor_tree");
model = (GtkTreeModel *) gtk_list_store_new (N_COLUMNS, GDK_TYPE_PIXBUF, GTK_TYPE_STRING);
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), model);
column = gtk_tree_view_column_new ();
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, renderer, FALSE);
gtk_tree_view_column_set_attributes (column, renderer,
"pixbuf", COLUMN_PIXBUF,
NULL);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_attributes (column, renderer,
"markup", COLUMN_TEXT,
NULL);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
COLUMN_PIXBUF, gdk_pixbuf_new_from_file ("mouse-cursor-normal.png", NULL),
COLUMN_TEXT, "<b>Default Cursor</b>\nThe default cursor that ships with X",
-1);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
COLUMN_PIXBUF, gdk_pixbuf_new_from_file ("mouse-cursor-white.png", NULL),
COLUMN_TEXT, "<b>White Cursor</b>\nThe default cursor inverted",
-1);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
COLUMN_PIXBUF, gdk_pixbuf_new_from_file ("mouse-cursor-normal-large.png", NULL),
COLUMN_TEXT, "<b>Large Cursor</b>\nLarge version of normal cursor",
-1);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
COLUMN_PIXBUF, gdk_pixbuf_new_from_file ("mouse-cursor-white-large.png", NULL),
COLUMN_TEXT, "<b>Large White Cursor</b>\nLarge version of white cursor",
-1);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
gconf_peditor_new_boolean
(changeset, "/desktop/gnome/peripherals/mouse/locate_pointer_id", WID ("locate_pointer_toggle"), NULL);
/* Motion page */
/* speed */
gconf_peditor_new_numeric_range
(changeset, DOUBLE_CLICK_KEY, WID ("delay_scale"),
"conv-to-widget-cb", double_click_from_gconf,
@ -352,6 +404,7 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
(changeset, "/desktop/gnome/peripherals/mouse/motion_threshold",
WID ("sensitivity_scale"), NULL);
/* DnD threshold */
gconf_peditor_new_numeric_range
(changeset, "/desktop/gnome/peripherals/mouse/drag_threshold", WID ("drag_threshold_scale"),
"conv-to-widget-cb", threshold_from_gconf,
@ -386,10 +439,6 @@ create_dialog (void)
gtk_size_group_add_widget (size_group, WID ("slow_label"));
gtk_size_group_add_widget (size_group, WID ("small_label"));
/* Remove cursors page */
widget = glade_xml_get_widget (dialog, "main_notebook");
gtk_notebook_remove_page (GTK_NOTEBOOK (widget), 1);
g_object_weak_ref (G_OBJECT (widget), (GWeakNotify) g_object_unref, dialog);
return dialog;
@ -447,7 +496,7 @@ main (int argc, char **argv)
setup_dialog (dialog, changeset);
dialog_win = gtk_dialog_new_with_buttons
(_("Keyboard properties"), NULL, -1,
(_("Mouse Properties"), NULL, -1,
GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);

View file

@ -312,51 +312,128 @@
</child>
<child>
<widget class="GtkFrame" id="frame6">
<widget class="GtkVBox" id="cursors_vbox">
<property name="border_width">4</property>
<property name="label" translatable="yes">Mouse Cursor</property>
<property name="label_xalign">0</property>
<property name="shadow">GTK_SHADOW_ETCHED_IN</property>
<property name="homogeneous">no</property>
<property name="spacing">4</property>
<property name="visible">yes</property>
<child>
<widget class="GtkFrame" id="frame6">
<property name="label" translatable="yes">Cursor Theme</property>
<property name="label_xalign">0</property>
<property name="shadow">GTK_SHADOW_ETCHED_IN</property>
<property name="visible">yes</property>
<child>
<widget class="GtkVBox" id="cursor_vbox">
<property name="border_width">8</property>
<property name="homogeneous">no</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
<child>
<widget class="GtkVBox" id="vbox6">
<property name="border_width">4</property>
<property name="homogeneous">no</property>
<property name="spacing">4</property>
<property name="visible">yes</property>
<child>
<widget class="GtkLabel" id="placeholderlabel">
<property name="visible">yes</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label19">
<property name="label" translatable="yes">You will need to restart your login session for this setting to take effect.</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">yes</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkFrame" id="frame7">
<property name="visible">yes</property>
<property
name="shadow">GTK_SHADOW_IN</property>
<child>
<widget class="GtkTreeView" id="cursor_tree">
<property name="visible">yes</property>
<property name="headers-visible">no</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label19">
<property name="label"
translatable="yes"><b>Note:</b> You will need to restart your login session for this setting to take effect.</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">yes</property>
<property name="use_markup">yes</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="locate_pointer_frame">
<property name="label" translatable="yes">Locate Pointer</property>
<property name="label_xalign">0</property>
<property name="shadow">GTK_SHADOW_ETCHED_IN</property>
<property name="visible">yes</property>
<child>
<widget class="GtkVBox" id="vbox6">
<property name="border_width">8</property>
<property name="homogeneous">no</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
<child>
<widget class="GtkCheckButton" id="locate_pointer_toggle">
<property name="can_focus">yes</property>
<property name="label" translatable="yes">_Show position of cursor when Control is pressed</property>
<property name="active">no</property>
<property name="draw_indicator">yes</property>
<property name="visible">yes</property>
<property name="use_underline">yes</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label20">
<property name="label"
translatable="yes">Draws a quick box around the cursor when the control key has been pressed and released</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">yes</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label2">
<property name="label" translatable="yes">_Cursors</property>
<property name="label" translatable="yes">C_ursors</property>
<property name="use_underline">yes</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

View file

@ -42,6 +42,13 @@ enum
DOUBLE_CLICK_TEST_ON,
};
enum
{
COLUMN_PIXBUF,
COLUMN_TEXT,
N_COLUMNS
};
/* We use this in at least half a dozen places, so it makes sense just to
* define the macro */
@ -54,11 +61,10 @@ GdkPixbuf *right_handed_pixbuf;
GdkPixbuf *double_click_on_pixbuf;
GdkPixbuf *double_click_maybe_pixbuf;
GdkPixbuf *double_click_off_pixbuf;
GConfClient *client;
/* State in testing the double-click speed. Global for a great deal of
* convenience
*/
gint double_click_state = DOUBLE_CLICK_TEST_OFF;
/* normalilzation routines */
@ -318,11 +324,15 @@ load_pixbufs (void)
static void
setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
{
GObject *peditor;
GConfValue *value;
GObject *peditor;
GtkWidget *tree_view;
GtkTreeModel *model;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
GtkTreeIter iter;
GConfValue *value;
/* Buttons page
*/
/* Buttons page */
/* Left-handed toggle */
peditor = gconf_peditor_new_boolean
(changeset, "/desktop/gnome/peripherals/mouse/left_handed", WID ("left_handed_toggle"), NULL);
@ -336,6 +346,48 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
/* Double-click time */
g_signal_connect (WID ("double_click_darea"), "expose_event", (GCallback) drawing_area_expose_event, changeset);
/* Cursors page */
tree_view = WID ("cursor_tree");
model = (GtkTreeModel *) gtk_list_store_new (N_COLUMNS, GDK_TYPE_PIXBUF, GTK_TYPE_STRING);
gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), model);
column = gtk_tree_view_column_new ();
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, renderer, FALSE);
gtk_tree_view_column_set_attributes (column, renderer,
"pixbuf", COLUMN_PIXBUF,
NULL);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_attributes (column, renderer,
"markup", COLUMN_TEXT,
NULL);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
COLUMN_PIXBUF, gdk_pixbuf_new_from_file ("mouse-cursor-normal.png", NULL),
COLUMN_TEXT, "<b>Default Cursor</b>\nThe default cursor that ships with X",
-1);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
COLUMN_PIXBUF, gdk_pixbuf_new_from_file ("mouse-cursor-white.png", NULL),
COLUMN_TEXT, "<b>White Cursor</b>\nThe default cursor inverted",
-1);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
COLUMN_PIXBUF, gdk_pixbuf_new_from_file ("mouse-cursor-normal-large.png", NULL),
COLUMN_TEXT, "<b>Large Cursor</b>\nLarge version of normal cursor",
-1);
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
COLUMN_PIXBUF, gdk_pixbuf_new_from_file ("mouse-cursor-white-large.png", NULL),
COLUMN_TEXT, "<b>Large White Cursor</b>\nLarge version of white cursor",
-1);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
gconf_peditor_new_boolean
(changeset, "/desktop/gnome/peripherals/mouse/locate_pointer_id", WID ("locate_pointer_toggle"), NULL);
/* Motion page */
/* speed */
gconf_peditor_new_numeric_range
(changeset, DOUBLE_CLICK_KEY, WID ("delay_scale"),
"conv-to-widget-cb", double_click_from_gconf,
@ -352,6 +404,7 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
(changeset, "/desktop/gnome/peripherals/mouse/motion_threshold",
WID ("sensitivity_scale"), NULL);
/* DnD threshold */
gconf_peditor_new_numeric_range
(changeset, "/desktop/gnome/peripherals/mouse/drag_threshold", WID ("drag_threshold_scale"),
"conv-to-widget-cb", threshold_from_gconf,
@ -386,10 +439,6 @@ create_dialog (void)
gtk_size_group_add_widget (size_group, WID ("slow_label"));
gtk_size_group_add_widget (size_group, WID ("small_label"));
/* Remove cursors page */
widget = glade_xml_get_widget (dialog, "main_notebook");
gtk_notebook_remove_page (GTK_NOTEBOOK (widget), 1);
g_object_weak_ref (G_OBJECT (widget), (GWeakNotify) g_object_unref, dialog);
return dialog;
@ -447,7 +496,7 @@ main (int argc, char **argv)
setup_dialog (dialog, changeset);
dialog_win = gtk_dialog_new_with_buttons
(_("Keyboard properties"), NULL, -1,
(_("Mouse Properties"), NULL, -1,
GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);

View file

@ -12,7 +12,7 @@
<property name="window-position">GTK_WIN_POS_NONE</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="prefs_widget">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="homogeneous">no</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
@ -54,7 +54,7 @@
</child>
<child>
<widget class="GtkNotebook" id="main_notebook">
<widget class="GtkNotebook" id="prefs_widget">
<property name="can_focus">yes</property>
<property name="show_tabs">yes</property>
<property name="show_border">yes</property>
@ -312,51 +312,129 @@
</child>
<child>
<widget class="GtkFrame" id="frame6">
<widget class="GtkVBox" id="cursors_vbox">
<property name="border_width">4</property>
<property name="label" translatable="yes">Mouse Cursor</property>
<property name="label_xalign">0</property>
<property name="shadow">GTK_SHADOW_ETCHED_IN</property>
<property name="homogeneous">no</property>
<property name="spacing">4</property>
<property name="visible">yes</property>
<child>
<widget class="GtkFrame" id="frame6">
<property name="label" translatable="yes">Cursor Theme</property>
<property name="label_xalign">0</property>
<property name="shadow">GTK_SHADOW_ETCHED_IN</property>
<property name="visible">yes</property>
<child>
<widget class="GtkVBox" id="cursor_vbox">
<property name="border_width">8</property>
<property name="homogeneous">no</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
<child>
<widget class="GtkVBox" id="vbox6">
<property name="border_width">4</property>
<property name="homogeneous">no</property>
<property name="spacing">4</property>
<property name="visible">yes</property>
<child>
<widget class="GtkLabel" id="placeholderlabel">
<property name="visible">yes</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label19">
<property name="label" translatable="yes">You will need to restart your login session for this setting to take effect.</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">yes</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkFrame" id="frame7">
<property name="visible">yes</property>
<property
name="shadow">GTK_SHADOW_IN</property>
<child>
<widget class="GtkTreeView" id="cursor_tree">
<property name="rules_hint">yes</property>
<property name="visible">yes</property>
<property name="headers-visible">no</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label19">
<property name="label" translatable="yes">&lt;b&gt;Note:&lt;/b&gt; You will need to logout for this setting to take effect.</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">yes</property>
<property name="use_markup">yes</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="locate_pointer_frame">
<property name="label" translatable="yes">Locate Pointer</property>
<property name="label_xalign">0</property>
<property name="shadow">GTK_SHADOW_ETCHED_IN</property>
<property name="visible">yes</property>
<child>
<widget class="GtkVBox" id="vbox6">
<property name="border_width">8</property>
<property name="homogeneous">no</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
<child>
<widget class="GtkCheckButton" id="locate_pointer_toggle">
<property name="can_focus">yes</property>
<property name="label"
translatable="yes">_Show position of cursor when the Control key is pressed</property>
<property name="active">no</property>
<property name="draw_indicator">yes</property>
<property name="visible">yes</property>
<property name="use_underline">yes</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label20">
<property name="label"
translatable="yes">Animates a quick marker around the cursor when the Control key has been pressed and released.</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">yes</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property> <property
name="ypad">0</property> <property
name="visible">yes</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">no</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label2">
<property name="label" translatable="yes">_Cursors</property>
<property name="label" translatable="yes">C_ursors</property>
<property name="use_underline">yes</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>

View file

@ -1,3 +1,12 @@
Tue Jan 8 15:50:59 2002 Jonathan Blandford <jrb@redhat.com>
* Makefile.am: Add locate-pointer.
* gnome-settings-keyboard.c: Initial attempt at locate-pointer.
Don't understand XKB enough to figure it out.
* gnome-settings-locate-pointer.[ch]: Draw the locate pointer
box. Pretty snazzy for a useless (but fun) feature.
* gnome-settings-mouse.c: Move locate pointer to it's own file.
2002-01-08 Richard Hestilow <hestilow@ximian.com>
* gnome-settings-daemon.c (main): Initialize libgnomeui,

View file

@ -11,6 +11,8 @@ gnome_settings_daemon_SOURCES = \
gnome-settings-background.c \
gnome-settings-xsettings.c \
gnome-settings-xsettings.h \
gnome-settings-locate-pointer.c \
gnome-settings-locate-pointer.h \
gnome-settings-sound.c \
gnome-settings-sound.h \
xsettings-common.c \

View file

@ -32,11 +32,20 @@
#include "gnome-settings-keyboard.h"
#include "gnome-settings-daemon.h"
#include "gnome-settings-locate-pointer.h"
#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
# include <X11/extensions/xf86misc.h>
#endif
#define HAVE_XKB
#ifdef HAVE_XKB
# include <X11/XKBlib.h>
#endif
static gboolean use_xkb = FALSE;
static gint xkb_event_type = 0;
static void
apply_settings (void)
{
@ -58,7 +67,7 @@ apply_settings (void)
click = gconf_client_get_bool (client, "/gnome/desktop/peripherals/keyboard/click", NULL);
rate = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/rate", NULL);
delay = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/delay", NULL);
volume = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/volume", NULL);
volume = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/click_volume", NULL);
bell_volume = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/bell_volume", NULL);
bell_pitch = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/bell_pitch", NULL);
bell_duration = gconf_client_get_int (client, "/gnome/desktop/peripherals/keyboard/bell_duration", NULL);
@ -93,10 +102,56 @@ apply_settings (void)
&kbdcontrol);
}
#ifdef HAVE_XKB
/* XKB support
*/
static GdkFilterReturn
gnome_settings_keyboard_xkb_filter (GdkXEvent *xevent,
GdkEvent *event,
gpointer data)
{
if (((XEvent *) xevent)->type == xkb_event_type) {
XkbEvent *xkb_event = (XkbEvent *)xevent;
if (xkb_event->any.xkb_type == XkbStateNotify) {
/* gnome_settings_locate_pointer (); */
}
}
return GDK_FILTER_CONTINUE;
}
#endif
static void
gnome_settings_keyboard_init_xkb (void)
{
#ifdef HAVE_XKB
gint xkb_major = XkbMajorVersion;
gint xkb_minor = XkbMinorVersion;
g_print ("foo1\n");
if (XkbLibraryVersion (&xkb_major, &xkb_minor)) {
xkb_major = XkbMajorVersion;
xkb_minor = XkbMinorVersion;
g_print ("foo2\n");
if (XkbQueryExtension (gdk_display, NULL, &xkb_event_type, NULL,
&xkb_major, &xkb_minor)) {
g_print ("foo3\n");
XkbSelectEvents (gdk_display,
XkbUseCoreKbd,
XkbMapNotifyMask | XkbStateNotifyMask,
XkbMapNotifyMask | XkbStateNotifyMask);
gdk_window_add_filter (NULL, gnome_settings_keyboard_xkb_filter, NULL);
}
}
#endif
}
void
gnome_settings_keyboard_init (GConfClient *client)
{
gnome_settings_daemon_register_callback ("/desktop/gnome/peripherals/keyboard", (KeyCallbackFunc) apply_settings);
gnome_settings_keyboard_init_xkb ();
}
void

View file

@ -0,0 +1,220 @@
#include <gtk/gtk.h>
#include "gnome-settings-locate-pointer.h"
#include "gnome-settings-daemon.h"
#define LARGE_SIZE 101
#define SMALL_SIZE 51
typedef enum {
STAGE_ONE,
STAGE_TWO,
STAGE_THREE,
STAGE_FOUR,
STAGE_DONE
} LocatePointerStage;
static LocatePointerStage stage;
static GdkWindow *window = NULL;
static gint cursor_x, cursor_y;
static guint locate_pointer_id = 0;
static gint
locate_pointer_expose (GtkWidget *widget,
GdkEventExpose *event,
gpointer data)
{
gint size;
GdkPoint points[4];
if (event->window != window)
return FALSE;
switch (stage)
{
case STAGE_ONE:
case STAGE_TWO:
size = LARGE_SIZE;
break;
case STAGE_THREE:
case STAGE_FOUR:
size = SMALL_SIZE;
break;
default:
return;
}
gdk_draw_rectangle (event->window,
widget->style->black_gc,
TRUE,
0, 0, size, size);
switch (stage)
{
case STAGE_ONE:
case STAGE_THREE:
gdk_draw_rectangle (event->window,
widget->style->white_gc,
FALSE,
1, 1, size - 3, size - 3);
break;
case STAGE_TWO:
case STAGE_FOUR:
points[0].x = size/2;
points[0].y = 0 + 1;
points[1].x = size - 2;
points[1].y = size/2;
points[2].x = size/2;
points[2].y = size - 2;
points[3].x = 0 + 1;
points[3].y = size/2;
gdk_draw_polygon (event->window,
widget->style->white_gc,
FALSE, points, 4);
break;
default:
g_assert_not_reached ();
}
return TRUE;
}
static void
setup_window (void)
{
gint size;
GdkBitmap *mask;
GdkGC *gc;
GdkColor col;
GdkPoint points[4];
gdk_window_hide (window);
switch (stage)
{
case STAGE_ONE:
case STAGE_TWO:
size = LARGE_SIZE;
break;
case STAGE_THREE:
case STAGE_FOUR:
size = SMALL_SIZE;
break;
default:
return;
}
gdk_window_move_resize (window,
cursor_x - size/2,
cursor_y - size/2,
size, size);
mask = gdk_pixmap_new (window, size, size, 1);
gc = gdk_gc_new (mask);
switch (stage)
{
case STAGE_ONE:
case STAGE_THREE:
col.pixel = 1;
gdk_gc_set_foreground (gc, &col);
gdk_draw_rectangle (mask, gc, TRUE, 0, 0, size, size);
col.pixel = 0;
gdk_gc_set_foreground (gc, &col);
gdk_draw_rectangle (mask, gc, TRUE, 3, 3, size - 6, size - 6);
break;
case STAGE_TWO:
case STAGE_FOUR:
col.pixel = 0;
gdk_gc_set_foreground (gc, &col);
gdk_draw_rectangle (mask, gc, TRUE, 0, 0, size, size);
col.pixel = 1;
gdk_gc_set_foreground (gc, &col);
points[0].x = size/2;
points[0].y = 0;
points[1].x = size - 1;
points[1].y = size/2;
points[2].x = size/2;
points[2].y = size - 1;
points[3].x = 0;
points[3].y = size/2;
gdk_draw_polygon (mask, gc, FALSE, points, 4);
points[0].x = size/2;
points[0].y = 0 + 1;
points[1].x = size - 2;
points[1].y = size/2;
points[2].x = size/2;
points[2].y = size - 2;
points[3].x = 0 + 1;
points[3].y = size/2;
gdk_draw_polygon (mask, gc, FALSE, points, 4);
points[0].x = size/2;
points[0].y = 0 + 2;
points[1].x = size - 3;
points[1].y = size/2;
points[2].x = size/2;
points[2].y = size - 3;
points[3].x = 0 + 2;
points[3].y = size/2;
gdk_draw_polygon (mask, gc, FALSE, points, 4);
break;
default:
g_assert_not_reached ();
}
gdk_window_shape_combine_mask (window, mask, 0, 0);
gdk_gc_destroy (gc);
gdk_pixmap_unref (mask);
gdk_window_show (window);
}
static void
create_window (void)
{
GdkWindowAttr attributes;
GtkWidget *invisible;
invisible = gnome_settings_daemon_get_invisible ();
attributes.window_type = GDK_WINDOW_TEMP;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (invisible);
attributes.colormap = gtk_widget_get_colormap (invisible);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK;
attributes.width = 1;
attributes.height = 1;
window = gdk_window_new (gdk_get_default_root_window (),
&attributes,
GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP);
gdk_window_set_user_data (window, invisible);
g_signal_connect (G_OBJECT (invisible),
"expose_event",
(GCallback) locate_pointer_expose,
NULL);
}
static gboolean
locate_pointer_timeout (gpointer data)
{
stage++;
if (stage == STAGE_DONE)
{
gdk_window_hide (window);
locate_pointer_id = 0;
return FALSE;
}
setup_window ();
return TRUE;
}
void
gnome_settings_locate_pointer (void)
{
gdk_window_get_pointer (gdk_get_default_root_window (), &cursor_x, &cursor_y, NULL);
if (locate_pointer_id)
gtk_timeout_remove (locate_pointer_id);
if (window == NULL)
create_window ();
stage = STAGE_ONE;
setup_window ();
gdk_window_show (window);
locate_pointer_id = gtk_timeout_add (125, locate_pointer_timeout, NULL);
}

View file

@ -0,0 +1,22 @@
/*
* Copyright © 2001 Jonathan Blandford <jrb@gnome.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Red Hat not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Red Hat makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Authors: Jonathan Blandford
*/
#ifndef LOCATE_POINTER_H
#define LOCATE_POINTER_H
void gnome_settings_locate_pointer (void);
#endif

View file

@ -7,52 +7,6 @@
#define MAX_BUTTONS 10
#if 0
GdkWindow *window = NULL;
static gint
locate_pointer_expose (GtkWidget *widget,
GdkExposeEvent *event,
gpointer data)
{
}
static void
create_window (void)
{
GdkWindowAttr attributes;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
attributes.colormap = gtk_widget_get_colormap (GTK_WIDGET (tree_view));
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK;
window = gdk_window_new (gdk_get_default_root_window (),
&attributes,
GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP);
gdk_window_set_user_data (tree_view->priv->drag_highlight_window, gnome_settings_daemon_get_invisible ());
g_signal_connect (G_OBJECT (gnome_settings_daemon_get_invisible ()),
"expose_event",
locate_pointer_expose,
NULL);
}
static void
locate_pointer (void)
{
GtkWidget *window;
gint cursor_x, cursor_y;
window = gtk_window_new (GTK_WINDOW_POPUP);
gdk_window_get_pointer (NULL, &cursor_x, &cursor_y, NULL);
if (window == NULL)
create_window ();
}
#endif
static void
@ -136,6 +90,11 @@ set_motion_threshold (gint motion_threshold)
0, 0, motion_threshold);
}
static void
set_drag_threshold (gint drag_threshold)
{
}
static void
@ -171,4 +130,5 @@ gnome_settings_mouse_init (GConfClient *client)
void
gnome_settings_mouse_load (GConfClient *client)
{
}

View file

@ -11,13 +11,6 @@
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Jonathan Blandford
*/