2008-07-01 22:57:50 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
1998-02-25 22:03:10 +00:00
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
1998-03-11 06:11:52 +00:00
|
|
|
* GtkSpinButton widget for GTK+
|
|
|
|
* Copyright (C) 1998 Lars Hamann and Stefan Jeske
|
|
|
|
*
|
1998-02-25 22:03:10 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-02-25 22:03:10 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1998-02-25 22:03:10 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1998-02-25 22:03:10 +00:00
|
|
|
*/
|
|
|
|
|
1999-02-24 07:37:18 +00:00
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
1998-02-25 22:03:10 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <math.h>
|
1998-03-11 06:11:52 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <locale.h>
|
1998-02-25 22:03:10 +00:00
|
|
|
#include "gdk/gdkkeysyms.h"
|
2002-02-08 00:02:52 +00:00
|
|
|
#include "gtkbindings.h"
|
1998-02-25 22:03:10 +00:00
|
|
|
#include "gtkspinbutton.h"
|
2006-08-15 18:52:14 +00:00
|
|
|
#include "gtkentryprivate.h"
|
1998-02-25 22:03:10 +00:00
|
|
|
#include "gtkmain.h"
|
2001-11-17 23:28:51 +00:00
|
|
|
#include "gtkmarshalers.h"
|
2001-03-18 04:50:34 +00:00
|
|
|
#include "gtksettings.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
#include "gtkprivate.h"
|
2001-05-18 22:31:02 +00:00
|
|
|
#include "gtkintl.h"
|
2005-03-20 07:01:23 +00:00
|
|
|
#include "gtkalias.h"
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2005-11-22 12:40:15 +00:00
|
|
|
#define MIN_SPIN_BUTTON_WIDTH 30
|
|
|
|
#define MAX_TIMER_CALLS 5
|
|
|
|
#define EPSILON 1e-10
|
|
|
|
#define MAX_DIGITS 20
|
|
|
|
#define MIN_ARROW_WIDTH 6
|
1998-02-25 22:03:10 +00:00
|
|
|
|
1998-09-26 03:12:03 +00:00
|
|
|
enum {
|
2001-05-18 22:31:02 +00:00
|
|
|
PROP_0,
|
|
|
|
PROP_ADJUSTMENT,
|
|
|
|
PROP_CLIMB_RATE,
|
|
|
|
PROP_DIGITS,
|
|
|
|
PROP_SNAP_TO_TICKS,
|
|
|
|
PROP_NUMERIC,
|
|
|
|
PROP_WRAP,
|
|
|
|
PROP_UPDATE_POLICY,
|
|
|
|
PROP_VALUE
|
1998-09-26 03:12:03 +00:00
|
|
|
};
|
|
|
|
|
1999-02-28 16:04:47 +00:00
|
|
|
/* Signals */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
INPUT,
|
|
|
|
OUTPUT,
|
2001-03-30 03:35:47 +00:00
|
|
|
VALUE_CHANGED,
|
2002-02-08 00:02:52 +00:00
|
|
|
CHANGE_VALUE,
|
2006-01-30 17:35:49 +00:00
|
|
|
WRAPPED,
|
1999-02-28 16:04:47 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2001-10-03 21:50:58 +00:00
|
|
|
static void gtk_spin_button_editable_init (GtkEditableClass *iface);
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
static void gtk_spin_button_finalize (GObject *object);
|
2002-01-16 01:07:11 +00:00
|
|
|
static void gtk_spin_button_destroy (GtkObject *object);
|
2001-05-18 22:31:02 +00:00
|
|
|
static void gtk_spin_button_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gtk_spin_button_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
1998-02-25 22:03:10 +00:00
|
|
|
static void gtk_spin_button_map (GtkWidget *widget);
|
|
|
|
static void gtk_spin_button_unmap (GtkWidget *widget);
|
|
|
|
static void gtk_spin_button_realize (GtkWidget *widget);
|
|
|
|
static void gtk_spin_button_unrealize (GtkWidget *widget);
|
|
|
|
static void gtk_spin_button_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition);
|
|
|
|
static void gtk_spin_button_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation);
|
|
|
|
static gint gtk_spin_button_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event);
|
|
|
|
static gint gtk_spin_button_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
|
|
|
static gint gtk_spin_button_button_release (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
|
|
|
static gint gtk_spin_button_motion_notify (GtkWidget *widget,
|
|
|
|
GdkEventMotion *event);
|
|
|
|
static gint gtk_spin_button_enter_notify (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event);
|
|
|
|
static gint gtk_spin_button_leave_notify (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event);
|
|
|
|
static gint gtk_spin_button_focus_out (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event);
|
2002-01-16 01:07:11 +00:00
|
|
|
static void gtk_spin_button_grab_notify (GtkWidget *widget,
|
|
|
|
gboolean was_grabbed);
|
2002-01-23 20:15:48 +00:00
|
|
|
static void gtk_spin_button_state_changed (GtkWidget *widget,
|
|
|
|
GtkStateType previous_state);
|
2007-03-12 05:51:11 +00:00
|
|
|
static void gtk_spin_button_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *previous_style);
|
1998-02-25 22:03:10 +00:00
|
|
|
static void gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
GdkRectangle *area,
|
2002-02-26 23:50:14 +00:00
|
|
|
GtkArrowType arrow_type);
|
2006-12-22 19:10:43 +00:00
|
|
|
static gboolean gtk_spin_button_timer (GtkSpinButton *spin_button);
|
2002-01-16 01:07:11 +00:00
|
|
|
static void gtk_spin_button_stop_spinning (GtkSpinButton *spin);
|
1998-06-19 17:33:51 +00:00
|
|
|
static void gtk_spin_button_value_changed (GtkAdjustment *adjustment,
|
1998-02-25 22:03:10 +00:00
|
|
|
GtkSpinButton *spin_button);
|
1998-06-17 20:07:31 +00:00
|
|
|
static gint gtk_spin_button_key_release (GtkWidget *widget,
|
|
|
|
GdkEventKey *event);
|
2000-02-18 20:02:24 +00:00
|
|
|
static gint gtk_spin_button_scroll (GtkWidget *widget,
|
|
|
|
GdkEventScroll *event);
|
Make parent_class static.
Sun Nov 5 04:24:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertextpixbuf.c: Make parent_class
static.
Tue Sep 19 10:54:22 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext*.[ch] gtk/gtkimmulticontext.[ch]
gtk/gtktextlayout.[ch] gtk/gtktextview.c gtk/gtkentry.c:
Add support for positioning the cursor within the preedit string.
Mon Sep 18 23:56:32 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Check for bindings after passing
events to im context filter.
Mon Sep 18 11:50:51 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (add_preedit_attrs): Handle
empty attribute lists properly.
Sun Sep 17 10:08:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c (main): Return non-zero exit
status if errors were encountered querying any
modules.
Sat Sep 16 14:01:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h: include gtkmodule.h gtkoldeditable.h,
don't include gtkthemes.h.
* gtk/testgtk.c gtk/testtext.c: Set environment variables
to point
* gtk/Makefile.am: Add new .c and .h files, build
gtk-query-immodules and use it to create a gtk.immodules
file for use of test programs.
* gtk/gtkpreview.c: remove extra blank line.
Sat Sep 16 13:21:04 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.c (gtk_im_context_simple_add_table):
Add the ability to add extra tables beyond the default
one, and also the ability to have compose sequences
that are prefixes of other compose sequences.
* gtk/gtkimcontextsimple.c: Export a preedit string which
consists of possible candidates for keystrokes that have
been entered but not yet committed.
* gtk/gtkimcontext.[ch] gtk/immulticontext.[ch]
gtk/gtkimcontextsimple.[ch]: add gtk_im_context_reset()
* gtk/gtkmulticontext.[ch] (gtk_im_multicontext_append_menuitems):
Add a function to add input-method switching menu items
to a menu.
* gtk/gtkimmulticontext.[ch]: Properly handly set_client_window
when switching input methods.
* gtk/gtkimcontextsimple.[ch]: Change the format of
the compose table to allow compose tables of different
lengths / sequence.
Sat Sep 16 13:05:48 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmodule.[ch]: Support routines for loading
GtkIMContext implementations dynamically at runtime.
* gtk/queryimmodules.c: Program to query the available
input modules and write the results into a file.
* gtk/gtkrc.[ch] (gtk_rc_get_im_module_file): Add
extra config options "im_module_file" (cache file for
input method modules), and "im_module_path" - path
to look for modules when generating cache file.
This doesn't scale.
Sat Sep 16 13:09:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.[ch] gtk/gtkmodule.[ch]: Move most of the
generic code from gtkthemes into a new abstraction
GtkModule which has the logic for implementing
a loadable module which implements a number of
GObject types.
Sat Sep 16 13:07:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.[ch]: Convert GtkEditable from
a class into an interface
* gtk/gtkoldeditable.[ch]: Move the old editable
implementation into here, so legacy widgets can
still rely on the implemenation. GtkOldEditable
exports GtkEditable. Make selection handling
code use new text conversion functions (and
handle UTF-8 as a side-effect). Use GtkClipboard
for CLIPBOARD.
* gtk/gtktext.[ch] gtk/gtkcombo.c gtk/gtkspinbutton.c:
Adopt to match above changes.
* gtk/gtkentry.[ch]: Implement GtkEditable directly,
avoid GtkOldEditable implementation. Restructure
to reduce number of places that modify state directly.
Move to GtkBindingSet. Display the preedit string.
Queue recomputation of PangoLayout and scroll position
to improve effiency of doing complex changes naively.
Add a menu with cut/copy/paste and input method selection.
Thu Sep 14 22:11:05 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add gtk_text_layout_set_preedit_string()
to set preedit string and attributes; display preedit string by
inserting string and attributes at cursor when creating the
GtkTextLineDisplay.
* gtk/gtktextlayout.c: Move all conversions between byte
positions in PangoLayout and GtkTextIter into new functions
line_display_iter_to_index/index_to_iter that properly
handle the preedit string.
* gtk/gtktextmark.[ch]: Restore gtk_text_mark_get_name, modify
it to return const char * (eventually will end up
as GCONST char *, most likely.)
* gtk/gtktextview.[ch]: Handle the preedit string, call
gtk_im_context_reset() as necessary, add a menu to switch
input methods.
* gtk/gtktextlayout.[ch]: Remove useless
gtk_text_layout_get_log_attrs() function.
2000-11-12 03:43:24 +00:00
|
|
|
static void gtk_spin_button_activate (GtkEntry *entry);
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
static void gtk_spin_button_get_text_area_size (GtkEntry *entry,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
gint *width,
|
|
|
|
gint *height);
|
1998-03-11 06:11:52 +00:00
|
|
|
static void gtk_spin_button_snap (GtkSpinButton *spin_button,
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble val);
|
2001-10-03 21:50:58 +00:00
|
|
|
static void gtk_spin_button_insert_text (GtkEditable *editable,
|
1998-03-11 06:11:52 +00:00
|
|
|
const gchar *new_text,
|
1998-06-19 17:33:51 +00:00
|
|
|
gint new_text_length,
|
1998-03-11 06:11:52 +00:00
|
|
|
gint *position);
|
1998-06-19 17:33:51 +00:00
|
|
|
static void gtk_spin_button_real_spin (GtkSpinButton *spin_button,
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble step);
|
2002-02-08 00:02:52 +00:00
|
|
|
static void gtk_spin_button_real_change_value (GtkSpinButton *spin,
|
|
|
|
GtkScrollType scroll);
|
|
|
|
|
1999-02-28 16:04:47 +00:00
|
|
|
static gint gtk_spin_button_default_input (GtkSpinButton *spin_button,
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble *new_val);
|
1999-02-28 16:04:47 +00:00
|
|
|
static gint gtk_spin_button_default_output (GtkSpinButton *spin_button);
|
2002-02-08 00:02:52 +00:00
|
|
|
|
2001-10-21 22:28:55 +00:00
|
|
|
static gint spin_button_get_arrow_size (GtkSpinButton *spin_button);
|
2001-03-18 04:50:34 +00:00
|
|
|
static gint spin_button_get_shadow_type (GtkSpinButton *spin_button);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
1999-02-28 16:04:47 +00:00
|
|
|
static guint spinbutton_signals[LAST_SIGNAL] = {0};
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2002-02-20 23:36:28 +00:00
|
|
|
#define NO_ARROW 2
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkSpinButton, gtk_spin_button, GTK_TYPE_ENTRY,
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE,
|
2006-05-14 04:25:34 +00:00
|
|
|
gtk_spin_button_editable_init))
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2002-02-08 00:02:52 +00:00
|
|
|
#define add_spin_binding(binding_set, keyval, mask, scroll) \
|
|
|
|
gtk_binding_entry_add_signal (binding_set, keyval, mask, \
|
|
|
|
"change_value", 1, \
|
|
|
|
GTK_TYPE_SCROLL_TYPE, scroll)
|
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_class_init (GtkSpinButtonClass *class)
|
|
|
|
{
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
2008-07-21 09:41:28 +00:00
|
|
|
GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
|
|
|
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
|
|
|
GtkEntryClass *entry_class = GTK_ENTRY_CLASS (class);
|
2002-02-08 00:02:52 +00:00
|
|
|
GtkBindingSet *binding_set;
|
1998-02-25 22:03:10 +00:00
|
|
|
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
gobject_class->finalize = gtk_spin_button_finalize;
|
|
|
|
|
2001-05-18 22:31:02 +00:00
|
|
|
gobject_class->set_property = gtk_spin_button_set_property;
|
|
|
|
gobject_class->get_property = gtk_spin_button_get_property;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
2002-01-16 01:07:11 +00:00
|
|
|
object_class->destroy = gtk_spin_button_destroy;
|
|
|
|
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
widget_class->map = gtk_spin_button_map;
|
|
|
|
widget_class->unmap = gtk_spin_button_unmap;
|
|
|
|
widget_class->realize = gtk_spin_button_realize;
|
|
|
|
widget_class->unrealize = gtk_spin_button_unrealize;
|
|
|
|
widget_class->size_request = gtk_spin_button_size_request;
|
|
|
|
widget_class->size_allocate = gtk_spin_button_size_allocate;
|
|
|
|
widget_class->expose_event = gtk_spin_button_expose;
|
|
|
|
widget_class->scroll_event = gtk_spin_button_scroll;
|
|
|
|
widget_class->button_press_event = gtk_spin_button_button_press;
|
|
|
|
widget_class->button_release_event = gtk_spin_button_button_release;
|
|
|
|
widget_class->motion_notify_event = gtk_spin_button_motion_notify;
|
|
|
|
widget_class->key_release_event = gtk_spin_button_key_release;
|
|
|
|
widget_class->enter_notify_event = gtk_spin_button_enter_notify;
|
|
|
|
widget_class->leave_notify_event = gtk_spin_button_leave_notify;
|
|
|
|
widget_class->focus_out_event = gtk_spin_button_focus_out;
|
2002-01-16 01:07:11 +00:00
|
|
|
widget_class->grab_notify = gtk_spin_button_grab_notify;
|
2002-01-23 20:15:48 +00:00
|
|
|
widget_class->state_changed = gtk_spin_button_state_changed;
|
2007-03-12 05:51:11 +00:00
|
|
|
widget_class->style_set = gtk_spin_button_style_set;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
Make parent_class static.
Sun Nov 5 04:24:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertextpixbuf.c: Make parent_class
static.
Tue Sep 19 10:54:22 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext*.[ch] gtk/gtkimmulticontext.[ch]
gtk/gtktextlayout.[ch] gtk/gtktextview.c gtk/gtkentry.c:
Add support for positioning the cursor within the preedit string.
Mon Sep 18 23:56:32 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Check for bindings after passing
events to im context filter.
Mon Sep 18 11:50:51 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (add_preedit_attrs): Handle
empty attribute lists properly.
Sun Sep 17 10:08:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c (main): Return non-zero exit
status if errors were encountered querying any
modules.
Sat Sep 16 14:01:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h: include gtkmodule.h gtkoldeditable.h,
don't include gtkthemes.h.
* gtk/testgtk.c gtk/testtext.c: Set environment variables
to point
* gtk/Makefile.am: Add new .c and .h files, build
gtk-query-immodules and use it to create a gtk.immodules
file for use of test programs.
* gtk/gtkpreview.c: remove extra blank line.
Sat Sep 16 13:21:04 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.c (gtk_im_context_simple_add_table):
Add the ability to add extra tables beyond the default
one, and also the ability to have compose sequences
that are prefixes of other compose sequences.
* gtk/gtkimcontextsimple.c: Export a preedit string which
consists of possible candidates for keystrokes that have
been entered but not yet committed.
* gtk/gtkimcontext.[ch] gtk/immulticontext.[ch]
gtk/gtkimcontextsimple.[ch]: add gtk_im_context_reset()
* gtk/gtkmulticontext.[ch] (gtk_im_multicontext_append_menuitems):
Add a function to add input-method switching menu items
to a menu.
* gtk/gtkimmulticontext.[ch]: Properly handly set_client_window
when switching input methods.
* gtk/gtkimcontextsimple.[ch]: Change the format of
the compose table to allow compose tables of different
lengths / sequence.
Sat Sep 16 13:05:48 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmodule.[ch]: Support routines for loading
GtkIMContext implementations dynamically at runtime.
* gtk/queryimmodules.c: Program to query the available
input modules and write the results into a file.
* gtk/gtkrc.[ch] (gtk_rc_get_im_module_file): Add
extra config options "im_module_file" (cache file for
input method modules), and "im_module_path" - path
to look for modules when generating cache file.
This doesn't scale.
Sat Sep 16 13:09:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.[ch] gtk/gtkmodule.[ch]: Move most of the
generic code from gtkthemes into a new abstraction
GtkModule which has the logic for implementing
a loadable module which implements a number of
GObject types.
Sat Sep 16 13:07:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.[ch]: Convert GtkEditable from
a class into an interface
* gtk/gtkoldeditable.[ch]: Move the old editable
implementation into here, so legacy widgets can
still rely on the implemenation. GtkOldEditable
exports GtkEditable. Make selection handling
code use new text conversion functions (and
handle UTF-8 as a side-effect). Use GtkClipboard
for CLIPBOARD.
* gtk/gtktext.[ch] gtk/gtkcombo.c gtk/gtkspinbutton.c:
Adopt to match above changes.
* gtk/gtkentry.[ch]: Implement GtkEditable directly,
avoid GtkOldEditable implementation. Restructure
to reduce number of places that modify state directly.
Move to GtkBindingSet. Display the preedit string.
Queue recomputation of PangoLayout and scroll position
to improve effiency of doing complex changes naively.
Add a menu with cut/copy/paste and input method selection.
Thu Sep 14 22:11:05 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add gtk_text_layout_set_preedit_string()
to set preedit string and attributes; display preedit string by
inserting string and attributes at cursor when creating the
GtkTextLineDisplay.
* gtk/gtktextlayout.c: Move all conversions between byte
positions in PangoLayout and GtkTextIter into new functions
line_display_iter_to_index/index_to_iter that properly
handle the preedit string.
* gtk/gtktextmark.[ch]: Restore gtk_text_mark_get_name, modify
it to return const char * (eventually will end up
as GCONST char *, most likely.)
* gtk/gtktextview.[ch]: Handle the preedit string, call
gtk_im_context_reset() as necessary, add a menu to switch
input methods.
* gtk/gtktextlayout.[ch]: Remove useless
gtk_text_layout_get_log_attrs() function.
2000-11-12 03:43:24 +00:00
|
|
|
entry_class->activate = gtk_spin_button_activate;
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
entry_class->get_text_area_size = gtk_spin_button_get_text_area_size;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
|
|
|
class->input = NULL;
|
|
|
|
class->output = NULL;
|
2002-02-08 00:02:52 +00:00
|
|
|
class->change_value = gtk_spin_button_real_change_value;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
2001-05-18 22:31:02 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_ADJUSTMENT,
|
|
|
|
g_param_spec_object ("adjustment",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Adjustment"),
|
|
|
|
P_("The adjustment that holds the value of the spinbutton"),
|
2001-05-18 22:31:02 +00:00
|
|
|
GTK_TYPE_ADJUSTMENT,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_CLIMB_RATE,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_double ("climb-rate",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Climb Rate"),
|
|
|
|
P_("The acceleration rate when you hold down a button"),
|
2001-05-18 22:31:02 +00:00
|
|
|
0.0,
|
|
|
|
G_MAXDOUBLE,
|
|
|
|
0.0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_DIGITS,
|
|
|
|
g_param_spec_uint ("digits",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Digits"),
|
|
|
|
P_("The number of decimal places to display"),
|
2001-05-18 22:31:02 +00:00
|
|
|
0,
|
2001-06-20 04:13:37 +00:00
|
|
|
MAX_DIGITS,
|
2001-05-18 22:31:02 +00:00
|
|
|
0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_SNAP_TO_TICKS,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_boolean ("snap-to-ticks",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Snap to Ticks"),
|
|
|
|
P_("Whether erroneous values are automatically changed to a spin button's nearest step increment"),
|
2001-05-18 22:31:02 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_NUMERIC,
|
|
|
|
g_param_spec_boolean ("numeric",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Numeric"),
|
|
|
|
P_("Whether non-numeric characters should be ignored"),
|
2001-05-18 22:31:02 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_WRAP,
|
|
|
|
g_param_spec_boolean ("wrap",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Wrap"),
|
|
|
|
P_("Whether a spin button should wrap upon reaching its limits"),
|
2001-05-18 22:31:02 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_UPDATE_POLICY,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_enum ("update-policy",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Update Policy"),
|
|
|
|
P_("Whether the spin button should update always, or only when the value is legal"),
|
2001-05-18 22:31:02 +00:00
|
|
|
GTK_TYPE_SPIN_BUTTON_UPDATE_POLICY,
|
|
|
|
GTK_UPDATE_ALWAYS,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_VALUE,
|
|
|
|
g_param_spec_double ("value",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Value"),
|
|
|
|
P_("Reads the current value, or sets a new value"),
|
2001-05-18 22:31:02 +00:00
|
|
|
-G_MAXDOUBLE,
|
|
|
|
G_MAXDOUBLE,
|
|
|
|
0.0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
gtk_widget_class_install_style_property_parser (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_enum ("shadow-type",
|
2003-06-24 21:55:40 +00:00
|
|
|
"Shadow Type",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Style of bevel around the spin button"),
|
2001-03-18 04:50:34 +00:00
|
|
|
GTK_TYPE_SHADOW_TYPE,
|
2001-05-01 01:36:33 +00:00
|
|
|
GTK_SHADOW_IN,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READABLE),
|
2001-03-18 04:50:34 +00:00
|
|
|
gtk_rc_property_parse_enum);
|
1999-02-28 16:04:47 +00:00
|
|
|
spinbutton_signals[INPUT] =
|
2005-09-01 05:11:46 +00:00
|
|
|
g_signal_new (I_("input"),
|
2002-10-10 01:02:25 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GtkSpinButtonClass, input),
|
|
|
|
NULL, NULL,
|
|
|
|
_gtk_marshal_INT__POINTER,
|
|
|
|
G_TYPE_INT, 1,
|
|
|
|
G_TYPE_POINTER);
|
1999-02-28 16:04:47 +00:00
|
|
|
|
2008-01-06 06:35:49 +00:00
|
|
|
/**
|
|
|
|
* GtkSpinButton::output:
|
|
|
|
* @spin_button: the object which received the signal
|
|
|
|
*
|
|
|
|
* The ::output signal can be used to change to formatting
|
|
|
|
* of the value that is displayed in the spin buttons entry.
|
|
|
|
* |[
|
|
|
|
* /* show leading zeros */
|
|
|
|
* static gboolean
|
|
|
|
* on_output (GtkSpinButton *spin,
|
|
|
|
* gpointer data)
|
|
|
|
* {
|
|
|
|
* GtkAdjustment *adj;
|
|
|
|
* gchar *text;
|
2008-01-07 01:26:39 +00:00
|
|
|
* int value;
|
2008-01-06 06:35:49 +00:00
|
|
|
*
|
|
|
|
* adj = gtk_spin_button_get_adjustment (spin);
|
|
|
|
* value = (int)gtk_adjustment_get_value (adj);
|
|
|
|
* text = g_strdup_printf ("%02d", value);
|
|
|
|
* gtk_entry_set_text (GTK_ENTRY (spin), text);
|
|
|
|
* g_free (text);
|
|
|
|
*
|
|
|
|
* return TRUE;
|
|
|
|
* }
|
|
|
|
* ]|
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the value has been displayed.
|
|
|
|
*/
|
1999-02-28 16:04:47 +00:00
|
|
|
spinbutton_signals[OUTPUT] =
|
2005-09-01 05:11:46 +00:00
|
|
|
g_signal_new (I_("output"),
|
2002-10-10 01:02:25 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GtkSpinButtonClass, output),
|
|
|
|
_gtk_boolean_handled_accumulator, NULL,
|
|
|
|
_gtk_marshal_BOOLEAN__VOID,
|
|
|
|
G_TYPE_BOOLEAN, 0);
|
2001-03-30 03:35:47 +00:00
|
|
|
|
|
|
|
spinbutton_signals[VALUE_CHANGED] =
|
2008-08-08 13:25:18 +00:00
|
|
|
g_signal_new (I_("value-changed"),
|
2002-10-10 01:02:25 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GtkSpinButtonClass, value_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2002-02-08 00:02:52 +00:00
|
|
|
|
2006-01-30 17:35:49 +00:00
|
|
|
/**
|
|
|
|
* GtkSpinButton::wrapped:
|
|
|
|
* @spinbutton: the object which received the signal
|
|
|
|
*
|
|
|
|
* The wrapped signal is emitted right after the spinbutton wraps
|
|
|
|
* from its maximum to minimum value or vice-versa.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
*/
|
|
|
|
spinbutton_signals[WRAPPED] =
|
|
|
|
g_signal_new (I_("wrapped"),
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GtkSpinButtonClass, wrapped),
|
|
|
|
NULL, NULL,
|
|
|
|
_gtk_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2002-02-08 00:02:52 +00:00
|
|
|
/* Action signals */
|
|
|
|
spinbutton_signals[CHANGE_VALUE] =
|
2008-08-08 14:36:41 +00:00
|
|
|
g_signal_new (I_("change-value"),
|
2002-10-10 01:02:25 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2002-02-08 00:02:52 +00:00
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
G_STRUCT_OFFSET (GtkSpinButtonClass, change_value),
|
|
|
|
NULL, NULL,
|
|
|
|
_gtk_marshal_VOID__ENUM,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GTK_TYPE_SCROLL_TYPE);
|
|
|
|
|
|
|
|
binding_set = gtk_binding_set_by_class (class);
|
|
|
|
|
|
|
|
add_spin_binding (binding_set, GDK_Up, 0, GTK_SCROLL_STEP_UP);
|
|
|
|
add_spin_binding (binding_set, GDK_KP_Up, 0, GTK_SCROLL_STEP_UP);
|
|
|
|
add_spin_binding (binding_set, GDK_Down, 0, GTK_SCROLL_STEP_DOWN);
|
|
|
|
add_spin_binding (binding_set, GDK_KP_Down, 0, GTK_SCROLL_STEP_DOWN);
|
|
|
|
add_spin_binding (binding_set, GDK_Page_Up, 0, GTK_SCROLL_PAGE_UP);
|
|
|
|
add_spin_binding (binding_set, GDK_Page_Down, 0, GTK_SCROLL_PAGE_DOWN);
|
|
|
|
add_spin_binding (binding_set, GDK_Page_Up, GDK_CONTROL_MASK, GTK_SCROLL_END);
|
|
|
|
add_spin_binding (binding_set, GDK_Page_Down, GDK_CONTROL_MASK, GTK_SCROLL_START);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
2001-10-03 21:50:58 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_editable_init (GtkEditableClass *iface)
|
|
|
|
{
|
|
|
|
iface->insert_text = gtk_spin_button_insert_text;
|
|
|
|
}
|
|
|
|
|
1998-09-26 03:12:03 +00:00
|
|
|
static void
|
2001-05-18 22:31:02 +00:00
|
|
|
gtk_spin_button_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
1998-09-26 03:12:03 +00:00
|
|
|
{
|
2008-07-21 09:41:28 +00:00
|
|
|
GtkSpinButton *spin_button = GTK_SPIN_BUTTON (object);
|
1998-09-26 03:12:03 +00:00
|
|
|
|
2001-05-18 22:31:02 +00:00
|
|
|
switch (prop_id)
|
1998-09-26 03:12:03 +00:00
|
|
|
{
|
|
|
|
GtkAdjustment *adjustment;
|
|
|
|
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_ADJUSTMENT:
|
|
|
|
adjustment = GTK_ADJUSTMENT (g_value_get_object (value));
|
1998-09-26 03:12:03 +00:00
|
|
|
if (!adjustment)
|
|
|
|
adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
|
|
|
gtk_spin_button_set_adjustment (spin_button, adjustment);
|
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_CLIMB_RATE:
|
1998-09-26 03:12:03 +00:00
|
|
|
gtk_spin_button_configure (spin_button,
|
|
|
|
spin_button->adjustment,
|
2001-05-18 22:31:02 +00:00
|
|
|
g_value_get_double (value),
|
1998-09-26 03:12:03 +00:00
|
|
|
spin_button->digits);
|
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_DIGITS:
|
1998-09-26 03:12:03 +00:00
|
|
|
gtk_spin_button_configure (spin_button,
|
|
|
|
spin_button->adjustment,
|
|
|
|
spin_button->climb_rate,
|
2001-05-18 22:31:02 +00:00
|
|
|
g_value_get_uint (value));
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_SNAP_TO_TICKS:
|
|
|
|
gtk_spin_button_set_snap_to_ticks (spin_button, g_value_get_boolean (value));
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_NUMERIC:
|
|
|
|
gtk_spin_button_set_numeric (spin_button, g_value_get_boolean (value));
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_WRAP:
|
|
|
|
gtk_spin_button_set_wrap (spin_button, g_value_get_boolean (value));
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_UPDATE_POLICY:
|
|
|
|
gtk_spin_button_set_update_policy (spin_button, g_value_get_enum (value));
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_VALUE:
|
|
|
|
gtk_spin_button_set_value (spin_button, g_value_get_double (value));
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
|
|
|
default:
|
2008-01-06 03:28:40 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-05-18 22:31:02 +00:00
|
|
|
gtk_spin_button_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
1998-09-26 03:12:03 +00:00
|
|
|
{
|
2008-07-21 09:41:28 +00:00
|
|
|
GtkSpinButton *spin_button = GTK_SPIN_BUTTON (object);
|
1998-09-26 03:12:03 +00:00
|
|
|
|
2001-05-18 22:31:02 +00:00
|
|
|
switch (prop_id)
|
1998-09-26 03:12:03 +00:00
|
|
|
{
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_ADJUSTMENT:
|
2002-01-09 10:28:02 +00:00
|
|
|
g_value_set_object (value, spin_button->adjustment);
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_CLIMB_RATE:
|
|
|
|
g_value_set_double (value, spin_button->climb_rate);
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_DIGITS:
|
|
|
|
g_value_set_uint (value, spin_button->digits);
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_SNAP_TO_TICKS:
|
|
|
|
g_value_set_boolean (value, spin_button->snap_to_ticks);
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_NUMERIC:
|
|
|
|
g_value_set_boolean (value, spin_button->numeric);
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_WRAP:
|
|
|
|
g_value_set_boolean (value, spin_button->wrap);
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_UPDATE_POLICY:
|
|
|
|
g_value_set_enum (value, spin_button->update_policy);
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
2001-05-18 22:31:02 +00:00
|
|
|
case PROP_VALUE:
|
|
|
|
g_value_set_double (value, spin_button->adjustment->value);
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
|
|
|
default:
|
2001-05-18 22:31:02 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
1998-09-26 03:12:03 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_init (GtkSpinButton *spin_button)
|
|
|
|
{
|
|
|
|
spin_button->adjustment = NULL;
|
1998-03-11 06:11:52 +00:00
|
|
|
spin_button->panel = NULL;
|
1998-02-25 22:03:10 +00:00
|
|
|
spin_button->timer = 0;
|
|
|
|
spin_button->climb_rate = 0.0;
|
|
|
|
spin_button->timer_step = 0.0;
|
1998-06-17 20:07:31 +00:00
|
|
|
spin_button->update_policy = GTK_UPDATE_ALWAYS;
|
2002-02-20 23:36:28 +00:00
|
|
|
spin_button->in_child = NO_ARROW;
|
|
|
|
spin_button->click_child = NO_ARROW;
|
1998-02-25 22:03:10 +00:00
|
|
|
spin_button->button = 0;
|
1998-06-19 17:33:51 +00:00
|
|
|
spin_button->need_timer = FALSE;
|
1998-02-25 22:03:10 +00:00
|
|
|
spin_button->timer_calls = 0;
|
|
|
|
spin_button->digits = 0;
|
1998-06-17 20:07:31 +00:00
|
|
|
spin_button->numeric = FALSE;
|
|
|
|
spin_button->wrap = FALSE;
|
|
|
|
spin_button->snap_to_ticks = FALSE;
|
2002-02-20 23:36:28 +00:00
|
|
|
|
1998-09-26 03:12:03 +00:00
|
|
|
gtk_spin_button_set_adjustment (spin_button,
|
1999-02-28 16:04:47 +00:00
|
|
|
(GtkAdjustment*) gtk_adjustment_new (0, 0, 0, 0, 0, 0));
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
gtk_spin_button_finalize (GObject *object)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
2002-09-23 16:14:15 +00:00
|
|
|
gtk_spin_button_set_adjustment (GTK_SPIN_BUTTON (object), NULL);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
G_OBJECT_CLASS (gtk_spin_button_parent_class)->finalize (object);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
2002-01-16 01:07:11 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_destroy (GtkObject *object)
|
|
|
|
{
|
|
|
|
gtk_spin_button_stop_spinning (GTK_SPIN_BUTTON (object));
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
GTK_OBJECT_CLASS (gtk_spin_button_parent_class)->destroy (object);
|
2002-01-16 01:07:11 +00:00
|
|
|
}
|
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_map (GtkWidget *widget)
|
|
|
|
{
|
2010-03-02 06:16:02 +00:00
|
|
|
if (gtk_widget_get_realized (widget) && !gtk_widget_get_mapped (widget))
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
2006-05-02 23:56:43 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->map (widget);
|
1998-04-05 06:58:29 +00:00
|
|
|
gdk_window_show (GTK_SPIN_BUTTON (widget)->panel);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_spin_button_unmap (GtkWidget *widget)
|
|
|
|
{
|
2010-03-02 04:19:28 +00:00
|
|
|
if (gtk_widget_get_mapped (widget))
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
2005-03-22 17:36:41 +00:00
|
|
|
gtk_spin_button_stop_spinning (GTK_SPIN_BUTTON (widget));
|
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
gdk_window_hide (GTK_SPIN_BUTTON (widget)->panel);
|
2006-05-02 23:56:43 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->unmap (widget);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_spin_button_realize (GtkWidget *widget)
|
|
|
|
{
|
2008-07-21 09:41:28 +00:00
|
|
|
GtkSpinButton *spin_button = GTK_SPIN_BUTTON (widget);
|
1998-02-25 22:03:10 +00:00
|
|
|
GdkWindowAttr attributes;
|
|
|
|
gint attributes_mask;
|
2002-10-10 01:02:25 +00:00
|
|
|
gboolean return_val;
|
2001-10-21 22:28:55 +00:00
|
|
|
gint arrow_size;
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2001-10-21 22:28:55 +00:00
|
|
|
arrow_size = spin_button_get_arrow_size (spin_button);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
1998-06-17 20:07:31 +00:00
|
|
|
gtk_widget_set_events (widget, gtk_widget_get_events (widget) |
|
|
|
|
GDK_KEY_RELEASE_MASK);
|
2006-05-02 23:56:43 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->realize (widget);
|
1998-06-17 20:07:31 +00:00
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
attributes.window_type = GDK_WINDOW_CHILD;
|
|
|
|
attributes.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
attributes.visual = gtk_widget_get_visual (widget);
|
|
|
|
attributes.colormap = gtk_widget_get_colormap (widget);
|
|
|
|
attributes.event_mask = gtk_widget_get_events (widget);
|
|
|
|
attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK
|
|
|
|
| GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK
|
|
|
|
| GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK;
|
|
|
|
|
|
|
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
attributes.x = (widget->allocation.width - arrow_size -
|
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com>
* modules/linux-fb/Makefile.am: Make this compile
without framebuffer enabled
* gdk/linux-fb/Makefile.am: Add conditional to not build
framebuffer unless specified in configure
* gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting
the size of the target instead of source if -1 was passed for
width/height
* gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix
width/height confusion.
2000-06-19 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be
GDK_DRAWABLE_XID. In the future, we probably want to make it
faster with G_DISABLE_CHECKS turned on.
2000-06-14 Havoc Pennington <hp@redhat.com>
* gdk/Makefile.am: add gdkpixmap.c
* gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/
s/gdk_image_init/_gdk_windowing_image_init
* gdk/gdkcolor.c: make ref/unref compat wrappers for GObject
ref/unref
* gdk/gdkcolor.h: make GdkColormap a GObject subclass
* gdk/gdkcompat.h: remove GdkWindowType compat, since
GdkWindowType is now non-deprecated;
change gdk_window_get_type() compat to be
gdk_window_get_window_type().
* gdk/gdkdnd.h: make GdkDragContext a GObject.
* gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure
virtual GObject. Make all functions call into the vtable.
Move gdk_image_put() guts in here. Remove GdkDrawableType
and gdk_drawable_get_type(), these are now GdkWindow-specific.
draw_image, get_depth, get_size, set_colormap, get_colormap,
get_visual added to the vtable.
* gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual
GObject. Virtualize everything.
(gdk_gc_new_with_values): remove check for destroyed window,
because now GdkWindow::create_gc will check this.
(gdk_gc_set_values): New function to set GC values, this
was already implemented but wasn't in the header
* gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject.
* gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove
_gdk_window_draw_image(), remove _gdk_windowing_window_class,
remove _gdk_window_class; add _gdk_window_impl_get_type() and
_gdk_pixmap_impl_get_type(). Rename gdk_window_init to
_gdk_windowing_window_init, rename gdk_image_init to
_gdk_windowing_image_init.
* gdk/gdkpango.c: Reflect GObject-ification of PangoContext.
(gdk_draw_layout): Remove check for destroyed window,
because all the drawable methods already check it.
* gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject.
Add gdkpixmap.c which contains implementation of GdkDrawable
virtual table (by chaining to a platform-specific implementation
object).
* gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP,
GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace
GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate,
GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate,
GdkColormapPrivate.
* gdk/gdktypes.h: #include <glib-object.h>
* gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject.
Move most functionality to platform-specific implementation
object. GdkWindow itself now handles the backing store, then
chains to the platform-specific implementation.
(gdk_window_get_window_type): return GdkWindowType of the window.
(gdk_window_peek_children): New routine, returns the children of
a GdkWindow
(gdk_window_get_children): Was in X11-specific code and did
XQueryTree. Changed to simply return a copy of window->children;
so it can go in cross-platform code.
* gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path
* gdk/x11/gdkcolor-x11.c: implement X-specific parts of
GdkColormap; just changed to use the new private data instead
of casting to GdkColormapPrivate.
* gdk/x11/gdkcursor-x11.c: added a couple typechecks to
gdk_cursor_new().
* gdk/x11/gdkdnd-x11.c: Change the way we access private fields
(private data member in the GObject).
(xdnd_manager_source_filter): Function had broken
error handling, fix it (use gdk_error_trap_push).
* gdk/x11/gdkdrawable-x11.c: This file now implements
a base class for GdkWindowImplX11/GdkPixmapImplX11. This
base class is purely for the convenience of the X port,
and not part of the interface to cross-platform GDK.
* gdk/x11/gdkevents-x11.c: Reflect various renamings.
* gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's
specific to X, and returned by the create_gc virtual method
of GdkDrawableImplX11.
(gdk_x11_gc_set_dashes): Change this to take an array of gint8
rather than gchar, this was also changed in the GdkGC vtable.
(gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the
mask is 0, return immediately, instead of checking every flag.
This is faster, and keeps us from segfaulting if values is NULL
and the mask contains some nonzero flags.
* gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of
GdkWindow.
* gdk/x11/gdkglobals-x11.c: change type of grab window, since
GdkWindowPrivate is gone.
* gdk/x11/gdkim-x11.c: rename things that got renamed.
* gdk/x11/gdkimage-x11.c: implement in terms of GObject, and
remove the image_put stuff that got transferred to GdkDrawable.
* gdk/x11/gdkinput.c: renamings
* gdk/x11/gdkmain-x11.c: #include <pango/pangox.h>
* gdk/x11/gdkpixmap-x11.c: GObject conversion
* gdk/x11/gdkprivate-x11.h: indentation fixes
* gdk/x11/gdkproperty-x11.c: renamings
* gdk/x11/gdkselection-x11.c: renamings
* gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now
implements the platform-specific "impl" object.
Moved gdk_window_get_children to gdk/gdkwindow.c
* gdk/x11/gdkx.h: Remove all the private structs and private datas
that no longer exist. Add declaration of GdkGCX11 object here.
Fix all the macros to still work.
* gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow,
GdkDragContext from the boxed types since they are now GObjects.
* gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject,
moved xthickness/ythickness into the instance. GtkStyleClass
functions are now in the standard vtable for GtkStyle, so you have
to create a GObject subclass to write a theme engine.
(gtk_style_copy): fixed a leaked PangoFontDescription
(gtk_style_init): renamed gtk_style_realize, so gtk_style_init
can be the standard GObject function.
* Throughout GTK:
s/style->klass->[xy]thickness/style->[xy]thickness
s/pango_layout_unref/g_object_unref/
* gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject.
* gtk/gtksocket.c: Use gdk_window_get_user_data() instead of
accessing GDK internals.
* gtk/gtkwidget.c: Use gdk_window_peek_children() instead of
accessing GDK internals.
2000-06-20 21:04:44 +00:00
|
|
|
2 * widget->style->xthickness);
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
attributes.y = (widget->allocation.height -
|
1998-04-05 06:58:29 +00:00
|
|
|
widget->requisition.height) / 2;
|
2001-10-21 22:28:55 +00:00
|
|
|
attributes.width = arrow_size + 2 * widget->style->xthickness;
|
1998-04-05 06:58:29 +00:00
|
|
|
attributes.height = widget->requisition.height;
|
1998-02-25 22:03:10 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
spin_button->panel = gdk_window_new (widget->window,
|
1999-02-28 16:04:47 +00:00
|
|
|
&attributes, attributes_mask);
|
|
|
|
gdk_window_set_user_data (spin_button->panel, widget);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
1999-02-28 16:04:47 +00:00
|
|
|
gtk_style_set_background (widget->style, spin_button->panel, GTK_STATE_NORMAL);
|
|
|
|
|
|
|
|
return_val = FALSE;
|
2002-10-10 01:02:25 +00:00
|
|
|
g_signal_emit (spin_button, spinbutton_signals[OUTPUT], 0, &return_val);
|
1999-02-28 16:04:47 +00:00
|
|
|
if (return_val == FALSE)
|
|
|
|
gtk_spin_button_default_output (spin_button);
|
2002-02-20 23:36:28 +00:00
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (spin_button));
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_spin_button_unrealize (GtkWidget *widget)
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->unrealize (widget);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
|
|
|
if (spin->panel)
|
|
|
|
{
|
1998-03-03 00:20:49 +00:00
|
|
|
gdk_window_set_user_data (spin->panel, NULL);
|
1998-02-25 22:03:10 +00:00
|
|
|
gdk_window_destroy (spin->panel);
|
|
|
|
spin->panel = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-18 22:31:02 +00:00
|
|
|
static int
|
2001-06-04 22:32:10 +00:00
|
|
|
compute_double_length (double val, int digits)
|
2001-05-18 22:31:02 +00:00
|
|
|
{
|
2001-06-04 22:32:10 +00:00
|
|
|
int a;
|
2001-05-18 22:31:02 +00:00
|
|
|
int extra;
|
|
|
|
|
|
|
|
a = 1;
|
|
|
|
if (fabs (val) > 1.0)
|
2001-06-04 22:32:10 +00:00
|
|
|
a = floor (log10 (fabs (val))) + 1;
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
extra = 0;
|
|
|
|
|
|
|
|
/* The dot: */
|
2001-06-04 22:32:10 +00:00
|
|
|
if (digits > 0)
|
2001-05-18 22:31:02 +00:00
|
|
|
extra++;
|
|
|
|
|
|
|
|
/* The sign: */
|
|
|
|
if (val < 0)
|
|
|
|
extra++;
|
|
|
|
|
2001-06-04 22:32:10 +00:00
|
|
|
return a + digits + extra;
|
2001-05-18 22:31:02 +00:00
|
|
|
}
|
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
2008-07-21 09:41:28 +00:00
|
|
|
GtkSpinButton *spin_button = GTK_SPIN_BUTTON (widget);
|
|
|
|
GtkEntry *entry = GTK_ENTRY (widget);
|
2001-10-21 22:28:55 +00:00
|
|
|
gint arrow_size;
|
2002-01-28 18:52:49 +00:00
|
|
|
|
2001-10-21 22:28:55 +00:00
|
|
|
arrow_size = spin_button_get_arrow_size (spin_button);
|
2008-07-21 09:41:28 +00:00
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->size_request (widget, requisition);
|
2001-03-07 21:32:51 +00:00
|
|
|
|
|
|
|
if (entry->width_chars < 0)
|
2001-03-08 01:55:28 +00:00
|
|
|
{
|
2001-06-14 20:41:44 +00:00
|
|
|
PangoContext *context;
|
2001-09-18 20:06:48 +00:00
|
|
|
PangoFontMetrics *metrics;
|
2001-03-08 01:55:28 +00:00
|
|
|
gint width;
|
|
|
|
gint w;
|
2001-09-18 20:06:48 +00:00
|
|
|
gint string_len;
|
2001-10-18 20:15:53 +00:00
|
|
|
gint max_string_len;
|
2001-09-18 20:06:48 +00:00
|
|
|
gint digit_width;
|
2001-12-04 03:27:30 +00:00
|
|
|
gboolean interior_focus;
|
|
|
|
gint focus_width;
|
2004-03-11 21:10:49 +00:00
|
|
|
gint xborder, yborder;
|
2006-08-15 18:52:14 +00:00
|
|
|
GtkBorder inner_border;
|
2001-12-04 03:27:30 +00:00
|
|
|
|
|
|
|
gtk_widget_style_get (widget,
|
|
|
|
"interior-focus", &interior_focus,
|
|
|
|
"focus-line-width", &focus_width,
|
|
|
|
NULL);
|
2001-03-08 01:55:28 +00:00
|
|
|
|
2001-06-14 20:41:44 +00:00
|
|
|
context = gtk_widget_get_pango_context (widget);
|
2001-09-18 20:06:48 +00:00
|
|
|
metrics = pango_context_get_metrics (context,
|
|
|
|
widget->style->font_desc,
|
|
|
|
pango_context_get_language (context));
|
|
|
|
|
|
|
|
digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
|
2003-08-20 23:47:19 +00:00
|
|
|
digit_width = PANGO_SCALE *
|
|
|
|
((digit_width + PANGO_SCALE - 1) / PANGO_SCALE);
|
2001-09-18 20:06:48 +00:00
|
|
|
|
|
|
|
pango_font_metrics_unref (metrics);
|
2001-03-08 01:55:28 +00:00
|
|
|
|
|
|
|
/* Get max of MIN_SPIN_BUTTON_WIDTH, size of upper, size of lower */
|
|
|
|
|
|
|
|
width = MIN_SPIN_BUTTON_WIDTH;
|
2001-10-18 20:15:53 +00:00
|
|
|
max_string_len = MAX (10, compute_double_length (1e9 * spin_button->adjustment->step_increment,
|
|
|
|
spin_button->digits));
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
string_len = compute_double_length (spin_button->adjustment->upper,
|
2001-06-04 22:32:10 +00:00
|
|
|
spin_button->digits);
|
2003-08-20 23:47:19 +00:00
|
|
|
w = PANGO_PIXELS (MIN (string_len, max_string_len) * digit_width);
|
2001-03-08 01:55:28 +00:00
|
|
|
width = MAX (width, w);
|
2001-05-18 22:31:02 +00:00
|
|
|
string_len = compute_double_length (spin_button->adjustment->lower,
|
2001-09-19 00:58:09 +00:00
|
|
|
spin_button->digits);
|
2003-08-20 23:47:19 +00:00
|
|
|
w = PANGO_PIXELS (MIN (string_len, max_string_len) * digit_width);
|
2001-03-08 01:55:28 +00:00
|
|
|
width = MAX (width, w);
|
|
|
|
|
2004-10-08 04:24:45 +00:00
|
|
|
_gtk_entry_get_borders (entry, &xborder, &yborder);
|
2006-08-15 18:52:14 +00:00
|
|
|
_gtk_entry_effective_inner_border (entry, &inner_border);
|
2004-03-11 21:10:49 +00:00
|
|
|
|
2006-08-15 18:52:14 +00:00
|
|
|
requisition->width = width + xborder * 2 + inner_border.left + inner_border.right;
|
2001-03-08 01:55:28 +00:00
|
|
|
}
|
2002-02-20 23:36:28 +00:00
|
|
|
|
|
|
|
requisition->width += arrow_size + 2 * widget->style->xthickness;
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_spin_button_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation)
|
|
|
|
{
|
2008-07-21 09:41:28 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
2002-02-20 23:36:28 +00:00
|
|
|
GtkAllocation panel_allocation;
|
2001-10-21 22:28:55 +00:00
|
|
|
gint arrow_size;
|
2002-02-20 23:36:28 +00:00
|
|
|
gint panel_width;
|
|
|
|
|
2001-10-21 22:28:55 +00:00
|
|
|
arrow_size = spin_button_get_arrow_size (spin);
|
2002-02-20 23:36:28 +00:00
|
|
|
panel_width = arrow_size + 2 * widget->style->xthickness;
|
|
|
|
|
|
|
|
widget->allocation = *allocation;
|
|
|
|
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
panel_allocation.x = 0;
|
2002-02-20 23:36:28 +00:00
|
|
|
else
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
panel_allocation.x = allocation->width - panel_width;
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
2002-02-20 23:36:28 +00:00
|
|
|
panel_allocation.width = panel_width;
|
|
|
|
panel_allocation.height = MIN (widget->requisition.height, allocation->height);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
panel_allocation.y = 0;
|
2002-02-20 23:36:28 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->size_allocate (widget, allocation);
|
1998-03-03 00:20:49 +00:00
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
if (gtk_widget_get_realized (widget))
|
1998-03-03 00:20:49 +00:00
|
|
|
{
|
|
|
|
gdk_window_move_resize (GTK_SPIN_BUTTON (widget)->panel,
|
2002-02-20 23:36:28 +00:00
|
|
|
panel_allocation.x,
|
|
|
|
panel_allocation.y,
|
|
|
|
panel_allocation.width,
|
|
|
|
panel_allocation.height);
|
1998-03-03 00:20:49 +00:00
|
|
|
}
|
2002-02-20 23:36:28 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin));
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
2000-12-04 01:15:37 +00:00
|
|
|
static gint
|
|
|
|
gtk_spin_button_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
2008-07-21 09:41:28 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2010-01-07 15:47:35 +00:00
|
|
|
if (gtk_widget_is_drawable (widget))
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
if (event->window == spin->panel)
|
|
|
|
{
|
|
|
|
GtkShadowType shadow_type;
|
2002-02-20 23:36:28 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
shadow_type = spin_button_get_shadow_type (spin);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
if (shadow_type != GTK_SHADOW_NONE)
|
|
|
|
{
|
|
|
|
gint width, height;
|
2002-02-20 23:36:28 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gdk_drawable_get_size (spin->panel, &width, &height);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_paint_box (widget->style, spin->panel,
|
|
|
|
GTK_STATE_NORMAL, shadow_type,
|
|
|
|
&event->area, widget, "spinbutton",
|
|
|
|
0, 0, width, height);
|
|
|
|
}
|
2002-02-20 23:36:28 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_spin_button_draw_arrow (spin, &event->area, GTK_ARROW_UP);
|
|
|
|
gtk_spin_button_draw_arrow (spin, &event->area, GTK_ARROW_DOWN);
|
2002-02-20 23:36:28 +00:00
|
|
|
}
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
else
|
|
|
|
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->expose_event (widget, event);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
2002-02-20 23:36:28 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
spin_button_at_limit (GtkSpinButton *spin_button,
|
|
|
|
GtkArrowType arrow)
|
|
|
|
{
|
2004-04-22 13:49:27 +00:00
|
|
|
GtkArrowType effective_arrow;
|
|
|
|
|
2002-02-20 23:36:28 +00:00
|
|
|
if (spin_button->wrap)
|
|
|
|
return FALSE;
|
|
|
|
|
2004-04-22 13:49:27 +00:00
|
|
|
if (spin_button->adjustment->step_increment > 0)
|
|
|
|
effective_arrow = arrow;
|
|
|
|
else
|
|
|
|
effective_arrow = arrow == GTK_ARROW_UP ? GTK_ARROW_DOWN : GTK_ARROW_UP;
|
|
|
|
|
|
|
|
if (effective_arrow == GTK_ARROW_UP &&
|
2002-02-20 23:36:28 +00:00
|
|
|
(spin_button->adjustment->upper - spin_button->adjustment->value <= EPSILON))
|
|
|
|
return TRUE;
|
2002-02-26 23:50:14 +00:00
|
|
|
|
2004-04-22 13:49:27 +00:00
|
|
|
if (effective_arrow == GTK_ARROW_DOWN &&
|
2002-02-20 23:36:28 +00:00
|
|
|
(spin_button->adjustment->value - spin_button->adjustment->lower <= EPSILON))
|
|
|
|
return TRUE;
|
2002-02-26 23:50:14 +00:00
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
GdkRectangle *area,
|
2002-02-26 23:50:14 +00:00
|
|
|
GtkArrowType arrow_type)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
|
|
|
GtkStateType state_type;
|
|
|
|
GtkShadowType shadow_type;
|
|
|
|
GtkWidget *widget;
|
1998-06-17 20:07:31 +00:00
|
|
|
gint x;
|
|
|
|
gint y;
|
2002-02-20 23:36:28 +00:00
|
|
|
gint height;
|
|
|
|
gint width;
|
2002-02-26 23:50:14 +00:00
|
|
|
gint h, w;
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
g_return_if_fail (arrow_type == GTK_ARROW_UP || arrow_type == GTK_ARROW_DOWN);
|
2008-07-21 09:41:28 +00:00
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
widget = GTK_WIDGET (spin_button);
|
|
|
|
|
2010-01-07 15:47:35 +00:00
|
|
|
if (gtk_widget_is_drawable (widget))
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
2002-02-20 23:36:28 +00:00
|
|
|
width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness;
|
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
if (arrow_type == GTK_ARROW_UP)
|
1998-12-06 14:18:46 +00:00
|
|
|
{
|
2002-02-20 23:36:28 +00:00
|
|
|
x = 0;
|
|
|
|
y = 0;
|
|
|
|
|
|
|
|
height = widget->requisition.height / 2;
|
1998-12-06 14:18:46 +00:00
|
|
|
}
|
1998-02-25 22:03:10 +00:00
|
|
|
else
|
1998-12-06 14:18:46 +00:00
|
|
|
{
|
2002-02-20 23:36:28 +00:00
|
|
|
x = 0;
|
|
|
|
y = widget->requisition.height / 2;
|
|
|
|
|
|
|
|
height = (widget->requisition.height + 1) / 2;
|
1998-12-06 14:18:46 +00:00
|
|
|
}
|
2002-02-20 23:36:28 +00:00
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
if (spin_button_at_limit (spin_button, arrow_type))
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
2002-02-20 23:36:28 +00:00
|
|
|
shadow_type = GTK_SHADOW_OUT;
|
|
|
|
state_type = GTK_STATE_INSENSITIVE;
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-02-26 23:50:14 +00:00
|
|
|
if (spin_button->click_child == arrow_type)
|
1998-06-17 20:07:31 +00:00
|
|
|
{
|
2002-02-20 23:36:28 +00:00
|
|
|
state_type = GTK_STATE_ACTIVE;
|
|
|
|
shadow_type = GTK_SHADOW_IN;
|
1998-06-17 20:07:31 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-02-26 23:50:14 +00:00
|
|
|
if (spin_button->in_child == arrow_type &&
|
2002-02-20 23:36:28 +00:00
|
|
|
spin_button->click_child == NO_ARROW)
|
|
|
|
{
|
|
|
|
state_type = GTK_STATE_PRELIGHT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
state_type = GTK_WIDGET_STATE (widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
shadow_type = GTK_SHADOW_OUT;
|
1998-06-17 20:07:31 +00:00
|
|
|
}
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
2002-02-20 23:36:28 +00:00
|
|
|
|
|
|
|
gtk_paint_box (widget->style, spin_button->panel,
|
|
|
|
state_type, shadow_type,
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
area, widget,
|
2002-02-26 23:50:14 +00:00
|
|
|
(arrow_type == GTK_ARROW_UP)? "spinbutton_up" : "spinbutton_down",
|
2002-02-20 23:36:28 +00:00
|
|
|
x, y, width, height);
|
|
|
|
|
2002-02-26 23:50:14 +00:00
|
|
|
height = widget->requisition.height;
|
|
|
|
|
|
|
|
if (arrow_type == GTK_ARROW_DOWN)
|
|
|
|
{
|
|
|
|
y = height / 2;
|
|
|
|
height = height - y - 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
y = 2;
|
|
|
|
height = height / 2 - 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
width -= 3;
|
|
|
|
|
|
|
|
if (widget && gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
|
|
|
x = 2;
|
|
|
|
else
|
|
|
|
x = 1;
|
|
|
|
|
|
|
|
w = width / 2;
|
|
|
|
w -= w % 2 - 1; /* force odd */
|
|
|
|
h = (w + 1) / 2;
|
|
|
|
|
|
|
|
x += (width - w) / 2;
|
|
|
|
y += (height - h) / 2;
|
|
|
|
|
|
|
|
height = h;
|
|
|
|
width = w;
|
|
|
|
|
2002-02-20 23:36:28 +00:00
|
|
|
gtk_paint_arrow (widget->style, spin_button->panel,
|
|
|
|
state_type, shadow_type,
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
area, widget, "spinbutton",
|
2002-02-26 23:50:14 +00:00
|
|
|
arrow_type, TRUE,
|
|
|
|
x, y, width, height);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_spin_button_enter_notify (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event)
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
|
|
|
if (event->window == spin->panel)
|
|
|
|
{
|
|
|
|
gint x;
|
|
|
|
gint y;
|
|
|
|
|
|
|
|
gdk_window_get_pointer (spin->panel, &x, &y, NULL);
|
|
|
|
|
|
|
|
if (y <= widget->requisition.height / 2)
|
2002-02-20 23:36:28 +00:00
|
|
|
spin->in_child = GTK_ARROW_UP;
|
1998-02-25 22:03:10 +00:00
|
|
|
else
|
2002-02-20 23:36:28 +00:00
|
|
|
spin->in_child = GTK_ARROW_DOWN;
|
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin));
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
2008-11-11 18:10:20 +00:00
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->enter_notify_event)
|
|
|
|
return GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->enter_notify_event (widget, event);
|
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_spin_button_leave_notify (GtkWidget *widget,
|
|
|
|
GdkEventCrossing *event)
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2002-02-20 23:36:28 +00:00
|
|
|
spin->in_child = NO_ARROW;
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin));
|
2008-11-11 18:10:20 +00:00
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->leave_notify_event)
|
|
|
|
return GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->leave_notify_event (widget, event);
|
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_spin_button_focus_out (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event)
|
|
|
|
{
|
Make parent_class static.
Sun Nov 5 04:24:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertextpixbuf.c: Make parent_class
static.
Tue Sep 19 10:54:22 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext*.[ch] gtk/gtkimmulticontext.[ch]
gtk/gtktextlayout.[ch] gtk/gtktextview.c gtk/gtkentry.c:
Add support for positioning the cursor within the preedit string.
Mon Sep 18 23:56:32 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Check for bindings after passing
events to im context filter.
Mon Sep 18 11:50:51 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (add_preedit_attrs): Handle
empty attribute lists properly.
Sun Sep 17 10:08:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c (main): Return non-zero exit
status if errors were encountered querying any
modules.
Sat Sep 16 14:01:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h: include gtkmodule.h gtkoldeditable.h,
don't include gtkthemes.h.
* gtk/testgtk.c gtk/testtext.c: Set environment variables
to point
* gtk/Makefile.am: Add new .c and .h files, build
gtk-query-immodules and use it to create a gtk.immodules
file for use of test programs.
* gtk/gtkpreview.c: remove extra blank line.
Sat Sep 16 13:21:04 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.c (gtk_im_context_simple_add_table):
Add the ability to add extra tables beyond the default
one, and also the ability to have compose sequences
that are prefixes of other compose sequences.
* gtk/gtkimcontextsimple.c: Export a preedit string which
consists of possible candidates for keystrokes that have
been entered but not yet committed.
* gtk/gtkimcontext.[ch] gtk/immulticontext.[ch]
gtk/gtkimcontextsimple.[ch]: add gtk_im_context_reset()
* gtk/gtkmulticontext.[ch] (gtk_im_multicontext_append_menuitems):
Add a function to add input-method switching menu items
to a menu.
* gtk/gtkimmulticontext.[ch]: Properly handly set_client_window
when switching input methods.
* gtk/gtkimcontextsimple.[ch]: Change the format of
the compose table to allow compose tables of different
lengths / sequence.
Sat Sep 16 13:05:48 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmodule.[ch]: Support routines for loading
GtkIMContext implementations dynamically at runtime.
* gtk/queryimmodules.c: Program to query the available
input modules and write the results into a file.
* gtk/gtkrc.[ch] (gtk_rc_get_im_module_file): Add
extra config options "im_module_file" (cache file for
input method modules), and "im_module_path" - path
to look for modules when generating cache file.
This doesn't scale.
Sat Sep 16 13:09:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.[ch] gtk/gtkmodule.[ch]: Move most of the
generic code from gtkthemes into a new abstraction
GtkModule which has the logic for implementing
a loadable module which implements a number of
GObject types.
Sat Sep 16 13:07:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.[ch]: Convert GtkEditable from
a class into an interface
* gtk/gtkoldeditable.[ch]: Move the old editable
implementation into here, so legacy widgets can
still rely on the implemenation. GtkOldEditable
exports GtkEditable. Make selection handling
code use new text conversion functions (and
handle UTF-8 as a side-effect). Use GtkClipboard
for CLIPBOARD.
* gtk/gtktext.[ch] gtk/gtkcombo.c gtk/gtkspinbutton.c:
Adopt to match above changes.
* gtk/gtkentry.[ch]: Implement GtkEditable directly,
avoid GtkOldEditable implementation. Restructure
to reduce number of places that modify state directly.
Move to GtkBindingSet. Display the preedit string.
Queue recomputation of PangoLayout and scroll position
to improve effiency of doing complex changes naively.
Add a menu with cut/copy/paste and input method selection.
Thu Sep 14 22:11:05 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add gtk_text_layout_set_preedit_string()
to set preedit string and attributes; display preedit string by
inserting string and attributes at cursor when creating the
GtkTextLineDisplay.
* gtk/gtktextlayout.c: Move all conversions between byte
positions in PangoLayout and GtkTextIter into new functions
line_display_iter_to_index/index_to_iter that properly
handle the preedit string.
* gtk/gtktextmark.[ch]: Restore gtk_text_mark_get_name, modify
it to return const char * (eventually will end up
as GCONST char *, most likely.)
* gtk/gtktextview.[ch]: Handle the preedit string, call
gtk_im_context_reset() as necessary, add a menu to switch
input methods.
* gtk/gtktextlayout.[ch]: Remove useless
gtk_text_layout_get_log_attrs() function.
2000-11-12 03:43:24 +00:00
|
|
|
if (GTK_ENTRY (widget)->editable)
|
1998-12-14 19:13:58 +00:00
|
|
|
gtk_spin_button_update (GTK_SPIN_BUTTON (widget));
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
return GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->focus_out_event (widget, event);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
2002-01-16 01:07:11 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_grab_notify (GtkWidget *widget,
|
|
|
|
gboolean was_grabbed)
|
|
|
|
{
|
2003-03-29 00:11:32 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
|
|
|
|
2002-01-16 01:07:11 +00:00
|
|
|
if (!was_grabbed)
|
2003-03-29 00:11:32 +00:00
|
|
|
{
|
|
|
|
gtk_spin_button_stop_spinning (spin);
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin));
|
2003-03-29 00:11:32 +00:00
|
|
|
}
|
2002-01-16 01:07:11 +00:00
|
|
|
}
|
|
|
|
|
2002-01-23 20:15:48 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_state_changed (GtkWidget *widget,
|
|
|
|
GtkStateType previous_state)
|
|
|
|
{
|
2003-03-29 00:11:32 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
|
|
|
|
2010-02-27 04:24:24 +00:00
|
|
|
if (!gtk_widget_is_sensitive (widget))
|
2003-03-29 00:11:32 +00:00
|
|
|
{
|
|
|
|
gtk_spin_button_stop_spinning (spin);
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin));
|
2003-03-29 00:11:32 +00:00
|
|
|
}
|
2002-01-23 20:15:48 +00:00
|
|
|
}
|
|
|
|
|
2007-03-12 05:51:11 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *previous_style)
|
|
|
|
{
|
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
if (previous_style && gtk_widget_get_realized (widget))
|
2007-03-12 05:51:11 +00:00
|
|
|
gtk_style_set_background (widget->style, spin->panel, GTK_STATE_NORMAL);
|
|
|
|
|
2008-08-12 09:06:34 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->style_set (widget, previous_style);
|
2007-03-12 05:51:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-02-18 20:02:24 +00:00
|
|
|
static gint
|
|
|
|
gtk_spin_button_scroll (GtkWidget *widget,
|
|
|
|
GdkEventScroll *event)
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
2000-02-18 20:02:24 +00:00
|
|
|
|
|
|
|
if (event->direction == GDK_SCROLL_UP)
|
|
|
|
{
|
2010-03-01 03:21:41 +00:00
|
|
|
if (!gtk_widget_has_focus (widget))
|
2000-02-18 20:02:24 +00:00
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
gtk_spin_button_real_spin (spin, spin->adjustment->step_increment);
|
|
|
|
}
|
|
|
|
else if (event->direction == GDK_SCROLL_DOWN)
|
|
|
|
{
|
2010-03-01 03:21:41 +00:00
|
|
|
if (!gtk_widget_has_focus (widget))
|
2000-02-18 20:02:24 +00:00
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
gtk_spin_button_real_spin (spin, -spin->adjustment->step_increment);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-01-16 01:07:11 +00:00
|
|
|
static void
|
2002-01-30 22:29:03 +00:00
|
|
|
gtk_spin_button_stop_spinning (GtkSpinButton *spin)
|
2002-01-16 01:07:11 +00:00
|
|
|
{
|
|
|
|
if (spin->timer)
|
|
|
|
{
|
2003-02-05 23:48:11 +00:00
|
|
|
g_source_remove (spin->timer);
|
2002-01-16 01:07:11 +00:00
|
|
|
spin->timer = 0;
|
|
|
|
spin->timer_calls = 0;
|
|
|
|
spin->need_timer = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
spin->button = 0;
|
|
|
|
spin->timer = 0;
|
2002-02-08 00:02:52 +00:00
|
|
|
spin->timer_step = spin->adjustment->step_increment;
|
|
|
|
spin->timer_calls = 0;
|
2003-03-29 00:11:32 +00:00
|
|
|
|
|
|
|
spin->click_child = NO_ARROW;
|
|
|
|
spin->button = 0;
|
2002-01-16 01:07:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
start_spinning (GtkSpinButton *spin,
|
|
|
|
GtkArrowType click_child,
|
2003-08-20 20:20:00 +00:00
|
|
|
gdouble step)
|
2002-01-16 01:07:11 +00:00
|
|
|
{
|
2002-01-25 13:22:00 +00:00
|
|
|
g_return_if_fail (click_child == GTK_ARROW_UP || click_child == GTK_ARROW_DOWN);
|
|
|
|
|
2002-01-16 01:07:11 +00:00
|
|
|
spin->click_child = click_child;
|
|
|
|
|
|
|
|
if (!spin->timer)
|
|
|
|
{
|
2005-11-22 12:40:15 +00:00
|
|
|
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (spin));
|
|
|
|
guint timeout;
|
|
|
|
|
|
|
|
g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
|
|
|
|
|
2002-01-16 01:07:11 +00:00
|
|
|
spin->timer_step = step;
|
|
|
|
spin->need_timer = TRUE;
|
2006-12-22 19:10:43 +00:00
|
|
|
spin->timer = gdk_threads_add_timeout (timeout,
|
2005-11-22 12:40:15 +00:00
|
|
|
(GSourceFunc) gtk_spin_button_timer,
|
2003-02-05 23:48:11 +00:00
|
|
|
(gpointer) spin);
|
2002-01-16 01:07:11 +00:00
|
|
|
}
|
2004-07-16 00:38:06 +00:00
|
|
|
gtk_spin_button_real_spin (spin, click_child == GTK_ARROW_UP ? step : -step);
|
2002-01-16 01:07:11 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin));
|
2002-01-16 01:07:11 +00:00
|
|
|
}
|
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
static gint
|
|
|
|
gtk_spin_button_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
|
|
|
if (!spin->button)
|
|
|
|
{
|
2000-02-18 20:02:24 +00:00
|
|
|
if (event->window == spin->panel)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
2010-03-01 03:21:41 +00:00
|
|
|
if (!gtk_widget_has_focus (widget))
|
1998-02-25 22:03:10 +00:00
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
spin->button = event->button;
|
1998-03-11 06:11:52 +00:00
|
|
|
|
Make parent_class static.
Sun Nov 5 04:24:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertextpixbuf.c: Make parent_class
static.
Tue Sep 19 10:54:22 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext*.[ch] gtk/gtkimmulticontext.[ch]
gtk/gtktextlayout.[ch] gtk/gtktextview.c gtk/gtkentry.c:
Add support for positioning the cursor within the preedit string.
Mon Sep 18 23:56:32 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Check for bindings after passing
events to im context filter.
Mon Sep 18 11:50:51 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (add_preedit_attrs): Handle
empty attribute lists properly.
Sun Sep 17 10:08:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c (main): Return non-zero exit
status if errors were encountered querying any
modules.
Sat Sep 16 14:01:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h: include gtkmodule.h gtkoldeditable.h,
don't include gtkthemes.h.
* gtk/testgtk.c gtk/testtext.c: Set environment variables
to point
* gtk/Makefile.am: Add new .c and .h files, build
gtk-query-immodules and use it to create a gtk.immodules
file for use of test programs.
* gtk/gtkpreview.c: remove extra blank line.
Sat Sep 16 13:21:04 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.c (gtk_im_context_simple_add_table):
Add the ability to add extra tables beyond the default
one, and also the ability to have compose sequences
that are prefixes of other compose sequences.
* gtk/gtkimcontextsimple.c: Export a preedit string which
consists of possible candidates for keystrokes that have
been entered but not yet committed.
* gtk/gtkimcontext.[ch] gtk/immulticontext.[ch]
gtk/gtkimcontextsimple.[ch]: add gtk_im_context_reset()
* gtk/gtkmulticontext.[ch] (gtk_im_multicontext_append_menuitems):
Add a function to add input-method switching menu items
to a menu.
* gtk/gtkimmulticontext.[ch]: Properly handly set_client_window
when switching input methods.
* gtk/gtkimcontextsimple.[ch]: Change the format of
the compose table to allow compose tables of different
lengths / sequence.
Sat Sep 16 13:05:48 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmodule.[ch]: Support routines for loading
GtkIMContext implementations dynamically at runtime.
* gtk/queryimmodules.c: Program to query the available
input modules and write the results into a file.
* gtk/gtkrc.[ch] (gtk_rc_get_im_module_file): Add
extra config options "im_module_file" (cache file for
input method modules), and "im_module_path" - path
to look for modules when generating cache file.
This doesn't scale.
Sat Sep 16 13:09:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.[ch] gtk/gtkmodule.[ch]: Move most of the
generic code from gtkthemes into a new abstraction
GtkModule which has the logic for implementing
a loadable module which implements a number of
GObject types.
Sat Sep 16 13:07:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.[ch]: Convert GtkEditable from
a class into an interface
* gtk/gtkoldeditable.[ch]: Move the old editable
implementation into here, so legacy widgets can
still rely on the implemenation. GtkOldEditable
exports GtkEditable. Make selection handling
code use new text conversion functions (and
handle UTF-8 as a side-effect). Use GtkClipboard
for CLIPBOARD.
* gtk/gtktext.[ch] gtk/gtkcombo.c gtk/gtkspinbutton.c:
Adopt to match above changes.
* gtk/gtkentry.[ch]: Implement GtkEditable directly,
avoid GtkOldEditable implementation. Restructure
to reduce number of places that modify state directly.
Move to GtkBindingSet. Display the preedit string.
Queue recomputation of PangoLayout and scroll position
to improve effiency of doing complex changes naively.
Add a menu with cut/copy/paste and input method selection.
Thu Sep 14 22:11:05 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add gtk_text_layout_set_preedit_string()
to set preedit string and attributes; display preedit string by
inserting string and attributes at cursor when creating the
GtkTextLineDisplay.
* gtk/gtktextlayout.c: Move all conversions between byte
positions in PangoLayout and GtkTextIter into new functions
line_display_iter_to_index/index_to_iter that properly
handle the preedit string.
* gtk/gtktextmark.[ch]: Restore gtk_text_mark_get_name, modify
it to return const char * (eventually will end up
as GCONST char *, most likely.)
* gtk/gtktextview.[ch]: Handle the preedit string, call
gtk_im_context_reset() as necessary, add a menu to switch
input methods.
* gtk/gtktextlayout.[ch]: Remove useless
gtk_text_layout_get_log_attrs() function.
2000-11-12 03:43:24 +00:00
|
|
|
if (GTK_ENTRY (widget)->editable)
|
1998-12-14 19:13:58 +00:00
|
|
|
gtk_spin_button_update (spin);
|
1998-03-11 06:11:52 +00:00
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
if (event->y <= widget->requisition.height / 2)
|
|
|
|
{
|
|
|
|
if (event->button == 1)
|
2002-01-16 01:07:11 +00:00
|
|
|
start_spinning (spin, GTK_ARROW_UP, spin->adjustment->step_increment);
|
1998-02-25 22:03:10 +00:00
|
|
|
else if (event->button == 2)
|
2002-01-16 01:07:11 +00:00
|
|
|
start_spinning (spin, GTK_ARROW_UP, spin->adjustment->page_increment);
|
2002-01-25 13:22:00 +00:00
|
|
|
else
|
|
|
|
spin->click_child = GTK_ARROW_UP;
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (event->button == 1)
|
2002-01-16 01:07:11 +00:00
|
|
|
start_spinning (spin, GTK_ARROW_DOWN, spin->adjustment->step_increment);
|
1998-02-25 22:03:10 +00:00
|
|
|
else if (event->button == 2)
|
2002-01-16 01:07:11 +00:00
|
|
|
start_spinning (spin, GTK_ARROW_DOWN, spin->adjustment->page_increment);
|
2002-01-25 13:22:00 +00:00
|
|
|
else
|
|
|
|
spin->click_child = GTK_ARROW_DOWN;
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
2001-03-24 06:10:40 +00:00
|
|
|
return TRUE;
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
1998-03-11 06:11:52 +00:00
|
|
|
else
|
2006-05-02 23:56:43 +00:00
|
|
|
return GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->button_press_event (widget, event);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_spin_button_button_release (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
2002-02-20 23:36:28 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
2001-10-21 22:28:55 +00:00
|
|
|
gint arrow_size;
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2001-10-21 22:28:55 +00:00
|
|
|
arrow_size = spin_button_get_arrow_size (spin);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
|
|
|
if (event->button == spin->button)
|
|
|
|
{
|
2003-03-29 00:11:32 +00:00
|
|
|
int click_child = spin->click_child;
|
1998-02-25 22:03:10 +00:00
|
|
|
|
2002-01-16 01:07:11 +00:00
|
|
|
gtk_spin_button_stop_spinning (spin);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
|
|
|
if (event->button == 3)
|
|
|
|
{
|
|
|
|
if (event->y >= 0 && event->x >= 0 &&
|
|
|
|
event->y <= widget->requisition.height &&
|
2001-10-21 22:28:55 +00:00
|
|
|
event->x <= arrow_size + 2 * widget->style->xthickness)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
2003-03-29 00:11:32 +00:00
|
|
|
if (click_child == GTK_ARROW_UP &&
|
1998-02-25 22:03:10 +00:00
|
|
|
event->y <= widget->requisition.height / 2)
|
1998-06-24 07:59:05 +00:00
|
|
|
{
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble diff;
|
1998-06-24 07:59:05 +00:00
|
|
|
|
|
|
|
diff = spin->adjustment->upper - spin->adjustment->value;
|
|
|
|
if (diff > EPSILON)
|
|
|
|
gtk_spin_button_real_spin (spin, diff);
|
|
|
|
}
|
2003-03-29 00:11:32 +00:00
|
|
|
else if (click_child == GTK_ARROW_DOWN &&
|
1998-02-25 22:03:10 +00:00
|
|
|
event->y > widget->requisition.height / 2)
|
1998-06-24 07:59:05 +00:00
|
|
|
{
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble diff;
|
1998-06-24 07:59:05 +00:00
|
|
|
|
|
|
|
diff = spin->adjustment->value - spin->adjustment->lower;
|
|
|
|
if (diff > EPSILON)
|
|
|
|
gtk_spin_button_real_spin (spin, -diff);
|
|
|
|
}
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
}
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin));
|
2002-01-25 13:22:00 +00:00
|
|
|
|
2001-03-24 06:10:40 +00:00
|
|
|
return TRUE;
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
else
|
2006-05-02 23:56:43 +00:00
|
|
|
return GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->button_release_event (widget, event);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_spin_button_motion_notify (GtkWidget *widget,
|
|
|
|
GdkEventMotion *event)
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
1998-02-25 22:03:10 +00:00
|
|
|
|
|
|
|
if (spin->button)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (event->window == spin->panel)
|
|
|
|
{
|
2007-02-06 14:53:35 +00:00
|
|
|
gint y = event->y;
|
|
|
|
|
|
|
|
gdk_event_request_motions (event);
|
2002-02-20 23:36:28 +00:00
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
if (y <= widget->requisition.height / 2 &&
|
|
|
|
spin->in_child == GTK_ARROW_DOWN)
|
|
|
|
{
|
|
|
|
spin->in_child = GTK_ARROW_UP;
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin));
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
else if (y > widget->requisition.height / 2 &&
|
|
|
|
spin->in_child == GTK_ARROW_UP)
|
|
|
|
{
|
|
|
|
spin->in_child = GTK_ARROW_DOWN;
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin));
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
2002-02-20 23:36:28 +00:00
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
return GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->motion_notify_event (widget, event);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_spin_button_timer (GtkSpinButton *spin_button)
|
|
|
|
{
|
1998-12-15 07:32:11 +00:00
|
|
|
gboolean retval = FALSE;
|
|
|
|
|
1998-02-25 22:03:10 +00:00
|
|
|
if (spin_button->timer)
|
|
|
|
{
|
1998-06-24 07:59:05 +00:00
|
|
|
if (spin_button->click_child == GTK_ARROW_UP)
|
|
|
|
gtk_spin_button_real_spin (spin_button, spin_button->timer_step);
|
|
|
|
else
|
|
|
|
gtk_spin_button_real_spin (spin_button, -spin_button->timer_step);
|
1998-06-19 17:33:51 +00:00
|
|
|
|
|
|
|
if (spin_button->need_timer)
|
|
|
|
{
|
2005-11-22 12:40:15 +00:00
|
|
|
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (spin_button));
|
|
|
|
guint timeout;
|
|
|
|
|
|
|
|
g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
|
|
|
|
|
1998-06-19 17:33:51 +00:00
|
|
|
spin_button->need_timer = FALSE;
|
2006-12-22 19:10:43 +00:00
|
|
|
spin_button->timer = gdk_threads_add_timeout (timeout,
|
2003-12-17 22:23:32 +00:00
|
|
|
(GSourceFunc) gtk_spin_button_timer,
|
2003-02-05 23:48:11 +00:00
|
|
|
(gpointer) spin_button);
|
1998-06-19 17:33:51 +00:00
|
|
|
}
|
1998-12-15 07:32:11 +00:00
|
|
|
else
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
1998-12-15 07:32:11 +00:00
|
|
|
if (spin_button->climb_rate > 0.0 && spin_button->timer_step
|
|
|
|
< spin_button->adjustment->page_increment)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
1998-12-15 07:32:11 +00:00
|
|
|
if (spin_button->timer_calls < MAX_TIMER_CALLS)
|
|
|
|
spin_button->timer_calls++;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
spin_button->timer_calls = 0;
|
|
|
|
spin_button->timer_step += spin_button->climb_rate;
|
|
|
|
}
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
1998-12-15 07:32:11 +00:00
|
|
|
retval = TRUE;
|
1998-06-19 17:33:51 +00:00
|
|
|
}
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
1998-12-15 07:32:11 +00:00
|
|
|
|
|
|
|
return retval;
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-06-19 17:33:51 +00:00
|
|
|
gtk_spin_button_value_changed (GtkAdjustment *adjustment,
|
1998-02-25 22:03:10 +00:00
|
|
|
GtkSpinButton *spin_button)
|
|
|
|
{
|
2002-10-10 01:02:25 +00:00
|
|
|
gboolean return_val;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
1998-02-25 22:03:10 +00:00
|
|
|
|
1999-02-28 16:04:47 +00:00
|
|
|
return_val = FALSE;
|
2002-10-10 01:02:25 +00:00
|
|
|
g_signal_emit (spin_button, spinbutton_signals[OUTPUT], 0, &return_val);
|
1999-02-28 16:04:47 +00:00
|
|
|
if (return_val == FALSE)
|
|
|
|
gtk_spin_button_default_output (spin_button);
|
2000-11-27 17:47:52 +00:00
|
|
|
|
2002-10-10 01:02:25 +00:00
|
|
|
g_signal_emit (spin_button, spinbutton_signals[VALUE_CHANGED], 0);
|
2001-03-30 03:35:47 +00:00
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin_button));
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (spin_button), "value");
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
1998-03-11 06:11:52 +00:00
|
|
|
|
2002-02-08 00:02:52 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_real_change_value (GtkSpinButton *spin,
|
|
|
|
GtkScrollType scroll)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
2008-05-27 22:50:49 +00:00
|
|
|
gdouble old_value;
|
|
|
|
|
|
|
|
/* When the key binding is activated, there may be an outstanding
|
|
|
|
* value, so we first have to commit what is currently written in
|
|
|
|
* the spin buttons text entry. See #106574
|
|
|
|
*/
|
|
|
|
gtk_spin_button_update (spin);
|
|
|
|
|
|
|
|
old_value = spin->adjustment->value;
|
2006-11-16 12:56:30 +00:00
|
|
|
|
2002-09-24 10:39:23 +00:00
|
|
|
/* We don't test whether the entry is editable, since
|
|
|
|
* this key binding conceptually corresponds to changing
|
|
|
|
* the value with the buttons using the mouse, which
|
|
|
|
* we allow for non-editable spin buttons.
|
|
|
|
*/
|
|
|
|
switch (scroll)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
2002-09-24 10:39:23 +00:00
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
|
|
|
case GTK_SCROLL_STEP_DOWN:
|
|
|
|
case GTK_SCROLL_STEP_LEFT:
|
|
|
|
gtk_spin_button_real_spin (spin, -spin->timer_step);
|
|
|
|
|
|
|
|
if (spin->climb_rate > 0.0 && spin->timer_step
|
|
|
|
< spin->adjustment->page_increment)
|
|
|
|
{
|
|
|
|
if (spin->timer_calls < MAX_TIMER_CALLS)
|
|
|
|
spin->timer_calls++;
|
|
|
|
else
|
2002-02-08 00:02:52 +00:00
|
|
|
{
|
2002-09-24 10:39:23 +00:00
|
|
|
spin->timer_calls = 0;
|
|
|
|
spin->timer_step += spin->climb_rate;
|
2002-02-08 00:02:52 +00:00
|
|
|
}
|
2002-09-24 10:39:23 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
|
|
|
case GTK_SCROLL_STEP_UP:
|
|
|
|
case GTK_SCROLL_STEP_RIGHT:
|
|
|
|
gtk_spin_button_real_spin (spin, spin->timer_step);
|
|
|
|
|
|
|
|
if (spin->climb_rate > 0.0 && spin->timer_step
|
|
|
|
< spin->adjustment->page_increment)
|
|
|
|
{
|
|
|
|
if (spin->timer_calls < MAX_TIMER_CALLS)
|
|
|
|
spin->timer_calls++;
|
|
|
|
else
|
2002-02-08 00:02:52 +00:00
|
|
|
{
|
2002-09-24 10:39:23 +00:00
|
|
|
spin->timer_calls = 0;
|
|
|
|
spin->timer_step += spin->climb_rate;
|
2002-02-08 00:02:52 +00:00
|
|
|
}
|
2002-09-24 10:39:23 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_BACKWARD:
|
|
|
|
case GTK_SCROLL_PAGE_DOWN:
|
|
|
|
case GTK_SCROLL_PAGE_LEFT:
|
|
|
|
gtk_spin_button_real_spin (spin, -spin->adjustment->page_increment);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SCROLL_PAGE_FORWARD:
|
|
|
|
case GTK_SCROLL_PAGE_UP:
|
|
|
|
case GTK_SCROLL_PAGE_RIGHT:
|
|
|
|
gtk_spin_button_real_spin (spin, spin->adjustment->page_increment);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SCROLL_START:
|
|
|
|
{
|
|
|
|
gdouble diff = spin->adjustment->value - spin->adjustment->lower;
|
|
|
|
if (diff > EPSILON)
|
|
|
|
gtk_spin_button_real_spin (spin, -diff);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case GTK_SCROLL_END:
|
|
|
|
{
|
|
|
|
gdouble diff = spin->adjustment->upper - spin->adjustment->value;
|
|
|
|
if (diff > EPSILON)
|
|
|
|
gtk_spin_button_real_spin (spin, diff);
|
|
|
|
break;
|
|
|
|
}
|
2002-02-08 00:02:52 +00:00
|
|
|
|
2002-09-24 10:39:23 +00:00
|
|
|
default:
|
|
|
|
g_warning ("Invalid scroll type %d for GtkSpinButton::change-value", scroll);
|
|
|
|
break;
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
2002-09-24 10:39:23 +00:00
|
|
|
|
|
|
|
gtk_spin_button_update (spin);
|
2006-11-16 12:56:30 +00:00
|
|
|
|
|
|
|
if (spin->adjustment->value == old_value)
|
|
|
|
gtk_widget_error_bell (GTK_WIDGET (spin));
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
1998-06-17 20:07:31 +00:00
|
|
|
static gint
|
|
|
|
gtk_spin_button_key_release (GtkWidget *widget,
|
|
|
|
GdkEventKey *event)
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
|
2002-02-08 00:02:52 +00:00
|
|
|
|
|
|
|
/* We only get a release at the end of a key repeat run, so reset the timer_step */
|
|
|
|
spin->timer_step = spin->adjustment->step_increment;
|
|
|
|
spin->timer_calls = 0;
|
1998-06-17 20:07:31 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1998-03-11 06:11:52 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_snap (GtkSpinButton *spin_button,
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble val)
|
1998-03-11 06:11:52 +00:00
|
|
|
{
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble inc;
|
|
|
|
gdouble tmp;
|
2002-02-26 23:50:14 +00:00
|
|
|
|
1998-03-11 06:11:52 +00:00
|
|
|
inc = spin_button->adjustment->step_increment;
|
2002-06-12 19:42:48 +00:00
|
|
|
if (inc == 0)
|
|
|
|
return;
|
|
|
|
|
1998-03-11 06:11:52 +00:00
|
|
|
tmp = (val - spin_button->adjustment->lower) / inc;
|
|
|
|
if (tmp - floor (tmp) < ceil (tmp) - tmp)
|
|
|
|
val = spin_button->adjustment->lower + floor (tmp) * inc;
|
|
|
|
else
|
|
|
|
val = spin_button->adjustment->lower + ceil (tmp) * inc;
|
1998-06-19 17:33:51 +00:00
|
|
|
|
2008-05-20 17:29:34 +00:00
|
|
|
gtk_spin_button_set_value (spin_button, val);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Make parent_class static.
Sun Nov 5 04:24:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertextpixbuf.c: Make parent_class
static.
Tue Sep 19 10:54:22 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext*.[ch] gtk/gtkimmulticontext.[ch]
gtk/gtktextlayout.[ch] gtk/gtktextview.c gtk/gtkentry.c:
Add support for positioning the cursor within the preedit string.
Mon Sep 18 23:56:32 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Check for bindings after passing
events to im context filter.
Mon Sep 18 11:50:51 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (add_preedit_attrs): Handle
empty attribute lists properly.
Sun Sep 17 10:08:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c (main): Return non-zero exit
status if errors were encountered querying any
modules.
Sat Sep 16 14:01:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h: include gtkmodule.h gtkoldeditable.h,
don't include gtkthemes.h.
* gtk/testgtk.c gtk/testtext.c: Set environment variables
to point
* gtk/Makefile.am: Add new .c and .h files, build
gtk-query-immodules and use it to create a gtk.immodules
file for use of test programs.
* gtk/gtkpreview.c: remove extra blank line.
Sat Sep 16 13:21:04 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.c (gtk_im_context_simple_add_table):
Add the ability to add extra tables beyond the default
one, and also the ability to have compose sequences
that are prefixes of other compose sequences.
* gtk/gtkimcontextsimple.c: Export a preedit string which
consists of possible candidates for keystrokes that have
been entered but not yet committed.
* gtk/gtkimcontext.[ch] gtk/immulticontext.[ch]
gtk/gtkimcontextsimple.[ch]: add gtk_im_context_reset()
* gtk/gtkmulticontext.[ch] (gtk_im_multicontext_append_menuitems):
Add a function to add input-method switching menu items
to a menu.
* gtk/gtkimmulticontext.[ch]: Properly handly set_client_window
when switching input methods.
* gtk/gtkimcontextsimple.[ch]: Change the format of
the compose table to allow compose tables of different
lengths / sequence.
Sat Sep 16 13:05:48 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmodule.[ch]: Support routines for loading
GtkIMContext implementations dynamically at runtime.
* gtk/queryimmodules.c: Program to query the available
input modules and write the results into a file.
* gtk/gtkrc.[ch] (gtk_rc_get_im_module_file): Add
extra config options "im_module_file" (cache file for
input method modules), and "im_module_path" - path
to look for modules when generating cache file.
This doesn't scale.
Sat Sep 16 13:09:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.[ch] gtk/gtkmodule.[ch]: Move most of the
generic code from gtkthemes into a new abstraction
GtkModule which has the logic for implementing
a loadable module which implements a number of
GObject types.
Sat Sep 16 13:07:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.[ch]: Convert GtkEditable from
a class into an interface
* gtk/gtkoldeditable.[ch]: Move the old editable
implementation into here, so legacy widgets can
still rely on the implemenation. GtkOldEditable
exports GtkEditable. Make selection handling
code use new text conversion functions (and
handle UTF-8 as a side-effect). Use GtkClipboard
for CLIPBOARD.
* gtk/gtktext.[ch] gtk/gtkcombo.c gtk/gtkspinbutton.c:
Adopt to match above changes.
* gtk/gtkentry.[ch]: Implement GtkEditable directly,
avoid GtkOldEditable implementation. Restructure
to reduce number of places that modify state directly.
Move to GtkBindingSet. Display the preedit string.
Queue recomputation of PangoLayout and scroll position
to improve effiency of doing complex changes naively.
Add a menu with cut/copy/paste and input method selection.
Thu Sep 14 22:11:05 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add gtk_text_layout_set_preedit_string()
to set preedit string and attributes; display preedit string by
inserting string and attributes at cursor when creating the
GtkTextLineDisplay.
* gtk/gtktextlayout.c: Move all conversions between byte
positions in PangoLayout and GtkTextIter into new functions
line_display_iter_to_index/index_to_iter that properly
handle the preedit string.
* gtk/gtktextmark.[ch]: Restore gtk_text_mark_get_name, modify
it to return const char * (eventually will end up
as GCONST char *, most likely.)
* gtk/gtktextview.[ch]: Handle the preedit string, call
gtk_im_context_reset() as necessary, add a menu to switch
input methods.
* gtk/gtktextlayout.[ch]: Remove useless
gtk_text_layout_get_log_attrs() function.
2000-11-12 03:43:24 +00:00
|
|
|
gtk_spin_button_activate (GtkEntry *entry)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
Make parent_class static.
Sun Nov 5 04:24:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertextpixbuf.c: Make parent_class
static.
Tue Sep 19 10:54:22 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext*.[ch] gtk/gtkimmulticontext.[ch]
gtk/gtktextlayout.[ch] gtk/gtktextview.c gtk/gtkentry.c:
Add support for positioning the cursor within the preedit string.
Mon Sep 18 23:56:32 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Check for bindings after passing
events to im context filter.
Mon Sep 18 11:50:51 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (add_preedit_attrs): Handle
empty attribute lists properly.
Sun Sep 17 10:08:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c (main): Return non-zero exit
status if errors were encountered querying any
modules.
Sat Sep 16 14:01:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h: include gtkmodule.h gtkoldeditable.h,
don't include gtkthemes.h.
* gtk/testgtk.c gtk/testtext.c: Set environment variables
to point
* gtk/Makefile.am: Add new .c and .h files, build
gtk-query-immodules and use it to create a gtk.immodules
file for use of test programs.
* gtk/gtkpreview.c: remove extra blank line.
Sat Sep 16 13:21:04 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.c (gtk_im_context_simple_add_table):
Add the ability to add extra tables beyond the default
one, and also the ability to have compose sequences
that are prefixes of other compose sequences.
* gtk/gtkimcontextsimple.c: Export a preedit string which
consists of possible candidates for keystrokes that have
been entered but not yet committed.
* gtk/gtkimcontext.[ch] gtk/immulticontext.[ch]
gtk/gtkimcontextsimple.[ch]: add gtk_im_context_reset()
* gtk/gtkmulticontext.[ch] (gtk_im_multicontext_append_menuitems):
Add a function to add input-method switching menu items
to a menu.
* gtk/gtkimmulticontext.[ch]: Properly handly set_client_window
when switching input methods.
* gtk/gtkimcontextsimple.[ch]: Change the format of
the compose table to allow compose tables of different
lengths / sequence.
Sat Sep 16 13:05:48 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmodule.[ch]: Support routines for loading
GtkIMContext implementations dynamically at runtime.
* gtk/queryimmodules.c: Program to query the available
input modules and write the results into a file.
* gtk/gtkrc.[ch] (gtk_rc_get_im_module_file): Add
extra config options "im_module_file" (cache file for
input method modules), and "im_module_path" - path
to look for modules when generating cache file.
This doesn't scale.
Sat Sep 16 13:09:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.[ch] gtk/gtkmodule.[ch]: Move most of the
generic code from gtkthemes into a new abstraction
GtkModule which has the logic for implementing
a loadable module which implements a number of
GObject types.
Sat Sep 16 13:07:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.[ch]: Convert GtkEditable from
a class into an interface
* gtk/gtkoldeditable.[ch]: Move the old editable
implementation into here, so legacy widgets can
still rely on the implemenation. GtkOldEditable
exports GtkEditable. Make selection handling
code use new text conversion functions (and
handle UTF-8 as a side-effect). Use GtkClipboard
for CLIPBOARD.
* gtk/gtktext.[ch] gtk/gtkcombo.c gtk/gtkspinbutton.c:
Adopt to match above changes.
* gtk/gtkentry.[ch]: Implement GtkEditable directly,
avoid GtkOldEditable implementation. Restructure
to reduce number of places that modify state directly.
Move to GtkBindingSet. Display the preedit string.
Queue recomputation of PangoLayout and scroll position
to improve effiency of doing complex changes naively.
Add a menu with cut/copy/paste and input method selection.
Thu Sep 14 22:11:05 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add gtk_text_layout_set_preedit_string()
to set preedit string and attributes; display preedit string by
inserting string and attributes at cursor when creating the
GtkTextLineDisplay.
* gtk/gtktextlayout.c: Move all conversions between byte
positions in PangoLayout and GtkTextIter into new functions
line_display_iter_to_index/index_to_iter that properly
handle the preedit string.
* gtk/gtktextmark.[ch]: Restore gtk_text_mark_get_name, modify
it to return const char * (eventually will end up
as GCONST char *, most likely.)
* gtk/gtktextview.[ch]: Handle the preedit string, call
gtk_im_context_reset() as necessary, add a menu to switch
input methods.
* gtk/gtktextlayout.[ch]: Remove useless
gtk_text_layout_get_log_attrs() function.
2000-11-12 03:43:24 +00:00
|
|
|
if (entry->editable)
|
|
|
|
gtk_spin_button_update (GTK_SPIN_BUTTON (entry));
|
2002-09-24 08:57:57 +00:00
|
|
|
|
|
|
|
/* Chain up so that entry->activates_default is honored */
|
2006-05-02 23:56:43 +00:00
|
|
|
GTK_ENTRY_CLASS (gtk_spin_button_parent_class)->activate (entry);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
static void
|
|
|
|
gtk_spin_button_get_text_area_size (GtkEntry *entry,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
gint *width,
|
|
|
|
gint *height)
|
|
|
|
{
|
|
|
|
gint arrow_size;
|
|
|
|
gint panel_width;
|
|
|
|
|
|
|
|
GTK_ENTRY_CLASS (gtk_spin_button_parent_class)->get_text_area_size (entry, x, y, width, height);
|
|
|
|
|
|
|
|
arrow_size = spin_button_get_arrow_size (GTK_SPIN_BUTTON (entry));
|
|
|
|
panel_width = arrow_size + 2 * GTK_WIDGET (entry)->style->xthickness;
|
|
|
|
|
|
|
|
if (width)
|
|
|
|
*width -= panel_width;
|
|
|
|
|
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (entry)) == GTK_TEXT_DIR_RTL && x)
|
|
|
|
*x += panel_width;
|
|
|
|
}
|
|
|
|
|
1998-06-19 17:33:51 +00:00
|
|
|
static void
|
2001-10-03 21:50:58 +00:00
|
|
|
gtk_spin_button_insert_text (GtkEditable *editable,
|
1998-06-19 17:33:51 +00:00
|
|
|
const gchar *new_text,
|
|
|
|
gint new_text_length,
|
|
|
|
gint *position)
|
|
|
|
{
|
2001-10-03 21:50:58 +00:00
|
|
|
GtkEntry *entry = GTK_ENTRY (editable);
|
Make parent_class static.
Sun Nov 5 04:24:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertextpixbuf.c: Make parent_class
static.
Tue Sep 19 10:54:22 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext*.[ch] gtk/gtkimmulticontext.[ch]
gtk/gtktextlayout.[ch] gtk/gtktextview.c gtk/gtkentry.c:
Add support for positioning the cursor within the preedit string.
Mon Sep 18 23:56:32 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Check for bindings after passing
events to im context filter.
Mon Sep 18 11:50:51 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (add_preedit_attrs): Handle
empty attribute lists properly.
Sun Sep 17 10:08:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c (main): Return non-zero exit
status if errors were encountered querying any
modules.
Sat Sep 16 14:01:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h: include gtkmodule.h gtkoldeditable.h,
don't include gtkthemes.h.
* gtk/testgtk.c gtk/testtext.c: Set environment variables
to point
* gtk/Makefile.am: Add new .c and .h files, build
gtk-query-immodules and use it to create a gtk.immodules
file for use of test programs.
* gtk/gtkpreview.c: remove extra blank line.
Sat Sep 16 13:21:04 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.c (gtk_im_context_simple_add_table):
Add the ability to add extra tables beyond the default
one, and also the ability to have compose sequences
that are prefixes of other compose sequences.
* gtk/gtkimcontextsimple.c: Export a preedit string which
consists of possible candidates for keystrokes that have
been entered but not yet committed.
* gtk/gtkimcontext.[ch] gtk/immulticontext.[ch]
gtk/gtkimcontextsimple.[ch]: add gtk_im_context_reset()
* gtk/gtkmulticontext.[ch] (gtk_im_multicontext_append_menuitems):
Add a function to add input-method switching menu items
to a menu.
* gtk/gtkimmulticontext.[ch]: Properly handly set_client_window
when switching input methods.
* gtk/gtkimcontextsimple.[ch]: Change the format of
the compose table to allow compose tables of different
lengths / sequence.
Sat Sep 16 13:05:48 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmodule.[ch]: Support routines for loading
GtkIMContext implementations dynamically at runtime.
* gtk/queryimmodules.c: Program to query the available
input modules and write the results into a file.
* gtk/gtkrc.[ch] (gtk_rc_get_im_module_file): Add
extra config options "im_module_file" (cache file for
input method modules), and "im_module_path" - path
to look for modules when generating cache file.
This doesn't scale.
Sat Sep 16 13:09:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.[ch] gtk/gtkmodule.[ch]: Move most of the
generic code from gtkthemes into a new abstraction
GtkModule which has the logic for implementing
a loadable module which implements a number of
GObject types.
Sat Sep 16 13:07:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.[ch]: Convert GtkEditable from
a class into an interface
* gtk/gtkoldeditable.[ch]: Move the old editable
implementation into here, so legacy widgets can
still rely on the implemenation. GtkOldEditable
exports GtkEditable. Make selection handling
code use new text conversion functions (and
handle UTF-8 as a side-effect). Use GtkClipboard
for CLIPBOARD.
* gtk/gtktext.[ch] gtk/gtkcombo.c gtk/gtkspinbutton.c:
Adopt to match above changes.
* gtk/gtkentry.[ch]: Implement GtkEditable directly,
avoid GtkOldEditable implementation. Restructure
to reduce number of places that modify state directly.
Move to GtkBindingSet. Display the preedit string.
Queue recomputation of PangoLayout and scroll position
to improve effiency of doing complex changes naively.
Add a menu with cut/copy/paste and input method selection.
Thu Sep 14 22:11:05 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add gtk_text_layout_set_preedit_string()
to set preedit string and attributes; display preedit string by
inserting string and attributes at cursor when creating the
GtkTextLineDisplay.
* gtk/gtktextlayout.c: Move all conversions between byte
positions in PangoLayout and GtkTextIter into new functions
line_display_iter_to_index/index_to_iter that properly
handle the preedit string.
* gtk/gtktextmark.[ch]: Restore gtk_text_mark_get_name, modify
it to return const char * (eventually will end up
as GCONST char *, most likely.)
* gtk/gtktextview.[ch]: Handle the preedit string, call
gtk_im_context_reset() as necessary, add a menu to switch
input methods.
* gtk/gtktextlayout.[ch]: Remove useless
gtk_text_layout_get_log_attrs() function.
2000-11-12 03:43:24 +00:00
|
|
|
GtkSpinButton *spin = GTK_SPIN_BUTTON (editable);
|
2006-05-02 23:56:43 +00:00
|
|
|
GtkEditableClass *parent_editable_iface = g_type_interface_peek (gtk_spin_button_parent_class, GTK_TYPE_EDITABLE);
|
1998-06-19 17:33:51 +00:00
|
|
|
|
|
|
|
if (spin->numeric)
|
|
|
|
{
|
|
|
|
struct lconv *lc;
|
|
|
|
gboolean sign;
|
|
|
|
gint dotpos = -1;
|
|
|
|
gint i;
|
Destroy widgets _after_ propagating unrealize signals through the widget
Mon Dec 7 10:27:09 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize
signals through the widget heirarchy. This is unpleasant, as it
causes more X traffic, but is necessary, because we have to clean
up our Input Contexts before destroying the X windows.
(from matsu-981109-0.patch)
Mon Dec 7 10:18:18 1998 Owen Taylor <otaylor@redhat.com>
Applied gtk-a-higuti-981202-0 :
[ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ]
* gdk/gdk.h gdk/gdk.c
(gdk_mbstowcs): New function. Nearly equals to mbstowcs, but
implemented by a combination of Xlib functions, so
it works even with X_LOCALE.
(gdk_wcstombs): New function.
(g_mbtowc): Removed. No longer needed.
* gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c:
Added _wc() variants to gdk_text_width(),
gdk_char_width(), gdk_draw_text(),
* gdk/gdki18n.h
(mblen, mbtowc, wctomb, mbstowcs, wcstombs,
wcslen, wcscpy, wcsncpy):
Removed. No longer needed.
(iswalnum): Removed.
(gdk_iswalnum): New macro.
(gdk_iswspace): New macro.
* gdk/gdktype.h
(GdkWChar): New typedef.
* gtk/gtkentry.h, gtk/gtkentry.c
There are many changes according to the change of the
internal representation of text, from multibyte string
to wide characters.
* gtk/gtkprivate.h, gtk/gtkmain.c
Removed the variable gtk_use_mb and related codes.
* gtk/gtkspinbutton.c
Some changes according to the change of type of entry->text.
* gtk/gtktext.h, gtk/gtktext.c
Changed the internal representation of text. We use GdkWchar
if a fontset is supplied. If not, we use guchar to save
memory.
1998-12-09 06:36:57 +00:00
|
|
|
GdkWChar pos_sign;
|
|
|
|
GdkWChar neg_sign;
|
2000-12-05 20:53:30 +00:00
|
|
|
gint entry_length;
|
2009-03-27 05:22:23 +00:00
|
|
|
const gchar *entry_text;
|
Destroy widgets _after_ propagating unrealize signals through the widget
Mon Dec 7 10:27:09 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize
signals through the widget heirarchy. This is unpleasant, as it
causes more X traffic, but is necessary, because we have to clean
up our Input Contexts before destroying the X windows.
(from matsu-981109-0.patch)
Mon Dec 7 10:18:18 1998 Owen Taylor <otaylor@redhat.com>
Applied gtk-a-higuti-981202-0 :
[ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ]
* gdk/gdk.h gdk/gdk.c
(gdk_mbstowcs): New function. Nearly equals to mbstowcs, but
implemented by a combination of Xlib functions, so
it works even with X_LOCALE.
(gdk_wcstombs): New function.
(g_mbtowc): Removed. No longer needed.
* gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c:
Added _wc() variants to gdk_text_width(),
gdk_char_width(), gdk_draw_text(),
* gdk/gdki18n.h
(mblen, mbtowc, wctomb, mbstowcs, wcstombs,
wcslen, wcscpy, wcsncpy):
Removed. No longer needed.
(iswalnum): Removed.
(gdk_iswalnum): New macro.
(gdk_iswspace): New macro.
* gdk/gdktype.h
(GdkWChar): New typedef.
* gtk/gtkentry.h, gtk/gtkentry.c
There are many changes according to the change of the
internal representation of text, from multibyte string
to wide characters.
* gtk/gtkprivate.h, gtk/gtkmain.c
Removed the variable gtk_use_mb and related codes.
* gtk/gtkspinbutton.c
Some changes according to the change of type of entry->text.
* gtk/gtktext.h, gtk/gtktext.c
Changed the internal representation of text. We use GdkWchar
if a fontset is supplied. If not, we use guchar to save
memory.
1998-12-09 06:36:57 +00:00
|
|
|
|
2009-03-27 05:22:23 +00:00
|
|
|
entry_length = gtk_entry_get_text_length (entry);
|
|
|
|
entry_text = gtk_entry_get_text (entry);
|
1998-06-19 17:33:51 +00:00
|
|
|
|
|
|
|
lc = localeconv ();
|
|
|
|
|
|
|
|
if (*(lc->negative_sign))
|
|
|
|
neg_sign = *(lc->negative_sign);
|
|
|
|
else
|
|
|
|
neg_sign = '-';
|
|
|
|
|
|
|
|
if (*(lc->positive_sign))
|
|
|
|
pos_sign = *(lc->positive_sign);
|
|
|
|
else
|
|
|
|
pos_sign = '+';
|
|
|
|
|
2008-04-03 12:44:29 +00:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
/* Workaround for bug caused by some Windows application messing
|
|
|
|
* up the positive sign of the current locale, more specifically
|
|
|
|
* HKEY_CURRENT_USER\Control Panel\International\sPositiveSign.
|
|
|
|
* See bug #330743 and for instance
|
|
|
|
* http://www.msnewsgroups.net/group/microsoft.public.dotnet.languages.csharp/topic36024.aspx
|
|
|
|
*
|
|
|
|
* I don't know if the positive sign always gets bogusly set to
|
|
|
|
* a digit when the above Registry value is corrupted as
|
|
|
|
* described. (In my test case, it got set to "8", and in the
|
|
|
|
* bug report above it presumably was set ot "0".) Probably it
|
|
|
|
* might get set to almost anything? So how to distinguish a
|
|
|
|
* bogus value from some correct one for some locale? That is
|
|
|
|
* probably hard, but at least we should filter out the
|
|
|
|
* digits...
|
|
|
|
*/
|
|
|
|
if (pos_sign >= '0' && pos_sign <= '9')
|
|
|
|
pos_sign = '+';
|
|
|
|
#endif
|
|
|
|
|
Destroy widgets _after_ propagating unrealize signals through the widget
Mon Dec 7 10:27:09 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize
signals through the widget heirarchy. This is unpleasant, as it
causes more X traffic, but is necessary, because we have to clean
up our Input Contexts before destroying the X windows.
(from matsu-981109-0.patch)
Mon Dec 7 10:18:18 1998 Owen Taylor <otaylor@redhat.com>
Applied gtk-a-higuti-981202-0 :
[ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ]
* gdk/gdk.h gdk/gdk.c
(gdk_mbstowcs): New function. Nearly equals to mbstowcs, but
implemented by a combination of Xlib functions, so
it works even with X_LOCALE.
(gdk_wcstombs): New function.
(g_mbtowc): Removed. No longer needed.
* gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c:
Added _wc() variants to gdk_text_width(),
gdk_char_width(), gdk_draw_text(),
* gdk/gdki18n.h
(mblen, mbtowc, wctomb, mbstowcs, wcstombs,
wcslen, wcscpy, wcsncpy):
Removed. No longer needed.
(iswalnum): Removed.
(gdk_iswalnum): New macro.
(gdk_iswspace): New macro.
* gdk/gdktype.h
(GdkWChar): New typedef.
* gtk/gtkentry.h, gtk/gtkentry.c
There are many changes according to the change of the
internal representation of text, from multibyte string
to wide characters.
* gtk/gtkprivate.h, gtk/gtkmain.c
Removed the variable gtk_use_mb and related codes.
* gtk/gtkspinbutton.c
Some changes according to the change of type of entry->text.
* gtk/gtktext.h, gtk/gtktext.c
Changed the internal representation of text. We use GdkWchar
if a fontset is supplied. If not, we use guchar to save
memory.
1998-12-09 06:36:57 +00:00
|
|
|
for (sign=0, i=0; i<entry_length; i++)
|
2009-03-27 05:22:23 +00:00
|
|
|
if ((entry_text[i] == neg_sign) ||
|
|
|
|
(entry_text[i] == pos_sign))
|
Destroy widgets _after_ propagating unrealize signals through the widget
Mon Dec 7 10:27:09 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize
signals through the widget heirarchy. This is unpleasant, as it
causes more X traffic, but is necessary, because we have to clean
up our Input Contexts before destroying the X windows.
(from matsu-981109-0.patch)
Mon Dec 7 10:18:18 1998 Owen Taylor <otaylor@redhat.com>
Applied gtk-a-higuti-981202-0 :
[ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ]
* gdk/gdk.h gdk/gdk.c
(gdk_mbstowcs): New function. Nearly equals to mbstowcs, but
implemented by a combination of Xlib functions, so
it works even with X_LOCALE.
(gdk_wcstombs): New function.
(g_mbtowc): Removed. No longer needed.
* gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c:
Added _wc() variants to gdk_text_width(),
gdk_char_width(), gdk_draw_text(),
* gdk/gdki18n.h
(mblen, mbtowc, wctomb, mbstowcs, wcstombs,
wcslen, wcscpy, wcsncpy):
Removed. No longer needed.
(iswalnum): Removed.
(gdk_iswalnum): New macro.
(gdk_iswspace): New macro.
* gdk/gdktype.h
(GdkWChar): New typedef.
* gtk/gtkentry.h, gtk/gtkentry.c
There are many changes according to the change of the
internal representation of text, from multibyte string
to wide characters.
* gtk/gtkprivate.h, gtk/gtkmain.c
Removed the variable gtk_use_mb and related codes.
* gtk/gtkspinbutton.c
Some changes according to the change of type of entry->text.
* gtk/gtktext.h, gtk/gtktext.c
Changed the internal representation of text. We use GdkWchar
if a fontset is supplied. If not, we use guchar to save
memory.
1998-12-09 06:36:57 +00:00
|
|
|
{
|
|
|
|
sign = 1;
|
|
|
|
break;
|
|
|
|
}
|
1998-06-19 17:33:51 +00:00
|
|
|
|
|
|
|
if (sign && !(*position))
|
|
|
|
return;
|
|
|
|
|
Destroy widgets _after_ propagating unrealize signals through the widget
Mon Dec 7 10:27:09 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize
signals through the widget heirarchy. This is unpleasant, as it
causes more X traffic, but is necessary, because we have to clean
up our Input Contexts before destroying the X windows.
(from matsu-981109-0.patch)
Mon Dec 7 10:18:18 1998 Owen Taylor <otaylor@redhat.com>
Applied gtk-a-higuti-981202-0 :
[ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ]
* gdk/gdk.h gdk/gdk.c
(gdk_mbstowcs): New function. Nearly equals to mbstowcs, but
implemented by a combination of Xlib functions, so
it works even with X_LOCALE.
(gdk_wcstombs): New function.
(g_mbtowc): Removed. No longer needed.
* gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c:
Added _wc() variants to gdk_text_width(),
gdk_char_width(), gdk_draw_text(),
* gdk/gdki18n.h
(mblen, mbtowc, wctomb, mbstowcs, wcstombs,
wcslen, wcscpy, wcsncpy):
Removed. No longer needed.
(iswalnum): Removed.
(gdk_iswalnum): New macro.
(gdk_iswspace): New macro.
* gdk/gdktype.h
(GdkWChar): New typedef.
* gtk/gtkentry.h, gtk/gtkentry.c
There are many changes according to the change of the
internal representation of text, from multibyte string
to wide characters.
* gtk/gtkprivate.h, gtk/gtkmain.c
Removed the variable gtk_use_mb and related codes.
* gtk/gtkspinbutton.c
Some changes according to the change of type of entry->text.
* gtk/gtktext.h, gtk/gtktext.c
Changed the internal representation of text. We use GdkWchar
if a fontset is supplied. If not, we use guchar to save
memory.
1998-12-09 06:36:57 +00:00
|
|
|
for (dotpos=-1, i=0; i<entry_length; i++)
|
2009-03-27 05:22:23 +00:00
|
|
|
if (entry_text[i] == *(lc->decimal_point))
|
Destroy widgets _after_ propagating unrealize signals through the widget
Mon Dec 7 10:27:09 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize
signals through the widget heirarchy. This is unpleasant, as it
causes more X traffic, but is necessary, because we have to clean
up our Input Contexts before destroying the X windows.
(from matsu-981109-0.patch)
Mon Dec 7 10:18:18 1998 Owen Taylor <otaylor@redhat.com>
Applied gtk-a-higuti-981202-0 :
[ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ]
* gdk/gdk.h gdk/gdk.c
(gdk_mbstowcs): New function. Nearly equals to mbstowcs, but
implemented by a combination of Xlib functions, so
it works even with X_LOCALE.
(gdk_wcstombs): New function.
(g_mbtowc): Removed. No longer needed.
* gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c:
Added _wc() variants to gdk_text_width(),
gdk_char_width(), gdk_draw_text(),
* gdk/gdki18n.h
(mblen, mbtowc, wctomb, mbstowcs, wcstombs,
wcslen, wcscpy, wcsncpy):
Removed. No longer needed.
(iswalnum): Removed.
(gdk_iswalnum): New macro.
(gdk_iswspace): New macro.
* gdk/gdktype.h
(GdkWChar): New typedef.
* gtk/gtkentry.h, gtk/gtkentry.c
There are many changes according to the change of the
internal representation of text, from multibyte string
to wide characters.
* gtk/gtkprivate.h, gtk/gtkmain.c
Removed the variable gtk_use_mb and related codes.
* gtk/gtkspinbutton.c
Some changes according to the change of type of entry->text.
* gtk/gtktext.h, gtk/gtktext.c
Changed the internal representation of text. We use GdkWchar
if a fontset is supplied. If not, we use guchar to save
memory.
1998-12-09 06:36:57 +00:00
|
|
|
{
|
|
|
|
dotpos = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1998-06-19 17:33:51 +00:00
|
|
|
if (dotpos > -1 && *position > dotpos &&
|
2000-12-05 20:53:30 +00:00
|
|
|
(gint)spin->digits - entry_length
|
Destroy widgets _after_ propagating unrealize signals through the widget
Mon Dec 7 10:27:09 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize
signals through the widget heirarchy. This is unpleasant, as it
causes more X traffic, but is necessary, because we have to clean
up our Input Contexts before destroying the X windows.
(from matsu-981109-0.patch)
Mon Dec 7 10:18:18 1998 Owen Taylor <otaylor@redhat.com>
Applied gtk-a-higuti-981202-0 :
[ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ]
* gdk/gdk.h gdk/gdk.c
(gdk_mbstowcs): New function. Nearly equals to mbstowcs, but
implemented by a combination of Xlib functions, so
it works even with X_LOCALE.
(gdk_wcstombs): New function.
(g_mbtowc): Removed. No longer needed.
* gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c:
Added _wc() variants to gdk_text_width(),
gdk_char_width(), gdk_draw_text(),
* gdk/gdki18n.h
(mblen, mbtowc, wctomb, mbstowcs, wcstombs,
wcslen, wcscpy, wcsncpy):
Removed. No longer needed.
(iswalnum): Removed.
(gdk_iswalnum): New macro.
(gdk_iswspace): New macro.
* gdk/gdktype.h
(GdkWChar): New typedef.
* gtk/gtkentry.h, gtk/gtkentry.c
There are many changes according to the change of the
internal representation of text, from multibyte string
to wide characters.
* gtk/gtkprivate.h, gtk/gtkmain.c
Removed the variable gtk_use_mb and related codes.
* gtk/gtkspinbutton.c
Some changes according to the change of type of entry->text.
* gtk/gtktext.h, gtk/gtktext.c
Changed the internal representation of text. We use GdkWchar
if a fontset is supplied. If not, we use guchar to save
memory.
1998-12-09 06:36:57 +00:00
|
|
|
+ dotpos - new_text_length + 1 < 0)
|
1998-06-19 17:33:51 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < new_text_length; i++)
|
|
|
|
{
|
|
|
|
if (new_text[i] == neg_sign || new_text[i] == pos_sign)
|
|
|
|
{
|
|
|
|
if (sign || (*position) || i)
|
|
|
|
return;
|
|
|
|
sign = TRUE;
|
|
|
|
}
|
|
|
|
else if (new_text[i] == *(lc->decimal_point))
|
|
|
|
{
|
|
|
|
if (!spin->digits || dotpos > -1 ||
|
Destroy widgets _after_ propagating unrealize signals through the widget
Mon Dec 7 10:27:09 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize
signals through the widget heirarchy. This is unpleasant, as it
causes more X traffic, but is necessary, because we have to clean
up our Input Contexts before destroying the X windows.
(from matsu-981109-0.patch)
Mon Dec 7 10:18:18 1998 Owen Taylor <otaylor@redhat.com>
Applied gtk-a-higuti-981202-0 :
[ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ]
* gdk/gdk.h gdk/gdk.c
(gdk_mbstowcs): New function. Nearly equals to mbstowcs, but
implemented by a combination of Xlib functions, so
it works even with X_LOCALE.
(gdk_wcstombs): New function.
(g_mbtowc): Removed. No longer needed.
* gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c:
Added _wc() variants to gdk_text_width(),
gdk_char_width(), gdk_draw_text(),
* gdk/gdki18n.h
(mblen, mbtowc, wctomb, mbstowcs, wcstombs,
wcslen, wcscpy, wcsncpy):
Removed. No longer needed.
(iswalnum): Removed.
(gdk_iswalnum): New macro.
(gdk_iswspace): New macro.
* gdk/gdktype.h
(GdkWChar): New typedef.
* gtk/gtkentry.h, gtk/gtkentry.c
There are many changes according to the change of the
internal representation of text, from multibyte string
to wide characters.
* gtk/gtkprivate.h, gtk/gtkmain.c
Removed the variable gtk_use_mb and related codes.
* gtk/gtkspinbutton.c
Some changes according to the change of type of entry->text.
* gtk/gtktext.h, gtk/gtktext.c
Changed the internal representation of text. We use GdkWchar
if a fontset is supplied. If not, we use guchar to save
memory.
1998-12-09 06:36:57 +00:00
|
|
|
(new_text_length - 1 - i + entry_length
|
2000-12-05 20:53:30 +00:00
|
|
|
- *position > (gint)spin->digits))
|
1998-06-19 17:33:51 +00:00
|
|
|
return;
|
|
|
|
dotpos = *position + i;
|
|
|
|
}
|
|
|
|
else if (new_text[i] < 0x30 || new_text[i] > 0x39)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-10-03 21:50:58 +00:00
|
|
|
parent_editable_iface->insert_text (editable, new_text,
|
|
|
|
new_text_length, position);
|
1998-06-19 17:33:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_spin_button_real_spin (GtkSpinButton *spin_button,
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble increment)
|
1998-06-19 17:33:51 +00:00
|
|
|
{
|
|
|
|
GtkAdjustment *adj;
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble new_value = 0.0;
|
2006-01-30 17:35:49 +00:00
|
|
|
gboolean wrapped = FALSE;
|
1998-06-19 17:33:51 +00:00
|
|
|
|
|
|
|
adj = spin_button->adjustment;
|
|
|
|
|
1998-06-24 07:59:05 +00:00
|
|
|
new_value = adj->value + increment;
|
|
|
|
|
|
|
|
if (increment > 0)
|
1998-06-19 17:33:51 +00:00
|
|
|
{
|
|
|
|
if (spin_button->wrap)
|
|
|
|
{
|
|
|
|
if (fabs (adj->value - adj->upper) < EPSILON)
|
2006-01-30 17:35:49 +00:00
|
|
|
{
|
|
|
|
new_value = adj->lower;
|
|
|
|
wrapped = TRUE;
|
|
|
|
}
|
1998-06-19 17:33:51 +00:00
|
|
|
else if (new_value > adj->upper)
|
|
|
|
new_value = adj->upper;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
new_value = MIN (new_value, adj->upper);
|
|
|
|
}
|
1998-06-24 07:59:05 +00:00
|
|
|
else if (increment < 0)
|
1998-06-19 17:33:51 +00:00
|
|
|
{
|
|
|
|
if (spin_button->wrap)
|
|
|
|
{
|
|
|
|
if (fabs (adj->value - adj->lower) < EPSILON)
|
2006-01-30 17:35:49 +00:00
|
|
|
{
|
|
|
|
new_value = adj->upper;
|
|
|
|
wrapped = TRUE;
|
|
|
|
}
|
1998-06-19 17:33:51 +00:00
|
|
|
else if (new_value < adj->lower)
|
|
|
|
new_value = adj->lower;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
new_value = MAX (new_value, adj->lower);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fabs (new_value - adj->value) > EPSILON)
|
|
|
|
gtk_adjustment_set_value (adj, new_value);
|
2002-02-20 23:36:28 +00:00
|
|
|
|
2006-01-30 17:35:49 +00:00
|
|
|
if (wrapped)
|
|
|
|
g_signal_emit (spin_button, spinbutton_signals[WRAPPED], 0);
|
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin_button));
|
1998-06-19 17:33:51 +00:00
|
|
|
}
|
|
|
|
|
1999-02-28 16:04:47 +00:00
|
|
|
static gint
|
|
|
|
gtk_spin_button_default_input (GtkSpinButton *spin_button,
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble *new_val)
|
1999-02-28 16:04:47 +00:00
|
|
|
{
|
|
|
|
gchar *err = NULL;
|
|
|
|
|
2003-08-07 18:54:51 +00:00
|
|
|
*new_val = g_strtod (gtk_entry_get_text (GTK_ENTRY (spin_button)), &err);
|
1999-02-28 16:04:47 +00:00
|
|
|
if (*err)
|
2000-09-07 18:07:59 +00:00
|
|
|
return GTK_INPUT_ERROR;
|
1999-02-28 16:04:47 +00:00
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_spin_button_default_output (GtkSpinButton *spin_button)
|
|
|
|
{
|
2001-06-20 04:13:37 +00:00
|
|
|
gchar *buf = g_strdup_printf ("%0.*f", spin_button->digits, spin_button->adjustment->value);
|
1999-02-28 16:04:47 +00:00
|
|
|
|
|
|
|
if (strcmp (buf, gtk_entry_get_text (GTK_ENTRY (spin_button))))
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (spin_button), buf);
|
2001-06-20 04:13:37 +00:00
|
|
|
g_free (buf);
|
1999-02-28 16:04:47 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1998-06-19 17:33:51 +00:00
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
***********************************************************
|
|
|
|
*** Public interface ***
|
|
|
|
***********************************************************
|
|
|
|
***********************************************************/
|
|
|
|
|
|
|
|
|
2009-12-10 10:23:40 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_configure:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
* @adjustment: (allow-none): a #GtkAdjustment.
|
|
|
|
* @climb_rate: the new climb rate.
|
|
|
|
* @digits: the number of decimal places to display in the spin button.
|
|
|
|
*
|
|
|
|
* Changes the properties of an existing spin button. The adjustment, climb rate,
|
|
|
|
* and number of decimal places are all changed accordingly, after this function call.
|
|
|
|
*/
|
1998-06-19 17:33:51 +00:00
|
|
|
void
|
1998-09-26 03:12:03 +00:00
|
|
|
gtk_spin_button_configure (GtkSpinButton *spin_button,
|
1998-06-19 17:33:51 +00:00
|
|
|
GtkAdjustment *adjustment,
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble climb_rate,
|
1998-09-26 03:12:03 +00:00
|
|
|
guint digits)
|
1998-06-19 17:33:51 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
1998-09-26 03:12:03 +00:00
|
|
|
if (adjustment)
|
|
|
|
gtk_spin_button_set_adjustment (spin_button, adjustment);
|
|
|
|
else
|
|
|
|
adjustment = spin_button->adjustment;
|
1998-06-19 17:33:51 +00:00
|
|
|
|
coalescing property notifies
2001-08-11 Hans Breuer <hans@breuer.org>
* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies
* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
GDK_TYPE_EVENT signals
* gtk/gtkalignment.c : removed 'direct allocation bug',
which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
|
|
|
g_object_freeze_notify (G_OBJECT (spin_button));
|
2001-05-18 22:31:02 +00:00
|
|
|
if (spin_button->digits != digits)
|
|
|
|
{
|
|
|
|
spin_button->digits = digits;
|
|
|
|
g_object_notify (G_OBJECT (spin_button), "digits");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (spin_button->climb_rate != climb_rate)
|
|
|
|
{
|
|
|
|
spin_button->climb_rate = climb_rate;
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (spin_button), "climb-rate");
|
2001-05-18 22:31:02 +00:00
|
|
|
}
|
coalescing property notifies
2001-08-11 Hans Breuer <hans@breuer.org>
* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies
* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
GDK_TYPE_EVENT signals
* gtk/gtkalignment.c : removed 'direct allocation bug',
which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
|
|
|
g_object_thaw_notify (G_OBJECT (spin_button));
|
2001-05-18 22:31:02 +00:00
|
|
|
|
1998-09-26 03:12:03 +00:00
|
|
|
gtk_adjustment_value_changed (adjustment);
|
1998-06-19 17:33:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
gtk_spin_button_new (GtkAdjustment *adjustment,
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble climb_rate,
|
1998-09-26 03:12:03 +00:00
|
|
|
guint digits)
|
1998-06-19 17:33:51 +00:00
|
|
|
{
|
|
|
|
GtkSpinButton *spin;
|
|
|
|
|
1998-09-26 03:12:03 +00:00
|
|
|
if (adjustment)
|
|
|
|
g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), NULL);
|
1998-06-19 17:33:51 +00:00
|
|
|
|
2002-10-10 01:02:25 +00:00
|
|
|
spin = g_object_new (GTK_TYPE_SPIN_BUTTON, NULL);
|
1998-06-19 17:33:51 +00:00
|
|
|
|
1998-09-26 03:12:03 +00:00
|
|
|
gtk_spin_button_configure (spin, adjustment, climb_rate, digits);
|
1998-06-19 17:33:51 +00:00
|
|
|
|
|
|
|
return GTK_WIDGET (spin);
|
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_new_with_range:
|
|
|
|
* @min: Minimum allowable value
|
|
|
|
* @max: Maximum allowable value
|
|
|
|
* @step: Increment added or subtracted by spinning the widget
|
|
|
|
*
|
|
|
|
* This is a convenience constructor that allows creation of a numeric
|
|
|
|
* #GtkSpinButton without manually creating an adjustment. The value is
|
|
|
|
* initially set to the minimum value and a page increment of 10 * @step
|
|
|
|
* is the default. The precision of the spin button is equivalent to the
|
2005-07-06 03:45:13 +00:00
|
|
|
* precision of @step.
|
|
|
|
*
|
|
|
|
* Note that the way in which the precision is derived works best if @step
|
|
|
|
* is a power of ten. If the resulting precision is not suitable for your
|
|
|
|
* needs, use gtk_spin_button_set_digits() to correct it.
|
2001-03-30 03:35:47 +00:00
|
|
|
*
|
2001-10-27 01:17:38 +00:00
|
|
|
* Return value: The new spin button as a #GtkWidget.
|
2001-03-30 03:35:47 +00:00
|
|
|
**/
|
|
|
|
GtkWidget *
|
|
|
|
gtk_spin_button_new_with_range (gdouble min,
|
|
|
|
gdouble max,
|
|
|
|
gdouble step)
|
|
|
|
{
|
|
|
|
GtkObject *adj;
|
|
|
|
GtkSpinButton *spin;
|
|
|
|
gint digits;
|
|
|
|
|
2004-11-14 01:25:35 +00:00
|
|
|
g_return_val_if_fail (min <= max, NULL);
|
2001-03-30 03:35:47 +00:00
|
|
|
g_return_val_if_fail (step != 0.0, NULL);
|
|
|
|
|
2002-10-10 01:02:25 +00:00
|
|
|
spin = g_object_new (GTK_TYPE_SPIN_BUTTON, NULL);
|
2001-03-30 03:35:47 +00:00
|
|
|
|
2002-01-29 19:44:49 +00:00
|
|
|
adj = gtk_adjustment_new (min, min, max, step, 10 * step, 0);
|
2001-03-30 03:35:47 +00:00
|
|
|
|
2001-06-04 22:32:10 +00:00
|
|
|
if (fabs (step) >= 1.0 || step == 0.0)
|
2001-03-30 03:35:47 +00:00
|
|
|
digits = 0;
|
|
|
|
else {
|
|
|
|
digits = abs ((gint) floor (log10 (fabs (step))));
|
2001-06-20 04:13:37 +00:00
|
|
|
if (digits > MAX_DIGITS)
|
|
|
|
digits = MAX_DIGITS;
|
2001-03-30 03:35:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gtk_spin_button_configure (spin, GTK_ADJUSTMENT (adj), step, digits);
|
|
|
|
|
|
|
|
gtk_spin_button_set_numeric (spin, TRUE);
|
|
|
|
|
|
|
|
return GTK_WIDGET (spin);
|
|
|
|
}
|
|
|
|
|
2009-05-03 17:04:06 +00:00
|
|
|
static void
|
|
|
|
warn_nonzero_page_size (GtkAdjustment *adjustment)
|
|
|
|
{
|
|
|
|
if (gtk_adjustment_get_page_size (adjustment) != 0.0)
|
|
|
|
g_warning ("GtkSpinButton: setting an adjustment with non-zero page size is deprecated");
|
|
|
|
}
|
|
|
|
|
2000-11-27 17:47:52 +00:00
|
|
|
/* Callback used when the spin button's adjustment changes. We need to redraw
|
2001-03-08 01:55:28 +00:00
|
|
|
* the arrows when the adjustment's range changes, and reevaluate our size request.
|
2000-11-27 17:47:52 +00:00
|
|
|
*/
|
|
|
|
static void
|
|
|
|
adjustment_changed_cb (GtkAdjustment *adjustment, gpointer data)
|
|
|
|
{
|
|
|
|
GtkSpinButton *spin_button;
|
|
|
|
|
|
|
|
spin_button = GTK_SPIN_BUTTON (data);
|
|
|
|
|
2002-02-08 00:02:52 +00:00
|
|
|
spin_button->timer_step = spin_button->adjustment->step_increment;
|
2009-05-03 17:04:06 +00:00
|
|
|
warn_nonzero_page_size (adjustment);
|
2001-03-08 01:55:28 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (spin_button));
|
2000-11-27 17:47:52 +00:00
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_set_adjustment:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
* @adjustment: a #GtkAdjustment to replace the existing adjustment
|
|
|
|
*
|
|
|
|
* Replaces the #GtkAdjustment associated with @spin_button.
|
|
|
|
**/
|
1998-02-25 22:03:10 +00:00
|
|
|
void
|
|
|
|
gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
|
|
|
|
GtkAdjustment *adjustment)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
|
|
|
if (spin_button->adjustment != adjustment)
|
|
|
|
{
|
|
|
|
if (spin_button->adjustment)
|
|
|
|
{
|
2002-10-10 01:02:25 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (spin_button->adjustment,
|
|
|
|
gtk_spin_button_value_changed,
|
|
|
|
spin_button);
|
|
|
|
g_signal_handlers_disconnect_by_func (spin_button->adjustment,
|
|
|
|
adjustment_changed_cb,
|
|
|
|
spin_button);
|
|
|
|
g_object_unref (spin_button->adjustment);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
spin_button->adjustment = adjustment;
|
|
|
|
if (adjustment)
|
|
|
|
{
|
2005-11-23 18:06:58 +00:00
|
|
|
g_object_ref_sink (adjustment);
|
2008-08-08 13:25:18 +00:00
|
|
|
g_signal_connect (adjustment, "value-changed",
|
2002-10-10 01:02:25 +00:00
|
|
|
G_CALLBACK (gtk_spin_button_value_changed),
|
|
|
|
spin_button);
|
|
|
|
g_signal_connect (adjustment, "changed",
|
|
|
|
G_CALLBACK (adjustment_changed_cb),
|
|
|
|
spin_button);
|
2002-09-23 16:14:15 +00:00
|
|
|
spin_button->timer_step = spin_button->adjustment->step_increment;
|
2009-05-03 17:04:06 +00:00
|
|
|
warn_nonzero_page_size (adjustment);
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
2001-03-08 01:55:28 +00:00
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (spin_button));
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
2001-05-18 22:31:02 +00:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (spin_button), "adjustment");
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_get_adjustment:
|
2005-06-10 04:45:40 +00:00
|
|
|
* @spin_button: a #GtkSpinButton
|
2001-03-30 03:35:47 +00:00
|
|
|
*
|
|
|
|
* Get the adjustment associated with a #GtkSpinButton
|
|
|
|
*
|
|
|
|
* Return value: the #GtkAdjustment of @spin_button
|
|
|
|
**/
|
1998-02-25 22:03:10 +00:00
|
|
|
GtkAdjustment *
|
|
|
|
gtk_spin_button_get_adjustment (GtkSpinButton *spin_button)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), NULL);
|
|
|
|
|
|
|
|
return spin_button->adjustment;
|
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_set_digits:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
2003-07-01 20:49:01 +00:00
|
|
|
* @digits: the number of digits after the decimal point to be displayed for the spin button's value
|
2001-03-30 03:35:47 +00:00
|
|
|
*
|
2001-06-20 04:13:37 +00:00
|
|
|
* Set the precision to be displayed by @spin_button. Up to 20 digit precision
|
2001-03-30 03:35:47 +00:00
|
|
|
* is allowed.
|
|
|
|
**/
|
1998-02-25 22:03:10 +00:00
|
|
|
void
|
|
|
|
gtk_spin_button_set_digits (GtkSpinButton *spin_button,
|
1998-09-26 03:12:03 +00:00
|
|
|
guint digits)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
|
|
|
if (spin_button->digits != digits)
|
|
|
|
{
|
|
|
|
spin_button->digits = digits;
|
1998-06-19 17:33:51 +00:00
|
|
|
gtk_spin_button_value_changed (spin_button->adjustment, spin_button);
|
2001-05-18 22:31:02 +00:00
|
|
|
g_object_notify (G_OBJECT (spin_button), "digits");
|
|
|
|
|
2001-03-08 01:55:28 +00:00
|
|
|
/* since lower/upper may have changed */
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (spin_button));
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_get_digits:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
*
|
|
|
|
* Fetches the precision of @spin_button. See gtk_spin_button_set_digits().
|
|
|
|
*
|
|
|
|
* Returns: the current precision
|
|
|
|
**/
|
|
|
|
guint
|
|
|
|
gtk_spin_button_get_digits (GtkSpinButton *spin_button)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), 0);
|
|
|
|
|
|
|
|
return spin_button->digits;
|
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_set_increments:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
* @step: increment applied for a button 1 press.
|
|
|
|
* @page: increment applied for a button 2 press.
|
|
|
|
*
|
|
|
|
* Sets the step and page increments for spin_button. This affects how
|
|
|
|
* quickly the value changes when the spin button's arrows are activated.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_spin_button_set_increments (GtkSpinButton *spin_button,
|
|
|
|
gdouble step,
|
|
|
|
gdouble page)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
|
|
|
spin_button->adjustment->step_increment = step;
|
|
|
|
spin_button->adjustment->page_increment = page;
|
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_get_increments:
|
2001-09-08 06:24:46 +00:00
|
|
|
* @spin_button: a #GtkSpinButton
|
2010-02-19 16:53:17 +00:00
|
|
|
* @step: (allow-none): location to store step increment, or %NULL
|
|
|
|
* @page: (allow-none): location to store page increment, or %NULL
|
2001-06-24 15:34:48 +00:00
|
|
|
*
|
|
|
|
* Gets the current step and page the increments used by @spin_button. See
|
|
|
|
* gtk_spin_button_set_increments().
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_spin_button_get_increments (GtkSpinButton *spin_button,
|
|
|
|
gdouble *step,
|
|
|
|
gdouble *page)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
|
|
|
if (step)
|
|
|
|
*step = spin_button->adjustment->step_increment;
|
|
|
|
if (page)
|
|
|
|
*page = spin_button->adjustment->page_increment;
|
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_set_range:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
* @min: minimum allowable value
|
|
|
|
* @max: maximum allowable value
|
|
|
|
*
|
|
|
|
* Sets the minimum and maximum allowable values for @spin_button
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_spin_button_set_range (GtkSpinButton *spin_button,
|
|
|
|
gdouble min,
|
|
|
|
gdouble max)
|
|
|
|
{
|
2001-06-05 20:07:02 +00:00
|
|
|
gdouble value;
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
|
|
|
spin_button->adjustment->lower = min;
|
|
|
|
spin_button->adjustment->upper = max;
|
2001-06-05 20:07:02 +00:00
|
|
|
|
|
|
|
value = CLAMP (spin_button->adjustment->value,
|
|
|
|
spin_button->adjustment->lower,
|
|
|
|
(spin_button->adjustment->upper - spin_button->adjustment->page_size));
|
|
|
|
|
|
|
|
if (value != spin_button->adjustment->value)
|
|
|
|
gtk_spin_button_set_value (spin_button, value);
|
|
|
|
|
|
|
|
gtk_adjustment_changed (spin_button->adjustment);
|
2001-03-30 03:35:47 +00:00
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_get_range:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
2010-02-19 16:53:17 +00:00
|
|
|
* @min: (allow-none): location to store minimum allowed value, or %NULL
|
|
|
|
* @max: (allow-none): location to store maximum allowed value, or %NULL
|
2001-06-24 15:34:48 +00:00
|
|
|
*
|
|
|
|
* Gets the range allowed for @spin_button. See
|
|
|
|
* gtk_spin_button_set_range().
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_spin_button_get_range (GtkSpinButton *spin_button,
|
|
|
|
gdouble *min,
|
|
|
|
gdouble *max)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
|
|
|
if (min)
|
|
|
|
*min = spin_button->adjustment->lower;
|
|
|
|
if (max)
|
|
|
|
*max = spin_button->adjustment->upper;
|
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
2001-06-05 20:07:02 +00:00
|
|
|
* gtk_spin_button_get_value:
|
2001-03-30 03:35:47 +00:00
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
*
|
2001-06-05 20:07:02 +00:00
|
|
|
* Get the value in the @spin_button.
|
2001-03-30 03:35:47 +00:00
|
|
|
*
|
|
|
|
* Return value: the value of @spin_button
|
|
|
|
**/
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble
|
2001-06-05 20:07:02 +00:00
|
|
|
gtk_spin_button_get_value (GtkSpinButton *spin_button)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), 0.0);
|
|
|
|
|
|
|
|
return spin_button->adjustment->value;
|
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_get_value_as_int:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
*
|
|
|
|
* Get the value @spin_button represented as an integer.
|
|
|
|
*
|
|
|
|
* Return value: the value of @spin_button
|
|
|
|
**/
|
1998-02-25 22:03:10 +00:00
|
|
|
gint
|
|
|
|
gtk_spin_button_get_value_as_int (GtkSpinButton *spin_button)
|
|
|
|
{
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble val;
|
1998-02-25 22:03:10 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), 0);
|
|
|
|
|
|
|
|
val = spin_button->adjustment->value;
|
|
|
|
if (val - floor (val) < ceil (val) - val)
|
|
|
|
return floor (val);
|
|
|
|
else
|
|
|
|
return ceil (val);
|
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_set_value:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
* @value: the new value
|
|
|
|
*
|
|
|
|
* Set the value of @spin_button.
|
|
|
|
**/
|
1998-02-25 22:03:10 +00:00
|
|
|
void
|
|
|
|
gtk_spin_button_set_value (GtkSpinButton *spin_button,
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble value)
|
1998-02-25 22:03:10 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
1998-06-19 17:33:51 +00:00
|
|
|
if (fabs (value - spin_button->adjustment->value) > EPSILON)
|
1998-03-11 06:11:52 +00:00
|
|
|
gtk_adjustment_set_value (spin_button->adjustment, value);
|
1998-06-19 17:33:51 +00:00
|
|
|
else
|
|
|
|
{
|
1999-02-28 16:04:47 +00:00
|
|
|
gint return_val = FALSE;
|
2002-10-10 01:02:25 +00:00
|
|
|
g_signal_emit (spin_button, spinbutton_signals[OUTPUT], 0, &return_val);
|
1999-02-28 16:04:47 +00:00
|
|
|
if (return_val == FALSE)
|
|
|
|
gtk_spin_button_default_output (spin_button);
|
1998-06-19 17:33:51 +00:00
|
|
|
}
|
1998-02-25 22:03:10 +00:00
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_set_update_policy:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
* @policy: a #GtkSpinButtonUpdatePolicy value
|
|
|
|
*
|
|
|
|
* Sets the update behavior of a spin button. This determines whether the
|
|
|
|
* spin button is always updated or only when a valid value is set.
|
|
|
|
**/
|
1998-02-25 22:03:10 +00:00
|
|
|
void
|
|
|
|
gtk_spin_button_set_update_policy (GtkSpinButton *spin_button,
|
|
|
|
GtkSpinButtonUpdatePolicy policy)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
2001-05-18 22:31:02 +00:00
|
|
|
if (spin_button->update_policy != policy)
|
|
|
|
{
|
|
|
|
spin_button->update_policy = policy;
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (spin_button), "update-policy");
|
2001-05-18 22:31:02 +00:00
|
|
|
}
|
1998-03-11 06:11:52 +00:00
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_get_update_policy:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
*
|
|
|
|
* Gets the update behavior of a spin button. See
|
|
|
|
* gtk_spin_button_set_update_policy().
|
|
|
|
*
|
|
|
|
* Return value: the current update policy
|
|
|
|
**/
|
|
|
|
GtkSpinButtonUpdatePolicy
|
|
|
|
gtk_spin_button_get_update_policy (GtkSpinButton *spin_button)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), GTK_UPDATE_ALWAYS);
|
|
|
|
|
|
|
|
return spin_button->update_policy;
|
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_set_numeric:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
* @numeric: flag indicating if only numeric entry is allowed.
|
|
|
|
*
|
|
|
|
* Sets the flag that determines if non-numeric text can be typed into
|
|
|
|
* the spin button.
|
|
|
|
**/
|
1998-03-11 06:11:52 +00:00
|
|
|
void
|
|
|
|
gtk_spin_button_set_numeric (GtkSpinButton *spin_button,
|
1998-09-26 03:12:03 +00:00
|
|
|
gboolean numeric)
|
1998-03-11 06:11:52 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
2002-01-28 18:52:49 +00:00
|
|
|
numeric = numeric != FALSE;
|
2001-05-18 22:31:02 +00:00
|
|
|
|
2002-01-28 18:52:49 +00:00
|
|
|
if (spin_button->numeric != numeric)
|
|
|
|
{
|
|
|
|
spin_button->numeric = numeric;
|
|
|
|
g_object_notify (G_OBJECT (spin_button), "numeric");
|
|
|
|
}
|
1998-03-11 06:11:52 +00:00
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_get_numeric:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
*
|
|
|
|
* Returns whether non-numeric text can be typed into the spin button.
|
|
|
|
* See gtk_spin_button_set_numeric().
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if only numeric text can be entered
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_spin_button_get_numeric (GtkSpinButton *spin_button)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), FALSE);
|
|
|
|
|
|
|
|
return spin_button->numeric;
|
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_set_wrap:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
* @wrap: a flag indicating if wrapping behavior is performed.
|
|
|
|
*
|
|
|
|
* Sets the flag that determines if a spin button value wraps around to the
|
|
|
|
* opposite limit when the upper or lower limit of the range is exceeded.
|
|
|
|
**/
|
1998-03-29 20:40:10 +00:00
|
|
|
void
|
|
|
|
gtk_spin_button_set_wrap (GtkSpinButton *spin_button,
|
1998-09-26 03:12:03 +00:00
|
|
|
gboolean wrap)
|
1998-03-29 20:40:10 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
2002-01-28 18:52:49 +00:00
|
|
|
wrap = wrap != FALSE;
|
|
|
|
|
|
|
|
if (spin_button->wrap != wrap)
|
|
|
|
{
|
|
|
|
spin_button->wrap = (wrap != 0);
|
2001-05-18 22:31:02 +00:00
|
|
|
|
2002-01-28 18:52:49 +00:00
|
|
|
g_object_notify (G_OBJECT (spin_button), "wrap");
|
|
|
|
}
|
1998-03-29 20:40:10 +00:00
|
|
|
}
|
1998-06-13 08:56:27 +00:00
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_get_wrap:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
*
|
|
|
|
* Returns whether the spin button's value wraps around to the
|
|
|
|
* opposite limit when the upper or lower limit of the range is
|
|
|
|
* exceeded. See gtk_spin_button_set_wrap().
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if the spin button wraps around
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_spin_button_get_wrap (GtkSpinButton *spin_button)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), FALSE);
|
|
|
|
|
|
|
|
return spin_button->wrap;
|
|
|
|
}
|
|
|
|
|
2001-10-21 22:28:55 +00:00
|
|
|
static gint
|
|
|
|
spin_button_get_arrow_size (GtkSpinButton *spin_button)
|
|
|
|
{
|
|
|
|
gint size = pango_font_description_get_size (GTK_WIDGET (spin_button)->style->font_desc);
|
2002-02-20 23:36:28 +00:00
|
|
|
gint arrow_size;
|
|
|
|
|
|
|
|
arrow_size = MAX (PANGO_PIXELS (size), MIN_ARROW_WIDTH);
|
|
|
|
|
|
|
|
return arrow_size - arrow_size % 2; /* force even */
|
2001-10-21 22:28:55 +00:00
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* spin_button_get_shadow_type:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
*
|
|
|
|
* Convenience function to Get the shadow type from the underlying widget's
|
|
|
|
* style.
|
|
|
|
*
|
|
|
|
* Return value: the #GtkShadowType
|
|
|
|
**/
|
2001-03-18 04:50:34 +00:00
|
|
|
static gint
|
|
|
|
spin_button_get_shadow_type (GtkSpinButton *spin_button)
|
1998-06-13 08:56:27 +00:00
|
|
|
{
|
2001-03-18 04:50:34 +00:00
|
|
|
GtkShadowType rc_shadow_type;
|
1998-06-13 08:56:27 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
gtk_widget_style_get (GTK_WIDGET (spin_button), "shadow-type", &rc_shadow_type, NULL);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
return rc_shadow_type;
|
1998-06-13 08:56:27 +00:00
|
|
|
}
|
1998-06-17 20:07:31 +00:00
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_set_snap_to_ticks:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
* @snap_to_ticks: a flag indicating if invalid values should be corrected.
|
|
|
|
*
|
|
|
|
* Sets the policy as to whether values are corrected to the nearest step
|
|
|
|
* increment when a spin button is activated after providing an invalid value.
|
|
|
|
**/
|
1998-06-17 20:07:31 +00:00
|
|
|
void
|
|
|
|
gtk_spin_button_set_snap_to_ticks (GtkSpinButton *spin_button,
|
1998-09-26 03:12:03 +00:00
|
|
|
gboolean snap_to_ticks)
|
1998-06-17 20:07:31 +00:00
|
|
|
{
|
|
|
|
guint new_val;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
|
|
|
new_val = (snap_to_ticks != 0);
|
|
|
|
|
|
|
|
if (new_val != spin_button->snap_to_ticks)
|
|
|
|
{
|
|
|
|
spin_button->snap_to_ticks = new_val;
|
Make parent_class static.
Sun Nov 5 04:24:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcellrenderertextpixbuf.c: Make parent_class
static.
Tue Sep 19 10:54:22 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext*.[ch] gtk/gtkimmulticontext.[ch]
gtk/gtktextlayout.[ch] gtk/gtktextview.c gtk/gtkentry.c:
Add support for positioning the cursor within the preedit string.
Mon Sep 18 23:56:32 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c: Check for bindings after passing
events to im context filter.
Mon Sep 18 11:50:51 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (add_preedit_attrs): Handle
empty attribute lists properly.
Sun Sep 17 10:08:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c (main): Return non-zero exit
status if errors were encountered querying any
modules.
Sat Sep 16 14:01:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtk.h: include gtkmodule.h gtkoldeditable.h,
don't include gtkthemes.h.
* gtk/testgtk.c gtk/testtext.c: Set environment variables
to point
* gtk/Makefile.am: Add new .c and .h files, build
gtk-query-immodules and use it to create a gtk.immodules
file for use of test programs.
* gtk/gtkpreview.c: remove extra blank line.
Sat Sep 16 13:21:04 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.c (gtk_im_context_simple_add_table):
Add the ability to add extra tables beyond the default
one, and also the ability to have compose sequences
that are prefixes of other compose sequences.
* gtk/gtkimcontextsimple.c: Export a preedit string which
consists of possible candidates for keystrokes that have
been entered but not yet committed.
* gtk/gtkimcontext.[ch] gtk/immulticontext.[ch]
gtk/gtkimcontextsimple.[ch]: add gtk_im_context_reset()
* gtk/gtkmulticontext.[ch] (gtk_im_multicontext_append_menuitems):
Add a function to add input-method switching menu items
to a menu.
* gtk/gtkimmulticontext.[ch]: Properly handly set_client_window
when switching input methods.
* gtk/gtkimcontextsimple.[ch]: Change the format of
the compose table to allow compose tables of different
lengths / sequence.
Sat Sep 16 13:05:48 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmodule.[ch]: Support routines for loading
GtkIMContext implementations dynamically at runtime.
* gtk/queryimmodules.c: Program to query the available
input modules and write the results into a file.
* gtk/gtkrc.[ch] (gtk_rc_get_im_module_file): Add
extra config options "im_module_file" (cache file for
input method modules), and "im_module_path" - path
to look for modules when generating cache file.
This doesn't scale.
Sat Sep 16 13:09:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.[ch] gtk/gtkmodule.[ch]: Move most of the
generic code from gtkthemes into a new abstraction
GtkModule which has the logic for implementing
a loadable module which implements a number of
GObject types.
Sat Sep 16 13:07:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.[ch]: Convert GtkEditable from
a class into an interface
* gtk/gtkoldeditable.[ch]: Move the old editable
implementation into here, so legacy widgets can
still rely on the implemenation. GtkOldEditable
exports GtkEditable. Make selection handling
code use new text conversion functions (and
handle UTF-8 as a side-effect). Use GtkClipboard
for CLIPBOARD.
* gtk/gtktext.[ch] gtk/gtkcombo.c gtk/gtkspinbutton.c:
Adopt to match above changes.
* gtk/gtkentry.[ch]: Implement GtkEditable directly,
avoid GtkOldEditable implementation. Restructure
to reduce number of places that modify state directly.
Move to GtkBindingSet. Display the preedit string.
Queue recomputation of PangoLayout and scroll position
to improve effiency of doing complex changes naively.
Add a menu with cut/copy/paste and input method selection.
Thu Sep 14 22:11:05 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add gtk_text_layout_set_preedit_string()
to set preedit string and attributes; display preedit string by
inserting string and attributes at cursor when creating the
GtkTextLineDisplay.
* gtk/gtktextlayout.c: Move all conversions between byte
positions in PangoLayout and GtkTextIter into new functions
line_display_iter_to_index/index_to_iter that properly
handle the preedit string.
* gtk/gtktextmark.[ch]: Restore gtk_text_mark_get_name, modify
it to return const char * (eventually will end up
as GCONST char *, most likely.)
* gtk/gtktextview.[ch]: Handle the preedit string, call
gtk_im_context_reset() as necessary, add a menu to switch
input methods.
* gtk/gtktextlayout.[ch]: Remove useless
gtk_text_layout_get_log_attrs() function.
2000-11-12 03:43:24 +00:00
|
|
|
if (new_val && GTK_ENTRY (spin_button)->editable)
|
1999-02-28 16:04:47 +00:00
|
|
|
gtk_spin_button_update (spin_button);
|
2001-05-18 22:31:02 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (spin_button), "snap-to-ticks");
|
1998-06-17 20:07:31 +00:00
|
|
|
}
|
|
|
|
}
|
1998-06-19 17:33:51 +00:00
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_get_snap_to_ticks:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
*
|
|
|
|
* Returns whether the values are corrected to the nearest step. See
|
|
|
|
* gtk_spin_button_set_snap_to_ticks().
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if values are snapped to the nearest step.
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_spin_button_get_snap_to_ticks (GtkSpinButton *spin_button)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), FALSE);
|
|
|
|
|
|
|
|
return spin_button->snap_to_ticks;
|
|
|
|
}
|
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_spin:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
* @direction: a #GtkSpinType indicating the direction to spin.
|
|
|
|
* @increment: step increment to apply in the specified direction.
|
|
|
|
*
|
|
|
|
* Increment or decrement a spin button's value in a specified direction
|
|
|
|
* by a specified amount.
|
|
|
|
**/
|
1998-06-19 17:33:51 +00:00
|
|
|
void
|
|
|
|
gtk_spin_button_spin (GtkSpinButton *spin_button,
|
|
|
|
GtkSpinType direction,
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble increment)
|
1998-06-19 17:33:51 +00:00
|
|
|
{
|
|
|
|
GtkAdjustment *adj;
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble diff;
|
1998-06-19 17:33:51 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
|
|
|
adj = spin_button->adjustment;
|
|
|
|
|
1998-06-24 07:59:05 +00:00
|
|
|
/* for compatibility with the 1.0.x version of this function */
|
|
|
|
if (increment != 0 && increment != adj->step_increment &&
|
1998-06-25 07:43:27 +00:00
|
|
|
(direction == GTK_SPIN_STEP_FORWARD ||
|
|
|
|
direction == GTK_SPIN_STEP_BACKWARD))
|
1998-06-24 07:59:05 +00:00
|
|
|
{
|
|
|
|
if (direction == GTK_SPIN_STEP_BACKWARD && increment > 0)
|
|
|
|
increment = -increment;
|
|
|
|
direction = GTK_SPIN_USER_DEFINED;
|
|
|
|
}
|
|
|
|
|
1998-06-19 17:33:51 +00:00
|
|
|
switch (direction)
|
|
|
|
{
|
|
|
|
case GTK_SPIN_STEP_FORWARD:
|
|
|
|
|
1998-06-24 07:59:05 +00:00
|
|
|
gtk_spin_button_real_spin (spin_button, adj->step_increment);
|
1998-06-19 17:33:51 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SPIN_STEP_BACKWARD:
|
|
|
|
|
1998-06-24 07:59:05 +00:00
|
|
|
gtk_spin_button_real_spin (spin_button, -adj->step_increment);
|
1998-06-19 17:33:51 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SPIN_PAGE_FORWARD:
|
|
|
|
|
1998-06-24 07:59:05 +00:00
|
|
|
gtk_spin_button_real_spin (spin_button, adj->page_increment);
|
1998-06-19 17:33:51 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SPIN_PAGE_BACKWARD:
|
|
|
|
|
1998-06-24 07:59:05 +00:00
|
|
|
gtk_spin_button_real_spin (spin_button, -adj->page_increment);
|
1998-06-19 17:33:51 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SPIN_HOME:
|
|
|
|
|
|
|
|
diff = adj->value - adj->lower;
|
|
|
|
if (diff > EPSILON)
|
1998-06-24 07:59:05 +00:00
|
|
|
gtk_spin_button_real_spin (spin_button, -diff);
|
1998-06-19 17:33:51 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SPIN_END:
|
|
|
|
|
|
|
|
diff = adj->upper - adj->value;
|
|
|
|
if (diff > EPSILON)
|
1998-06-24 07:59:05 +00:00
|
|
|
gtk_spin_button_real_spin (spin_button, diff);
|
1998-06-19 17:33:51 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SPIN_USER_DEFINED:
|
|
|
|
|
|
|
|
if (increment != 0)
|
1998-06-24 07:59:05 +00:00
|
|
|
gtk_spin_button_real_spin (spin_button, increment);
|
1998-06-19 17:33:51 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
1999-02-28 16:04:47 +00:00
|
|
|
|
2001-03-30 03:35:47 +00:00
|
|
|
/**
|
|
|
|
* gtk_spin_button_update:
|
|
|
|
* @spin_button: a #GtkSpinButton
|
|
|
|
*
|
|
|
|
* Manually force an update of the spin button.
|
|
|
|
**/
|
1999-02-28 16:04:47 +00:00
|
|
|
void
|
|
|
|
gtk_spin_button_update (GtkSpinButton *spin_button)
|
|
|
|
{
|
2001-03-19 21:06:38 +00:00
|
|
|
gdouble val;
|
1999-02-28 16:04:47 +00:00
|
|
|
gint error = 0;
|
|
|
|
gint return_val;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
|
|
|
|
|
|
|
return_val = FALSE;
|
2002-10-10 01:02:25 +00:00
|
|
|
g_signal_emit (spin_button, spinbutton_signals[INPUT], 0, &val, &return_val);
|
1999-02-28 16:04:47 +00:00
|
|
|
if (return_val == FALSE)
|
|
|
|
{
|
|
|
|
return_val = gtk_spin_button_default_input (spin_button, &val);
|
2000-09-07 18:07:59 +00:00
|
|
|
error = (return_val == GTK_INPUT_ERROR);
|
1999-02-28 16:04:47 +00:00
|
|
|
}
|
2000-09-07 18:07:59 +00:00
|
|
|
else if (return_val == GTK_INPUT_ERROR)
|
1999-02-28 16:04:47 +00:00
|
|
|
error = 1;
|
|
|
|
|
Reorder strange window hierarchy of the GtkSpinButton (#466000).
2008-05-25 Jan Arne Petersen <jpetersen@jpetersen.org>
* gtk/gtkentry.c: (gtk_entry_class_init), (get_text_area_size),
(gtk_entry_get_text_area_size), (gtk_entry_draw_frame):
* gtk/gtkentry.h:
* gtk/gtkspinbutton.c: (gtk_spin_button_class_init),
(gtk_spin_button_realize), (gtk_spin_button_size_allocate),
(gtk_spin_button_expose), (gtk_spin_button_draw_arrow),
(gtk_spin_button_enter_notify), (gtk_spin_button_leave_notify),
(gtk_spin_button_grab_notify), (gtk_spin_button_state_changed),
(start_spinning), (gtk_spin_button_button_release),
(gtk_spin_button_motion_notify), (gtk_spin_button_value_changed),
(gtk_spin_button_get_text_area_size), (gtk_spin_button_real_spin),
(gtk_spin_button_update): Reorder strange window hierarchy of the
GtkSpinButton (#466000).
svn path=/trunk/; revision=20147
2008-05-25 12:46:26 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (spin_button));
|
2002-02-20 23:36:28 +00:00
|
|
|
|
1999-02-28 16:04:47 +00:00
|
|
|
if (spin_button->update_policy == GTK_UPDATE_ALWAYS)
|
|
|
|
{
|
|
|
|
if (val < spin_button->adjustment->lower)
|
|
|
|
val = spin_button->adjustment->lower;
|
|
|
|
else if (val > spin_button->adjustment->upper)
|
|
|
|
val = spin_button->adjustment->upper;
|
|
|
|
}
|
|
|
|
else if ((spin_button->update_policy == GTK_UPDATE_IF_VALID) &&
|
|
|
|
(error ||
|
|
|
|
val < spin_button->adjustment->lower ||
|
|
|
|
val > spin_button->adjustment->upper))
|
|
|
|
{
|
|
|
|
gtk_spin_button_value_changed (spin_button->adjustment, spin_button);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (spin_button->snap_to_ticks)
|
|
|
|
gtk_spin_button_snap (spin_button, val);
|
|
|
|
else
|
2008-05-20 17:29:34 +00:00
|
|
|
gtk_spin_button_set_value (spin_button, val);
|
1999-02-28 16:04:47 +00:00
|
|
|
}
|
2001-03-30 03:35:47 +00:00
|
|
|
|
2005-03-20 07:01:23 +00:00
|
|
|
#define __GTK_SPIN_BUTTON_C__
|
|
|
|
#include "gtkaliasdef.c"
|