Commit Graph

420 Commits

Author SHA1 Message Date
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