Commit Graph

808 Commits

Author SHA1 Message Date
Havoc Pennington
9df0074685 add default icon
2001-08-28  Havoc Pennington  <hp@pobox.com>

	* demos/gtk-demo/main.c (setup_default_icon): add default icon

	* gtk/gtkradiobutton.c (gtk_radio_button_new_with_mnemonic):
	warning fix
	(gtk_radio_button_new_with_label): warning fix

	* gtk/gtkdnd.c: used some random GtkImage private structs,
	update to reflect GtkImage changes

	* gdk/x11/gdkwindow-x11.c (gdk_window_set_icon_list): don't check
	whether the hint is supported, just always set the icon. A task
	list might want to use it even if the WM doesn't, and the WM may
	change over time. Also, XDeleteProperty() if list == NULL.

	* gtk/gtkwindow.c (gtk_window_set_icon_list)
	(gtk_window_get_icon_list)
	(gtk_window_set_icon)
	(gtk_window_get_icon)
	(gtk_window_set_default_icon_list)
	(gtk_window_get_default_icon_list):
	new functions

	* gtk/gtk-boxed.defs (GtkIconSet): add GtkIconSet

	* gtk/gtkimage.c: Implement property support, bug #59408

	* gtk/gtkcontainer.c (gtk_container_add): make the warning message
	on reparent-without-removing-first a bit more helpful.
	Let's just destroy this FAQ.
2001-08-29 02:20:02 +00:00
Havoc Pennington
eae09f4d83 remove gtk_menu_* compat defines; these are already in gtkmenu.h, and the
2001-08-24  Havoc Pennington  <hp@pobox.com>

	* gtk/gtkcompat.h: remove gtk_menu_* compat defines;
	these are already in gtkmenu.h, and the copies
	here were broken.

	Also, change GTK_DISABLE_COMPAT_H to GTK_DISABLE_DEPRECATED

	* gdk/gdkpixbuf-drawable.c (gdk_pixbuf_get_from_image):
	special-case bitmaps to allow no colormap
	(bitmap1): implement no-colormap bitmap-getting
	(bitmap1a): implement no-colormap bitmap-getting to pixbuf with
	alpha
	(rgb8): indentation
	(rgb1a, rgb1): change the way we read the data out of the image,
	old way didn't seem to work quite right.

	I'm pretty sure a lot of the rgbconvert code is still broken.

	* gtk/gtkwindow.c (gtk_window_move_resize): move hints comparison
	above position constraint (I really intended to do this before,
	don't know what's up with that)
	(gtk_XParseGeometry): shut up gcc

	* gdk/gdkpixbuf-drawable.c (rgb1a): fix bug where "x1" was used
	and "0" should have been. remove the attempted 4-bytes-at-once
	optimization, it was totally broken.
2001-08-26 02:03:10 +00:00
Owen Taylor
a2d60d44b1 [ Patch from Sebastian Wilhelmi, 52790 ]
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.
2001-08-23 15:26:49 +00:00
Hans Breuer
f34e996b5f updated externals
2001-08-18  Hans Breuer  <hans@breuer.org>

	* gdk/gdk.def : updated externals

	* gdk/win32/gdkselection-win32.c : returning TRUE with gdk_selection_set
	is required to get (at least) visible in entry fields. Some selections
	are really handled now - even on win32 - but copying via middle
	mouse button into a different app needs to wait ...

	* gdk/win32/gdkdnd-win32.c : implemented inter-app drag&drop
	mostly by stealling code from gdkdnd-fb.c. Thanks to who ever wrote it!

	* gdk/win32/gdkevents-win32.c : some tweaking to get better expose
	handling. I'm not sure if it is better now, but at least not worse

	* gdk/win32/gdkgeometry-win32.c : replaced every call to MoveWindow
	with SetWindowPos () which allows more fine-tuning backing-store wise

	* gdk/win32/gdkwindow-win32.c : allow unraised gdk_window_show ().
	Also changed move/resize to be more like the X version.

	* gtk/gtk.def : updated externals
2001-08-19 18:34:59 +00:00
Matthias Clasen
370046c735 gtk/docs/debugging.txt, gdk/gdk.c, gdk/gdkinternals.h,
gdk/x11/gdkmain-x11.c, gtk/gtkdebug.h, gtk/gtkmain.c: Update
debugging info, remove unused debug flags. (#58330)
2001-08-15 06:52:19 +00:00
Hans Breuer
0b5db507da coalescing property notifies
2001-08-11  Hans Breuer  <hans@breuer.org>

	* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
	  gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
	  gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
	  gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
	  gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
	  gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies

	* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
	  gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
	GDK_TYPE_EVENT signals

	* gtk/gtkalignment.c : removed 'direct allocation bug',
	which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
Havoc Pennington
f37a0627fc fix a typo.
2001-08-07  Havoc Pennington  <hp@pobox.com>

	* gtk/gtkfilesel.c (open_ref_dir): fix a typo.

	* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
	some fixage is needed here, but nothing simple. Owen understands
	it. ;-)

        * gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
	sizing and positioning.  Also, fix bug in compute_geometry_hints
	(width/height confusion for setting min size).
	(gtk_window_move): new function
	(gtk_window_resize): new function
	(gtk_window_get_size): new function
	(gtk_window_get_position): new function
	(gtk_window_parse_geometry): new function

 	* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
 	(gtk_widget_get_size_request): new function
 	(gtk_widget_get_usize): delete, that was a short-lived function
 	;-)
 	(gtk_widget_set_usize): deprecate
 	(gtk_widget_set_uposition): deprecate, make it a trivial
	gtk_window_move() wrapper
	(gtk_widget_class_init): remove x/y/width/height properties,
	add width_request height_request

        * demos/*: update to avoid deprecated functions

	* gtk/gtklayout.c: add x/y child properties

	* gtk/gtkfixed.c: add x/y child properties, and get rid of
	uses of "gint16"

	* tests/testgtk.c (create_window_sizing): lots of tweaks to window
	sizing test

	* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
	configure events on toplevel windows are always in root window
	coordinates, following ICCCM spec that all synthetic events
	are in root window coords already, while real events are
	in parent window coords. Previously the code assumed that
	coords of 0,0 were parent window coords, which was
	really broken.

 	* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
 	warning

 	* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
 	and GDK_HINT_USER_SIZE so we can set USSize and USPosition
 	hints in gtk_window_parse_geometry()

 	* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
 	new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
Matthias Clasen
6dd7f04620 gdk/gdkgc.c (gdk_gc_set_rgb_bg_color): Set the background color,
not the foreground color. (#57621)
2001-08-09 07:14:56 +00:00
Alexander Larsson
cdb59b8949 Update to the new pango win32 api.
2001-08-09  Alexander Larsson <alexl@redhat.com>

	* gdk/win32/gdkfont-win32.c:
	Update to the new pango win32 api.
2001-08-09 05:09:01 +00:00
Hidetoshi Tajima
2a80b70a2e ask apps for COMPOUND_TEXT instead of TEXT correctly interpret the return
* gtk/gtkclipboard.c (request_text_received_func): ask apps for
	COMPOUND_TEXT instead of TEXT
	* gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): correctly
	interpret the return value of g_string_to_compound_text()
	(#55152)
2001-08-08 17:58:52 +00:00
Havoc Pennington
a4be7d83c1 The whole GDK_IS_WINDOW() branch of this was a bit screwed up, because it
2001-08-06  Havoc Pennington  <hp@pobox.com>

 	* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): The whole
 	GDK_IS_WINDOW() branch of this was a bit screwed up, because
 	it was expecting a GdkWindow, not a GdkWindowImplX11.

 	Also, we were getting the window rect in screen coords
 	and the screen rect in window coords then intersecting
 	them; instead, get window rect in window coords.

 	Finally, there were codepaths that resulted in a stuck server grab
 	(when the window was fully onscreen, or on gdk_image_new()
 	failure); make the server ungrab thing a bit more
 	robust/consistent.
2001-08-06 16:54:17 +00:00
Sven Neumann
adca251bab check if info->colormap != NULL before unref'ing it. It might have been
2001-08-06  Sven Neumann  <sven@gimp.org>

	* gdk/gdkpango.c (gdk_pango_context_destroy):
	check if info->colormap != NULL before unref'ing it. It might have
	been set to NULL using gdk_pango_context_set_colormap().
2001-08-06 15:52:46 +00:00
Alexander Larsson
81cfd5c9dc Add #ifdef HAVE_WINTAB around wintab.h include.
2001-08-04 Alexander Larsson <alexl@redhat.com>

	* gdk/win32/gdkinput.c:
	Add #ifdef HAVE_WINTAB around wintab.h include.

	* gtk/gtk.def:
	Removed marshals that have been moved to glib.
	Commented out plug and socket. They didn't compile for me
	on win32.
2001-08-04 16:28:09 +00:00
Hans Breuer
afb6e60fb3 new file use it
2001-08-04  Hans Breuer  <hans@breuer.org>

	* gtk/stocks-icons/makefile.msc : new file
	* gtk/makefile.msc.in : use it

	* gtk/gtkstyle.c : not all platforms do provide M_PI and
	friends, but luckily there is G_PI

	* gtk/gtk.def : updated

	* gdk/win32/gdkwindow.c (gdk_window_new) : don't make all TEMP
	windows WS_POPUP, but only those without a parent. This fixes the
	mis-alignment between the selectable (temp, input only) window and
	the window text of GtkLabel.

	(gdk_window_show) : respect private->state when actually showing
	the window.

	(gdk_window_set_transient_for) : Implementation from Wolfgang
	Sourdeau <wolfgang@contre.com> ported to 2.0 and added some
	error handling. Should fix #50586.

	* gdk/win32/gdkevents-win32.c : beautify log output
2001-08-04 13:17:33 +00:00
Darin Adler
6fe3d87b10 Put all mentions of GdkFont inside #ifndef GDK_DISABLE_DEPRECATED.
* gdk/gdkprivate.h:
	* gdk/x11/gdkx.h:
	Put all mentions of GdkFont inside #ifndef GDK_DISABLE_DEPRECATED.

	* demos/gtk-demo/menus.c: (do_menus): Cast to G_OBJECT, not
	GTK_OBJECT.
2001-07-31 20:12:01 +00:00
Hans Breuer
da155bb731 build in the backend dir after auto-generating files
2001-07-29  Hans Breuer  <hans@breuer.org>

	* gdk/makefile.msc : build in the backend dir after
	auto-generating files

	* gdk/win32/gdkfont-win32.c (gdk_font_load) : reimplement
	with code from win32-production-branch.

	*  gdk/win32/gdkwindow-win32.c : set the private->destroyed flag
	before calling DestroyWindow, which indirectly calls
	gdk_window_destroy_notify ()

	(performance patch merged from win32-production-branch)
	* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_segments):
	Use PatBlt() instead of LineTo() when possible (solid single-pixel pen,
	R2_COPYPEN rop). It is claimed to be much faster.
2001-07-28 23:02:02 +00:00
Alex Larsson
c16e87bcba Initialize image->bits_per_pixel from the drawable, not from the root
2001-07-26  Alex Larsson  <alexl@redhat.com>

	* gdk/linux-fb/gdkimage-fb.c (_gdk_fb_get_image):
	Initialize image->bits_per_pixel from the drawable, not from
	the root window.

	* gdk/linux-fb/gdkdrawable-fb2.c (gdk_fb_get_depth):
	Fix cast. argument is an IMPL already.
2001-07-26 20:07:08 +00:00
Ron Steinke
9cfd92ef66 Added a check on the colormap depth to gdk_drawable_set_colormap()
* gdk/gdkdraw.c: Added a check on the colormap depth to
        gdk_drawable_set_colormap()
        * gdk/x11/gdkimage-x11.c: combination of Mathias Hasselmann's
        patch to fix colorsel and my patch to fix gdk_drawable_get_image()
        for pixmaps without visuals (more specifically, bitmaps)
        * gdk/x11/gdkpixmap-x11.c: Fixed gdk_pixmap_new() so it
        doesn't set a colormap with the wrong depth
2001-07-23 21:28:38 +00:00
Hans Breuer
4c5b559e04 gdk_device_get_history moved to gdk/gdkinput.c like the other backends
2001-07-20  Hans Breuer  <hans@breuer.org>

	* gdk/win32/gdkinput-win32.c : gdk_device_get_history moved to
	gdk/gdkinput.c like the other backends

	* gdk/win32/gdkinput-win32.h :
	* gdk/win32/gdkinput.c :
	* gdk/win32/gdkvisual-win32.c :
	* gdk/win32/gdkwin32.h : mechanical adaption to GdkDevice and
	GdkVisual GObjectification. UNTESTED for pen-devices because
	I simply have none.

	* gdk/gdk.def :
	* gtk/gtk.def : updated externals

	* gtk/gtkiconfactory.c :
	* gtk/gtkoldeditable.c : GError *error needs to be initialized (= NULL)
	before passing &error to functions to avoid strange crashes

	* gtk/gtkcontainer.c (gtk_container_real_set_focus_child) : is static

	* gtk/gtkwidget.c (gtk_widget_get_child_visible): use g_return_val_if_fail

	* gtk/makefile.msc.in : updated
2001-07-20 18:05:33 +00:00
Darin Adler
f500db339a Reorder code so that we don't get a g_warning message every time we
* gtk/gtkiconfactory.c: (gtk_icon_size_register): Reorder code so
	that we don't get a g_warning message every time we register a new
	icon size.

	* gdk/x11/gdkcolor-x11.c: (gdk_colormap_alloc1): Fix warning by
	using pixel variable of the correct type.
2001-07-18 22:06:40 +00:00
Owen Taylor
94239d144e Add a function gdk_window_get_internal_paint_info(), so that using X
Fri Jul 13 15:33:32 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.[ch]: Add a function gdk_window_get_internal_paint_info(),
	so that using X functions on a GdkWindow is possible, if
	a little hairy.

	* gdk/gdkgc.c (gdk_gc_offset): Add a function to offset the clip
	and ts_origin of a GC, so that external parties can offset/restore
	a GC, when using gdk_window_get_internal_paint_info().
2001-07-18 20:09:28 +00:00
Darin Adler
0349676329 Ignore the sgml directory made by gtkdoc. Use gtk_window_set_resizable
* .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.
2001-07-18 04:31:11 +00:00
Owen Taylor
3c57c96148 Properly clean up when handling events for move-resize emulation. (Problem
Thu Jul 12 13:53:28 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkevents-x11.c (gdk_event_translate): Properly
	clean up when handling events for move-resize emulation.
	(Problem traced down by Matthias Clasen, #57271)
2001-07-12 17:58:43 +00:00
Owen Taylor
515852ba91 Jul 6 15:38:33 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init):
	G_SIGNAL_TYPE_STATIC_SCOPE GtkSelectionData to
	restore some workingness.

	* gdk/x11/gdkwindow-x11.c (gdk_window_new): Fix
	handle of window type for input-only windows.
2001-07-06 19:41:00 +00:00
Owen Taylor
191e83b32a Add gdk_set_pointer_hooks() to allow pointer-querying to be hooked by an
Mon Jul  2 01:09:37 2001  Owen Taylor  <otaylor@redhat.com>

 	* gdk/gdkwindow.[ch] gdk/gdkinternals.h gdk/x11/gdkwindow-x11.c
 	gdk/linux-fb/gdkwindow-fb.c gdk/x11/gdkwindow-x11.c gdk/gdk:
 	Add gdk_set_pointer_hooks() to allow pointer-querying to
 	be hooked by an event record/playback system like GERD.
	(#56914)
2001-07-05 13:41:34 +00:00
Owen Taylor
c1a14d036d Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not
Wed Jul  4 22:35:40 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c
	  gtk/gtkwidget.c:
	Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)),
	not GTK_WIDGET_GET_ANCESTOR ... see
	http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html.
	Indicate the best practice in the docs for gtk_widget_get_toplevel().

	* gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(),
	so GtkPlug can give the correct signals when transforming
	from a child to a toplevel.

	* gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle
	reparentation correctly.

	* gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed):
	Propagate the previous_toplevel argument down properly.

	* gtk/gtklabel.c (gtk_label_finalize): Fix unrefing
	of wrong atr list.

	* gtk/gtkplug.[ch]: Add an "embedded" signal.

	* gtk/gtksocket.[ch]: Add "child_added", "child_removed"
	signals.

	* gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add
	functions gtk_plug_get_id(), gtk_socket_get_id(),
	to avoid the user having to worry about realization,
	and gdkx.h.

	* tests/testsocket.c: Extend to try out the new signals
	and gtk_plug/socket_get_id().

	* gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix
	setting of underline attributes.

	* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore
	DestroyNotify events from SubstructureNotifyMask

	* gdk/x11/gdkwindow-x11.c (gdk_window_reparent):
	Switch GDK_WINDOW_TYPE (window) as needed.

	* gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up,
	allow creation of toplevel windows as children of
	foreign windows.

	* gtk/gtkplug.c: Remove hacks involving changing private
	fields of GdkWindow.

	* gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make
	exactly the same signals and notification
	be emitted for local embedding as for inter-process
	embedding.
2001-07-05 02:58:34 +00:00
Owen Taylor
f409cd9b7f For XEMBED embedding add a _XEMBED_INFO property to the client with
Mon Jul  2 16:53:25 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/xembed.h gtk/gtkplug.c gtk/gtksocket.c: For
	XEMBED embedding add a _XEMBED_INFO property to the
	client with version number and a "mapped" flags.
	Use the mapped flag instead of the racy MapRequestEvent

        * gtk/gtksocket.c: Clean up the gtk_socket_steal()
	code to reliably set things (when the child is a passive
	embedder participating in the XEMBED protocol) intead
	of just being a hack for embedding non-participating
	programs. Fix various bugs and race conditions.

	* gtk/gtksocket.[ch] gtk/gtkplug.[ch]: Make local embedding
	work by simply making the GtkSocket the gtk parent
	of the GtkPlug. Set a flag in this case and make
	the GtkPlug work like a normal container by overriding
	methods such as check_resize and "chaining past" GtkWindow
	to GtkBin.

 	* gtk/gtkentry.c (gtk_entry_real_activate)
	  gtk/gtkmain.c (gtk_propagate_event):
 	Eliminate use of gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW).

	* gtk/gtkwidget.c (gtk_widget_get_toplevel,
	gtk_widget_get_ancestor):
	Explain	why gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)
	might not give the expected result and recommend
	an alternative.

	* tests/testsocket.c tests/testsocket_child.c
	tests/testsocket_common.c tests/Makefile.am: Extended
	to test different type of adding plugs to sockets
	(local,active,passive),	and to test mapping/unmapping
	the plug.

 	* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Don't
 	mark the window as destroyed until after we
 	called _gdk_windowing_window_destroy().
	(_gdk_windowing_window_destroy() may use GDK functions
	on the window.)

 	* gdk/x11/gdkinput.c: Remove the check for finalization -
 	devices can be finalized under some circumnstances.

 	* gdk/x11/gdkinput-x11.c (gdk_input_device_new): Fix
 	small problem with GDK_TYPE_DEVICE.
2001-07-03 14:14:30 +00:00
Havoc Pennington
b6cc525fa0 fix to use constants not atoms.
2001-07-02  Havoc Pennington  <hp@pobox.com>

	* gdk/x11/gdkwindow-x11.c (gdk_wmspec_change_state): fix to
	use constants not atoms.
2001-07-03 01:39:36 +00:00
Tim Janik
93db42e7a6 s/signal_newc/signal_new/
Mon Jul  2 06:35:10 2001  Tim Janik  <timj@gtk.org>

        * gdk/gdkkeys.c (gdk_keymap_class_init): s/signal_newc/signal_new/

        * gtk/gtkobject.c (gtk_object_destroy): invoke
        g_object_run_dispose().

        * gtk/gtkwindow.c:
        * gtk/gtkwidget.c:
        * gtk/gtkobject.c:
        * gtk/gtklist.c: s/shutdown/dispose/ for the GObject
        method.
2001-07-02 05:03:21 +00:00
Owen Taylor
fbfc305174 Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
	for style to mean "revert to default style"

	* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
	  gtk_widget_restore_default_style): Make this functions
	deprecated aliases for gtk_widget_set_style (widget, NULL).

	* gtk/gtkwidget.[ch]: Remove:
	   gtk_widget_set_default_style ()
	   gtk_widget_push_style ()
	   gtk_widget_pop_style ()
	These functions interact are overriden by RC files, and
	thus virtually useless, and complicated.

Fri Jun 22 18:49:48 2001  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkrc.c: Add a GtkRcContext structure to hold
	most of the previous global variables in gtkrc.c. This is
	in preparation for multi-head, since each screen can
	have different GtkSettings and RC information.

	* gtk/gtkrc.[ch]:

	* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
	GtkSettings parameter to GtkRcStyle::parse.

	* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
	Add two new settings gtk-theme-name, gtk-key-theme-name,
	for RC files that are loaded by name after reading
	the default RC files.

	* gtk/gtkrc.c: Allow priorities for styles, as wll as
	bindings.

	* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
	and use it by default for RC files loaded via
	gtk-theme-name, gtk-key-theme-name.

	* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
        gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
	tests/testgtkrc: Require pathnames to be absolute.

	* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
	the source when parsing, since the operation of looking up a
	pixmap from an RC file depends on the parsing context.

	* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
	reset RC styles on all widgets when files are reparsed.

	* tests/testgtk.c (create_rc_file)
	  gtk/gtkwindow.c (gtk_window_read_rcfiles):
	Simplify, now that gtk_rc_reparse_all() resets styles on
	all widgets itself.

	* gtk/gtkmain.c (gtk_get_default_language): Fix broken
	return value.

	* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
	GtkSettings argument.

	* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
	gtk_settings_get_global().

	* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
	to get the appropriate GtkSettings for a widget. (For now,
	just gets the default GtkSetttings.)

	* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
	  gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
        changes.

	* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
	getting a style for a path without actually having a widget.
	(Allows using a style for a subpart of a widget, for
	example.)

	* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
	the RC files to be reloaded for just one GtkSettings
	(not sure how useful this really is.)

	* gtk/gtkrc.h: Deprecate
	gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
Alex Larsson
ba02311234 Convert GdkDevice to a GObject.
2001-06-30  Alex Larsson  <alexl@redhat.com>

	* gdk/linux-fb/gdkinput-none.c:
	* gdk/linux-fb/gdkinput.c:
	* gdk/linux-fb/gdkinputprivate.h:
	Convert GdkDevice to a GObject.

	* linux-fb/gdkprivate-fb.h:
	* linux-fb/gdkvisual-fb.c:
	Convert GdkVisual to a GObject.
2001-06-30 04:30:32 +00:00
Alex Larsson
43696e841d Convert GdkVisual to a GObject.
2001-06-29  Alex Larsson  <alexl@redhat.com>

	* gdk/gdkvisual.h:
	* gdk/gdkcolor.c:
	* gdk/x11/gdkx.h:
	* gdk/x11/gdkvisual-x11.c:
	Convert GdkVisual to a GObject.

	* gdk/gdkinput.h:
	* gdk/gdkevents.c:
	* gdk/x11/gdkinputprivate.h:
	* gdk/x11/gdkinput-gxi.c:
	* gdk/x11/gdkinput-none.c:
	* gdk/x11/gdkinput-x11.c:
	* gdk/x11/gdkinput-xfree.c:
	* gdk/x11/gdkinput.c:
	Convert GdkDevice to a GObject.
2001-06-30 02:56:50 +00:00
Owen Taylor
85224117f4 Fix args to g_type_init().
Thu Jun 28 22:53:18 2001  Owen Taylor  <otaylor@redhat.com>

	*  gdk/gdk.c gtk/gtktypeutils.c: Fix args to g_type_init().
2001-06-29 02:54:55 +00:00
Havoc Pennington
0bee26c7ba Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28  Havoc Pennington  <hp@pobox.com>

	* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
	image data to the screen, using a server grab to avoid race
	conditions.

	* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
	check for NULL return from gtk_image_new_from_stock(), it never
	returns NULL.
	(gtk_item_factory_create_item): fix bug where we parsed the stock
	ID as an inline pixbuf

	* gtk/gtktext.c (gtk_text_key_press): numeric keypad support

	* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
	support (should be using binding set here)

	* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
	support (should be using binding set here)

	* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
	support

	* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support

	* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad

	* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad

	* gtk/gtkimcontextsimple.c
	(gtk_im_context_simple_filter_keypress): keypad

	* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad

	* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes

	* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support

	* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
	should be binding-setted)

	* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes

	* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes

	* gtk/gtkcalendar.c: numeric keypad fixes

	* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
	support

	* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
	screwup

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
	clip the render area to the drawable's clip region in advance,
	so we don't get data from the server that we don't need.

	* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
	check return value of gdk_pixbuf_get_from_drawable(), fall back
	to bilevel alpha if we can't get the pixbuf to composite against.

	* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap

	* gdk/gdkimage.c (gdk_image_get_colormap): add
	gdk_image_set_colormap, gdk_image_get_colormap

	* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
	take a region of the image, instead of converting the entire
	image.

	* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
	keybinding signal. Add default bindings for it. Add default
	handler for show_help that shows the tooltip for the widget.

	* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
	"close" keybinding signal, remove key press handler.

	* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
	it's not our usual practice to leave a deprecated function around
	with a runtime warning, plus we don't want it to appear in docs,
	plus if we make them yellow no one will want to change them
	anyhow.
2001-06-29 01:59:02 +00:00
Tim Janik
00f85bf815 !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
James Henstridge
cd3ddf900f The following changes correspond to bug #56812
2001-06-29  James Henstridge  <james@daa.com.au>

	The following changes correspond to bug #56812

	* gdk/gdkinput.h, gdk/gdkevents.c (GDK_TYPE_DEVICE): register type
	code for GdkDevice.

	* gdk/gdkcursor.[ch] (GDK_TYPE_CURSOR): register type code for
	GdkCursor.
2001-06-28 16:35:38 +00:00
Havoc Pennington
796dc4b1d7 new function for mapping a window without fooling with stacking order, but
2001-06-19  Havoc Pennington  <hp@pobox.com>

	* gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function
	for mapping a window without fooling with stacking order, but
	updating the "withdrawn" flag

	* gdk/x11/gdkevents-x11.c (gdk_event_translate): Do event
	filtering as soon as possible, moving move resize and wmspec_check
	handling after the event filter.  Make default filter apply to all
	events, not just those with no GdkWindow wrapped around the X
	window. Fix a FIXME about how the window could be a pixmap using
	RTTI; this of course assumes GDK_IS_WINDOW() is optimized.

	Also, be robust against events not on a known GdkWindow.

	* gdk/x11/gdkmain-x11.c (gdk_x11_grab_server,
	gdk_x11_ungrab_server): export reference-counted server grabs, so
	other people can grab server over a GDK function that also does
	so.
2001-06-28 05:24:00 +00:00
Alexander Larsson
75fd7f09af Added --enable-fbmanager. This is some experimental code that lets several
2001-06-25  Alexander Larsson  <alexl@redhat.com>

	* configure.in:
	Added --enable-fbmanager. This is some experimental code
	that lets several GtkFB apps coordinate their access to the
	framebuffer.

	* acconfig.h:
	Added ENABLE_FB_MANAGER.

	* gdk/linux-fb/Makefile.am:
	Added gdkfbmanager and gdkfbswitch.

	* gdk/linux-fb/gdkkeyboard-fb.c:
	* gdk/linux-fb/gdkmouse-fb.c:
	* gdk/linux-fb/gdkprivate-fb.h:
	Split device init and open so that
	they can be opened and closed while switched
	away.

	* gdk/linux-fb/gdkmain-fb.c:
	Add the basic manager communication.

	* gdk/linux-fb/gdkrender-fb.c:
	Don't update to the shadow fb if we're
	blocked by the fb manager.
2001-06-25 23:01:36 +00:00
Owen Taylor
cc223eeff6 Fix stupid error introduced last night that was making things decidedly
Sun Jun 24 11:29:35 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkimage-x11.c (gdk_image_new): Fix stupid error
	introduced last night that was making things decidedly not work.

	* gtk/*.[ch]: Patch from Kristian Rietveld adding 80 getters
	so that we have getter/setter pairing everywhere it makes
	sense. (#55767)

	* gtk/gtkradiobutton.[ch] gtk/gtktoolbar.c tests/testgtk.:
	Rename gtk_radio_button_group to gtk_radio_button_get_group, add a
	deprecated compat macro. (#55516)

	* gtk/gtklabel.[ch]: Add functions
	gtk_label_set/get_use_underline(), gtk_label_set/get_use_markup(),
	gtk_label_set_label(), which mirror the property API for GtkLabel.
	Make gtk_label_get_attributes() only reflect the attributes
	set by gtk_label_set_attributes.

	* gtk/gtknotebook.c (gtk_notebook_set_current_page) gtk/gtkcompat.h: Rename
	from gtk_notebook_set_page().
2001-06-24 15:34:48 +00:00
Owen Taylor
5a5580a8e7 Fix tests for XShm.h.
Sat Jun 23 18:02:46 2001  Owen Taylor  <otaylor@redhat.com>

        * configure.in: Fix tests for XShm.h.

        * gdk/x11/gdkimage-x11.c: Cleanup error handling in
        gdk_image_new() by use of goto, properly use g_object_unref().
2001-06-23 22:14:02 +00:00
Tim Janik
92e87e40a7 disabled g_free (image) calls, as GdkImage is an object. these should be
Sat Jun 23 22:03:20 2001  Tim Janik  <timj@gtk.org>

        * gdk/x11/gdkimage-x11.c (gdk_image_init): disabled g_free (image)
        calls, as GdkImage is an object. these should be g_obejct_unref()
        instead but that won't work because of the g_error() statement
        in gdk_x11_image_destroy(). so for now, i did s/g_free/LEAK_IMAGE/
        to spot these places.
2001-06-23 20:26:10 +00:00
Hans Breuer
f0ee2996e1 updated externals
2001-06-22  Hans Breuer  <hans@breuer.org>

	* gdk/gdk.def : updated externals

	* gdk/win32/gdkdrawable-win32.c : corrected some casts
	in GDK_NOTEs

	* gdk/win32/gdkevents-win32.c : use _gdk_windowing_window_get_offsets
	to translate coordinates to the internal > 16 bit system
	Try to handle WM_WINDOWPOSCHANGED to get better performance for
	when moving/resizing

	* gdk/win32/gdkkeys-win32.c : implement gdk_keymap_get_default ()
	and gdk_keymap_get_direction (). The latter is untested for
	the RTL case

	* gtk/gtk.def : updated externals

	* gtk/gtkmain.c : gtk_get_default_language () should reurn the result
	from pango_language_from_string (), not an already freed pointer

	* gtk/stock-icons/stock_menu_sort_ascending.png : PNGs need to be
	binary (-kb) to be useable on windoze
2001-06-22 14:08:51 +00:00
Owen Taylor
d809ceee2e Handle the case without XKB properly.
Thu Jun 21 13:42:01 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkkeys-x11.c (gdk_keymap_get_direction): Handle
	the case without XKB properly.

	* gtk/gtkrc.c (gtk_rc_set_default_files): Remove
	unused gtk_rc_auto_parse variable.

	* gtk/gtkrc.[ch] gtk/gtkstyle.c docs/Changes-2.0.txt:
	Remove gtk_rc_set_image_loader(), gtk_rc_load_image(), no
	longer needed with GdkPixbuf.

	* gtk/gtkrc.c (_gtk_rc_init): Make private.
2001-06-21 17:45:26 +00:00
Alexander Larsson
46880b96cf Update to new PangoLanguage changes.
2001-06-15  Alexander Larsson  <alexl@redhat.com>

	* gdk/linux-fb/gdkfont-fb.c (gdk_font_from_description):
	Update to new PangoLanguage changes.

	* gtk/gtkwindow-decorate.c:
	* gtk/gtkwindow.[ch]:
	Added setting argument to gtk_window_set_has_frame ()
2001-06-15 15:58:26 +00:00
Owen Taylor
cf2fab9077 Add a GtkWindowGroup struct that allows grouping together multiple windows
Fri Jun  8 17:56:52 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct
	that allows grouping together multiple windows so that grabs
	within that set of windows only affect those windows.

	* gtk/gtkmain.c gtk/gtkwidget.[ch]: Add a "grab_notify"
	signal for notification when a widget becomes shadowed
	by a grab or is no longer shadowed by a grab.

	* gtk/gtkwidget.c (gtk_widget_propagate_state)
	  gtk/gtkmain.c: (gtk_widget_grab_add): Don't allow
	insenstive widgets to maintain a grab.
2001-06-14 21:44:01 +00:00
Owen Taylor
22491fd6a4 Add missing gdk_rectangle_get_type() prototype.
Mon Jun 11 18:15:16 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.h: Add missing gdk_rectangle_get_type() prototype.

	* gtk/gtk[hv]scale.c: Include math.h, stdlib.h

	* gdk/gdkpango.h gtk/gtkclist.c gtk/gtkentry.c gtk/gtkmain.[ch]
	  gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtktextbuffer.c
	  gtk/gtktextdisplay.c gtk/gtktextiter.[ch]
	  gtk/gtktextlayout.c gtk/gtktexttag.[ch] gtk/gtkwidget.c: Adapt
	  to recent changes in Pango.

	* tests/testgtk.c: Set language tags with gtk_label_set_markup()
	  to test whether the basic engine honors them.
2001-06-14 20:41:44 +00:00
Alexander Larsson
7d1a049bc3 Add some example config files that can be used with the URW fonts.
2001-06-14  Alexander Larsson  <alexl@redhat.com>

        * docs/README.linux-fb:
	Add some example config files that can be used with the URW fonts.

	* gdk/linux-fb/gdkvisual-fb.c (gdk_visual_init):
	Set up the color ramps for DirectColor mode.
2001-06-14 18:10:01 +00:00
Alexander Larsson
be12f52526 Unify shaped window code and make it repaint the area that used to be part
2001-06-13  Alexander Larsson  <alla@lysator.liu.se>

	* gdk/linux-fb/gdkwindow-fb.c:
	Unify shaped window code and make it repaint the area that used
	to be part of the shape, but isn't anymore.
2001-06-13 21:40:37 +00:00
Alexander Larsson
b2ff45ef83 Don't pass on GDK_ACTION_DEFAULT. The Xdnd code passes zero instead, so do
2001-06-13  Alexander Larsson  <alla@lysator.liu.se>

	* gdk/linux-fb/gdkdnd-fb.c (gdk_drag_status):
	Don't pass on GDK_ACTION_DEFAULT. The Xdnd code
	passes zero instead, so do we.
2001-06-13 16:00:24 +00:00
Alexander Larsson
099da4d222 Deep copy dash_list too. (_gdk_fb_gc_new): Set default cap_style before
2001-06-13  Alexander Larsson  <alla@lysator.liu.se>

	* gdk/linux-fb/gdkgc-fb.c (gdk_gc_copy):
	Deep copy dash_list too.
	(_gdk_fb_gc_new): Set default cap_style before
	setting values.
2001-06-13 15:02:35 +00:00