summaryrefslogtreecommitdiff
path: root/gtk/gtkselection.c
Commit message (Collapse)AuthorAgeFilesLines
* Apply a cleanup patch by Kjartan Maraas (#341812)Matthias Clasen2006-10-081-1/+0
| | | | | | 2006-10-08 Matthias Clasen <mclasen@redhat.com> * Apply a cleanup patch by Kjartan Maraas (#341812)
* Improve consistency of signal and property namesMatthias Clasen2006-07-061-5/+6
|
* Fix 344743Matthias Clasen2006-06-141-0/+8
|
* Add infrastructure for copy/paste and DND of rich text for GtkTextBuffer.Michael Natterer2006-03-071-3/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-03-07 Michael Natterer <mitch@imendio.com> Add infrastructure for copy/paste and DND of rich text for GtkTextBuffer. Fixes bug #324177. * gtk/gtktextbufferrichtext.[ch]: new files implementing a per-buffer registry of rich text formats. * gtk/gtk.h: #include gtktextbufferrichtext.h * gtk/gtktextbufferserialize.[ch]: new files implementing an internal serialization format that can handle all of a text buffer's tags and pixbufs. It's not useful for anything except tranfer between instances of GtkTextBuffer (Anders Carlsson). * gtk/Makefile.am: build the new files. * gtk/gtkclipboard.[ch]: added convenience APIs for rich text, just as they exist for plain text and pixbufs. * gtk/gtkselection.[ch]: added rich text convenience APIs here too. Return the target list from gtk_target_list_ref(). Register GtkTargetList as boxed type. Added gtk_target_table_new_from_list() and gtk_target_table_free(), which make converting between GtkTargetList and arrays of GtkTargetEntry considerably easier. * gtk/gtktextutil.[ch]: added _gtk_text_util_create_rich_drag_icon() which creates a fancy rich text icon (Matthias Clasen). * gtk/gtktextbuffer.[ch]: use all the new stuff above and implement copy and paste of rich text. Added APIs for getting the target lists used for copy and paste. Added public enum GtkTextBufferTargetInfo which contains the "info" IDs associated with the entries of the target lists. * gtk/gtktextview.c: use the new rich text APIs and GtkTextBuffer's new target list API to enable DND of rich text chunks. * gtk/gtk.symbols: export all the new symbols added. * tests/testtext.c: added rich text testing stuff.
* Doc updatesMatthias Clasen2005-12-201-1/+1
|
* Don't leak list[0]. (#323629, Markku Vire)Matthias Clasen2005-12-091-3/+1
| | | | | | | 2005-12-09 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c (gtk_selection_data_get_uris): Don't leak list[0]. (#323629, Markku Vire)
* Plug a leakMatthias Clasen2005-11-151-0/+2
|
* Only set the text if it is not NULL. (#319930, Thomas Klausner)Matthias Clasen2005-10-271-6/+6
| | | | | | | | | | 2005-10-27 Matthias Clasen <mclasen@redhat.com> * demos/gtk-demo/clipboard.c (paste_received): Only set the text if it is not NULL. (#319930, Thomas Klausner) * gtk/gtkselection.c (gtk_selection_data_get_pixbuf): Close the loader before trying to get the pixbuf. (#319930, Thomas Klausner)
* Free mult_atoms here. (#317039, Paolo Borelli)Matthias Clasen2005-09-281-0/+2
| | | | | | | 2005-09-28 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c (_gtk_selection_request): Free mult_atoms here. (#317039, Paolo Borelli)
* Use gdk_atom_intern_static_string() where appropriate.Matthias Clasen2005-09-111-13/+13
| | | | | * gtk/*.c: Use gdk_atom_intern_static_string() where appropriate.
* Intern some more strings.Matthias Clasen2005-09-011-4/+5
| | | | | | | | | 2005-09-01 Matthias Clasen <mclasen@redhat.com> * gdk/*.c: Intern some more strings. * gtk/gtkintl.h: * gtk/*.c: Define an I_() macro and use it instead of the bulky g_intern_static_string().
* Also intern static strings passed to g_object_set_data()Matthias Clasen2005-08-311-3/+3
|
* Intern type names in code generated by glib-mkenums, too.Matthias Clasen2005-08-311-1/+1
| | | | | | | | | | | | | 2005-08-31 Matthias Clasen <mclasen@redhat.com> * gdk/Makefile.am: * gtk/Makefile.am: Intern type names in code generated by glib-mkenums, too. * gtk/*.c: * gdk/x11/*.c: * gdk/*.c: Intern type names before registering the type to avoid unnecessary copies.
* Add functions which look for text, image or uri targets in an array ofMatthias Clasen2005-08-301-43/+117
| | | | | | | | | 2005-08-30 Matthias Clasen <mclasen@redhat.com> * gtk/gtk.symbols: * gtk/gtkselection.h: * gtk/gtkselection.c: Add functions which look for text, image or uri targets in an array of atoms. (#314089, Mark Wielaard)
* Add gtk_window_[sg]et_deletable. AddMatthias Clasen2005-08-301-0/+47
| | | | | | | 2005-08-30 Matthias Clasen <mclasen@redhat.com> * gtk/gtk-sections.txt: Add gtk_window_[sg]et_deletable. Add gtk_selection_data_targets_include_uri.
* Don't leak the format names. (#307190, Morten Welinder)Matthias Clasen2005-06-121-2/+7
| | | | | | | 2005-06-12 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c (gtk_target_list_add_image_targets): Don't leak the format names. (#307190, Morten Welinder)
* use a less aggressive PNG compression level (bug #305340).Sven Neumann2005-05-261-4/+7
| | | | | | | 2005-05-26 Sven Neumann <sven@gimp.org> * gtk/gtkselection.c (gtk_selection_data_set_pixbuf): use a less aggressive PNG compression level (bug #305340).
* Make sure png comes first, otherwise dnd may use bmp by default, loosingMatthias Clasen2005-05-251-0/+15
| | | | | | | | 2005-05-25 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c (gtk_target_list_add_image_targets): Make sure png comes first, otherwise dnd may use bmp by default, loosing transparency.
* Fix the buildMatthias Clasen2005-05-021-1/+1
|
* Doc fixupsMatthias Clasen2005-05-021-6/+6
|
* New debugging function, to log a clipboard format name symbolically.Tor Lillqvist2005-04-041-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-04-04 Tor Lillqvist <tml@novell.com> * gdk/win32/gdkmain.c (_gdk_win32_cf_to_string): New debugging function, to log a clipboard format name symbolically. (_gdk_win32_data_to_string): Also new, to log random data bytes. Implement delayed rendering on Win32, specifically for transfering images through the clipboard from GTK+ apps to other apps (#168173, implementation by Ivan Wong): * gdk/win32/gdkevents-win32.c (gdk_event_translate): Handle WM_RENDERFORMAT. * gdk/win32/gdkprivate-win32.h * gdk/win32/gdkglobals-win32.c: Add _format_atom_table, _delayed_rendering_data and _image_bmp. * gdk/win32/gdkmain-win32.c: Initialize _image_bmp. * gdk/win32/gdkproperty-win32.c (gdk_property_change): Accept formats other than GDK_TARGET_STRING or _utf8_string, and assume they are handled through delayed rendering. * gdk/win32/gdkselection-win32.c (gdk_selection_convert): Return all available formats (including those registered by GTK+ apps) on request_targets. (gdk_selection_property_get): We should append a zero byte like X11 does. (gdk_win32_selection_add_targets): New function, for gtkselection's use. Win32 requires that the clipboard owner registers all valid formats even if the owner wants delayed rendering. (_gdk_win32_selection_convert_to_dib): New function. Convert images to DIB using gdk-pixbuf. * gdk/win32/gdkwin32.h: Declare gdk_win32_selection_add_targets(). * gtk/gtkselection.c (gtk_selection_add_target, gtk_selection_add_targets): Call gdk_win32_selection_add_targets() to register target formats. * gdk/gdk.symbols: Add gdk_win32_selection_add_targets().
* Move documentation inline, document if add_target functions append orMatthias Clasen2005-04-011-59/+135
| | | | | | | | 2005-04-01 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c: Move documentation inline, document if add_target functions append or prepend. (#172350, Jon-Kare Hellan)
* Make PLT-reduction work with gcc4, and don't include everything inMatthias Clasen2005-03-201-1/+5
| | | | | | | | | | | | | | | | | | 2005-03-20 Matthias Clasen <mclasen@redhat.com> Make PLT-reduction work with gcc4, and don't include everything in gdkalias.h: * gtk/grk.symbols: Group symbols by header and source file. * gtk/makegtkalias.pl: Protect definitions by the same preprocessor symbols used to guard the headers. Move the alias declarations to a separate file which is produced when calling makegtkalias.pl -def * gdk/Makefile.am (gtkaliasdef.c): Add a rule to generate this file. * gtk/*.c: Include gtkalias.h after the other headers, include gtkaliasdef.c at the bottom. * gtk/*.h: Small cleanups.
* Make the clipboard image API more robust (#162357, Torsten Schoenfeld):Matthias Clasen2004-12-281-18/+18
| | | | | | | | | | | | | | | | 2004-12-27 Matthias Clasen <mclasen@redhat.com> Make the clipboard image API more robust (#162357, Torsten Schoenfeld): * gtk/gtkclipboard.c (clipboard_image_received_func): Don't ref the pixbuf if it is NULL. * gtk/gtkselection.c (gtk_selection_data_set_pixbuf): NULL-terminate the varargs in the call to gdk_pixbuf_save_to_buffer(). (gtk_selection_data_get_pixbuf): Only use a pixbuf loader if there is data to load.
* Reduce the clipboard timeout from 300 seconds to 30 seconds. (#155428,Matthias Clasen2004-11-161-1/+1
| | | | | | | 2004-11-15 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c: Reduce the clipboard timeout from 300 seconds to 30 seconds. (#155428, Billy Biggs)
* Add api for image transfer via copy-and-paste (#156408)Matthias Clasen2004-10-311-1/+52
| | | | | | | | | | | | | | | 2004-10-31 Matthias Clasen <mclasen@redhat.com> Add api for image transfer via copy-and-paste (#156408) * gtk/gtkclipboard.c (gtk_clipboard_set_image) (gtk_clipboard_request_image, gtk_clipboard_wait_for_image) (gtk_clipboard_wait_is_image_available): New functions for image transfer. * gtk/gtkselection.h: * gtk/gtkselection.c (gtk_selection_data_targets_include_image): New function, similar to gtk_selection_data_targets_include_text().
* Fix many sparse warnings.Matthias Clasen2004-10-281-1/+1
|
* Use the new file DND api.Matthias Clasen2004-10-221-0/+118
| | | | | | | | | | | | | | | | | | | | | | 2004-10-22 Matthias Clasen <mclasen@redhat.com> * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_drag_data_received) (gtk_file_chooser_button_init): Use the new file DND api. * gtk/gtkdnd.h: * gtk/gtkdnd.c (gtk_drag_dest_add_uri_targets) (gtk_drag_source_add_uri_targets): * gtk/gtkselection.h: * gtk/gtkselection.c (gtk_target_list_add_uri_targets): (gtk_selection_data_set_uris): (gtk_selection_data_get_uris): New functions to allow handling file DND "without knowing jack shit". * configure.in: Bump glib requirement to 2.5.4. * gtk/gtkfilechooserdefault.c (shortcuts_drop_uris): Use g_uri_list_extract_uris().
* Document how to use info with text/image targets.Matthias Clasen2004-10-221-13/+15
| | | | | | | | | | | | | | | 2004-10-22 Matthias Clasen <mclasen@redhat.com> * gtk/gtkdnd.c: Document how to use info with text/image targets. * gtk/gtkselection.h: * gtk/gtkselection.c (gtk_target_list_add_text_targets): (gtk_target_list_add_image_targets): Add info argument. * gtk/gtkcalendar.c (gtk_calendar_motion_notify): * gtk/gtkentry.c (gtk_entry_init): * gtk/gtktextview.c (gtk_text_view_init): Adjust all callers.
* Add convenience api for image dnd (#150165):Matthias Clasen2004-10-211-0/+145
| | | | | | | | | | | | | | | | | 2004-10-21 Matthias Clasen <mclasen@redhat.com> Add convenience api for image dnd (#150165): * gtk/gtkselection.h: * gtk/gtkselection.c (gtk_target_list_add_image_targets) (gtk_selection_data_set_pixbuf, gtk_selection_data_get_pixbuf): New functions to handle the image formats readable/writable by gdk-pixbuf. * gtk/gtkdnd.h: * gtk/gtkdnd.c (gtk_drag_dest_add_image_targets) (gtk_drag_source_add_text_targets): New functions to handle the image formats readable/writable by gdk-pixbuf.
* Warn if a UTF8_STRING or text/plain;charset=utf-8 roperty contains invalidMatthias Clasen2004-09-171-8/+13
| | | | | | | | | Thu Sep 16 23:20:05 2004 Matthias Clasen <maclas@gmx.de> * gtk/gtkselection.c (selection_get_text_plain): * gdk/x11/gdkselection-x11.c (make_list): Warn if a UTF8_STRING or text/plain;charset=utf-8 roperty contains invalid UTF-8. (#152845, Owen Taylor)
* initialize path so we don't potentially use an undefined pointer.Manish Singh2004-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | Wed Aug 25 17:14:58 2004 Manish Singh <yosh@gimp.org> * gtk/gtktreeview.c (gtk_tree_view_search_activate): initialize path so we don't potentially use an undefined pointer. * gtk/gtkfilechooserdefault.c (shortcuts_list_create): add G_CALLBACK cast for tree_view_keybinding_cb. * gtk/gtkfilechooserdefault.c (location_entry_create): cast to GTK_FILE_CHOOSER_ENTRY for _gtk_file_chooser_entry_set_file_part() calls. * gtk/gtkcellrenderercombo.c (gtk_cell_renderer_combo_start_editing): cast to GTK_COMBO_BOX for gtk_combo_box_set_active_iter() call. * gtk/gtkselection.c (selection_get_text_plain): make len a gsize, since that's what g_convert_with_fallback() expects.
* Add hidden aliases for exported symbols which are used internally in orderMatthias Clasen2004-08-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mon Aug 9 12:48:04 2004 Matthias Clasen <maclas@gmx.de> Add hidden aliases for exported symbols which are used internally in order to get rid of many PLT entries. (#145519, Arjan van de Ven) * gtk/Makefile.am: Add rules to generate gtk.def and from gtk.symbols, and make make check check the abi with abicheck.sh. (gtk_private_h_sources): Add gtkinternals.h (gtk_built_private_headers): Add gtkalias.h (gtk_extra_sources): Add gtk.symbols (EXTRA_DIST): Add makegtkalias.pl and abicheck.sh * gtk/gtk.symbols: New file. Definition of the GTK+ ABI. The file can be processed by cpp to filter out certain subsets of symbols. * gtk/abicheck.sh: New file. Script to check the actually symbols exported from libgtk-x11.2.0.so against the symbols found in gtk.symbols. * gtk/makegtkalias.pl: New file. Perl script to generate the header containing the alias definitions for internally used exported symbols from a list of symbols. * gtk/gtkinternals.h: New file. An uninstalled header listing symbols which must be exported for some reason and do not appear in any other header. * gtk/*.c: Include gtkalias.h
* Support text/plain selection target (#55117, Owen Taylor)Matthias Clasen2004-07-171-22/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sat Jul 17 00:48:27 2004 Matthias Clasen <maclas@gmx.de> Support text/plain selection target (#55117, Owen Taylor) * gtk/gtkselection.h: * gtk/gtkdnd.h: * gtk/gtkselection.c (gtk_target_list_add_text_targets): * gtk/gtkdnd.c (gtk_drag_dest_add_text_targets): * gtk/gtkdnd.c (gtk_drag_source_add_text_targets): New functions to facilitate handling of text targets. * gtk/gtkentry.c: * gtk/gtktextview.c: Use the new text target handling functions instead of hardwiring the list of supported text targets everywhere. * gtk/gtkselection.c (gtk_selection_data_get_text): (gtk_selection_data_set_text): Support the targets text/plain, text/plain?charset=utf-8 and text/plain?charset=<LOCALE-CHARSET> as outlined in #55117: For text/plain send only ASCII, but accept 8-bit text and treat it as ISO-8859-1 as specified by the Xdnd spec. Always send CRLF terminators. Accept either and convert into the native terminator for the platform.
* Make sure this gets defined for all backends, so linux-fb has a chance ofMatthias Clasen2004-06-221-4/+4
| | | | | | * gtk/gtkselection.c (GTK_SELECTION_MAX_SIZE): Make sure this gets defined for all backends, so linux-fb has a chance of compiling.
* Remove leftover debug code.Matthias Clasen2004-06-021-5/+0
| | | | | | | Wed Jun 2 00:47:11 2004 Matthias Clasen <maclas@gmx.de> * gtk/gtkselection.c (_gtk_selection_request): Remove leftover debug code.
* finally also create the correct mask for 'pseudo mime' iconsHans Breuer2004-05-081-0/+2
| | | | | | | | | | | | | | | | | 2004-05-08 Hans Breuer <hans@breuer.org> * gtk/gtkfilesystemwin32.c (extract_icon) : finally also create the correct mask for 'pseudo mime' icons * gdk/win32/gdkwindow-win32.c(show_window_internal) : also take focus_on_map into account * gtk/gtkselection.c : g_message() only with DEBUG_SELECTION * gtk/gtkactiongroup.c gtk/gtkcombobox.c : ... must return a value * gdk/gdk.def gtk/gtk.def demos/gtk-demo/makefile.msc.in : updated
* Disable debug logging again.Matthias Clasen2004-05-041-1/+1
| | | | | | 2004-05-04 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c: Disable debug logging again.
* Make the chunk size for incremental transfers depend on the maximalMatthias Clasen2004-05-031-11/+29
| | | | | | | | | | 2004-05-03 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c: Make the chunk size for incremental transfers depend on the maximal request size, capped at 256k. This should allow most selections to be transferred nonincrementally, avoiding many roundtrips and protocol overhead.
* u2004-05-03 Matthias Clasen <mclasen@redhat.com>Matthias Clasen2004-05-031-4/+3
| | | | | | | * gtk/gtkselection.c (_gtk_selection_request): Fix a debug message to show correct information. (_gtk_selection_incr_event): Make INCRemental transfer of MULTIPLE targets work. This was broken since 1997!
* Fixes #136082 and #135265, patch by Morten Welinder.Federico Mena Quintero2004-03-061-0/+1
| | | | | | | | | | 2004-03-05 Federico Mena Quintero <federico@ximian.com> Fixes #136082 and #135265, patch by Morten Welinder. * configure.in: Use AC_SYS_LARGEFILE. * */*.c: #include <config.h>
* Call g_convert(), not g_convert() with fallback, since Emacs is happier ifOwen Taylor2004-02-251-36/+57
| | | | | | | | | | | | Wed Feb 25 15:36:50 2004 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text_for_display): Call g_convert(), not g_convert() with fallback, since Emacs is happier if we reject the COMPOUND_TEXT request and it can then ask for UTF-8. (#114527) * gtk/gtkselection.c (gtk_selection_data_set_text): When TEXT is requested, if COMPOUND_TEXT fails, fall back to STRING.
* Assign xtype using gdk_x11_atom_to_xatom_for_display () when type !=Manish Singh2004-02-121-1/+1
| | | | | | | | | | | | | Thu Feb 12 11:05:16 2004 Manish Singh <yosh@gimp.org> * gdk/x11/gdkproperty-x11.c (gdk_property_get): Assign xtype using gdk_x11_atom_to_xatom_for_display () when type != GDK_NONE. * gtk/gtkselection.c (_gtk_selection_request): Use GDK_NONE in gdk_property_get call instead of 0. * docs/reference/gdk/tmpl/properties.sgml: Document the above as GDK_NONE instead of simply 0.
* nul-terminate the target atoms. (#132656, Christian Persch)Owen Taylor2004-01-291-2/+5
| | | | | | | Thu Jan 29 11:00:18 2004 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_selection_default_handler): nul-terminate the target atoms. (#132656, Christian Persch)
* Add missing GDK_THREADS_ENTER()/GDK_THREADS_LEAVE(). Cast second argumentMatthias Clasen2003-12-171-2/+2
| | | | | | | | | | | Wed Dec 17 23:20:23 2003 Matthias Clasen <maclas@gmx.de> * gtk/gtkexpander.c (gtk_expander_animation_timeout): Add missing GDK_THREADS_ENTER()/GDK_THREADS_LEAVE(). * gtk/gtkcalendar.c, gtk/gtkclist.c, gtk/gtkexpander.c, gtk/gtklist.c, gtk/gtknotebook.c, gtk/gtkselection.c, gtk/gtkspinbutton.c: Cast second argument to g_timeout_add() to GSourceFunc instead of GtkFunction. (#129525, Olexiy Avramchenko)
* Comprehensively zero all unused parts of client messages (Mainly Motif DNDOwen Taylor2003-05-201-14/+47
| | | | | | | | | | | | | | | Tue May 20 15:09:29 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkdnd-x11.c gdk/x11/gdkwindow-x11.c: Comprehensively zero all unused parts of client messages (Mainly Motif DND and EWMH). Also, fix a couple places where we were putting contents into Motif DND messages that didn't belong. (#113361, EWMH problem reported by Lubos Lunak) * gtk/gtkselection.c (_gtk_selection_request): Handle the case where the property type for the multiple atoms is ATOM_PAIR by doing the conversions ourselve. This is needed for Xt inter-operation.
* Replace uses of gtk_timeout_* and gtk_idle_* by their non-deprecatedMatthias Clasen2003-02-051-2/+2
| | | | GLib counterparts. Fully deprecate gtk_timeout_* and gtk_idle_*.
* Deprecate. (#85683)Matthias Clasen2003-01-311-4/+5
| | | | | | | 2003-01-31 Matthias Clasen <maclas@gmx.de> * gtk/gtkselection.h: * gtk/gtkselection.c (gtk_selection_clear): Deprecate. (#85683)
* Data constness fixes. (#75754)Matthias Clasen2002-12-101-1/+1
|
* Always look up and create the Motif drag window as a child of the rootOwen Taylor2002-12-041-4/+12
| | | | | | | | | | | | | | | | Wed Dec 4 14:31:46 2002 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkdnd-x11.c: Always look up and create the Motif drag window as a child of the root window of screen 0 rather than the default screen. (#100362, Erwann Chenede) * gdk/x11/gdkdnd-x11.c (motif_read_initiator_info): Return FALSE, not GDK_FILTER_REMOVE on failure; this isn't a filter function. * gdk/x11/gdkselection-x11.c gtk/gtkselection.c: Add some g_return_if_fail() to catch selection == None more gracefully than an X error.