Commit caf8ebc6 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Reference count the fonts used in the text widget.

Mon Aug 24 18:37:15 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c: Reference count the fonts used in
	the text widget.

	* gdk/gdk.h gdk/gdkcolor.c: Rename the color allocation
	freeing functions to be more consistent, and more
	convenient; leave the old names in for backwards compatibility.

	* gdk/gdkcolor.c gdk/gdkprivate.h: Reference count the
	allocations in pseudo-color colormaps to greatly reduce
	calls to XAllocColor. Keep a per-colormap hashtable to
	speed up finding if there is an already-allocated matching
	color.

	* gdk/gdkcolor.c: Don't just match read the system colormap
	when the colormap is created, but synchronize our copy
	with the system colormap periodically.

	* gdk/gdk.c gdk/gdktypes.h gtk/gtkentry.c gtk/gtktext.c:
	Change XIM constants names to match GDK conventions

	* gtk/testinput.c: Allow the drawing area to get the focus.

	* gtk/testgtk.c: Change around the Text test to demonstrates
	multiple fonts, use more colors.

	* gtk/gtkwidget.c: Improve gtk_widget_get_colormap()/visual()
	so they work after a widget is unrealized.

	* gtk/gtktext.[ch]: Remove the requirement that the text
	widget be realized before adding text (!) Allocate colors
	ourself, instead of requiring the caller allocate them.
	Allow changing styles to work properly by keeping track
	of the values for a certain property are default or
	set explicitely.

	* gtk/gtkmenu.h: Added some comments.

	* gtk/gtkentry.c: Changes to match XIM constants.

	* gtk/gdk.h gdk/gdkwindow.c: Add gdk_drawable_set_data(),
	for adding keyed data to drawables. (Uses g_dataset
	internally)

	* gdk/gdkpixmap.c: Keep track of the colors we allocate,
	when creating an XPM - store them as user data for the GdkPixmap,
	so we don't leak colors when we create pixmaps from XPM's.

	Allocate memory for color information in large blocks instead of
	as many little pieces.
parent b93d6892
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
the text widget.
* gdk/gdk.h gdk/gdkcolor.c: Rename the color allocation
freeing functions to be more consistent, and more
convenient; leave the old names in for backwards compatibility.
* gdk/gdkcolor.c gdk/gdkprivate.h: Reference count the
allocations in pseudo-color colormaps to greatly reduce
calls to XAllocColor. Keep a per-colormap hashtable to
speed up finding if there is an already-allocated matching
color.
* gdk/gdkcolor.c: Don't just match read the system colormap
when the colormap is created, but synchronize our copy
with the system colormap periodically.
* gdk/gdk.c gdk/gdktypes.h gtk/gtkentry.c gtk/gtktext.c:
Change XIM constants names to match GDK conventions
* gtk/testinput.c: Allow the drawing area to get the focus.
* gtk/testgtk.c: Change around the Text test to demonstrates
multiple fonts, use more colors.
* gtk/gtkwidget.c: Improve gtk_widget_get_colormap()/visual()
so they work after a widget is unrealized.
* gtk/gtktext.[ch]: Remove the requirement that the text
widget be realized before adding text (!) Allocate colors
ourself, instead of requiring the caller allocate them.
Allow changing styles to work properly by keeping track
of the values for a certain property are default or
set explicitely.
* gtk/gtkmenu.h: Added some comments.
* gtk/gtkentry.c: Changes to match XIM constants.
* gtk/gdk.h gdk/gdkwindow.c: Add gdk_drawable_set_data(),
for adding keyed data to drawables. (Uses g_dataset
internally)
* gdk/gdkpixmap.c: Keep track of the colors we allocate,
when creating an XPM - store them as user data for the GdkPixmap,
so we don't leak colors when we create pixmaps from XPM's.
Allocate memory for color information in large blocks instead of
as many little pieces.
Mon Aug 24 11:09:32 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: removed some unused variables
......
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
the text widget.
* gdk/gdk.h gdk/gdkcolor.c: Rename the color allocation
freeing functions to be more consistent, and more
convenient; leave the old names in for backwards compatibility.
* gdk/gdkcolor.c gdk/gdkprivate.h: Reference count the
allocations in pseudo-color colormaps to greatly reduce
calls to XAllocColor. Keep a per-colormap hashtable to
speed up finding if there is an already-allocated matching
color.
* gdk/gdkcolor.c: Don't just match read the system colormap
when the colormap is created, but synchronize our copy
with the system colormap periodically.
* gdk/gdk.c gdk/gdktypes.h gtk/gtkentry.c gtk/gtktext.c:
Change XIM constants names to match GDK conventions
* gtk/testinput.c: Allow the drawing area to get the focus.
* gtk/testgtk.c: Change around the Text test to demonstrates
multiple fonts, use more colors.
* gtk/gtkwidget.c: Improve gtk_widget_get_colormap()/visual()
so they work after a widget is unrealized.
* gtk/gtktext.[ch]: Remove the requirement that the text
widget be realized before adding text (!) Allocate colors
ourself, instead of requiring the caller allocate them.
Allow changing styles to work properly by keeping track
of the values for a certain property are default or
set explicitely.
* gtk/gtkmenu.h: Added some comments.
* gtk/gtkentry.c: Changes to match XIM constants.
* gtk/gdk.h gdk/gdkwindow.c: Add gdk_drawable_set_data(),
for adding keyed data to drawables. (Uses g_dataset
internally)
* gdk/gdkpixmap.c: Keep track of the colors we allocate,
when creating an XPM - store them as user data for the GdkPixmap,
so we don't leak colors when we create pixmaps from XPM's.
Allocate memory for color information in large blocks instead of
as many little pieces.
Mon Aug 24 11:09:32 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: removed some unused variables
......
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
the text widget.
* gdk/gdk.h gdk/gdkcolor.c: Rename the color allocation
freeing functions to be more consistent, and more
convenient; leave the old names in for backwards compatibility.
* gdk/gdkcolor.c gdk/gdkprivate.h: Reference count the
allocations in pseudo-color colormaps to greatly reduce
calls to XAllocColor. Keep a per-colormap hashtable to
speed up finding if there is an already-allocated matching
color.
* gdk/gdkcolor.c: Don't just match read the system colormap
when the colormap is created, but synchronize our copy
with the system colormap periodically.
* gdk/gdk.c gdk/gdktypes.h gtk/gtkentry.c gtk/gtktext.c:
Change XIM constants names to match GDK conventions
* gtk/testinput.c: Allow the drawing area to get the focus.
* gtk/testgtk.c: Change around the Text test to demonstrates
multiple fonts, use more colors.
* gtk/gtkwidget.c: Improve gtk_widget_get_colormap()/visual()
so they work after a widget is unrealized.
* gtk/gtktext.[ch]: Remove the requirement that the text
widget be realized before adding text (!) Allocate colors
ourself, instead of requiring the caller allocate them.
Allow changing styles to work properly by keeping track
of the values for a certain property are default or
set explicitely.
* gtk/gtkmenu.h: Added some comments.
* gtk/gtkentry.c: Changes to match XIM constants.
* gtk/gdk.h gdk/gdkwindow.c: Add gdk_drawable_set_data(),
for adding keyed data to drawables. (Uses g_dataset
internally)
* gdk/gdkpixmap.c: Keep track of the colors we allocate,
when creating an XPM - store them as user data for the GdkPixmap,
so we don't leak colors when we create pixmaps from XPM's.
Allocate memory for color information in large blocks instead of
as many little pieces.
Mon Aug 24 11:09:32 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: removed some unused variables
......
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
the text widget.
* gdk/gdk.h gdk/gdkcolor.c: Rename the color allocation
freeing functions to be more consistent, and more
convenient; leave the old names in for backwards compatibility.
* gdk/gdkcolor.c gdk/gdkprivate.h: Reference count the
allocations in pseudo-color colormaps to greatly reduce
calls to XAllocColor. Keep a per-colormap hashtable to
speed up finding if there is an already-allocated matching
color.
* gdk/gdkcolor.c: Don't just match read the system colormap
when the colormap is created, but synchronize our copy
with the system colormap periodically.
* gdk/gdk.c gdk/gdktypes.h gtk/gtkentry.c gtk/gtktext.c:
Change XIM constants names to match GDK conventions
* gtk/testinput.c: Allow the drawing area to get the focus.
* gtk/testgtk.c: Change around the Text test to demonstrates
multiple fonts, use more colors.
* gtk/gtkwidget.c: Improve gtk_widget_get_colormap()/visual()
so they work after a widget is unrealized.
* gtk/gtktext.[ch]: Remove the requirement that the text
widget be realized before adding text (!) Allocate colors
ourself, instead of requiring the caller allocate them.
Allow changing styles to work properly by keeping track
of the values for a certain property are default or
set explicitely.
* gtk/gtkmenu.h: Added some comments.
* gtk/gtkentry.c: Changes to match XIM constants.
* gtk/gdk.h gdk/gdkwindow.c: Add gdk_drawable_set_data(),
for adding keyed data to drawables. (Uses g_dataset
internally)
* gdk/gdkpixmap.c: Keep track of the colors we allocate,
when creating an XPM - store them as user data for the GdkPixmap,
so we don't leak colors when we create pixmaps from XPM's.
Allocate memory for color information in large blocks instead of
as many little pieces.
Mon Aug 24 11:09:32 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: removed some unused variables
......
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
the text widget.
* gdk/gdk.h gdk/gdkcolor.c: Rename the color allocation
freeing functions to be more consistent, and more
convenient; leave the old names in for backwards compatibility.
* gdk/gdkcolor.c gdk/gdkprivate.h: Reference count the
allocations in pseudo-color colormaps to greatly reduce
calls to XAllocColor. Keep a per-colormap hashtable to
speed up finding if there is an already-allocated matching
color.
* gdk/gdkcolor.c: Don't just match read the system colormap
when the colormap is created, but synchronize our copy
with the system colormap periodically.
* gdk/gdk.c gdk/gdktypes.h gtk/gtkentry.c gtk/gtktext.c:
Change XIM constants names to match GDK conventions
* gtk/testinput.c: Allow the drawing area to get the focus.
* gtk/testgtk.c: Change around the Text test to demonstrates
multiple fonts, use more colors.
* gtk/gtkwidget.c: Improve gtk_widget_get_colormap()/visual()
so they work after a widget is unrealized.
* gtk/gtktext.[ch]: Remove the requirement that the text
widget be realized before adding text (!) Allocate colors
ourself, instead of requiring the caller allocate them.
Allow changing styles to work properly by keeping track
of the values for a certain property are default or
set explicitely.
* gtk/gtkmenu.h: Added some comments.
* gtk/gtkentry.c: Changes to match XIM constants.
* gtk/gdk.h gdk/gdkwindow.c: Add gdk_drawable_set_data(),
for adding keyed data to drawables. (Uses g_dataset
internally)
* gdk/gdkpixmap.c: Keep track of the colors we allocate,
when creating an XPM - store them as user data for the GdkPixmap,
so we don't leak colors when we create pixmaps from XPM's.
Allocate memory for color information in large blocks instead of
as many little pieces.
Mon Aug 24 11:09:32 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: removed some unused variables
......
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
the text widget.
* gdk/gdk.h gdk/gdkcolor.c: Rename the color allocation
freeing functions to be more consistent, and more
convenient; leave the old names in for backwards compatibility.
* gdk/gdkcolor.c gdk/gdkprivate.h: Reference count the
allocations in pseudo-color colormaps to greatly reduce
calls to XAllocColor. Keep a per-colormap hashtable to
speed up finding if there is an already-allocated matching
color.
* gdk/gdkcolor.c: Don't just match read the system colormap
when the colormap is created, but synchronize our copy
with the system colormap periodically.
* gdk/gdk.c gdk/gdktypes.h gtk/gtkentry.c gtk/gtktext.c:
Change XIM constants names to match GDK conventions
* gtk/testinput.c: Allow the drawing area to get the focus.
* gtk/testgtk.c: Change around the Text test to demonstrates
multiple fonts, use more colors.
* gtk/gtkwidget.c: Improve gtk_widget_get_colormap()/visual()
so they work after a widget is unrealized.
* gtk/gtktext.[ch]: Remove the requirement that the text
widget be realized before adding text (!) Allocate colors
ourself, instead of requiring the caller allocate them.
Allow changing styles to work properly by keeping track
of the values for a certain property are default or
set explicitely.
* gtk/gtkmenu.h: Added some comments.
* gtk/gtkentry.c: Changes to match XIM constants.
* gtk/gdk.h gdk/gdkwindow.c: Add gdk_drawable_set_data(),
for adding keyed data to drawables. (Uses g_dataset
internally)
* gdk/gdkpixmap.c: Keep track of the colors we allocate,
when creating an XPM - store them as user data for the GdkPixmap,
so we don't leak colors when we create pixmaps from XPM's.
Allocate memory for color information in large blocks instead of
as many little pieces.
Mon Aug 24 11:09:32 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: removed some unused variables
......
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
the text widget.
* gdk/gdk.h gdk/gdkcolor.c: Rename the color allocation
freeing functions to be more consistent, and more
convenient; leave the old names in for backwards compatibility.
* gdk/gdkcolor.c gdk/gdkprivate.h: Reference count the
allocations in pseudo-color colormaps to greatly reduce
calls to XAllocColor. Keep a per-colormap hashtable to
speed up finding if there is an already-allocated matching
color.
* gdk/gdkcolor.c: Don't just match read the system colormap
when the colormap is created, but synchronize our copy
with the system colormap periodically.
* gdk/gdk.c gdk/gdktypes.h gtk/gtkentry.c gtk/gtktext.c:
Change XIM constants names to match GDK conventions
* gtk/testinput.c: Allow the drawing area to get the focus.
* gtk/testgtk.c: Change around the Text test to demonstrates
multiple fonts, use more colors.
* gtk/gtkwidget.c: Improve gtk_widget_get_colormap()/visual()
so they work after a widget is unrealized.
* gtk/gtktext.[ch]: Remove the requirement that the text
widget be realized before adding text (!) Allocate colors
ourself, instead of requiring the caller allocate them.
Allow changing styles to work properly by keeping track
of the values for a certain property are default or
set explicitely.
* gtk/gtkmenu.h: Added some comments.
* gtk/gtkentry.c: Changes to match XIM constants.
* gtk/gdk.h gdk/gdkwindow.c: Add gdk_drawable_set_data(),
for adding keyed data to drawables. (Uses g_dataset
internally)
* gdk/gdkpixmap.c: Keep track of the colors we allocate,
when creating an XPM - store them as user data for the GdkPixmap,
so we don't leak colors when we create pixmaps from XPM's.
Allocate memory for color information in large blocks instead of
as many little pieces.
Mon Aug 24 11:09:32 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: removed some unused variables
......
......@@ -271,3 +271,5 @@ Text/Edit widget:
[ From: Stefan Jeske <jeske@braunschweig.netsurf.de> ]
- "changed" emitted when doing deletes on empty Text widget.
- Delete IC in editable->unrealize, not editable->finalize?
\ No newline at end of file
......@@ -446,15 +446,15 @@ gdk_init (int *argc,
{
(*argv)[i++] = NULL;
if (strcmp ("none", (*argv)[i]) == 0)
gdk_im_set_best_style (GdkIMPreeditNone);
gdk_im_set_best_style (GDK_IM_PREEDIT_NONE);
else if (strcmp ("nothing", (*argv)[i]) == 0)
gdk_im_set_best_style (GdkIMPreeditNothing);
gdk_im_set_best_style (GDK_IM_PREEDIT_NOTHING);
else if (strcmp ("area", (*argv)[i]) == 0)
gdk_im_set_best_style (GdkIMPreeditArea);
gdk_im_set_best_style (GDK_IM_PREEDIT_AREA);
else if (strcmp ("position", (*argv)[i]) == 0)
gdk_im_set_best_style (GdkIMPreeditPosition);
gdk_im_set_best_style (GDK_IM_PREEDIT_POSITION);
else if (strcmp ("callbacks", (*argv)[i]) == 0)
gdk_im_set_best_style (GdkIMPreeditCallbacks);
gdk_im_set_best_style (GDK_IM_PREEDIT_CALLBACKS);
}
}
else if (strcmp ("--xim-status", (*argv)[i]) == 0)
......@@ -463,13 +463,13 @@ gdk_init (int *argc,
{
(*argv)[i++] = NULL;
if (strcmp ("none", (*argv)[i]) == 0)
gdk_im_set_best_style (GdkIMStatusNone);
gdk_im_set_best_style (GDK_IM_STATUS_NONE);
else if (strcmp ("nothing", (*argv)[i]) == 0)
gdk_im_set_best_style (GdkIMStatusNothing);
gdk_im_set_best_style (GDK_IM_STATUS_NOTHING);
else if (strcmp ("area", (*argv)[i]) == 0)
gdk_im_set_best_style (GdkIMStatusArea);
gdk_im_set_best_style (GDK_IM_STATUS_AREA);
else if (strcmp ("callbacks", (*argv)[i]) == 0)
gdk_im_set_best_style (GdkIMStatusCallbacks);
gdk_im_set_best_style (GDK_IM_STATUS_CALLBACKS);
}
}
#endif
......@@ -584,10 +584,10 @@ gdk_init (int *argc,
xim_using = FALSE;
xim_im = NULL;
xim_styles = NULL;
if (!(xim_best_allowed_style & GdkIMPreeditMask))
gdk_im_set_best_style (GdkIMPreeditCallbacks);
if (!(xim_best_allowed_style & GdkIMStatusMask))
gdk_im_set_best_style (GdkIMStatusCallbacks);
if (!(xim_best_allowed_style & GDK_IM_PREEDIT_MASK))
gdk_im_set_best_style (GDK_IM_PREEDIT_CALLBACKS);
if (!(xim_best_allowed_style & GDK_IM_STATUS_MASK))
gdk_im_set_best_style (GDK_IM_STATUS_CALLBACKS);
xim_ic = NULL;
xim_window = (GdkWindow*)NULL;
......@@ -3570,34 +3570,34 @@ gdk_im_choose_better_style (GdkIMStyle style1, GdkIMStyle style2)
if (style1 == 0) return style2;
if (style2 == 0) return style1;
if ((style1 & (GdkIMPreeditMask | GdkIMStatusMask))
== (style2 & (GdkIMPreeditMask | GdkIMStatusMask)))
if ((style1 & (GDK_IM_PREEDIT_MASK | GDK_IM_STATUS_MASK))
== (style2 & (GDK_IM_PREEDIT_MASK | GDK_IM_STATUS_MASK)))
return style1;
s1 = style1 & GdkIMPreeditMask;
s2 = style2 & GdkIMPreeditMask;
s1 = style1 & GDK_IM_PREEDIT_MASK;
s2 = style2 & GDK_IM_PREEDIT_MASK;
u = s1 | s2;
if (s1 != s2) {
if (u & GdkIMPreeditCallbacks)
return (s1 == GdkIMPreeditCallbacks)? style1:style2;
else if (u & GdkIMPreeditPosition)
return (s1 == GdkIMPreeditPosition)? style1:style2;
else if (u & GdkIMPreeditArea)
return (s1 == GdkIMPreeditArea)? style1:style2;
else if (u & GdkIMPreeditNothing)
return (s1 == GdkIMPreeditNothing)? style1:style2;
if (u & GDK_IM_PREEDIT_CALLBACKS)
return (s1 == GDK_IM_PREEDIT_CALLBACKS)? style1:style2;
else if (u & GDK_IM_PREEDIT_POSITION)
return (s1 == GDK_IM_PREEDIT_POSITION)? style1:style2;
else if (u & GDK_IM_PREEDIT_AREA)
return (s1 == GDK_IM_PREEDIT_AREA)? style1:style2;
else if (u & GDK_IM_PREEDIT_NOTHING)
return (s1 == GDK_IM_PREEDIT_NOTHING)? style1:style2;
} else {
s1 = style1 & GdkIMStatusMask;
s2 = style2 & GdkIMStatusMask;
s1 = style1 & GDK_IM_STATUS_MASK;
s2 = style2 & GDK_IM_STATUS_MASK;
u = s1 | s2;
if ( u & GdkIMStatusCallbacks)
return (s1 == GdkIMStatusCallbacks)? style1:style2;
else if ( u & GdkIMStatusArea)
return (s1 == GdkIMStatusArea)? style1:style2;
else if ( u & GdkIMStatusNothing)
return (s1 == GdkIMStatusNothing)? style1:style2;
else if ( u & GdkIMStatusNone)
return (s1 == GdkIMStatusNone)? style1:style2;
if ( u & GDK_IM_STATUS_CALLBACKS)
return (s1 == GDK_IM_STATUS_CALLBACKS)? style1:style2;
else if ( u & GDK_IM_STATUS_AREA)
return (s1 == GDK_IM_STATUS_AREA)? style1:style2;
else if ( u & GDK_IM_STATUS_NOTHING)
return (s1 == GDK_IM_STATUS_NOTHING)? style1:style2;
else if ( u & GDK_IM_STATUS_NONE)
return (s1 == GDK_IM_STATUS_NONE)? style1:style2;
}
return 0; /* Get rid of stupid warning */
}
......@@ -3623,39 +3623,39 @@ gdk_im_decide_style (GdkIMStyle supported_style)
GdkIMStyle
gdk_im_set_best_style (GdkIMStyle style)
{
if (style & GdkIMPreeditMask)
if (style & GDK_IM_PREEDIT_MASK)
{
xim_best_allowed_style &= ~GdkIMPreeditMask;
xim_best_allowed_style |= GdkIMPreeditNone;
if (!(style & GdkIMPreeditNone))
xim_best_allowed_style &= ~GDK_IM_PREEDIT_MASK;
xim_best_allowed_style |= GDK_IM_PREEDIT_NONE;
if (!(style & GDK_IM_PREEDIT_NONE))
{
xim_best_allowed_style |= GdkIMPreeditNothing;
if (!(style & GdkIMPreeditNothing))
xim_best_allowed_style |= GDK_IM_PREEDIT_NOTHING;
if (!(style & GDK_IM_PREEDIT_NOTHING))
{
xim_best_allowed_style |= GdkIMPreeditArea;
if (!(style & GdkIMPreeditArea))
xim_best_allowed_style |= GDK_IM_PREEDIT_AREA;
if (!(style & GDK_IM_PREEDIT_AREA))
{
xim_best_allowed_style |= GdkIMPreeditPosition;
if (!(style & GdkIMPreeditPosition))
xim_best_allowed_style |= GdkIMPreeditCallbacks;
xim_best_allowed_style |= GDK_IM_PREEDIT_POSITION;
if (!(style & GDK_IM_PREEDIT_POSITION))
xim_best_allowed_style |= GDK_IM_PREEDIT_CALLBACKS;
}
}
}
}
if (style & GdkIMStatusMask)
if (style & GDK_IM_STATUS_MASK)
{
xim_best_allowed_style &= ~GdkIMStatusMask;
xim_best_allowed_style |= GdkIMStatusNone;
if (!(style & GdkIMStatusNone))
xim_best_allowed_style &= ~GDK_IM_STATUS_MASK;
xim_best_allowed_style |= GDK_IM_STATUS_NONE;
if (!(style & GDK_IM_STATUS_NONE))
{
xim_best_allowed_style |= GdkIMStatusNothing;
if (!(style & GdkIMStatusNothing))
xim_best_allowed_style |= GDK_IM_STATUS_NOTHING;
if (!(style & GDK_IM_STATUS_NOTHING))
{
xim_best_allowed_style |= GdkIMStatusArea;
if (!(style & GdkIMStatusArea))
xim_best_allowed_style |= GdkIMStatusCallbacks;
xim_best_allowed_style |= GDK_IM_STATUS_AREA;
if (!(style & GDK_IM_STATUS_AREA))
xim_best_allowed_style |= GDK_IM_STATUS_CALLBACKS;
}
}
}
......@@ -3960,13 +3960,13 @@ gdk_im_end (void)
GdkIMStyle
gdk_im_decide_style (GdkIMStyle supported_style)
{
return GdkIMPreeditNone | GdkIMStatusNone;
return GDK_IM_PREEDIT_NONE | GDK_IM_STATUS_NONE;
}
GdkIMStyle
gdk_im_set_best_style (GdkIMStyle style)
{
return GdkIMPreeditNone | GdkIMStatusNone;
return GDK_IM_PREEDIT_NONE | GDK_IM_STATUS_NONE;
}
gint
......@@ -3991,7 +3991,7 @@ gdk_ic_destroy (GdkIC ic)
GdkIMStyle
gdk_ic_get_style (GdkIC ic)
{
return GdkIMPreeditNone | GdkIMStatusNone;
return GDK_IM_PREEDIT_NONE | GDK_IM_STATUS_NONE;
}
void
......
......@@ -307,6 +307,11 @@ void gdk_window_set_functions (GdkWindow *window,
GdkWMFunction functions);
GList * gdk_window_get_toplevels (void);
void gdk_drawable_set_data (GdkDrawable *drawable,
const gchar *key,
gpointer data,
GDestroyNotify destroy_func);
/* Cursors
*/
......@@ -455,6 +460,22 @@ gint gdk_colormap_get_system_size (void);
void gdk_colormap_change (GdkColormap *colormap,
gint ncolors);
gint gdk_colormap_alloc_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors,
gboolean writeable,
gboolean best_match,
gboolean *success);
gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
GdkColor *color,
gboolean writeable,
gboolean best_match);
void gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors);
void gdk_colors_store (GdkColormap *colormap,
GdkColor *colors,
gint ncolors);
......@@ -482,8 +503,10 @@ gint gdk_color_alloc (GdkColormap *colormap,
GdkColor *color);
gint gdk_color_change (GdkColormap *colormap,
GdkColor *color);
gint gdk_color_equal (GdkColor *colora,
GdkColor *colorb);
guint gdk_color_hash (const GdkColor *colora,
const GdkColor *colorb);
gint gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
/* Fonts
......@@ -722,22 +745,27 @@ GdkTimeCoord *gdk_input_motion_events (GdkWindow *window,
/* International Input Method Support Functions
*/
gint gdk_im_ready (void);
void gdk_im_begin (GdkIC ic, GdkWindow* window);
void gdk_im_end (void);
GdkIMStyle gdk_im_decide_style (GdkIMStyle supported_style);
GdkIMStyle gdk_im_set_best_style (GdkIMStyle best_allowed_style);
GdkIC gdk_ic_new (GdkWindow* client_window,
GdkWindow* focus_window,
GdkIMStyle style, ...);
void gdk_ic_destroy (GdkIC ic);
GdkIMStyle gdk_ic_get_style (GdkIC ic);
void gdk_ic_set_values (GdkIC ic, ...);
void gdk_ic_get_values (GdkIC ic, ...);
void gdk_ic_set_attr (GdkIC ic, const char *target, ...);
void gdk_ic_get_attr (GdkIC ic, const char *target, ...);
GdkEventMask gdk_ic_get_events (GdkIC ic);
gint gdk_im_ready (void);
void gdk_im_begin (GdkIC ic,
GdkWindow* window);
void gdk_im_end (void);
GdkIMStyle gdk_im_decide_style (GdkIMStyle supported_style);
GdkIMStyle gdk_im_set_best_style (GdkIMStyle best_allowed_style);
GdkIC gdk_ic_new (GdkWindow* client_window,
GdkWindow* focus_window,
GdkIMStyle style, ...);
void gdk_ic_destroy (GdkIC ic);
GdkIMStyle gdk_ic_get_style (GdkIC ic);
void gdk_ic_set_values (GdkIC ic,
...);
void gdk_ic_get_values (GdkIC ic,
...);
void gdk_ic_set_attr (GdkIC ic,
const char *target, ...);
void gdk_ic_get_attr (GdkIC ic,
const char *target, ...);
GdkEventMask gdk_ic_get_events (GdkIC ic);
/* Color Context */
......@@ -857,6 +885,7 @@ guint gdk_keyval_to_lower (guint keyval);
gboolean gdk_keyval_is_upper (guint keyval);
gboolean gdk_keyval_is_lower (guint keyval);
#include <gdk/gdkrgb.h>
#ifdef __cplusplus
......
This diff is collapsed.
......@@ -34,6 +34,13 @@ typedef struct
gint transparent;
} _GdkPixmapColor;
typedef struct
{
guint ncolors;
GdkColormap *colormap;
gulong pixels[1];
} _GdkPixmapInfo;
GdkPixmap*
gdk_pixmap_new (GdkWindow *window,
gint width,
......@@ -388,13 +395,6 @@ gdk_pixmap_extract_color (gchar *buffer)
return retcol;
}
static void
free_color (gpointer key, gpointer value, gpointer user_data)
{
g_free (key);
g_free (value);
}
enum buffer_op
{
......@@ -403,6 +403,23 @@ enum buffer_op
op_body
};
static void
gdk_xpm_destroy_notify (gpointer data)
{
_GdkPixmapInfo *info = (_GdkPixmapInfo *)data;
GdkColor color;
int i;
for (i=0; i<info->ncolors; i++)
{
color.pixel = info->pixels[i];
gdk_colormap_free_colors (info->colormap, &color, 1);
}
gdk_colormap_unref (info->colormap);
g_free (info);
}
static GdkPixmap *
_gdk_pixmap_create_from_xpm (GdkWindow *window,
......@@ -420,9 +437,12 @@ _gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkColor tmp_color;
gint width, height, num_cols, cpp, n, ns, cnt, xcnt, ycnt, wbytes;
gchar *buffer, pixel_str[32];