summaryrefslogtreecommitdiff
path: root/demos/testpixbuf-scale.c
Commit message (Collapse)AuthorAgeFilesLines
* Move demos aroundMatthias Clasen2011-05-261-152/+0
| | | | | The pixbuf-demo gets its own subdirectory, the other small tests move from demos/ to tests/.
* Remove no-longer-needed pixbuf_init hackMatthias Clasen2011-05-261-4/+0
| | | | | Since gdk-pixbuf is now a separate project again, we no longer need to locate it inside our source tree.
* demos: Update testpixbuf-scale demo for adjustment sealingBenjamin Otte2011-01-051-2/+2
|
* gtk: remove "gboolean homogeneous" from gtk_box_new()Michael Natterer2010-11-021-2/+2
| | | | Because it's FALSE in virtually all use cases.
* Use gtk_box_new() instead gtk_[v|h]box_new()Javier Jardón2010-10-301-2/+2
|
* Use gtk_scale_new() instead gtk_[v|h]scale_new()Javier Jardón2010-10-301-1/+1
|
* Use the new GtkComboBoxText APIJavier Jardón2010-10-151-5/+5
| | | | | Also remove mentions of the old text convenience API from the docs, and point to GtkComboBoxText instead.
* Remove unneded castsJavier Jardón2010-09-291-1/+1
| | | | | | As gtk_adjustment_new() returns a GtkAdjustment* now https://bugzilla.gnome.org/show_bug.cgi?id=630731
* Move GtkSizeRequest into GtkWidgetBenjamin Otte2010-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't make sense to keep them separate as GtkSizeRequest requires a GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have one without the other. It also makes the code a lot easier because no casts are required when calling functions. Also, the names would translate to gtk_widget_get_width() and people agreed that this would be a too generic name, so a "preferred" was added to the names. So this patch moves the functions: gtk_size_request_get_request_mode() => gtk_widget_get_request_mode() gtk_size_request_get_width() => gtk_widget_get_preferred_width() gtk_size_request_get_height() => gtk_widget_get_preferred_height() gtk_size_request_get_size() => gtk_widget_get_preferred_size() gtk_size_request_get_width_for_height() => gtk_widget_get_preferred_width_for_height() gtk_size_request_get_height_for_width() => gtk_widget_get_preferred_height_for_width() ... and moves the corresponding vfuncs to the GtkWidgetClass. The patch also renames the implementations of the vfuncs in widgets to include the word "preferrred".
* testpixbuf-scale: Connect to draw signalBenjamin Otte2010-09-261-17/+14
|
* demos: No need to set the background, it gets overridden anywayBenjamin Otte2010-09-261-3/+0
|
* demos: Use gtk_size_request_get_size() instead gtk_widget_size_request()Javier Jardón2010-09-151-1/+2
|
* demos/testpixbuf-scale.c: Use accessor functions to access GtkWidgetJavier Jardón2010-08-221-4/+7
|
* demos: Use Cairo instead of gdk_draw_pixbuf()Benjamin Otte2010-07-261-5/+8
|
* Include "config.h" instead of <config.h> Command used: find -nameJohan Dahlin2008-06-221-1/+1
| | | | | | | | | | | | 2008-06-21 Johan Dahlin <jdahlin@async.com.br> * *.[ch]: Include "config.h" instead of <config.h> Command used: find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g' Rubberstamped by Mitch and Tim svn path=/trunk/; revision=20669
* 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>
* enable GTK_DISABLE_DEPRECATED again, (set_interp_type), (main): port overKristian Rietveld2003-10-131-35/+20
| | | | | | | Mon Oct 13 20:21:55 2003 Kristian Rietveld <kris@gtk.org> * demos/testpixbuf-scale.c: enable GTK_DISABLE_DEPRECATED again, (set_interp_type), (main): port over from option menu to GtkComboBox.
* These files still use option menus, so turn off GTK_DISABLE_DEPRECATED toMatthias Clasen2003-10-111-0/+1
| | | | | | | | | Sun Oct 12 00:18:02 2003 Matthias Clasen <maclas@gmx.de> * tests/testtreeview.c: * demos/testpixbuf-scale.c: * tests/prop-editor.c: These files still use option menus, so turn off GTK_DISABLE_DEPRECATED to fix the build.
* Export _gdk_draw_pixbuf as gdk_draw_pixbuf(), rename the _draw_pixbufOwen Taylor2002-10-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Wed Oct 2 17:46:53 2002 Owen Taylor <otaylor@redhat.com> * gdk/gdkdrawable.h gdk/gdkinternals.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/gdkdrawable.c: Export _gdk_draw_pixbuf as gdk_draw_pixbuf(), rename the _draw_pixbuf virtual function to draw_pixbuf. (#60582) * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable[_alpha]): Note that these functions are obsolete in the docs. * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable): Remove all the sanity checks now we make it clear that it is obsolete name for gdk_draw_pixbuf(). * gdk/gdkpixmap.c gtk/gtkcellrendererpixbuf.c gtk/gtkimage.c gtk/gtkpixmap.c demos/testpixbuf-scale.c demos/testpixbuf.c tests/testrgb.c: Use gdk_draw_pixbuf() everywhere. * gtk/gtklabel.c (gtk_label_set_mnemonic_widget): Fix some warnings. * gdk/gdkinternals.h (struct _GdkEventPrivate): Fix missed bit from last gdk_event_get_screen() change. * gdk/gdkevents.c: Couple of small fixes.i
* Remove assorted G_OBJECT casts where unnecessary.Sebastian Wilhelmi2001-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-12-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gdk-pixbuf-animation.c, gdk-pixbuf-loader.c, gdk-pixpuf.c, io-gif-animation.c, io-gif.c, io-tiff.c, test-loaders.c: Remove assorted G_OBJECT casts where unnecessary. * gdk-pixbuf-loader.c: Call g_object_ref and g_object_unref instead of gdk_pixbuf_animation_ref and gdk_pixbuf_animation_unref resp. * gdk-pixbuf-csource.c, io-bmp.c, io-gif-animation.c, io-ico.c, io-jpeg.c, io-png.c, io-pnm.c, io-ras.c, io-tga.c, io-wbmp.c, io-xbm.c, io-xpm.c, test-gdk-pixbuf.c: Dito for gdk_pixbuf_ref and gdk_pixbuf_unref. * Makefile.am, pixops/Makefile.am: Compile everything with -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED * gdk-pixdata.c: Use g_ascii_strup() instead of g_strup(). * io-xpm.c: Use g_ascii_strcasecmp() instead of g_strcasecmp(). * demos/testpixbuf-drawable.c, demos/testpixbuf-save.c, demos/testpixbuf-scale.c, demos/testpixbuf.c: Call g_object_ref and g_object_unref instead of gdk_pixbuf_ref and gdk_pixbuf_unref resp.
* at Oct 20 19:38:16 2001 Owen Taylor <otaylor@redhat.com>Owen Taylor2001-10-201-18/+18
| | | | | | * demos/*.c demos/gdk-pixbuf/*.c: Eliminate gtk_signal_* in favor of g_signal_*, gtk_object_* in favor of g_object_*.
* gdk-pixbuf/gdk-pixbuf-io.c gdk-pixbuf/gdk-pixbuf-private.hSven Neumann2001-10-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | 2001-10-05 Sven Neumann <sven@gimp.org> * gdk-pixbuf/gdk-pixbuf-io.c * gdk-pixbuf/gdk-pixbuf-private.h * gdk-pixbuf/gdk-pixbuf.c * gdk-pixbuf/gdk-pixbuf.h * gdk-pixbuf/io-jpeg.c * gdk-pixbuf/io-png.c: changed GDK_PIXBUF_ERROR_BAD_OPTION_VALUE to GDK_PIXBUF_ERROR_BAD_OPTION to we can use it for bad keys too. Added new public API gdk_pixbuf_get_option() to retrieve key/value pairs set by an image loader. Added support for saving and reading PNG tEXt chunks in PNG images. * demos/testpixbuf-save.c * demos/testpixbuf-scale.c: simple tests for the new PNG tEXt chunk feature. * gdk-pixbuf/tmpl/gdk-pixbuf.sgml: adapt to changes in GDK_PIXBUF_ERROR enum.
* [ Patch from Sebastian Wilhelmi, 52790 ]Owen Taylor2001-08-231-1/+0
| | | | | | | | | | | | | | | | | | | | | Wed Aug 22 19:15:39 2001 Owen Taylor <otaylor@redhat.com> [ Patch from Sebastian Wilhelmi, 52790 ] * gtk/gtkversion.h.in gtk/gtk.h: New file replacing gtkcompat.h * gdk/gdkcompat.h gdk/gdk*.h gtk/gtkcompat.h.in gtk/gtk*.h: Move compatibility macros from g[dt]kcompat.h to within #ifndef G[DT]K_DISABLE_DEPRECATED in each file. * gdk/gdk-pixbuf-csource.c: Fix up include of gtkcompat.h. * demos/Makefile.am demos/gtk-demo/Makefile.am docs/reference/gdk-pixbuf/Makefile.am modules/input/Makefile.am tests/Makefile.am: Remove references to -G[DT]K_DISABLE_DEPRECATED. * demos/{pixbuf-demo.c,testpixbuf-drawable.c,testpixbuf-save.c, testpixbuf.c}: Fix usages of deprecated functions.
* Ignore the sgml directory made by gtkdoc. Use gtk_window_set_resizableDarin Adler2001-07-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .cvsignore: Ignore the sgml directory made by gtkdoc. * demos/pixbuf-demo.c: (main): Use gtk_window_set_resizable instead of the deprecated gtk_window_set_policy. * demos/testpixbuf-scale.c: Add missing <stdlib.h> include. * gdk/gdkkeys.c: (gdk_keymap_class_init): Remove empty finalize function to get rid of warning and some code too. * gdk/x11/gdkfont-x11.c: (gdk_font_charset_for_locale): Add missing const. * gdk/x11/gdkmain-x11.c: (_gdk_windowing_init_check): Remove unused local. * gdk/x11/gdkpango-x11.c: (gdk_pango_context_get): Add missing const. * gdk/x11/gdkselection-x11.c: (gdk_text_property_to_utf8_list), (gdk_utf8_to_compound_text): Add missing const. * gtk/gtkimage.c: (gtk_image_expose): Remove unused local. * gtk/gtkmenubar.c: (gtk_menu_bar_hierarchy_changed): Add missing cast and get rid of an unnecessary one. * gtk/gtksettings.c: (gtk_settings_notify): Remove unused local. * gtk/gtkstatusbar.c: (gtk_statusbar_size_allocate): Remove unused local. * gtk/gtktreemodelsort.c: (gtk_tree_model_sort_build_level): Remove unused local. * modules/input/gtkimcontextxim.c: (gtk_im_context_xim_new): Add missing const. * tests/testsocket.c: (add_child): Add cast so the printf format doesn't make us implicitly depend on what integer type gtk_socket_get_id returns. * tests/testtextbuffer.c: Add missing const. * tests/testtreefocus.c: (main): Remove unused local. * tests/treestoretest.c: (iter_remove): Remove unused local. (uppercase_value): Remove unused function. (make_window): Add statement to quiet the compiler's uninitialized variable warning.
* Some updatesHavoc Pennington2000-10-181-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-18 Havoc Pennington <hp@redhat.com> * gtk/gtk-sections.txt: Some updates * gdk/gdk-sections.txt: remove GdkPixbufAlphaMode * gdk-pixbuf/gdk-pixbuf-sections.txt: Add new API, remove GdkPixbufClass/GdkAnimationClass since those are private * gdk-pixbuf/Makefile.am (IGNORE_HFILES): ignore more headers 2000-10-18 Havoc Pennington <hp@redhat.com> * gtk/gtktextiter.c (gtk_text_iter_forward_to_newline): Fix a bug where any number of empty lines would get skipped * gtk/gtktextiter.h: Remove padding from GtkTextIter; live on the edge. * gtk/gtktextiter.c (gtk_text_iter_make_surreal): enhance the warning about invalid iterators (explain more thoroughly) (gtk_text_iter_in_region): rename gtk_text_iter_in_range * gtk/gtktextview.c (FOCUS_EDGE_WIDTH): Make focus rectangle less big * demos/*.c: Add error handling * gtk/gtktextbuffer.c: don't modify const iterators * gtk/gdk-pixbuf-loader.c: Add full error handling here * gtk/gtkimage.c (gtk_image_set_from_file): ignore errors on file load * gtk/gtkiconfactory.c: Update to reflect addition of error handling to gdk-pixbuf loaders 2000-10-16 Havoc Pennington <hp@redhat.com> * gdk-pixbuf-io.c (gdk_pixbuf_get_module) (gdk_pixbuf_get_named_module) (gdk_pixbuf_load_module): add error reporting here also * make-inline-pixbuf.c (main): use GError * io-xpm.c: include unistd.h * gdk-pixbuf-util.c: include string.h * io-*.c: add error reporting * gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file): add error reporting * gdk-pixbuf-io.c (gdk_pixbuf_new_from_file): Add error reporting * gdk-pixbuf-io.h: Add GError** to load_increment and load methods * gdk-pixbuf-io.c (gdk_pixbuf_save) (gdk_pixbuf_savev): return a G_FILE_ERROR if we fail to write or close the file. * gdk-pixbuf.h: remove GDK_PIXBUF_ERROR_IO, instead we'll use G_FILE_ERROR_*. Rename enum to GdkPixbufError, properly following the GError naming rules. Add GError** to load functions.
* Work with srcdir != builddir.Raja R Harinath2000-06-221-1/+0
| | | | | | | | | | | | * demos/testanimation.c: Don't include "gdk-pixbuf.h". Use <gtk/gdk-pixbuf-loader.h>, not "gtk-pixbuf/gdk-pixbuf-loader.h". * demos/testpixbuf.c: Likewise. * demos/testpixbuf-scale.c: Don't include "gdk-pixbuf.h". * demos/testpixbuf-drawable.c: Don't include "gdk-pixbuf.h". Use <gdk/x11/gdkx.h>. * demos/pixbuf-demo.c: Use <gtk/gtk.h> not "gtk.h". Don't include "gdk-pixbuf.h". * demos/Makefile.am (INCLUDES): Remove unneeded directories.
* Welcome aboard, gdk-pixbuf.Owen Taylor2000-06-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Wed Jun 21 16:38:13 2000 Owen Taylor <otaylor@redhat.com> * gdk-pixbuf/* docs/reference/gdk-pixbuf/*: Welcome aboard, gdk-pixbuf. * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_class_init): fixups for GObject. * gdk/Makefile.am gdk/gdkpixbuf-render.[ch] gdk/gdkpixbuf.[ch]: Bits of gdk-pixbuf with GDK dependencies moved into GDK. * gtk/Makefile.am gtk/gdk-pixbuf-loader.[ch]: Temporarily move gdk-pixbuf-loader here until GObject has signals. * demos/: New directory of demos. Move demos from gdk-pixbuf here. * demos/pixbuf-init.c: Small bit of code to check for loaders in ../gdk-pixbuf/.libs/gdk-pixbuf, and if found, set GDK_PIXBUF_MODULEDIR appropriately. * gdk/gdkcompat.h: Remove GDK_DRAWABLE_PIXMAP compat define which no longer makes sense.
* Revert accidental changes from Federico's last commit.Owen Taylor2000-06-211-31/+9
| | | | | | | 2000-06-21 Owen Taylor <otaylor@redhat.com> * gdk-pixbuf/testpixbuf-scale.c: Revert accidental changes from Federico's last commit.
* It was cold and rainy this Saturday morning, so I needed something to warmFederico Mena Quintero2000-06-111-9/+31
| | | | | | | | | | | | | | 2000-06-10 Federico Mena Quintero <federico@helixcode.com> * demo/pixbuf-demo.c: It was cold and rainy this Saturday morning, so I needed something to warm my thighs. Running plain infinite loops on your laptop to make it hot is not very much fun. A demo of the gdk-pixbuf scaling functions is way better, and looks prettier, too. * configure.in (AC_OUTPUT): Added the demo Makefile. * Makefile.am (SUBDIRS): Added the demo directory.
* Most of this patch is based on a patch by Havoc Pennington (hp@redhat.com)Federico Mena Quintero2000-04-111-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-04-11 Federico Mena Quintero <federico@helixcode.com> Most of this patch is based on a patch by Havoc Pennington (hp@redhat.com) to make GdkPixbuf's structures opaque and to remove the libart dependency. * gdk-pixbuf/gdk-pixbuf.h: Removed the public structures. (GdkColorspace): New enum that for now only contains GDK_COLORSPACE_RGB. (GdkPixbufDestroyNotify): New type for the pixbuf's pixels destroy notification function. (GdkInterpType): New num with interpolation types. * *.[ch]: Replace the libart stuff with our own stuff. * pixops/*.[ch]: Likewise. * gdk-pixbuf/gdk-pixbuf-private.h: New file with the private declarations of the GdkPixbuf structures. * gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_new_from_art_pixbuf): Removed function. (gdk_pixbuf_get_format): Constify. (gdk_pixbuf_get_n_channels): Constify. (gdk_pixbuf_get_has_alpha): Constify. (gdk_pixbuf_get_bits_per_sample): Constify. (gdk_pixbuf_get_pixels): Constify. (gdk_pixbuf_get_width): Constify. (gdk_pixbuf_get_height): Constify. (gdk_pixbuf_get_rowstride): Constify. * gdk-pixbuf/gdk-pixbuf.c (gdk_pixbuf_copy): New function to copy a pixbuf. * gdk-pixbuf/gdk-pixbuf-data.c (gdk_pixbuf_new_from_data): Added a bits_per_sample argument; currently only 8 bits per sample are supported. * gdk-pixbuf/gdk-pixbuf-animation.c (gdk_pixbuf_frame_get_pixbuf): New accessor. (gdk_pixbuf_frame_get_x_offset): New accessor. (gdk_pixbuf_frame_get_y_offset): New accessor. (gdk_pixbuf_frame_get_delay_time): New accessor. (gdk_pixbuf_frame_get_action): New accessor. * gdk-pixbuf/gdk-pixbuf-render.c (gdk_pixbuf_render_pixmap_and_mask): Instead of returning a solid mask rectangle for pixbufs without an alpha channel, set the *mask_return to NULL. * gdk-pixbuf/gdk-pixbuf-util.c (gdk_pixbuf_add_alpha): Constify. * gdk-pixbuf/gdk-pixbuf-scale.c: Fix includes. * gdk-pixbuf/gdk-pixbuf-scale.c (gdk_pixbuf_scale): Added some preconditions. Maybe we should also check for the colorspace, bits per pixel, and such. (gdk_pixbuf_composite): Likewise. (gdk_pixbuf_composite_color): Likewise. (gdk_pixbuf_scale_simple): Likewise, and fail gracefully if we cannot allocate the new pixbuf. (gdk_pixbuf_composite_color_simple): Likewise. * gdk-pixbuf/gnome-canvas-pixbuf.c (gnome_canvas_pixbuf_render): Use art_rgb_rgba_affine() or art_rgb_affine() since we no longer have an ArtPixBuf. * gdk-pixbuf/io-bmp.c: Fix includes. * gdk-pixbuf/pixops/pixops.c (pixops_scale_nearest): Fixed cast in an lvalue. * TODO: Populated. * configure.in: Removed checks for libart. * gdk-pixbuf/Makefile.am: Removed references to libart. (noinst_HEADERS): Added gdk-pixbuf-private.h. * gdk-pixbuf/Makefile.am (libgdk_pixbuf_la_LDFLAGS): Incremented the version number of the libtool library to indicate that this definitely is not compatible with the old usage. I know you love me. I know you do. * configure.in: Bumped version number to 0.7.0. * README: Updated. * gdk-pixbuf-config.in (--libs): We no longer require libart. * DEPENDS.libgdk_pixbuf: We no longer depend on libart. * gdk-pixbuf.spec.in: Updated, but I don't guarantee anything.
* Added scaling functions into gtk-doc framework.Owen Taylor2000-01-061-16/+7
| | | | | | | | | | | | | | | 2000-01-05 Owen Taylor <otaylor@redhat.com> * doc/Makefile.am doc/gdk-pixbuf-sections.txt doc/gdk-pixbuf.sgml doc/tmpl/scaling.sgml: Added scaling functions into gtk-doc framework. * gdk-pixbuf/gdk-pixbuf-scale.c: Documentation fixes. * gdk-pixbuf/testpixbuf-scale.c (expose_cb): Simplify a bit. * gdk-pixbuf/pixops/pixops.c (pixops_composite_color): Return immediately if scale_x or scale_y is 0.
* Added a README with a TODO and some explainations of the algorithms.Owen Taylor2000-01-051-0/+2
| | | | | | | | | | 2000-01-05 Owen Taylor <otaylor@redhat.com> * gdk-pixbuf/pixops/README: Added a README with a TODO and some explainations of the algorithms. * gdk-pixbuf/testpixbuf-scale.c: Set a background pixmap of None to reduce flashing when resizing.
* Directory full of pixel data scaling code that will eventually migrateOwen Taylor2000-01-051-0/+163
2000-01-05 Owen Taylor <otaylor@redhat.com> * gdk-pixbuf/pixops/: Directory full of pixel data scaling code that will eventually migrate into libart. * configure.in acconfig.h: Add checks for MMX compiler support * gdk-pixbuf/gdk-pixbuf.h gdk-pixbuf/gdk-pixbuf-scale.c: Nice wrapper routines for the code in pixops that operate on pixbufs instead of raw data. * gdk-pixbuf/testpixbuf-scale: Test program for scaling routines.