Commit Graph

670 Commits

Author SHA1 Message Date
Alexander Larsson
de1f551271 GtkTextView: Use *some* extra size for horizontal scrolling
Horizontal scrolling is unusual, but specifying some extra offscreen
space for it in free in the normal case where the viewport is the
same width as the canvas anyway, so lets do it.
2013-08-26 21:17:45 +02:00
Christian Hergert
d96882bc16 textview: use pixelcache to indirectly renderer to widget.
This patch uses GtkPixelCache to render the contents of the widget,
and typically a bit more, to an offscreen surface. The pixel cache in
turn manages rendering to the actual surface for the widget.

The current strategy for the size to render is the size of the widget
plus half the height.

https://bugzilla.gnome.org/show_bug.cgi?id=701125
2013-08-26 21:17:45 +02:00
Matthias Clasen
624ec0fb7d Add a style class for context menus
Attached widgets inherit from the style of the widget they are
attached to. This can sometimes have unintended consequences,
like a context menu in the main view of gedit inheriting the font
that is configured for documents, or the context menu of the preview
in the font chooser coming up with humongous font size.

To fix this problem, we introduce a context menu style class
and use it for all menus that are used like that. The theme
can then set a font for this style class.

https://bugzilla.gnome.org/show_bug.cgi?id=697127
2013-08-18 13:46:48 -04:00
Matthias Clasen
f8412eca34 Revert "Deprecate and ignore the cursor blink settings"
This reverts commit b2e666bf8f.

We need to keep cursor blinking configurable for accessibility
reasons.

https://bugzilla.gnome.org/show_bug.cgi?id=704134

Conflicts:
	gdk/win32/gdkproperty-win32.c
	gdk/x11/gdksettings.c
	gtk/gtksettings.c
	gtk/gtktextview.c
2013-08-16 22:45:13 -04:00
Jasper St. Pierre
030b62d122 gtkdnd: Introduce a new API for more accurate drag origin data
When trying to drag, we currently the position of the first motion
event to determine where the drag came from. This might be alright
in the case of the old animation, but the data will be inaccurate
if the user has moved the pointer quite a bit since pressing the
cursor to start dragging. While we could monkey patch the GdkEvent
at the widget layer, this is unintuitive and strange.

Add a new API that takes a set of pointer coordinates describing
the origin of the drag. Additionally, adapt most widgets to use
it and use it with correct coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-14 07:12:52 -04:00
Matthias Clasen
2f1fa7cdc3 Drop some unnecessary includes
Drop includes of deprecated headers where they are
no longer needed.
2013-07-19 22:32:23 -04:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
William Jon McCann
b2e666bf8f Deprecate and ignore the cursor blink settings
And hardcode them to reasonable values.
2013-06-26 12:32:31 -04:00
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
Matthias Clasen
27a15d9a7d GtkTextView: Remove the Unicode and input method menus
Submenus in the context menu are not great, and these two
in particular are not something we want to have there.
2013-06-07 18:13:20 -04:00
Sébastien Wilmet
6b50045f90 Doc: various small fixes
https://bugzilla.gnome.org/show_bug.cgi?id=700007
2013-05-12 18:09:28 +02:00
Giovanni Campagna
ca2368dba9 GtkTextView: don't popdown a bubble if we don't have one
This causes a segfault.

https://bugzilla.gnome.org/show_bug.cgi?id=695304
2013-03-06 17:08:48 +01:00
Matthias Clasen
e1edc998a2 Rename property to be more neutral
Don't put toolbar in the name of the property - we may use
a different container down the road, and then this name
would be misleading.
2013-03-05 16:48:01 -05:00
Matthias Clasen
3c04597306 Really keep GtkBubbleWindow private
_-prefix the symbols to keep them from leaking out.
Also, un-doc-commentize the sources.
2013-03-05 16:48:01 -05:00
Matthias Clasen
7c2a752b37 Small documentation tweak 2013-03-05 16:48:01 -05:00
Matthias Clasen
190dcfe050 Popdown the bubble window when text view is scrolled 2013-03-05 16:48:01 -05:00
Matthias Clasen
88623b98a7 Allow to populate bubbles with extra content
We do this by making the ::populate-popup signals a little more
flexible. They used to just accept a GtkMenu as argument, now
they can take a menu or a toolbar. To not break the expectations
of existing callbacks, we only emit ::populate-popup with a toolbar
if the :populate-toolbar property is TRUE.
2013-03-05 16:48:00 -05:00
Matthias Clasen
bb3c56abe2 Do without GtkSelectionWindow
Just populate a toolbar directly, in GtkEntry and GtkTextView.
2013-03-05 16:48:00 -05:00
Carlos Garnacho
ceeed09d07 Made GtkBubble/SelectionWindow private at the moment 2013-03-05 16:48:00 -05:00
Carlos Garnacho
0ba92bc26d Use gdk_threads_add_timeout to popup the selection window
Second granularity may bite us back there
2013-03-05 16:47:59 -05:00
Carlos Garnacho
320613c439 textview: Use GtkSelectionWindow for touch text selection
This enables touch devices to manipulate the text selection
2013-03-05 16:47:59 -05:00
Carlos Garnacho
17d3775555 Ensure the insertion handle stays on fake events (eg from IM)
Don't set handles mode to none if the event has send_event set.
For consistency with GtkEntry, also make GtkTextView keep the
handle mode on buffer changes.
2013-03-05 16:47:58 -05:00
Alexander Larsson
b5ee44b419 TextView: Properly render background
We always need to render the background, as the window
background is not always set (i.e. during gtk_widget_draw()) or
when its partially visible.

https://bugzilla.gnome.org/show_bug.cgi?id=694925
2013-03-01 12:50:20 +01:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
Matthias Clasen
edd1c66041 Make GtkTextView deal better with !can_focus
This was pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=693050
2013-02-03 15:44:41 -05:00
Matthias Clasen
e4b5e94eb9 Make accessible implementations public
This commit exposes the get_type() functions and standard
headers for accessible implementations. This makes it possible
to derive from the GTK accessible implementations without
GType magic tricks. This is necessary, because we require the
a11y type hierarchy to be parallel to the widget type hierarchy.
So, if you derive a widget and need to adjust its a11y implementation,
you have to be able to derive its accessible implementation.

This commit probably exposes more than is absolutely necessary,
it also exposes accessibles of widgets that are unlikely candidates
for deriving from.
2012-12-27 11:23:22 -05:00
Cosimo Cecchi
b855e91f7a build: fix some GCC warnings 2012-12-07 11:35:06 -05:00
Alexander Larsson
fd964ca178 textview: Only clear the layout in style_update if the font actually changes 2012-12-06 21:16:19 +01:00
Benjamin Otte
055b5d83d5 gtk: Use gtk_style_context_get()
... instead of soon-to-be-deprecated gtk_style_context_get_font().
2012-12-06 02:57:18 +01:00
Matthias Clasen
8c3a668d52 Add a way to test touch features
The GTK_TEST_TOUCHSCREEN envvar is now checked in entries
and textviews to allow testing of text handles with other
kinds of devices.
2012-09-03 00:19:46 -04:00
Carlos Garnacho
5bda3a001d Implement touch text selection in GtkTextView
GtkTextHandle is used to indicate both the cursor position
and the selection bound, dragging the handles will modify
the selection and scroll if necessary.

Backwards text selection is also blocked for touch devices,
so the handles don't get inverted positions and possibly
obscure portions of the selected text.
2012-09-03 00:19:46 -04:00
Matthias Clasen
0cb56312b9 Trivial: Fix a whitespace messup
Pointed out by Carlos Garnacho in bug 651244.
2012-08-25 14:24:20 -04:00
Cosimo Cecchi
4e9f4fbc77 textview: fix a typo in method gtk-doc annotation
This was causing a warning from the introspection scanner.
2012-08-21 11:14:46 +02:00
Matthias Clasen
0101a735a3 Add documentation
Document the new API and properties, and their interaction with
existing properties.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:22 -04:00
Matthias Clasen
7d1c1a8d20 GtkTextView: Add input purpose and hints
Add input-purpose and input-hints properties and pass these through
to the GtkIMContext.

https://bugzilla.gnome.org/show_bug.cgi?id=651244
2012-08-20 18:54:22 -04:00
Bastien Nocera
c1f01eb929 Add support for disabling middle click paste
Adds a gtk-enable-primary-paste setting that is backed by
and X setting, and make GtkEntry and GtkTextView respect it.

https://bugzilla.gnome.org/show_bug.cgi?id=665243
2012-05-03 21:59:54 -04:00
Benjamin Otte
3610ef90c3 Revert part of "textview: Remove extra magic for drawing children"
This partially reverts commit df37446f9b.
The commit changed API that was public (or at least semi-public) and
it's not worth changing that.

The original bug should still be fixed.

https://bugzilla.gnome.org/show_bug.cgi?id=673839
2012-04-10 16:21:07 +02:00
Benjamin Otte
df37446f9b textview: Remove extra magic for drawing children
Instead, just draw the children. The cairo code will keep track of
things, so there's no need to track things.
Also, the old code was doing it wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=672544
2012-04-07 13:01:25 +02:00
Benjamin Otte
917ca6a802 gtk: Don't call gdk_window_process_updates() when scrolling
This can cause lagging when scrolling as it causes us to repaint
on every scroll event. This wasn't historically a great problem,
but with smooth scrolling we get a lot more events, so this
now creates visible lagging on slower machines.
2012-04-05 15:48:51 +02:00
Daniel Stone
134ef22a4e Add smooth-scroll to GtkTextView event mask
Without any extra supporting code, just adding GTK_SMOOTH_SCROLL_MASK to
the event mask for GtkTextView makes GEdit do the right thing and scroll
smoothly.  Lovely.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>

https://bugzilla.gnome.org/show_bug.cgi?id=671488
2012-03-06 21:45:09 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Carlos Garnacho
1c45afaf95 textview: Set background on the widget's window
The widget window is usually covered by the bin_window.
Its background color will become relevant when we introduce
kinetic scrolling with overshooting.
2012-02-23 22:29:31 -05:00
Carlos Garnacho
ce23d52592 textview: Also cancel DnD on ::grab-notify
If a drag operation is about to start when the drag
device is grabbed somewhere else, unset drag start x/y,
otherwise the drag will start anyway.
2012-02-23 16:46:08 -05:00
Carlos Garcia Campos
4e41b5c5fd gtktextview: Use symbolic names for button numbers 2012-01-27 09:47:44 +01:00
Benjamin Otte
ff1e1e1f91 a11y: Disconnect from buffer signals
This way, we don't get crashes when the buffer is still in use after a
TextView gets finalized.

https://bugzilla.gnome.org/show_bug.cgi?id=667632
2012-01-12 04:45:34 +01:00
Matthias Clasen
020c1846b7 Use the workarea when placing popups
This uses the new workarea API to avoid placing popups underneath
panels, docks, etc.
2011-12-18 14:29:16 -05:00
Paolo Borelli
2ef5844bac Introduce gtk_render_insertion_cursor
The new function provides an API that takes the PangoLayout and index
as input params, this way it handles strong and weak cursors internally
factoring out all code duplicated in the widgets that need to render
cursors.

https://bugzilla.gnome.org/show_bug.cgi?id=640317
2011-12-01 01:22:39 +01:00
Matthias Clasen
41d4229155 Pop up context menus at the right device
When multiple pointers are in play, we need to be careful
not to loose track of the device between receiving a button
press and popping up a menu.

https://bugzilla.gnome.org/show_bug.cgi?id=663396
2011-11-05 01:24:17 -04:00
Michael Natterer
2d3db3421f Bug 659406 - Abstract what triggers a context menu
Add gdk_event_triggers_context_menu(), using the new modifier
abstraction API. Remove _gtk_button_event_triggers_context_menu()
and port all callers.
2011-09-27 15:45:18 +02:00
Michael Natterer
11f8c1ba6f gtk: remove the private GTK_EXTEND/MODIFY_SELECTION_MOD_MASK
and use the new public modifier abstraction API instead.
2011-09-27 12:06:10 +02:00
Michael Natterer
b663f3a00b Bug 659406 - Abstract what triggers a context menu
Add _gtk_button_event_triggers_context_menu() and use it instead
of checking for event->button == 3, so context menus are invoked
correctly on the Mac.
2011-09-26 16:01:50 +02:00
Michael Natterer
0955a59563 app: abstract which modifiers are used for extending and modifying selections
which are SHIFT and MOD2 on the Mac, and SHIFT and CONTROL otherwise.
Use the new define all over the place and rename variables and
members to not say "shift" or "control".
2011-09-26 16:01:50 +02:00
Benjamin Otte
bd8e9085ab textview: Fix comparison being the wrong way
Keynav failed when the position did _not_ change.
2011-09-23 22:24:00 +02:00
Matthias Clasen
2ba9c4b4a7 Make focus rectangles optional
This commit introduces a new setting, gtk-visible-focus, backed
by the Gtk/VisibleFocus X setting. Its three values control how
focus rectangles are displayed.

'always' is equivalent to the traditional GTK+ behaviour of always
rendering focus rectangles.

'never' does what it says, and is intended for keyboardless
situations, e.g. tablets.

'automatic' hides focus rectangles initially, until the user
interacts with the keyboard, at which point focus rectangles
become visible.

https://bugzilla.gnome.org/show_bug.cgi?id=649567
2011-08-10 16:34:20 +02:00
Matthias Clasen
3f9d39ffce Initial move GailTextView -> GtkTextViewAccessible
This just does the renaming, and drops the factory.
2011-07-05 16:08:09 -04:00
Matthias Clasen
d5dad6412b Give this code a chance to work
At least it does not get uninitialized variable warnings now.
2011-06-14 21:44:12 -04:00
Ignacio Casal Quinteiro
391917063e textview: do not destroy the layout in unrealize
Now instead of invalidating when we create the layout we invalidate
when we realize the widget and we remove the invalidation when
unrealizing. It was pointless too destroying the layout in unrealize
as at the end what we just wanted was to remove the invalidation idles.
2011-06-12 17:54:07 +02:00
Matthew Barnes
54c3f05848 Desensitize "Select All" when GtkEntry is empty
This avoids possible confusion in some situations, and
selecting an empty string is not very useful.

https://bugzilla.gnome.org/show_bug.cgi?id=647962
2011-04-26 07:56:09 -04:00
Ignacio Casal Quinteiro
76a571b61e [textview] remove idles when unmapping
This avoids the textview taking the whole cpu when it is hidden.
2011-04-17 16:10:48 +02:00
Matthias Clasen
a1f200426b GtkTextViewPrivate: Improve struct packing 2011-04-12 12:48:30 -04:00
Murray Cumming
f91c04e284 Minor documentation improvements
Mostly correcting it's to its and changing some , to .
2011-02-23 10:26:21 +01:00
Matthias Clasen
beb8c290d1 Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
2011-02-07 07:30:37 -05:00
Krzesimir Nowak
d688343a31 Check if buffer is NULL after setting it to NULL, not before.
This catches cases when "notify::buffer" handler does not recreate
the buffer again, which could end in reference leak.

https://bugzilla.gnome.org/show_bug.cgi?id=634677
2011-01-28 20:49:47 +01:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Matthias Clasen
2f7245699b Add gtk_text_view_get_cursor_locations
In GTK 3.0 it's no longer possible to e.g. pop up something
at a text view's cursor (this wasn't exactly possible before
either without including gtktextlayout, but this is a quite
special need anyway).
2011-01-19 17:01:19 -05:00
Matthias Clasen
abc8ac1a8b Move GtkSelection docs inline
At the same time, move private selection API to gtkselectionprivate.h
2011-01-14 19:20:56 -05:00
Sébastien Granjoux
8f6cd8d86d Fix bgo #638017 Crash in gtk_text_view_set_tabs() 2011-01-10 21:07:32 -05:00
Paolo Borelli
a67507a53e Set the proper css class when getting attributes. 2011-01-10 21:58:29 +01:00
Benjamin Otte
cc879a6028 textview: Update adjustment usage for sealing
Also rename all variables named "adj" to "adjustment", like they're
called everywhere else.
2011-01-05 23:50:22 +01:00
Benjamin Otte
58fa980d12 textview: Update adjustment usage for sealing 2011-01-05 14:36:11 +01:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Matthias Clasen
8bdb44fd47 Remove an outdated doc statement.
https://bugzilla.gnome.org/show_bug.cgi?id=553404
2011-01-04 11:55:56 -05:00
Ignacio Casal Quinteiro
9d64a5833d Fix docs. 2010-12-28 11:18:01 +01:00
Benjamin Otte
8f1f743903 gtk: Use g_object_unref instead of gdk_cursor_unref 2010-12-21 12:07:05 -05:00
Javier Jardón
2b7afcdd79 gtk/gtktextview.c: Use accessor functions to access GtkSelectionData 2010-12-15 23:58:15 +00:00
Carlos Garnacho
66800aa212 Make GtkTextView use GtkStyleContext
GtkTextAppearance still uses GdkColors, even though it could
switch to GdkRGBA with little hassle as it seems sheldomly used
out there.
2010-12-15 03:17:58 +01:00
Matthias Clasen
83204928b9 Don't access GdkDragContext fields directly
Instead use the accessors.
2010-12-10 00:59:07 -05:00
Javier Jardón
f90bdb33c8 docs: Move documentation to inline comments: GtkTextView 2010-11-06 03:26:14 +01:00
Tristan Van Berkom
c33a2b7237 Fixed remaining call to ->size_request in GtkTextView. 2010-10-27 23:34:58 +09:00
Tristan Van Berkom
1132f54dcc Removing size_request from GtkTextView 2010-10-27 23:25:05 +09:00
Tristan Van Berkom
3fe0fb4ed9 Added GtkScrollablePolicy property to scrollable interface
This patch adds the GtkScrollablePolicy type property to GtkScrollable
and implements it in all subclasses. GtkScrolledWindow observes this
property to make a good guess about when to show/hide scrollbars for
height-for-width content.

Most scrollable children do not do height-for-width *yet* but
most certainly will (toolpalette, treeview, iconview, textview
widgets all TODO), for scrollable widgets that do have a minimum
and natural size, it's important for them to observe the state
of this property in order to properly drive the scroll adjustments
according to the desired GtkScrollablePolicy. This patch makes
GtkViewport do this.

Patch also adds tests/testscrolledwindow.c to display the effects
of this property.
2010-10-26 10:15:56 +09:00
Matthias Clasen
0d9ebb501d Move min-display-width/height to GtkScrolledWindow
It is just too annoying to have to implement these properties in
every scrollable. Instead, we now have ::min-content-height/width
in GtkScrolledWindow.

We also add GtkScrollablePolicy to determine how to size the
scrollable content.
2010-10-22 19:21:17 +02:00
Alberto Garcia
d6a73fd5b0 Assign all g_signal_connect() and friends to gulong variables
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=87821
2010-10-22 18:58:47 +02:00
Tadej Borovšak
55196a705f Add GtkScrollable interface
The GtkScrollable interface provides "hadjustment" and "vadjustment"
properties that are used by GtkScrolledWindow. It replaces
the ::set_scroll_adjustment signal. The scrollable interface
also has ::min-display-width/height properties that can be
used to control the minimally visible part inside a scrolled window.
2010-10-22 11:03:45 +02:00
Michael Natterer
c2f29f2cef gtk: clean up GtkWidget signals
- add slots for damage-event, move-focus and keynav-failed
- reorder signals a bit so related stuff is grouped together
- some indentation fixes in the GtkWidgetClass
- remove the move-focus compat hack from GtkTextView
- turn the move-focus compat hack in GtkWindow into properly
  implementing GtkWidget::move-focus()
2010-10-20 17:02:38 +02:00
Emmanuele Bassi
2cc059a0e7 Split off gtkprivate.h
The gtkprivate.h header contains GtkWidget-specific private symbols that
are not useful except in a handful of cases. Basically everything
includes gtkprivate.h for the GTK_PARAM_* macros.

https://bugzilla.gnome.org/show_bug.cgi?id=632539
2010-10-20 10:34:26 +01:00
Benjamin Otte
14dc932fd1 gtk: Fix remaining mentions of gtk_container_propagate_expose()
That includes the gtkcontainer.h header file.

https://bugzilla.gnome.org/show_bug.cgi?id=630800
2010-09-29 14:14:20 +02:00
Javier Jardón
b072ea220c Remove unneded casts
As gtk_adjustment_new() returns a GtkAdjustment* now

https://bugzilla.gnome.org/show_bug.cgi?id=630731
2010-09-29 01:18:10 +02:00
Matthias Clasen
f53ad33994 Remove GtkObject completely 2010-09-26 22:18:19 -04:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -04:00
Benjamin Otte
19d1377494 textview: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:45 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
e10f5e9ad5 textview: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
00375c7692 textview: Port to draw vfunc 2010-09-26 15:11:37 +02:00
Benjamin Otte
2ee8fdb79b gtk: gdk_drawable_get_display() => gdk_window_get_display() 2010-09-26 15:11:33 +02:00
Benjamin Otte
e8a6bad00b gtk: Don't set colormap anymore when creating GDK windows
Colormaps are about to be removed, so not using them sounds like an
awesome idea.
2010-09-26 15:11:31 +02:00
Benjamin Otte
4138e86ad4 testview: Convert _gtk_text_util_create_rich_drag_icon() to use surfaces 2010-09-26 15:03:01 +02:00
Benjamin Otte
331999d84d textview: API: change gtk_text_layout_draw() to take a cairo_t
This simplifies the API a lot and allows more magic to happen later.
2010-09-26 15:03:01 +02:00
Benjamin Otte
5e4aaba482 gtk: Remove calls that try to set GDK_NO_BG on their windows
These calls aren't necessary anymore.
2010-09-26 15:03:00 +02:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Javier Jardón
9e81022bf6 Use gtk_size_request_get_size() instead deprecated gtk_widget_get_child_requisition()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629177
2010-09-13 21:26:01 +02:00
Tristan Van Berkom
73ea777c33 Fixed GtkTextView & GtkIconView to consult it's true previous size request
Fixed issues in my previous patch for bug 626939 removing GtkRequisition
cache: these widgets monitor the previous requested size and decide whether
to queue a resize when the content changes based on it's prior request.
2010-09-09 17:19:18 +09:00
Colin Walters
913cdf3be7 GDK: Prefix key names with KEY_
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.

For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.

Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
2010-09-08 18:51:44 -04:00
Javier Jardón
5533264958 gtk/gtktextview.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Tor Lillqvist
801875b805 Replace gtk_debug_flags with getter and setter functions
Preferrably should be made just into a local variable for libgtk like
_gdk_debug_flags for libgdk. But for now used by
gtk/tests/textbuffer.c and modules/printbackends/cups/gtkprintbackendcups.c.
2010-09-08 21:31:34 +03:00
Tristan Van Berkom
9934007420 Completely removed requisition cache from GtkWidget instance structure.
Since we have a new mechanism for requesting sizes: GtkSizeRequestIface;
it makes no sense to maintain this cache on the GtkWidget structure...
removing the requisition cache however does not break the old "size-request"
signal which is there for backwards compatability reasons.

In any case widget->requisition should not have been accessed,
gtk_widget_get_child_requisition() would have been the correct way
to consult the cache.

This commit also deprecates the newly added gtk_widget_get_requisition()
API and makes it fallback on gtk_size_request_get_size().
2010-09-08 18:50:24 +02:00
Matthias Clasen
5d6b21e7b2 Remove long-deprecated page-horizontally signal
This signal has been superseded by GTK_MOVEMENT_HORIZONTAL_PAGES
long ago. This breaks the GtkTextView ABI.
2010-08-28 19:26:42 -04:00
Javier Jardón
3a10216dd0 Use accessor functions to acces GtkContainer 2010-07-13 19:40:46 +02:00
Ignacio Casal Quinteiro
d219adfa5a Move sealed attributes to private struct. 2010-07-12 21:12:46 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Carlos Garnacho
385f83ff4a GtkTextView: Scroll on the pointer doing DnD. 2010-06-15 21:06:11 +02:00
Johan Dahlin
5c283cacbe [gtktreeview] Add a couple of annotations 2010-05-31 12:12:06 -03:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Javier Jardón
713f2b638e Use event instead key in the previous patch 2010-05-05 04:06:17 +02:00
Javier Jardón
7692a427a6 Added api to reset the im context in GtkTextView and GtkEntry
Also, added api to allow an input method to internally handle
key press and release events in the GtkTextView and GtkEntry
cases.
This is simply a wrapper to the gtk_im_context_filter_keypress()
function, but It's added to not access the ->im_context
directly.
Based on a Christian Dywan patch

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=163251
2010-05-05 03:14:28 +02:00
Mirsal Ennaime
5eaff47e85 Add accessors for GtkTextView adjustments
GtkTextView is missing accessors for its sealed hadjustment
and vadjustment members.
This patch adds gtk_text_view_get_hadjustment() and
gtk_text_view_get_vadjustment() to GtkTextView

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=616053
2010-04-27 02:23:07 +02:00
Javier Jardón
32b9aeaadd Don't use GTK_WIDGET_STATE in internal code anymore
Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-09 02:40:17 +01:00
Matthias Clasen
d84a831423 Don't scroll to insert after middle-click paste
Patch by Ignacio Casal Quinteiro, bug 612119.
2010-03-08 11:25:26 -05:00
Javier Jardón
1934de4b65 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_REALIZED)
Use new API instead: gtk_widget_set_realized ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-06 11:51:33 +01:00
Javier Jardón
16a59ad912 Deprecate widget flag: GTK_WIDGET_REALIZED
Use gtk_widget_get_realized() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:41:05 +01:00
Javier Jardón
483a5a9e1a Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_CAN_FOCUS)
Use new API instead: gtk_widget_set_can_focus ()
2010-03-02 04:42:54 +01:00
Javier Jardón
214a023e91 Deprecate widget flag: GTK_WIDGET_VISIBLE
Use gtk_widget_get_visible() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 07:52:07 +01:00
Javier Jardón
4232115e22 Deprecate widget flag: GTK_WIDGET_HAS_FOCUS
Use gtk_widget_has_focus() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 06:11:01 +01:00
Javier Jardón
a27d5a2c9e Deprecate widget flag: GTK_WIDGET_IS_SENSITIVE
Use gtk_widget_is_sensitive() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 05:32:51 +01:00
Javier Jardón
4f78f70b15 Deprecate widget flag: GTK_WIDGET_DRAWABLE
Use gtk_widget_is_drawable() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 04:55:55 +01:00
Christian Dywan
90f72a0d8f Implement "preedit-changed" in GtkEntry and GtkTextView
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=602284
2010-01-11 10:59:26 +01:00
Christian Dywan
bb1824c131 Deprecate flag macros for toplevel, state, no window and composite child
Deprecate widget flag macros GTK_WIDGET_STATE, GTK_WIDGET_SAVED_STATE,
GTK_WIDGET_FLAGS, GTK_WIDGET_TOPLEVEL, GTK_WIDGET_NO_WINDOW and
GTK_WIDGET_COMPOSITE_CHILD.

Also deprecate the type macros GTK_WIDGET_TYPE, GTK_OBJECT_TYPE_NAME and
GTK_OBJECT_TYPE which have become redundant.

Instances of GTK_WIDGET_TOPLEVEL are replaced with gtk_widget_is_toplevel,
GTK_WIDGET_TYPE is replaced with G_OBJECT_TYPE, GTK_WIDGET_COMPOSITE_CHILD
is replaced with use of the "composite-child" property and uses of
GTK_WIDGET_NO_WINDOW are adjusted to use gtk_widget_get_has_window.

Uses of GTK_WIDGET_SAVED_STATE and GTK_WIDGET_FLAGS inside GtkWidget are
changed to direct flag usage.

Documentation is updated to refer to gtk_widget_set_has_window and
gtk_widget_get_has_window.

Gail and tests are updated as well.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-01-04 07:57:05 +01:00
Matthias Clasen
c0d8b71bc5 Improve selection/arrow key behaviour in GtkTextView
This patch makes the text view behave more similar to entries.
Patch by Michael Natterer, see bug 50942
2009-12-21 11:29:12 -05:00
Hiroyuki Ikezoe
d3fab727ae Use g_value_dup_string instead.
g_value_get_string and g_strdup should be replaced by
g_value_dup_string.
2009-12-18 20:51:03 +01:00
Colin Walters
6529c07614 [introspection] Merge in Gtk-custom.c annotations
The Gtk-custom.c file in gir-repository contained a number of
introspection annotations.  Merge those into the GTK source files.

Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
2009-12-16 17:22:01 -02:00
Javier Jardón
62bfbe91d8 [gtk/gtktextview] Use {} in empty if..else blocks 2009-12-02 09:38:08 +01:00
Kristian Rietveld
a47aadb05e Protect gtk_text_view_scroll_mark_onscreen() from using invalid marks
Suggested by Paolo Borelli.
2009-09-04 17:40:12 +02:00
Kristian Rietveld
dcc87f7a67 Move mark check to gtk_text_view_scroll_to_mark()
Also use a different means to check that the given mark is in the text
view's buffer.  This will also play nice with anonymous and NULL marks.
Suggested by Paolo Borelli.
2009-09-04 17:08:29 +02:00
Kristian Rietveld
dc3fb714a0 Improve unsetting old buffer in gtk_text_view_set_buffer()
When unsetting the old buffer always set the buffer on the layout to
NULL.  More importantly, clear the pending scroll.  (The scroll is
handled in an idle, when not cleared an idle handler might touch the
layout later on, possibly corrupting the BTree).  Unref the buffer after
removing the selection from the clipboard, not before.  Patch merged
from maemo-gtk.
2009-09-04 14:06:59 +02:00
Kristian Rietveld
7a3d98324d Fail to scroll if the given mark is not in text view's current buffer
In gtk_text_view_queue_scroll() we need to verify if the given mark
exists in the text view's current buffer.  When not done, this can
result in corruption of the BTree data structure.  Patch merged from
maemo-gtk.
2009-09-04 14:06:58 +02:00
Kristian Rietveld
3a917a2a67 Update IM spot location before running _validate_onscreen()
Updating the IM spot location in gtk_text_view_value_changed() might
invalidate the layout, so we need to make sure that we update it before
validating the layout again.  Otherwise, the layout will be invalidated
right after validating it (possibly resulting in a failed
onscreen_validated assertion).  Patch merged from maemo-gtk.
2009-09-04 14:06:58 +02:00
Paolo Borelli
30ffad76f5 Bug 592003 - Shift+click should always modify selection
Shift-click inside an existing selection reduces the selection to the
range from the insert mark to the clicked point instead of removing the
selection. This makes GtkTextView more consistent with GtkEntry.
2009-08-17 17:07:50 +02:00
Matthias Clasen
d89c9911f0 Avoid warnings when unrealizing a text view
For some reason, input methods can emit preedit-changed when a
text view is unrealized, at which point the layout has already
been cleared. (#578221)
2009-04-07 19:28:29 -04:00
Matthias Clasen
d30ea97464 If additional areas got invalidated, don't try to add them to the paint
* gtk/gtktextview.c (gtk_text_view_paint): If additional areas got
        invalidated, don't try to add them to the paint region: in an expose
        handler, we cannot paint outside the area that was passed in, since
        drawing will be clipped. So stealing the update region from the
        window causes lost draws.
        Patch by Owen Taylor


svn path=/trunk/; revision=22442
2009-03-02 15:45:53 +00:00
Michael Natterer
f6eb9d4269 Bug 573383 – Setting a textview's buffer to NULL doesn't do a complete
2009-02-27  Michael Natterer  <mitch@imendio.com>

	Bug 573383 – Setting a textview's buffer to NULL doesn't do a
	complete job

	* gtk/gtktextview.c (gtk_text_view_set_buffer): always set
	text_view->layout's buffer, also if it's NULL.


svn path=/trunk/; revision=22414
2009-02-27 16:21:40 +00:00
Matthias Clasen
e380d4143d Be more careful with the beeps
svn path=/trunk/; revision=22262
2009-01-31 05:52:58 +00:00
Matthias Clasen
b9905c8fb5 Revert changes for bug 567124. Instead of trying to avoid
setting up the im context before the widget is realized, just
        reset it when the client window is set.

        * gtk/gtkimmulticontext.c: Reset the slave when a client window
        is set.

        * gtk/gtkimmodule.c
        * gtk/gtktextview.c: Revert changes for bug 567124.

svn path=/trunk/; revision=22214
2009-01-25 03:38:27 +00:00
Matthias Clasen
280eeb02e1 Don't set up im stuff if the widget is not realized.
* gtk/gtktextview.c: Don't set up im stuff if the widget
        is not realized.

        * gtk/gtkimmodule.c: Assert that we have a window.


svn path=/trunk/; revision=22193
2009-01-23 06:04:05 +00:00
Matthias Clasen
b6b5237663 Replace several implementation of blank cursor setting by
* gtk/gtkentry.c:
        * gtk/gtkfilechooserentry.c:
        * gtk/gtktextview.c: Replace several implementation of
        blank cursor setting by GDK_BLANK_CURSOR.


svn path=/trunk/; revision=22148
2009-01-20 02:45:19 +00:00
Matthias Clasen
3baf9b5e21 Correct some copy-and-paste mistakes in keybinding signal docs. Pointed
* gtk/gtkentry.c:
        * gtk/gtklabel.c:
        * gtk/gtktextview.c: Correct some copy-and-paste mistakes in
        keybinding signal docs. Pointed out by Pascal Terjan.


svn path=/trunk/; revision=22140
2009-01-19 05:01:35 +00:00
Murray Cumming
53097873ca documentation description: Mention the various properties and the
2009-01-15  Murray Cumming  <murrayc@murrayc.com>

* gtk/gtkimcontext.c: documentation description: Mention the various 
properties and the environment variable, with links to their 
 documentation.
* gtk/gtksettings.c:
* gtk/gtktextview.c: Make the im-module property documentation more 
expansive.

svn path=/trunk/; revision=22123
2009-01-15 16:53:27 +00:00
Matthias Clasen
5d4bb27b74 Bug 450716 – New API to change global IM
Requested by Daniel Elstner.

        * gtk/gtk.symbols:
        * gtk/gtkimmulticontext.[hc] (gtk_im_multicontext_set_context_id):
        New function to set the context id on a GtkIMMulticontext.

        * gtk/gtkentry.c:
        * gtk/gtktextview.c: Add a ::im-module property that can be
        set to override the global setting for the im module to be used.


svn path=/trunk/; revision=22113
2009-01-13 19:15:42 +00:00
Paolo Borelli
1a7c0ed099 Bug 492794 – Pasting external text at end of view yields wrong scrolling
2009-01-12  Paolo Borelli  <pborelli@katamail.com>

	Bug 492794 – Pasting external text at end of view yields wrong
	scrolling to mark

	* gtk/gtktextbuffer.[ch]:
	* gtk/gtktextview.c:
	Add a "paste-done" signal and use it to propelry scroll the
	view at the end of the pasted text in the case of an async
	paste. Patch by Ignacio Casal Quintero based on a patch by
	Yevgen Muntyan.


svn path=/trunk/; revision=22100
2009-01-12 17:07:35 +00:00
Claudio Saavedra
42cb64c2f6 Bug 567468 – no check for trailing != NULL in
2009-01-12  Claudio Saavedra  <csaavedra@igalia.com>

	Bug 567468 – no check for trailing != NULL in
	gtk_text_layout_get_iter_at_position()

	* gtk/gtktextlayout.c: (gtk_text_layout_get_iter_at_position):
	Check for trailing to be non-NULL.
	* gtk/gtktextview.c: (gtk_text_view_get_iter_at_position): document
	that trailing may be NULL.


svn path=/trunk/; revision=22090
2009-01-12 09:57:01 +00:00
Matthias Clasen
d9fc6d8abc Doc additions.
2008-12-29  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkentry.c:
        * gtk/gtktextview.c:
        * gtk/gtkeditable.c:
        * gtk/gtktextbuffer.c: Doc additions.



svn path=/trunk/; revision=22000
2008-12-29 20:39:42 +00:00
Sven Herzberg
2b31f26827 Document the "set-scroll-adjustments" signal
2008-12-11  Sven Herzberg  <sven@imendio.com>

	Document the "set-scroll-adjustments" signal

	Reviewed by Kristian Rietveld.

	* gtk/gtkiconview.c,
	* gtk/gtklayout.c,
	* gtk/gtktextview.c,
	* gtk/gtktreeview.c,
	* gtk/gtkviewport.c: added proper documentation for the signal


svn path=/trunk/; revision=21871
2008-12-11 13:09:27 +00:00
Paolo Borelli
05dba4badb Bug 526234 - make shift+ctrl+del delete till the end of line
2008-08-12  Paolo Borelli  <pborelli@katamail.com>

	Bug 526234 - make shift+ctrl+del delete till the end of line

	* gtk/gtktextview.c: add shift+ctrl+del and shift+ctrl+backspace
	keyboard shortcuts to delete to the end/start of the current line.


svn path=/trunk/; revision=21103
2008-08-12 17:21:13 +00:00
Sven Neumann
b699ac5853 gtk/gtkaccellabel.c gtk/gtkaction.c gtk/gtkclist.c gtk/gtkcolorbutton.c
2008-08-12  Sven Neumann  <sven@gimp.org>

	* gtk/gtkaccellabel.c
	* gtk/gtkaction.c
	* gtk/gtkclist.c
	* gtk/gtkcolorbutton.c
	* gtk/gtkctree.c
	* gtk/gtkdialog.c
	* gtk/gtkdnd-quartz.c
	* gtk/gtkdnd.c
	* gtk/gtkentry.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkfilesel.c
	* gtk/gtkgamma.c
	* gtk/gtkiconview.c
	* gtk/gtkkeyhash.c
	* gtk/gtklabel.c
	* gtk/gtkmenu.c
	* gtk/gtkmenubar.c
	* gtk/gtkpaned.c
	* gtk/gtkrecentchooserdialog.c
	* gtk/gtkrecentchooserutils.c
	* gtk/gtkselection.c
	* gtk/gtksizegroup.c
	* gtk/gtktextbtree.c
	* gtk/gtktextbuffer.c
	* gtk/gtktextview.c
	* gtk/gtktoolbar.c
	* gtk/gtktreemodel.c
	* gtk/gtkuimanager.c
	* gtk/gtkwindow-decorate.c
	* gtk/gtkwindow.c: use canonical signal names in some more places
	that I missed earlier. Also changed this in the documentation and
	comments.


svn path=/trunk/; revision=21094
2008-08-12 14:37:03 +00:00
Michael Natterer
d9d3379698 gtk/gtkaccellabel.c gtk/gtkcalendar.c gtk/gtkclist.c gtk/gtkentry.c
2008-08-12  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkaccellabel.c
	* gtk/gtkcalendar.c
	* gtk/gtkclist.c
	* gtk/gtkentry.c
	* gtk/gtkeventbox.c
	* gtk/gtkfilechooserbutton.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkhandlebox.c
	* gtk/gtkhsv.c
	* gtk/gtkiconview.c
	* gtk/gtkimage.c
	* gtk/gtklayout.c
	* gtk/gtklistitem.c
	* gtk/gtkmenuitem.c
	* gtk/gtkmessagedialog.c
	* gtk/gtknotebook.c
	* gtk/gtkpaned.c
	* gtk/gtkpathbar.c
	* gtk/gtkplug.c
	* gtk/gtkprintunixdialog.c
	* gtk/gtkrange.c
	* gtk/gtkrecentchooserdefault.c
	* gtk/gtkruler.c
	* gtk/gtksocket.c
	* gtk/gtktext.c
	* gtk/gtktextview.c
	* gtk/gtktoolbar.c
	* gtk/gtktreeitem.c
	* gtk/gtktreeview.c
	* gtk/gtkviewport.c
	* gtk/gtkwin32embedwidget.c: chain up unconditionally in
	realize(), unrealize(), map(), unmap(), style_set(),
	key_press_event() and size_request()


svn path=/trunk/; revision=21088
2008-08-12 09:44:32 +00:00
Michael Natterer
e18d3c6fd3 consistently chain up using GTK_FOO_CLASS(parent_class)->bar(instance)
2008-08-12  Michael Natterer  <mitch@imendio.com>

	* gtk/*.c: consistently chain up using
	GTK_FOO_CLASS(parent_class)->bar(instance) instead of
	(*GTK_FOO_CLASS(parent_class))->bar(instance).


svn path=/trunk/; revision=21085
2008-08-12 09:06:34 +00:00
Sven Neumann
e3c01cf601 gtk/gtktext.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
2008-08-08  Sven Neumann  <sven@gimp.org>

	* gtk/gtktext.c
	* gtk/gtktextbuffer.c
	* gtk/gtktextlayout.c
	* gtk/gtktexttagtable.c
	* gtk/gtktextview.c
	* gtk/gtktipsquery.c
	* gtk/gtktoolbar.c
	* gtk/gtktoolitem.c
	* gtk/gtktreeitem.c
	* gtk/gtktreemodelfilter.c
	* gtk/gtktreemodelsort.c
	* gtk/gtktreeviewcolumn.c: use canonical signal names.


svn path=/trunk/; revision=21045
2008-08-08 14:23:32 +00:00
Sven Neumann
867a82c36e gtk/gtkadjustment.c gtk/gtkclist.c gtk/gtkcolorsel.c gtk/gtkiconview.c
2008-08-08  Sven Neumann  <sven@gimp.org>

	* gtk/gtkadjustment.c
	* gtk/gtkclist.c
	* gtk/gtkcolorsel.c
	* gtk/gtkiconview.c
	* gtk/gtklayout.c
	* gtk/gtkprogress.c
	* gtk/gtkrange.c
	* gtk/gtkspinbutton.c
	* gtk/gtktext.c
	* gtk/gtktextview.c
	* gtk/gtktreeview.c
	* gtk/gtkviewport.c: use the canonical signal name 
"value-changed"
	instead of "value_changed".


svn path=/trunk/; revision=21041
2008-08-08 13:25:18 +00:00
Michael Natterer
b06c30bb51 use the simpler g_signal_override_class_handler() instead of
2008-07-21  Michael Natterer  <mitch@imendio.com>

	* gtk/gtktoolbar.c (gtk_toolbar_class_init): use the simpler
	g_signal_override_class_handler() instead of
	g_signal_override_class_closure().

	* gtk/gtktextview.c (gtk_text_view_class_init): ditto.

	(gtk_text_view_compat_move_focus): chain up using
	g_signal_chain_from_overridden_handler() instead of the generic
	g_signal_chain_from_overridden() which needs manual fiddling with
	millions of GValues.


svn path=/trunk/; revision=20880
2008-07-21 12:27:30 +00:00
Michael Natterer
7f00695920 remove _gtk_binding_signal_new().
2008-07-21  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkbindings.[ch]: remove _gtk_binding_signal_new().

	* gtk/gtkfilechooserdefault.c
	* gtk/gtkmenu.c
	* gtk/gtkmenushell.c
	* gtk/gtkscalebutton.c
	* gtk/gtktextview.c
	* gtk/gtktoolbar.c
	* gtk/gtkwidget.c: use g_signal_new_class_handler() instead. Add
	some missing I_() to the signal names.


svn path=/trunk/; revision=20874
2008-07-21 09:48:20 +00:00
Cody Russell
57223c9a05 Revert name change
svn path=/trunk/; revision=20724
2008-07-01 22:57:50 +00:00
Cody Russell
fce9c8b7d4 Practically everything changed.
2008-06-30  Cody Russell  <bratsche@gnome.org>

        * Practically everything changed.

        Change	all references	of GIMP	Toolkit	(and variations	of it)
        to GTK+	Toolkit, showing no mercy at all to our	beloved
	ancestry. (#540529)


svn path=/trunk/; revision=20709
2008-06-30 23:01:56 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Cody Russell
cd7376dd5e Bug 534463 - non-editable GtkTextView should not call
2008-05-25  Cody Russell  <bratsche@gnome.org>

        Bug 534463 - non-editable GtkTextView should not call
        gtk_im_context_focus_in	in focus	event

        * gtk/gtktextview.c: Add checks	to see	if the textview	is
        editable.  Patch by Wang Diancheng.


svn path=/trunk/; revision=20162
2008-05-25 22:58:55 +00:00
Michael Natterer
02fd7ba040 gtk/gtkcellrenderer.c gtk/gtkcellrendererpixbuf.c
2008-05-19  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkcellrenderer.c
	* gtk/gtkcellrendererpixbuf.c
	* gtk/gtkcellrenderertoggle.c
	* gtk/gtkimagemenuitem.c
	* gtk/gtkmenutoolbutton.c
	* gtk/gtkoptionmenu.c
	* gtk/gtkstatusbar.c
	* gtk/gtktextview.c: s/PROP_ZERO/PROP_0/g, remove LAST_PROP.


svn path=/trunk/; revision=20112
2008-05-19 14:15:34 +00:00
Matthias Clasen
0509519d35 Unify the handling of various "Enter" keysyms all over the place.
2008-02-12  Matthias Clasen  <mclasen@redhat.com>

        * gtk/*.c: Unify the handling of various "Enter" keysyms
        all over the place.  (#515047, Christian Persch)



svn path=/trunk/; revision=19528
2008-02-12 15:51:09 +00:00
Michael Natterer
2bf99bb12e gtk/gtktextchild.c meant to use G_STRFUNC, not G_STRLOC...
2008-01-28  Michael Natterer  <mitch@imendio.com>

	* gtk/gtktextchild.c
	* gtk/gtktextview.c: meant to use G_STRFUNC, not G_STRLOC...


svn path=/trunk/; revision=19418
2008-01-28 15:16:13 +00:00
Michael Natterer
f6f6a2a4b0 gtk/gtktextchild.c use G_STRLOC instead of G_GNUC_FUNCTION (which is
2008-01-28  Michael Natterer  <mitch@imendio.com>

	* gtk/gtktextchild.c
	* gtk/gtktextview.c: use G_STRLOC instead of G_GNUC_FUNCTION (which
	is deprecated now).


svn path=/trunk/; revision=19416
2008-01-28 13:01:01 +00:00
Johan Dahlin
71e9be7e6d Use G_OBJECT_WARN_INVALID_PROPERTY_ID consistently. Fixes #5075
2008-01-06  Johan Dahlin  <johan@gnome.org>

	* gtk/gtkcellrenderercombo.c:
	(gtk_cell_renderer_combo_get_property),
	(gtk_cell_renderer_combo_set_property):
	* gtk/gtkcombobox.c: (gtk_combo_box_set_property):
	* gtk/gtkcomboboxentry.c: (gtk_combo_box_entry_set_property):
	* gtk/gtknotebook.c: (gtk_notebook_set_property):
	* gtk/gtkspinbutton.c: (gtk_spin_button_set_property):
	* gtk/gtktextbuffer.c: (gtk_text_buffer_set_property),
	(gtk_text_buffer_get_property):
	* gtk/gtktextview.c: (gtk_text_view_set_property):
	* gtk/gtktogglebutton.c: (gtk_toggle_button_set_property):
	* gtk/gtktoolbutton.c: (gtk_tool_button_set_property),
	(gtk_tool_button_get_property):
	* gtk/gtktoolitem.c: (gtk_tool_item_set_property),
	(gtk_tool_item_get_property):
	* gtk/gtktreeview.c: (gtk_tree_view_set_property):
	* gtk/gtkwidget.c: (gtk_widget_set_property):
	* gtk/gtkwindow.c: (gtk_window_set_property):
	Use G_OBJECT_WARN_INVALID_PROPERTY_ID consistently.
	Fixes #5075

svn path=/trunk/; revision=19311
2008-01-06 03:28:40 +00:00
Paolo Borelli
540569dadb Use gtk_text_buffer_get_insert instead of get_mark. Fixes Bug 497164.
2007-11-17  Paolo Borelli  <pborelli@katamail.com>

	* gtk/gtktextbuffer.c:
	* gtk/gtktextlayout.c:
	* gtk/gtktextview.c:
	Use gtk_text_buffer_get_insert instead of get_mark. Fixes Bug 497164.


svn path=/trunk/; revision=18997
2007-11-17 10:18:13 +00:00
Yevgen Muntyan
c9371f873b Moved gtk_text_view_update_im_spot_location() calls into an idle, fixes
2007-11-11  Yevgen Muntyan  <muntyan@tamu.edu>

	* gtk/gtktextview.c: Moved gtk_text_view_update_im_spot_location()
	calls into an idle, fixes #494776.
	GtkTextViewPrivate:im_spot_idle, do_update_im_spot_location(),
	queue_update_im_spot_location(), flush_update_im_spot_location(): new
	field and functions to queue the call;
	(changed_handler): call queue_update_im_spot_location() instead of
	gtk_text_view_update_im_spot_location();
	(gtk_text_view_key_press_event): flush the idle here.


svn path=/trunk/; revision=18984
2007-11-11 19:07:27 +00:00
Michael Natterer
86994b49d3 merged patch from maemo-gtk which handles failed keynav correctly also
2007-09-21  Michael Natterer  <mitch@imendio.com>

	* gtk/gtktextview.c (gtk_text_view_move_cursor_internal)
	(gtk_text_view_move_viewport): merged patch from maemo-gtk which
	handles failed keynav correctly also when the cursor is invisible.
	(Tommi Komulainen)


svn path=/trunk/; revision=18851
2007-09-21 14:29:08 +00:00
Matthias Clasen
d5a7784394 Initialized GValues before unsetting them. (#457720)
2007-07-19  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextview.c (gtk_text_view_compat_move_focus):
        Initialized GValues before unsetting them.  (#457720)



svn path=/trunk/; revision=18497
2007-07-19 13:45:12 +00:00
Matthias Clasen
89b8b44a61 Add docs
svn path=/trunk/; revision=18455
2007-07-12 06:09:07 +00:00
Yevgen Muntyan
ef1e05f7de Implement block-cursor for overwrite mode. (#80378)
2007-06-12  Yevgen Muntyan  <muntyan@tamu.edu>

        * gtk/gtkentry.c (gtk_entry_expose), (gtk_entry_toggle_overwrite),
        (gtk_entry_draw_cursor):
        * gtk/gtkstyle.c (_gtk_widget_get_cursor_gc),
        (_gtk_widget_get_cursor_color):
        * gtk/gtkstyle.h:
        * gtk/gtktextdisplay.c (gtk_text_renderer_prepare_run),
        (gtk_text_renderer_draw_shape), (text_renderer_set_state),
        (render_para):
        * gtk/gtktextlayout.c (gtk_text_layout_set_overwrite_mode),
        (gtk_text_layout_invalidate_cache), (get_block_cursor),
        (add_cursor), (gtk_text_layout_get_line_display),
        (_gtk_text_layout_get_block_cursor):
        * gtk/gtktextlayout.h:
        * gtk/gtktextutil.c (layout_get_char_width),
        (_gtk_text_util_get_block_cursor_location):
        * gtk/gtktextutil.h:
        * gtk/gtktextview.c (gtk_text_view_set_editable),
        (gtk_text_view_toggle_overwrite), (gtk_text_view_set_overwrite),
        (gtk_text_view_ensure_layout), (text_window_invalidate_cursors):
        Implement block-cursor for overwrite mode.  (#80378)


svn path=/trunk/; revision=18108
2007-06-12 05:32:57 +00:00
Michael Natterer
e631aef881 Move "move-focus" signals from several widgets to GtkWidget to enable more
2007-06-04  Michael Natterer  <mitch@imendio.com>

	Move "move-focus" signals from several widgets to GtkWidget to
	enable more flexible costomization of keyboard navigation via
	bindings. Fixes bug #414947.

	* gtk/gtkwidget.c: add "move-focus" binding signal, default to
	calling the toplevel GtkWindow's "move-focus" vfunc.

	* gtk/gtktextview.[ch]
	* gtk/gtkwindow.[ch]: remove "move-focus" signals and add compat
	code that makes sure that both emitting the signal on the widget
	and overriding the virtual functions keeps working as before.

	* gtk/gtktoolbar.c: remove "move-focus" signal here too and use
	GtkWidget's signal. This change slightly changes keyboard
	navigation in toolbars. I'll fix the behavior if somebody can
	explain me if and how exactly the new behavior is broken.


svn path=/trunk/; revision=18025
2007-06-04 15:00:22 +00:00
Matthias Clasen
5622e4becd Improve docs
svn path=/trunk/; revision=17957
2007-05-28 05:18:51 +00:00
Matthias Clasen
5d5e545924 Fix the build
svn path=/trunk/; revision=17870
2007-05-19 02:12:07 +00:00
Matthias Clasen
26e5d4d6f7 Add a toggle-cursor-visibility keybinding signal, and bind F7 to it.
2007-05-18  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextview.c: Add a toggle-cursor-visibility keybinding
        signal, and bind F7 to it.  (#380048, Tim Miao)



svn path=/trunk/; revision=17869
2007-05-18 22:29:55 +00:00
Michael Natterer
f4df1a5245 call gdk_event_request_motions(event) so selecting works with XInput
2007-05-11  Michael Natterer  <mitch@imendio.com>

	* gtk/gtktextview.c (selection_motion_event_handler): call
	gdk_event_request_motions(event) so selecting works with
	XInput devices too. Spotted by Tommi Komulainen.


svn path=/trunk/; revision=17820
2007-05-11 16:03:48 +00:00
Matthias Clasen
d2ab216455 Allow indents to be negative. (#Bug 434308)
2007-04-30  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextview.c: Allow indents to be negative.  (#Bug 434308)


svn path=/trunk/; revision=17736
2007-04-30 15:17:45 +00:00
Matthias Clasen
3a3bce193e Set first_para_mark to NULL. (#396805, Colin Leroy, patch by Mariano
2007-03-11  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextview.c (gtk_text_view_set_buffer): Set first_para_mark
        to NULL.  (#396805, Colin Leroy, patch by Mariano Suárez-Alvarez)



svn path=/trunk/; revision=17481
2007-03-12 02:32:15 +00:00
Matthias Clasen
e643f1ee89 Get rid of the unused event argument. Update all callers.
2007-03-09  Matthias Clasen <mclasen@redhat.com>

        * gtk/gtktextview.c (gtk_text_view_end_selection_drag):
        Get rid of the unused event argument. Update all callers.

        * gtk/gtktextview.c (gtk_text_view_focus_out): Call
        gtk_text_view_end_selection_drag.  (#351671, Boyd Timothy)



svn path=/trunk/; revision=17449
2007-03-10 03:51:37 +00:00
Tim Janik
caa4d15dab call gdk_event_request_motions() for new motion events after receiving
Tue Feb  6 15:53:59 2007  Tim Janik  <timj@imendio.com>

        * gtk/gtktextview.c (gtk_text_view_motion_event):
        * gtk/gtkspinbutton.c (gtk_spin_button_motion_notify):
        * gtk/gtkaboutdialog.c (credits_motion_notify_event):
        * gtk/gtkhruler.c (gtk_hruler_motion_notify):
        * gtk/gtkvruler.c (gtk_vruler_motion_notify): 
        * gtk/gtkentry.c (gtk_entry_motion_notify):
        * gtk/gtktooltip.c (_gtk_tooltip_handle_event):
        * gtk/gtkhsv.c (gtk_hsv_motion): call gdk_event_request_motions()                              
        for new motion events after receiving motion hints.

        * gdk/gdkevents.[hc]: added gdk_event_request_motions().



svn path=/trunk/; revision=17269
2007-02-06 14:53:35 +00:00
Matthias Clasen
d8723a7375 Call text_window_realize() with the correct parameters. (#393813, Yevgen
2007-01-07  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextview.c (gtk_text_view_set_border_window_size):
        Call text_window_realize() with the correct parameters.
        (#393813, Yevgen Muntyan)



svn path=/trunk/; revision=17101
2007-01-07 07:19:07 +00:00
Matthias Clasen
1d5fdd6209 Rework the beep-on-uninserted-text by calling the input method regardless
2007-01-03  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextview.c: Rework the beep-on-uninserted-text
        by calling the input method regardless of editability,
        and beeping from the commit/preedit-changed handlers.
        (#390514, Yevgen Muntyan)



svn path=/trunk/; revision=17054
2007-01-04 06:09:13 +00:00
Matthias Clasen
2b267db6db Try harder not to beep on events which are not meant to insert stuff in
2007-01-02  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextbuffer.c (gtk_text_view_key_press_event):
        Try harder not to beep on events which are not meant to
        insert stuff in the buffer.  (#390514, Yevgen Muntyan)



svn path=/trunk/; revision=17020
2007-01-02 15:49:31 +00:00
Matthias Clasen
a441ab05f1 Fix a segfault in horizontal scrolling
svn path=/trunk/; revision=17011
2007-01-02 07:05:53 +00:00
Matthias Clasen
ea72820911 Remove the scroll timeout. (#390872, Yevgen Muntyan)
2006-12-30  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextview.c (gtk_text_view_destroy): Remove the
        scroll timeout.  (#390872, Yevgen Muntyan)



svn path=/trunk/; revision=16993
2006-12-31 06:00:08 +00:00
Matthias Clasen
571f4ff972 Don't install cursors on insensitive widgets. (#358864, Jan Schampera)
2006-12-30  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkentry.c:
        * gtk/gtklabel.c:
        * gtk/gtkpaned.c:
        * gtk/gtkstatusbar.c:
        * gtk/gtktextview.c: Don't install cursors on insensitive
        widgets.  (#358864, Jan Schampera)

svn path=/trunk/; revision=16983
2006-12-31 00:36:03 +00:00
Matthias Clasen
4193650dc9 Don't die in an assertion if focus went missing. Just warn, clean up and
2006-12-29  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkentry.c (blink_cb):
        * gtk/gtktextview.c (blink_cb): Don't die in an assertion
        if focus went missing. Just warn, clean up and continue.
        (#374378)
2006-12-29 19:26:34 +00:00
Matthias Clasen
e7e84bb8ec Remove debug output.
2006-12-24  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextutil.c: Remove debug output.

        * gtk/gtktextview.c: Improve the DND scrolling
        behaviour.  (#92387, Carlos Garnacho Parro)
2006-12-25 03:57:39 +00:00
Matthias Clasen
721c3bc101 Replace a lot of idle and timeout calls by the new gdk_threads api.
2006-12-22  Matthias Clasen  <mclasen@redhat.com>

        * *.c: Replace a lot of idle and timeout calls by
        the new gdk_threads api.
2006-12-22 19:10:43 +00:00
Matthias Clasen
10ae5ad60f Silently return if a drag is already in progress, rather than asserting.
2006-12-20  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtktextview.c (gtk_text_view_start_selection_drag):
        Silently return if a drag is already in progress, rather
        than asserting.  (#335622, Li Yuan, testcase by Erwann Chenede)
2006-12-20 20:57:49 +00:00
Michael Natterer
c7945c9502 remove FIXME #include that is no longer needed.
2006-12-03  Michael Natterer  <mitch@gimp.org>

	* gtk/gtktextview.c: remove FIXME #include that is no longer needed.
2006-12-03 21:16:42 +00:00
Tim Janik
ee294b1caf applied patch by Colin Leroy for Control+GDK_KP_Left to move one word to
Mon Nov 27 12:27:06 2006  Tim Janik  <timj@imendio.com>

        * gtk/gtktextview.c: applied patch by  Colin Leroy for
        Control+GDK_KP_Left to move one word to the left, #356255.
2006-11-27 11:51:54 +00:00
Michael Natterer
7f374a74ba Add new infrastructure for notifications of failed keyboard navigation and
2006-11-16  Michael Natterer  <mitch@imendio.com>

	Add new infrastructure for notifications of failed keyboard
	navigation and navigation with restricted set of keys.

	The patch handles configurable beeping, navigating the GUI with
	cursor keys only (as in phone environments), and configurable
	wrap-around. Fixes bugs #322640, #70986, #318827, #334726, #334742
	and #309291.

	* gtk/gtksettings.c: added properties gtk-keynav-cursor-only,
	gtk-keynav-wrap-around and gtk-error-bell.

	* gtk/gtkwidget.[ch]: added new signal "keynav-failed" and public
	API to emit it. Added New function gtk_widget_error_bell() which
	looks at the gtk-error-bell setting and calls gdk_window_beep()
	accordingly.

	* gtk/gtk.symbols: add the new widget symbols.

	* gtk/gtkcellrendereraccel.c
	* gtk/gtkimcontextsimple.c
	* gtk/gtkmenu.c
	* gtk/gtknotebook.c: use gtk_widget_error_bell() or look at the
	gtk-error-bell setting instead of calling gdk_display_beep()
	unconditionally.

	* gtk/gtkcombobox.c
	* gtk/gtkentry.c
	* gtk/gtkiconview.c
	* gtk/gtklabel.c
	* gtk/gtkmenushell.c
	* gtk/gtkspinbutton.c
	* gtk/gtktextview.c
	* gtk/gtktreeview.c: call gtk_widget_error_bell() on failed keynav.

	* gtk/gtkentry.c
	* gtk/gtklabel.c
	* gtk/gtkrange.c
	* gtk/gtktextview.c: consult gtk_widget_keynav_failed() on failed
	cursor navigation and leave the widget if it returns FALSE.

	* gtk/gtkmenushell.c
	* gtk/gtknotebook.c: only wrap around if gtk-keynav-wrap-around
	is TRUE.

	* gtk/gtkradiobutton.c: ask gtk_widget_keynav_failed() to decide
	whether to to wrap-around, and don't select active items on cursor
	navigation if gtk-keynav-cursor-only is TRUE. Should look at
	gtk-keynav-wrap-around too, will look into that.
2006-11-16 12:56:30 +00:00
Matthias Clasen
5b0de8d597 Stop cursor blinking after a configurable timeout. (#353670, #352442,
Stop cursor blinking after a configurable timeout.
	(#353670, #352442, Arjan van de Ven, Manu Cornet)

	* gtk/gtksettings.c (gtk_settings_class_init): Add a
	gtk-cursor-blink-timeout setting, which specifies the number
	of seconds that the cursor should blink after a user interaction.
	The default value is G_MAXINT to preserve the current behaviour.

	* gtk/gtkentry.c (blink_cb): Stop blinking after blink-timeout
	seconds.

	* gtk/gtkentry.c (gtk_entry_completion_key_press)
	(gtk_entry_button_press, gtk_entry_focus_in): Reset the
	blink timer.

	* gtk/gtktextview.c (blink_cb): Stop blinking after blink-timeout
	seconds.

	* gtk/gtktextview.c (gtk_text_view_key_press_event)
	(gtk_text_view_button_press_event, gtk_text_view_focus_in_event):
	Reset the blink timer.
2006-09-01 02:14:30 +00:00