summaryrefslogtreecommitdiff
path: root/gtk/gtkselection.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug 479384 – gtk_selection_data_targets_include_uri docs bugletMatthias Clasen2008-05-251-1/+1
| | | | | | | | | | | | 2008-05-25 Matthias Clasen <mclasen@redhat.com> Bug 479384 – gtk_selection_data_targets_include_uri docs buglet * gtk/gtkselection.c (gtk_selection_data_targets_include_uri): Fix doc glitch, pointed out by Christian Persch. svn path=/trunk/; revision=20158
* add tons of g_return_if_fail() instead of crashing when NULL pointers getMichael Natterer2008-04-211-2/+36
| | | | | | | | | | 2008-04-21 Michael Natterer <mitch@imendio.com> * gtk/gtkselection.c: add tons of g_return_if_fail() instead of crashing when NULL pointers get passed. svn path=/trunk/; revision=20031
* Don't add the same target atom twice. (#516087, Christian Persch)Matthias Clasen2008-02-161-1/+2
| | | | | | | | | 2008-02-15 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c (gtk_target_list_add_text_targets): Don't add the same target atom twice. (#516087, Christian Persch) svn path=/trunk/; revision=19589
* Use GSlice for GtkSelectionData. (#515060, Christian Persch)Matthias Clasen2008-02-121-29/+31
| | | | | | | | | | | | 2008-02-12 Matthias Clasen <mclasen@redhat.com> * gtk/gtkclipboard-quartz.c: * gtkquartz.c: * gtkselection.c: Use GSlice for GtkSelectionData. (#515060, Christian Persch) svn path=/trunk/; revision=19533
* svn path=/trunk/; revision=18842Hans Breuer2007-09-171-1/+1
| | | | svn path=/trunk/; revision=18842
* don't simply crash if any of the pointer args are NULL. Instead,Michael Natterer2007-09-151-5/+13
| | | | | | | | | | | 2007-09-15 Michael Natterer <mitch@imendio.com> * gtk/gtkselection.c (gtk_target_list_find): don't simply crash if any of the pointer args are NULL. Instead, g_return_if_fail() on "list != NULL" and allow to pass NULL as return location for "info". svn path=/trunk/; revision=18831
* Don't ignore the passed-in len parameter. (#430049, Yevgen Muntyan)Matthias Clasen2007-07-091-5/+5
| | | | | | | | | | | 2007-07-09 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c (normalize_to_crlf): Don't ignore the passed-in len parameter. (#430049, Yevgen Muntyan) svn path=/trunk/; revision=18423
* fixed wrong g_convert_with_fallback() call which causedYevgen Muntyan2007-04-141-1/+1
| | | | | | | | | | | | 2007-04-14 Yevgen Muntyan <muntyan@tamu.edu> * gtk/gtkselection.c (selection_get_text_plain): fixed wrong g_convert_with_fallback() call which caused gtk_selection_data_get_text() return invalid UTF-8 for non-ASCII text in text/plain selection (#382824). svn path=/trunk/; revision=17600
* Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder,Matthias Clasen2007-03-091-4/+2
| | | | | | | | | | | | | 2007-03-09 Matthias Clasen <mclasen@redhat.com> * Everywhere: Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder, Djihed Afifi) * configure.in: Check for ftw.h svn path=/trunk/; revision=17444
* Plug memory leaks. (#396160, Carlos Garcia Campos)Matthias Clasen2007-01-141-0/+3
| | | | | | | | | | | 2007-01-13 Matthias Clasen <mclasen@redhat.com> * gtk/gtkselection.c (_gtk_selection_request): Plug memory leaks. (#396160, Carlos Garcia Campos) svn path=/trunk/; revision=17145
* Replace a lot of idle and timeout calls by the new gdk_threads api.Matthias Clasen2006-12-221-13/+6
| | | | | | | 2006-12-22 Matthias Clasen <mclasen@redhat.com> * *.c: Replace a lot of idle and timeout calls by the new gdk_threads api.
* 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.