gtk/gdk/gdkevents.h

590 lines
15 KiB
C
Raw Normal View History

/* GDK - The GIMP Drawing Kit
2005-07-12 05:09:13 +00:00
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* 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/.
2005-07-12 05:09:13 +00:00
*/
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#ifndef __GDK_EVENTS_H__
#define __GDK_EVENTS_H__
#include <gdk/gdkcolor.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkdnd.h>
2010-05-25 22:38:44 +00:00
#include <gdk/gdkdevice.h>
G_BEGIN_DECLS
#define GDK_TYPE_EVENT (gdk_event_get_type ())
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
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
#define GDK_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 20)
typedef struct _GdkEventAny GdkEventAny;
typedef struct _GdkEventExpose GdkEventExpose;
typedef struct _GdkEventNoExpose GdkEventNoExpose;
typedef struct _GdkEventVisibility GdkEventVisibility;
typedef struct _GdkEventMotion GdkEventMotion;
typedef struct _GdkEventButton GdkEventButton;
typedef struct _GdkEventScroll GdkEventScroll;
typedef struct _GdkEventKey GdkEventKey;
typedef struct _GdkEventFocus GdkEventFocus;
typedef struct _GdkEventCrossing GdkEventCrossing;
typedef struct _GdkEventConfigure GdkEventConfigure;
typedef struct _GdkEventProperty GdkEventProperty;
typedef struct _GdkEventSelection GdkEventSelection;
typedef struct _GdkEventOwnerChange GdkEventOwnerChange;
typedef struct _GdkEventProximity GdkEventProximity;
typedef struct _GdkEventClient GdkEventClient;
typedef struct _GdkEventDND GdkEventDND;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
typedef struct _GdkEventWindowState GdkEventWindowState;
typedef struct _GdkEventSetting GdkEventSetting;
typedef struct _GdkEventGrabBroken GdkEventGrabBroken;
typedef union _GdkEvent GdkEvent;
typedef void (*GdkEventFunc) (GdkEvent *event,
gpointer data);
/* Event filtering */
/**
* GdkXEvent:
*
* Used to represent native events (<type>XEvent</type>s for the X11
* backend, <type>MSG</type>s for Win32).
*/
typedef void GdkXEvent; /* Can be cast to window system specific
* even type, XEvent on X11, MSG on Win32.
*/
/**
* GdkFilterReturn:
* @GDK_FILTER_CONTINUE: event not handled, continue processing.
* @GDK_FILTER_TRANSLATE: native event translated into a GDK event and stored
* in the <literal>event</literal> structure that was passed in.
* @GDK_FILTER_REMOVE: event handled, terminate processing.
*
* Specifies the result of applying a #GdkFilterFunc to a native event.
*/
typedef enum {
GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */
GDK_FILTER_TRANSLATE, /* Native event translated into a GDK event and
stored in the "event" structure that was
passed in */
GDK_FILTER_REMOVE /* Terminate processing, removing event */
} GdkFilterReturn;
/**
* GdkFilterFunc:
* @xevent: the native event to filter.
* @event: the GDK event to which the X event will be translated.
* @data: user data set when the filter was installed.
*
* Specifies the type of function used to filter native events before they are
* converted to GDK events.
*
* When a filter is called, @event is unpopulated, except for
* <literal>event->window</literal>. The filter may translate the native
* event to a GDK event and store the result in @event, or handle it without
* translation. If the filter translates the event and processing should
* continue, it should return %GDK_FILTER_TRANSLATE.
*
* Returns: a #GdkFilterReturn value.
*/
typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
GdkEvent *event,
gpointer data);
/* Event types.
* Nothing: No event occurred.
* Delete: A window delete event was sent by the window manager.
* The specified window should be deleted.
* Destroy: A window has been destroyed.
* Expose: Part of a window has been uncovered.
* NoExpose: Same as expose, but no expose event was generated.
* VisibilityNotify: A window has become fully/partially/not obscured.
* MotionNotify: The mouse has moved.
* ButtonPress: A mouse button was pressed.
* ButtonRelease: A mouse button was release.
* KeyPress: A key was pressed.
* KeyRelease: A key was released.
* EnterNotify: A window was entered.
* LeaveNotify: A window was exited.
* FocusChange: The focus window has changed. (The focus window gets
* keyboard events).
* Resize: A window has been resized.
* Map: A window has been mapped. (It is now visible on the screen).
* Unmap: A window has been unmapped. (It is no longer visible on
* the screen).
* Scroll: A mouse wheel was scrolled either up or down.
*/
typedef enum
{
GDK_NOTHING = -1,
GDK_DELETE = 0,
GDK_DESTROY = 1,
GDK_EXPOSE = 2,
GDK_MOTION_NOTIFY = 3,
GDK_BUTTON_PRESS = 4,
GDK_2BUTTON_PRESS = 5,
GDK_3BUTTON_PRESS = 6,
GDK_BUTTON_RELEASE = 7,
GDK_KEY_PRESS = 8,
GDK_KEY_RELEASE = 9,
GDK_ENTER_NOTIFY = 10,
GDK_LEAVE_NOTIFY = 11,
GDK_FOCUS_CHANGE = 12,
GDK_CONFIGURE = 13,
GDK_MAP = 14,
GDK_UNMAP = 15,
GDK_PROPERTY_NOTIFY = 16,
GDK_SELECTION_CLEAR = 17,
GDK_SELECTION_REQUEST = 18,
GDK_SELECTION_NOTIFY = 19,
GDK_PROXIMITY_IN = 20,
GDK_PROXIMITY_OUT = 21,
GDK_DRAG_ENTER = 22,
GDK_DRAG_LEAVE = 23,
GDK_DRAG_MOTION = 24,
GDK_DRAG_STATUS = 25,
GDK_DROP_START = 26,
GDK_DROP_FINISHED = 27,
GDK_CLIENT_EVENT = 28,
GDK_VISIBILITY_NOTIFY = 29,
GDK_NO_EXPOSE = 30,
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
GDK_SCROLL = 31,
GDK_WINDOW_STATE = 32,
GDK_SETTING = 33,
GDK_OWNER_CHANGE = 34,
Bug 318807 – Offscreen windows and window redirection. 2008-03-18 10:49:20 Tim Janik <timj@imendio.com> * Applied pixmap redirection patch by Alexander Larsson with various updates from: Bug 318807 – Offscreen windows and window redirection. Updates: * updated docs to mention "Since 2.16". * tests/testgtk.c: fixed snapshooting pixmap leak. convert pixmap to pixbuf after snapshooting, to compensate for different bit depths (occurs when snapshooting ARGB visuals and displaying the pixmap in an RGB visual). * gdk/gdkwindow.[hc]: made GdkWindowRedirect private. * gdk/gdkwindow.c: removed damage idle handler, there's no aparent need for it. enqueue damage notification as GDK_DAMAGE events for each painting redirection at the start of the event queue. consider windows with a redirection fully visible when invalidating, and when updating from backing store. cleaned up stale variables. * gdk/gdkevents.c: added _gdk_event_queue_prepend(). * gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve, tree, drawingarea, text, handlebox, etc. clip the redirected window hierarchy to window sizes, the visible rectangles don't need to be taken into account here. extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable() in case pixmap visuals could mismatch. * gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect(). Base patch: * tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting of possibly obscured widgets into an offscreen pixmap. * gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap. * gtk/gtkmain.c: dispatch GDK_DAMAGE events. * gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent() implementations here, adapted them to propagate redirects to child windows. gdk_window_end_paint(): copy repainted window contents to redirection pixmap, clipped to visible region. queue GDK_DAMAGE event delivery. gdk_window_redirect_to_drawable(): install window painting redirection. gdk_window_remove_redirection(): remove previously installed redirection. * gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(), renamed _gdk_window_new() and _gdk_window_reparent(). * gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export gdk_window_redirect_to_drawable() and gdk_window_remove_redirection(). * gdk/gdkevents.h: added GDK_DAMAGE event type. * gdk/gdkevents.c: extract time and state from GDK_DAMAGE events. * gdk/gdkinternals.h: added internal prototypes. svn path=/trunk/; revision=20122
2008-05-21 19:04:24 +00:00
GDK_GRAB_BROKEN = 35,
GDK_DAMAGE = 36,
GDK_EVENT_LAST /* helper variable for decls */
} GdkEventType;
typedef enum
{
GDK_VISIBILITY_UNOBSCURED,
GDK_VISIBILITY_PARTIAL,
GDK_VISIBILITY_FULLY_OBSCURED
} GdkVisibilityState;
typedef enum
{
GDK_SCROLL_UP,
GDK_SCROLL_DOWN,
GDK_SCROLL_LEFT,
GDK_SCROLL_RIGHT
} GdkScrollDirection;
/* Types of enter/leave notifications.
* Ancestor:
* Virtual:
* Inferior:
* Nonlinear:
* NonlinearVirtual:
* Unknown: An unknown type of enter/leave event occurred.
*/
typedef enum
{
GDK_NOTIFY_ANCESTOR = 0,
GDK_NOTIFY_VIRTUAL = 1,
GDK_NOTIFY_INFERIOR = 2,
GDK_NOTIFY_NONLINEAR = 3,
GDK_NOTIFY_NONLINEAR_VIRTUAL = 4,
GDK_NOTIFY_UNKNOWN = 5
} GdkNotifyType;
/* Enter/leave event modes.
* NotifyNormal
* NotifyGrab
* NotifyUngrab
*/
typedef enum
{
GDK_CROSSING_NORMAL,
GDK_CROSSING_GRAB,
GDK_CROSSING_UNGRAB,
GDK_CROSSING_GTK_GRAB,
GDK_CROSSING_GTK_UNGRAB,
GDK_CROSSING_STATE_CHANGED
} GdkCrossingMode;
typedef enum
{
GDK_PROPERTY_NEW_VALUE,
GDK_PROPERTY_DELETE
} GdkPropertyState;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
typedef enum
{
GDK_WINDOW_STATE_WITHDRAWN = 1 << 0,
GDK_WINDOW_STATE_ICONIFIED = 1 << 1,
GDK_WINDOW_STATE_MAXIMIZED = 1 << 2,
GDK_WINDOW_STATE_STICKY = 1 << 3,
GDK_WINDOW_STATE_FULLSCREEN = 1 << 4,
GDK_WINDOW_STATE_ABOVE = 1 << 5,
GDK_WINDOW_STATE_BELOW = 1 << 6
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
} GdkWindowState;
typedef enum
{
GDK_SETTING_ACTION_NEW,
GDK_SETTING_ACTION_CHANGED,
GDK_SETTING_ACTION_DELETED
} GdkSettingAction;
typedef enum
{
GDK_OWNER_CHANGE_NEW_OWNER,
GDK_OWNER_CHANGE_DESTROY,
GDK_OWNER_CHANGE_CLOSE
} GdkOwnerChange;
struct _GdkEventAny
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
};
struct _GdkEventExpose
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkRectangle area;
cairo_region_t *region;
gint count; /* If non-zero, how many more events follow. */
};
struct _GdkEventNoExpose
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
};
struct _GdkEventVisibility
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkVisibilityState state;
};
struct _GdkEventMotion
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
gdouble x;
gdouble y;
gdouble *axes;
guint state;
gint16 is_hint;
GdkDevice *device;
gdouble x_root, y_root;
};
struct _GdkEventButton
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
gdouble x;
gdouble y;
gdouble *axes;
guint state;
guint button;
GdkDevice *device;
gdouble x_root, y_root;
};
struct _GdkEventScroll
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
gdouble x;
gdouble y;
guint state;
GdkScrollDirection direction;
GdkDevice *device;
gdouble x_root, y_root;
};
struct _GdkEventKey
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
guint state;
guint keyval;
gint length;
gchar *string;
guint16 hardware_keycode;
guint8 group;
guint is_modifier : 1;
};
struct _GdkEventCrossing
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkWindow *subwindow;
guint32 time;
gdouble x;
gdouble y;
gdouble x_root;
gdouble y_root;
GdkCrossingMode mode;
GdkNotifyType detail;
gboolean focus;
guint state;
};
struct _GdkEventFocus
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
gint16 in;
};
struct _GdkEventConfigure
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
2000-03-28 01:24:44 +00:00
gint x, y;
gint width;
gint height;
};
struct _GdkEventProperty
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkAtom atom;
guint32 time;
guint state;
};
struct _GdkEventSelection
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkAtom selection;
GdkAtom target;
GdkAtom property;
guint32 time;
2000-06-20 20:20:38 +00:00
GdkNativeWindow requestor;
};
struct _GdkEventOwnerChange
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkNativeWindow owner;
GdkOwnerChange reason;
GdkAtom selection;
guint32 time;
guint32 selection_time;
};
/* This event type will be used pretty rarely. It only is important
for XInput aware programs that are drawing their own cursor */
struct _GdkEventProximity
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
GdkDevice *device;
};
struct _GdkEventClient
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkAtom message_type;
gushort data_format;
union {
char b[20];
short s[10];
long l[5];
} data;
};
struct _GdkEventSetting
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkSettingAction action;
char *name;
};
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
struct _GdkEventWindowState
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkWindowState changed_mask;
GdkWindowState new_window_state;
};
struct _GdkEventGrabBroken {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
gboolean keyboard;
gboolean implicit;
GdkWindow *grab_window;
};
/* Event types for DND */
struct _GdkEventDND {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkDragContext *context;
guint32 time;
gshort x_root, y_root;
};
union _GdkEvent
{
GdkEventType type;
GdkEventAny any;
GdkEventExpose expose;
GdkEventNoExpose no_expose;
GdkEventVisibility visibility;
GdkEventMotion motion;
GdkEventButton button;
GdkEventScroll scroll;
GdkEventKey key;
GdkEventCrossing crossing;
GdkEventFocus focus_change;
GdkEventConfigure configure;
GdkEventProperty property;
GdkEventSelection selection;
GdkEventOwnerChange owner_change;
GdkEventProximity proximity;
GdkEventClient client;
GdkEventDND dnd;
test the window state stuff 2001-02-26 Havoc Pennington <hp@redhat.com> * gtk/testgtk.c: test the window state stuff * gtk/gtkwindow.c (gtk_window_present): new function, makes a window come to the user's attention as if it were just created (gtk_window_iconify): new function (gtk_window_deiconify): new function (gtk_window_stick): new function (gtk_window_unstick): new function (gtk_window_maximize): new function (gtk_window_unmaximize): new function * gtk/gtkwidget.h, gtk/gtkwidget.c: add window_state_event signal * gtk/gtkmain.c (gtk_main_do_event): handle GDK_WINDOW_STATE * gdk/x11/gdkevents-x11.c: create window state events when appropriate (gdk_wmspec_supported): new function * gdk/x11/gdkwindow-x11.c (gdk_window_iconify): handle iconification before showing the window (gdk_window_deiconify): new function (gdk_window_stick): new function (gdk_window_unstick): new function (gdk_window_maximize): new function (gdk_window_unmaximize): new function * gdk/gdkwindow.c: store the window state in the window; change to using the GDK_WINDOW_STATE_WITHDRAWN flag instead of window->mapped. (gdk_window_get_state): return the current window state * gdk/gdkevents.c (gdk_event_get_time): handle GDK_WINDOW_STATE (gdk_event_get_state): handle GDK_WINDOW_STATE (gdk_synthesize_window_state): function to create the window state events * gdk/gdkevents.h (struct _GdkEventWindowState): new type of event, for changes to "window state" such as maximized, sticky, etc. * gdk/x11/gdkwindow-x11.c (gdk_window_focus): new function, focuses a window * gdk/x11/gdkmain-x11.c (_gdk_wmspec_supported): new function, finds out if we support a given WM spec hint
2001-02-27 20:40:15 +00:00
GdkEventWindowState window_state;
GdkEventSetting setting;
GdkEventGrabBroken grab_broken;
};
GType gdk_event_get_type (void) G_GNUC_CONST;
gboolean gdk_events_pending (void);
GdkEvent* gdk_event_get (void);
GdkEvent* gdk_event_peek (void);
void gdk_event_put (const GdkEvent *event);
GdkEvent* gdk_event_new (GdkEventType type);
GdkEvent* gdk_event_copy (const GdkEvent *event);
void gdk_event_free (GdkEvent *event);
Port to GObject, can go back in gdk-pixbuf after setting up a 2000-12-16 Havoc Pennington <hp@pobox.com> * gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c: Port to GObject, can go back in gdk-pixbuf after setting up a gdk-pixbuf-marshal.h header over there. * gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g; (gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal args (gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be set (gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons here, do it when we create the buttons later (gtk_tree_view_realize_buttons): add some g_return_if_fail (gtk_tree_view_map): paranoia checks that column->button is shown and unmapped (gtk_tree_view_size_request): only request visible children. Move header size calculation in here, for cleanliness, and to maintain invariants for child widgets if we eventually let users set different children inside the buttons (gtk_tree_view_map_buttons): factor out code to map buttons, since it was being called several times (gtk_tree_view_size_allocate_buttons): move_resize the drag windows instead of just moving them; their height may change if we allow random widgets in there, or the theme changes. (gtk_tree_view_size_allocate): move button size allocation above emitting the scroll signals, to ensure a sane state when we hit user code (gtk_tree_view_button_release): remove queue_resize after tree_view_set_size(), set_size() will handle any resize queuing that's needed (gtk_tree_view_focus_in): just queue a draw, don't fool with draw_focus goo (gtk_tree_view_focus): use gtk_get_current_event() and gdk_event_get_state() (gtk_tree_view_deleted): don't queue_resize() after calling set_size() (gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove semicolon (gtk_tree_view_create_button): show the button here (gtk_tree_view_button_clicked): actually emit the clicked signal on the column (_gtk_tree_view_set_size): return right away if the size is unchanged, as a cheesy optimization (gtk_tree_view_setup_model): rename set_model_realized to setup_model to match the flag that indicates whether we've called it (gtk_tree_view_get_hadjustment): create adjustment if it doesn't exist, because set_scroll_adjustment does that and it shouldn't matter what order you call these in (gtk_tree_view_get_vadjustment): ditto (gtk_tree_view_set_headers_visible): canonicalize the bool, for paranoia (gtk_tree_view_set_headers_visible): call gtk_tree_view_map_buttons() instead of using cut-and-paste code (gtk_tree_view_append_column): clarify whether the return value is the count of columns before or after, and do the increment separately from the return statement so you can tell from the code. (gtk_tree_view_remove_column): ditto (gtk_tree_view_insert_column): ditto (gtk_tree_view_get_column): remove g_return_if_fail for columns outside the existing range, the docs say that outside-range columns are allowed, so we handle them as documented. (Presumably this allows a nice loop with column != NULL as test.) (gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments mean (left/right/center etc.). (gtk_tree_view_collapse_all): only queue a draw if we're mapped (gtk_tree_view_expand_row): add docs (gtk_tree_view_collapse_row): add docs * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new function to emit the clicked signal on a column * gdk/gdkevents.c (gdk_event_get_state): new function, to get the state of an event (gdk_event_get_time): don't treat GDK_SCROLL as a button event, remove default case from switch so gcc will whine if we don't explicitly handle all event types * gtk/gtktreeselection.h: added some FIXME * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename "columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
guint32 gdk_event_get_time (const GdkEvent *event);
gboolean gdk_event_get_state (const GdkEvent *event,
Port to GObject, can go back in gdk-pixbuf after setting up a 2000-12-16 Havoc Pennington <hp@pobox.com> * gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c: Port to GObject, can go back in gdk-pixbuf after setting up a gdk-pixbuf-marshal.h header over there. * gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g; (gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal args (gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be set (gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons here, do it when we create the buttons later (gtk_tree_view_realize_buttons): add some g_return_if_fail (gtk_tree_view_map): paranoia checks that column->button is shown and unmapped (gtk_tree_view_size_request): only request visible children. Move header size calculation in here, for cleanliness, and to maintain invariants for child widgets if we eventually let users set different children inside the buttons (gtk_tree_view_map_buttons): factor out code to map buttons, since it was being called several times (gtk_tree_view_size_allocate_buttons): move_resize the drag windows instead of just moving them; their height may change if we allow random widgets in there, or the theme changes. (gtk_tree_view_size_allocate): move button size allocation above emitting the scroll signals, to ensure a sane state when we hit user code (gtk_tree_view_button_release): remove queue_resize after tree_view_set_size(), set_size() will handle any resize queuing that's needed (gtk_tree_view_focus_in): just queue a draw, don't fool with draw_focus goo (gtk_tree_view_focus): use gtk_get_current_event() and gdk_event_get_state() (gtk_tree_view_deleted): don't queue_resize() after calling set_size() (gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove semicolon (gtk_tree_view_create_button): show the button here (gtk_tree_view_button_clicked): actually emit the clicked signal on the column (_gtk_tree_view_set_size): return right away if the size is unchanged, as a cheesy optimization (gtk_tree_view_setup_model): rename set_model_realized to setup_model to match the flag that indicates whether we've called it (gtk_tree_view_get_hadjustment): create adjustment if it doesn't exist, because set_scroll_adjustment does that and it shouldn't matter what order you call these in (gtk_tree_view_get_vadjustment): ditto (gtk_tree_view_set_headers_visible): canonicalize the bool, for paranoia (gtk_tree_view_set_headers_visible): call gtk_tree_view_map_buttons() instead of using cut-and-paste code (gtk_tree_view_append_column): clarify whether the return value is the count of columns before or after, and do the increment separately from the return statement so you can tell from the code. (gtk_tree_view_remove_column): ditto (gtk_tree_view_insert_column): ditto (gtk_tree_view_get_column): remove g_return_if_fail for columns outside the existing range, the docs say that outside-range columns are allowed, so we handle them as documented. (Presumably this allows a nice loop with column != NULL as test.) (gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments mean (left/right/center etc.). (gtk_tree_view_collapse_all): only queue a draw if we're mapped (gtk_tree_view_expand_row): add docs (gtk_tree_view_collapse_row): add docs * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new function to emit the clicked signal on a column * gdk/gdkevents.c (gdk_event_get_state): new function, to get the state of an event (gdk_event_get_time): don't treat GDK_SCROLL as a button event, remove default case from switch so gcc will whine if we don't explicitly handle all event types * gtk/gtktreeselection.h: added some FIXME * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename "columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
GdkModifierType *state);
gboolean gdk_event_get_coords (const GdkEvent *event,
!GTK_OBJECT_DESTROYED() -> GTK_WIDGET_REALIZE() for resize queueing. Thu Jun 28 23:53:31 2001 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_hide): !GTK_OBJECT_DESTROYED() -> GTK_WIDGET_REALIZE() for resize queueing. * gtk/gtkmain.c (gtk_main_do_event): !GTK_OBJECT_DESTROYED() -> GTK_WIDGET_REALIZE() for post event delivery destruction upon GDK_DESTROY. * gtk/gtkwidget.c: added GtkWidget::event-after notification signal, to sompensate for former (pre-2.0) connect_after() facility. (gtk_widget_send_expose): (gtk_widget_event): assert the widget is realized, since event delivery to non-realized widgets is essentially a bug. event handlers should be able to unconditionally rely on widget->window (unless they emit events on their own which can trigger widget destruction). (gtk_widget_event_internal): removed old outdated GTK_OBJECT_DESTROYED() logic. event delivery happens as follows: a) emission of GtkWidget::event (RUN_LAST handler). returns was_handled. b) if !was_handled in (a) and the widget is still realized, emit event- specific signal (RUN_LAST handler). returns was_handled. c) emission of GtkWidget::event-after for notification if the widget is still realized (regardless of was_handled from previous stages, no class handler). no return value. d) was_handled gets passed on to caller, to determine further propagation. if the widget got unrealized meanwhile, was_handled is returned as TRUE. * gdk/gdkevents.[hc]: added gdk_event_get_root_coords() and gdk_event_get_coords().
2001-06-28 22:49:20 +00:00
gdouble *x_win,
gdouble *y_win);
gboolean gdk_event_get_root_coords (const GdkEvent *event,
!GTK_OBJECT_DESTROYED() -> GTK_WIDGET_REALIZE() for resize queueing. Thu Jun 28 23:53:31 2001 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_hide): !GTK_OBJECT_DESTROYED() -> GTK_WIDGET_REALIZE() for resize queueing. * gtk/gtkmain.c (gtk_main_do_event): !GTK_OBJECT_DESTROYED() -> GTK_WIDGET_REALIZE() for post event delivery destruction upon GDK_DESTROY. * gtk/gtkwidget.c: added GtkWidget::event-after notification signal, to sompensate for former (pre-2.0) connect_after() facility. (gtk_widget_send_expose): (gtk_widget_event): assert the widget is realized, since event delivery to non-realized widgets is essentially a bug. event handlers should be able to unconditionally rely on widget->window (unless they emit events on their own which can trigger widget destruction). (gtk_widget_event_internal): removed old outdated GTK_OBJECT_DESTROYED() logic. event delivery happens as follows: a) emission of GtkWidget::event (RUN_LAST handler). returns was_handled. b) if !was_handled in (a) and the widget is still realized, emit event- specific signal (RUN_LAST handler). returns was_handled. c) emission of GtkWidget::event-after for notification if the widget is still realized (regardless of was_handled from previous stages, no class handler). no return value. d) was_handled gets passed on to caller, to determine further propagation. if the widget got unrealized meanwhile, was_handled is returned as TRUE. * gdk/gdkevents.[hc]: added gdk_event_get_root_coords() and gdk_event_get_coords().
2001-06-28 22:49:20 +00:00
gdouble *x_root,
gdouble *y_root);
gboolean gdk_event_get_axis (const GdkEvent *event,
Port to GObject, can go back in gdk-pixbuf after setting up a 2000-12-16 Havoc Pennington <hp@pobox.com> * gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c: Port to GObject, can go back in gdk-pixbuf after setting up a gdk-pixbuf-marshal.h header over there. * gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g; (gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal args (gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be set (gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons here, do it when we create the buttons later (gtk_tree_view_realize_buttons): add some g_return_if_fail (gtk_tree_view_map): paranoia checks that column->button is shown and unmapped (gtk_tree_view_size_request): only request visible children. Move header size calculation in here, for cleanliness, and to maintain invariants for child widgets if we eventually let users set different children inside the buttons (gtk_tree_view_map_buttons): factor out code to map buttons, since it was being called several times (gtk_tree_view_size_allocate_buttons): move_resize the drag windows instead of just moving them; their height may change if we allow random widgets in there, or the theme changes. (gtk_tree_view_size_allocate): move button size allocation above emitting the scroll signals, to ensure a sane state when we hit user code (gtk_tree_view_button_release): remove queue_resize after tree_view_set_size(), set_size() will handle any resize queuing that's needed (gtk_tree_view_focus_in): just queue a draw, don't fool with draw_focus goo (gtk_tree_view_focus): use gtk_get_current_event() and gdk_event_get_state() (gtk_tree_view_deleted): don't queue_resize() after calling set_size() (gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove semicolon (gtk_tree_view_create_button): show the button here (gtk_tree_view_button_clicked): actually emit the clicked signal on the column (_gtk_tree_view_set_size): return right away if the size is unchanged, as a cheesy optimization (gtk_tree_view_setup_model): rename set_model_realized to setup_model to match the flag that indicates whether we've called it (gtk_tree_view_get_hadjustment): create adjustment if it doesn't exist, because set_scroll_adjustment does that and it shouldn't matter what order you call these in (gtk_tree_view_get_vadjustment): ditto (gtk_tree_view_set_headers_visible): canonicalize the bool, for paranoia (gtk_tree_view_set_headers_visible): call gtk_tree_view_map_buttons() instead of using cut-and-paste code (gtk_tree_view_append_column): clarify whether the return value is the count of columns before or after, and do the increment separately from the return statement so you can tell from the code. (gtk_tree_view_remove_column): ditto (gtk_tree_view_insert_column): ditto (gtk_tree_view_get_column): remove g_return_if_fail for columns outside the existing range, the docs say that outside-range columns are allowed, so we handle them as documented. (Presumably this allows a nice loop with column != NULL as test.) (gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments mean (left/right/center etc.). (gtk_tree_view_collapse_all): only queue a draw if we're mapped (gtk_tree_view_expand_row): add docs (gtk_tree_view_collapse_row): add docs * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new function to emit the clicked signal on a column * gdk/gdkevents.c (gdk_event_get_state): new function, to get the state of an event (gdk_event_get_time): don't treat GDK_SCROLL as a button event, remove default case from switch so gcc will whine if we don't explicitly handle all event types * gtk/gtktreeselection.h: added some FIXME * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename "columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
GdkAxisUse axis_use,
gdouble *value);
2010-05-25 22:38:44 +00:00
void gdk_event_set_device (GdkEvent *event,
GdkDevice *device);
GdkDevice* gdk_event_get_device (const GdkEvent *event);
void gdk_event_request_motions (const GdkEventMotion *event);
2010-05-25 22:38:44 +00:00
gboolean gdk_events_get_distance (GdkEvent *event1,
GdkEvent *event2,
gdouble *distance);
gboolean gdk_events_get_angle (GdkEvent *event1,
GdkEvent *event2,
gdouble *angle);
gboolean gdk_events_get_center (GdkEvent *event1,
GdkEvent *event2,
gdouble *x,
gdouble *y);
void gdk_event_handler_set (GdkEventFunc func,
gpointer data,
GDestroyNotify notify);
void gdk_event_set_screen (GdkEvent *event,
GdkScreen *screen);
GdkScreen *gdk_event_get_screen (const GdkEvent *event);
2000-03-14 19:57:25 +00:00
void gdk_set_show_events (gboolean show_events);
gboolean gdk_get_show_events (void);
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
#ifndef GDK_MULTIHEAD_SAFE
gboolean gdk_setting_get (const gchar *name,
GValue *value);
void gdk_add_client_message_filter (GdkAtom message_type,
GdkFilterFunc func,
gpointer data);
gboolean gdk_event_send_client_message (GdkEvent *event,
GdkNativeWindow winid);
void gdk_event_send_clientmessage_toall (GdkEvent *event);
Start of integration of Erwann Chenede's multihead work from the Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com> Start of integration of Erwann Chenede's multihead work from the gtk-multihead branch. * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch] New classes representing a set of screens with attached input devices and a single contiguous area, respectively. * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c: gdk/x11/gdkprivate-x11.h: Make the initialization interface simple _gdk_windowing_init() and do the rest in gdk_open_display() calls. * gdk/gdk.[ch]: Add gdk_parse_args() which can be used to do the display-independent part of initialization instead of gdk_init_[check]. * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h: Add multihead variants (_for_display(), for_screen()) of functions getting information specific to a particular screen screen or display. * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions like gdk_rgb_get_colormap() that used to get/list global objects. * gdk/x11/gdkx.h: Add functions for converting GdkScreen and GdkDisplay into the X equivalents. * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords() not in the headers and unused. * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}: Remove gxid support ... has not been tested for a long time... "xfree" support is more portable to non XFree86. * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be used to turn off functions that are inherently non-multihead safe. * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions are used in non-multihead-safe ways. * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK multihead safe.
2002-04-25 22:29:14 +00:00
#endif /* GDK_MULTIHEAD_SAFE */
gboolean gdk_event_send_client_message_for_display (GdkDisplay *display,
GdkEvent *event,
GdkNativeWindow winid);
G_END_DECLS
#endif /* __GDK_EVENTS_H__ */