summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
Diffstat (limited to 'gdk')
-rw-r--r--gdk/Makefile.am3
-rw-r--r--gdk/gdk.c2
-rw-r--r--gdk/gdk.h5
-rw-r--r--gdk/gdkcolor.c4
-rw-r--r--gdk/gdkcolor.h25
-rw-r--r--gdk/gdkdrawable.h9
-rw-r--r--gdk/gdkfont.c2
-rw-r--r--gdk/gdkfont.h28
-rw-r--r--gdk/gdkrgb.c44
-rw-r--r--gdk/gdkwindow.h3
-rw-r--r--gdk/x11/Makefile.am3
-rw-r--r--gdk/x11/gdkcolor-x11.c20
-rw-r--r--gdk/x11/gdkfont-x11.c2
-rw-r--r--gdk/x11/gdkx.h19
14 files changed, 87 insertions, 82 deletions
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index bc40e7d954..2f3037ee96 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -14,14 +14,15 @@ EXTRA_DIST = \
common_includes = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gdk\" \
+ -DGDK_COMPILATION \
-I$(top_srcdir) \
-I$(top_builddir)/gdk \
-I$(top_srcdir)/gdk-pixbuf \
-DG_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
@GTK_DEBUG_FLAGS@ \
@GDK_DEP_CFLAGS@ \
- -DGDK_COMPILATION \
@STRIP_END@
INCLUDES = $(common_includes)
diff --git a/gdk/gdk.c b/gdk/gdk.c
index bcfb040d6b..c3caeb8bf6 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -475,8 +475,6 @@ gdk_init (int *argc, char ***argv)
void
gdk_exit (gint errorcode)
{
- /* de-initialisation is done by the gdk_exit_funct(),
- no need to do this here (Alex J.) */
exit (errorcode);
}
diff --git a/gdk/gdk.h b/gdk/gdk.h
index edae8d80ba..80cb257fa1 100644
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -88,12 +88,15 @@ gboolean gdk_get_use_xshm (void);
gchar* gdk_get_display (void);
G_CONST_RETURN gchar* gdk_get_display_arg_name (void);
-#ifndef GDK_DISABLE_DEPRECATED
+#if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
+/* Used by gtk_input_add_full () */
gint gdk_input_add_full (gint source,
GdkInputCondition condition,
GdkInputFunction function,
gpointer data,
GdkDestroyNotify destroy);
+#endif /* !GDK_DISABLE_DEPRECATED || GTK_COMPILATION */
+#ifndef GDK_DISABLE_DEPRECATED
gint gdk_input_add (gint source,
GdkInputCondition condition,
GdkInputFunction function,
diff --git a/gdk/gdkcolor.c b/gdk/gdkcolor.c
index a211ec9b9d..8b9778d8a4 100644
--- a/gdk/gdkcolor.c
+++ b/gdk/gdkcolor.c
@@ -170,7 +170,7 @@ gdk_color_white (GdkColormap *colormap,
color->green = 65535;
color->blue = 65535;
- return_val = gdk_color_alloc (colormap, color);
+ return_val = gdk_colormap_alloc_color (colormap, color, FALSE, TRUE);
}
else
return_val = FALSE;
@@ -202,7 +202,7 @@ gdk_color_black (GdkColormap *colormap,
color->green = 0;
color->blue = 0;
- return_val = gdk_color_alloc (colormap, color);
+ return_val = gdk_colormap_alloc_color (colormap, color, FALSE, TRUE);
}
else
return_val = FALSE;
diff --git a/gdk/gdkcolor.h b/gdk/gdkcolor.h
index 87bfc80d77..d1835dd8c2 100644
--- a/gdk/gdkcolor.h
+++ b/gdk/gdkcolor.h
@@ -74,7 +74,10 @@ GdkScreen *gdk_colormap_get_screen (GdkColormap *cmap);
#ifndef GDK_DISABLE_DEPRECATED
gint gdk_colormap_get_system_size (void);
+#endif
+#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
+/* Used by gdk_colors_store () */
void gdk_colormap_change (GdkColormap *colormap,
gint ncolors);
#endif
@@ -113,6 +116,18 @@ GType gdk_color_get_type (void);
void gdk_colors_store (GdkColormap *colormap,
GdkColor *colors,
gint ncolors);
+gint gdk_color_white (GdkColormap *colormap,
+ GdkColor *color);
+gint gdk_color_black (GdkColormap *colormap,
+ GdkColor *color);
+gint gdk_color_alloc (GdkColormap *colormap,
+ GdkColor *color);
+gint gdk_color_change (GdkColormap *colormap,
+ GdkColor *color);
+#endif /* GDK_DISABLE_DEPRECATED */
+
+#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
+/* Used by gdk_rgb_try_colormap () */
gint gdk_colors_alloc (GdkColormap *colormap,
gboolean contiguous,
gulong *planes,
@@ -123,15 +138,7 @@ void gdk_colors_free (GdkColormap *colormap,
gulong *pixels,
gint npixels,
gulong planes);
-gint gdk_color_white (GdkColormap *colormap,
- GdkColor *color);
-gint gdk_color_black (GdkColormap *colormap,
- GdkColor *color);
-gint gdk_color_alloc (GdkColormap *colormap,
- GdkColor *color);
-gint gdk_color_change (GdkColormap *colormap,
- GdkColor *color);
-#endif /* GDK_DISABLE_DEPRECATED */
+#endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
#ifdef __cplusplus
}
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
index e81d3935d8..f250f3ea09 100644
--- a/gdk/gdkdrawable.h
+++ b/gdk/gdkdrawable.h
@@ -236,13 +236,17 @@ void gdk_draw_polygon (GdkDrawable *drawable,
gboolean filled,
GdkPoint *points,
gint npoints);
-#ifndef GDK_DISABLE_DEPRECATED
+#if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
+/* Used by gtk_default_draw_string () */
void gdk_draw_string (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *string);
+#endif /* !GDK_DISABLE_DEPRECATED || GTK_COMPILATION */
+#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
+/* Used by gdk_pixmap_draw_text (), gdk_window_draw_text() */
void gdk_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
@@ -250,6 +254,7 @@ void gdk_draw_text (GdkDrawable *drawable,
gint y,
const gchar *text,
gint text_length);
+/* Used by gdk_pixmap_draw_text_wc (), gdk_window_draw_text_wc () */
void gdk_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
@@ -257,7 +262,7 @@ void gdk_draw_text_wc (GdkDrawable *drawable,
gint y,
const GdkWChar *text,
gint text_length);
-#endif /* GDK_DISABLE_DEPRECATED */
+#endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
void gdk_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
diff --git a/gdk/gdkfont.c b/gdk/gdkfont.c
index c116851ab3..02dd2f214b 100644
--- a/gdk/gdkfont.c
+++ b/gdk/gdkfont.c
@@ -24,6 +24,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+#undef GDK_DISABLE_DEPRECATED
+
#include "gdkdisplay.h"
#include "gdkfont.h"
#include "gdkinternals.h"
diff --git a/gdk/gdkfont.h b/gdk/gdkfont.h
index 5ff42873e4..32d66e9d63 100644
--- a/gdk/gdkfont.h
+++ b/gdk/gdkfont.h
@@ -1,4 +1,4 @@
-#ifndef GDK_DISABLE_DEPRECATED
+#if !defined(GDK_DISABLE_DEPRECATED) || defined(GDK_COMPILATION) || defined(GTK_COMPILATION)
#ifndef __GDK_FONT_H__
#define __GDK_FONT_H__
@@ -31,11 +31,11 @@ struct _GdkFont
GType gdk_font_get_type (void);
-#ifndef GDK_MULTIHEAD_SAFE
-GdkFont* gdk_font_load (const gchar *font_name);
-GdkFont* gdk_fontset_load (const gchar *fontset_name);
-GdkFont* gdk_font_from_description (PangoFontDescription *font_desc);
-#endif
+GdkFont* gdk_font_ref (GdkFont *font);
+void gdk_font_unref (GdkFont *font);
+gint gdk_font_id (const GdkFont *font);
+gboolean gdk_font_equal (const GdkFont *fonta,
+ const GdkFont *fontb);
GdkFont *gdk_font_load_for_display (GdkDisplay *display,
const gchar *font_name);
@@ -44,11 +44,13 @@ GdkFont *gdk_fontset_load_for_display (GdkDisplay *display,
GdkFont *gdk_font_from_description_for_display (GdkDisplay *display,
PangoFontDescription *font_desc);
-GdkFont* gdk_font_ref (GdkFont *font);
-void gdk_font_unref (GdkFont *font);
-gint gdk_font_id (const GdkFont *font);
-gboolean gdk_font_equal (const GdkFont *fonta,
- const GdkFont *fontb);
+#ifndef GDK_DISABLE_DEPRECATED
+
+#ifndef GDK_MULTIHEAD_SAFE
+GdkFont* gdk_font_load (const gchar *font_name);
+GdkFont* gdk_fontset_load (const gchar *fontset_name);
+GdkFont* gdk_font_from_description (PangoFontDescription *font_desc);
+#endif
gint gdk_string_width (GdkFont *font,
const gchar *string);
@@ -103,10 +105,12 @@ void gdk_string_extents (GdkFont *font,
GdkDisplay * gdk_font_get_display (GdkFont *font);
+#endif /* GDK_DISABLE_DEPRECATED */
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_FONT_H__ */
-#endif /* GDK_DISABLE_DEPRECATED */
+#endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION || GTK_COMPILATION */
diff --git a/gdk/gdkrgb.c b/gdk/gdkrgb.c
index 9d80cd424c..20f1eef31f 100644
--- a/gdk/gdkrgb.c
+++ b/gdk/gdkrgb.c
@@ -146,7 +146,7 @@ static gboolean gdk_rgb_verbose = FALSE;
static gint
gdk_rgb_cmap_fail (const char *msg, GdkColormap *cmap, gulong *pixels)
{
- gulong free_pixels[256];
+ GdkColor free_colors[256];
gint n_free;
gint i;
@@ -156,9 +156,9 @@ gdk_rgb_cmap_fail (const char *msg, GdkColormap *cmap, gulong *pixels)
n_free = 0;
for (i = 0; i < 256; i++)
if (pixels[i] < 256)
- free_pixels[n_free++] = pixels[i];
+ free_colors[n_free++].pixel = pixels[i];
if (n_free)
- gdk_colors_free (cmap, free_pixels, n_free, 0);
+ gdk_colormap_free_colors (cmap, free_colors, n_free);
return 0;
}
@@ -257,18 +257,22 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force,
b0 = bi * 255 / (nb - 1);
idx = ((ri * nr) + gi) * nb + bi;
d2 = (r - r0) * (r - r0) + (g - g0) * (g - g0) + (b - b0) * (b - b0);
- if (d2 < best[idx]) {
- if (pixels[idx] < 256)
- gdk_colors_free (cmap, pixels + idx, 1, 0);
- else
- colors_needed--;
- color = cmap->colors[i];
- if (!gdk_colormap_alloc_color (cmap, &color, FALSE, FALSE))
- return gdk_rgb_cmap_fail ("error allocating system color\n",
- cmap, pixels);
- pixels[idx] = color.pixel; /* which is almost certainly i */
- best[idx] = d2;
- }
+ if (d2 < best[idx])
+ {
+ if (pixels[idx] < 256)
+ {
+ color.pixel = pixels[idx];
+ gdk_colormap_free_colors (cmap, &color, 1);
+ }
+ else
+ colors_needed--;
+ color = cmap->colors[i];
+ if (!gdk_colormap_alloc_color (cmap, &color, FALSE, FALSE))
+ return gdk_rgb_cmap_fail ("error allocating system color\n",
+ cmap, pixels);
+ pixels[idx] = color.pixel; /* which is almost certainly i */
+ best[idx] = d2;
+ }
}
#endif
@@ -3108,15 +3112,7 @@ gdk_draw_rgb_image_core (GdkRgbInfo *image_info,
if (image_info->bitmap)
{
if (image_info->own_gc == NULL)
- {
- GdkColor color;
-
- image_info->own_gc = gdk_gc_new (drawable);
- gdk_color_white (image_info->cmap, &color);
- gdk_gc_set_foreground (image_info->own_gc, &color);
- gdk_color_black (image_info->cmap, &color);
- gdk_gc_set_background (image_info->own_gc, &color);
- }
+ image_info->own_gc = gdk_gc_new (drawable);
gc = image_info->own_gc;
}
for (y0 = 0; y0 < height; y0 += GDK_SCRATCH_IMAGE_HEIGHT)
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index f8524c2ab7..f8f944b44a 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -449,7 +449,8 @@ gint gdk_window_get_origin (GdkWindow *window,
gint *x,
gint *y);
-#ifndef GDK_DISABLE_DEPRECATED
+#if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
+/* Used by gtk_handle_box_button_changed () */
gboolean gdk_window_get_deskrelative_origin (GdkWindow *window,
gint *x,
gint *y);
diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
index 3beac84346..a33987805c 100644
--- a/gdk/x11/Makefile.am
+++ b/gdk/x11/Makefile.am
@@ -4,12 +4,13 @@ libgdkincludedir = $(includedir)/gtk-2.0/gdk
INCLUDES = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gdk\" \
- -DINSIDE_GDK_X11 \
+ -DGDK_COMPILATION \
-I$(top_srcdir) \
-I$(top_srcdir)/gdk \
-I$(top_builddir)/gdk \
-DG_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
@GTK_DEBUG_FLAGS@ \
@GDK_DEP_CFLAGS@ \
@STRIP_END@
diff --git a/gdk/x11/gdkcolor-x11.c b/gdk/x11/gdkcolor-x11.c
index 57c84a9526..57f78b44c0 100644
--- a/gdk/x11/gdkcolor-x11.c
+++ b/gdk/x11/gdkcolor-x11.c
@@ -1072,26 +1072,6 @@ gint
gdk_colormap_alloc_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors,
-/**
- * gdk_colormap_alloc_colors:
- * @colormap: a #GdkColormap.
- * @colors: The color values to allocate. On return, the pixel
- * values for allocated colors will be filled in.
- * @ncolors: The number of colors in @colors.
- * @writeable: If %TRUE, the colors are allocated writeable
- * (their values can later be changed using gdk_color_change()).
- * Writeable colors cannot be shared between applications.
- * @best_match: If %TRUE, GDK will attempt to do matching against
- * existing colors if the colors cannot be allocated as requested.
- * @success: An array of length @ncolors. On return, this
- * indicates whether the corresponding color in @colors was
- * sucessfully allocated or not.
- *
- * Allocates colors from a colormap.
- *
- * Return value: The number of colors that were not sucessfully
- * allocated.
- **/
gboolean writeable,
gboolean best_match,
gboolean *success)
diff --git a/gdk/x11/gdkfont-x11.c b/gdk/x11/gdkfont-x11.c
index 78f2558c9c..0b3a55a999 100644
--- a/gdk/x11/gdkfont-x11.c
+++ b/gdk/x11/gdkfont-x11.c
@@ -24,6 +24,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+#undef GDK_DISABLE_DEPRECATED
+
#include <X11/Xlib.h>
#include <X11/Xos.h>
#include <locale.h>
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index 93c5cdfca0..7faf67e38b 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -73,7 +73,7 @@ gint gdk_x11_get_default_screen (void);
#define GDK_DISPLAY() gdk_display
#endif
-#ifdef INSIDE_GDK_X11
+#ifdef GDK_COMPILATION
#include "gdkprivate-x11.h"
#include "gdkscreen-x11.h"
@@ -95,7 +95,7 @@ gint gdk_x11_get_default_screen (void);
#define GDK_GC_GET_XGC(gc) (GDK_GC_X11(gc)->dirty_mask ? _gdk_x11_gc_flush (gc) : ((GdkGCX11 *)(gc))->xgc)
#define GDK_WINDOW_XWINDOW GDK_DRAWABLE_XID
-#else /* INSIDE_GDK_X11 */
+#else /* GDK_COMPILATION */
#ifndef GDK_MULTIHEAD_SAFE
#define GDK_ROOT_WINDOW() (gdk_x11_get_default_root_xwindow ())
@@ -117,7 +117,7 @@ gint gdk_x11_get_default_screen (void);
#define GDK_SCREEN_XNUMBER(screen) (gdk_x11_screen_get_screen_number (screen))
#define GDK_VISUAL_XVISUAL(visual) (gdk_x11_visual_get_xvisual (visual))
-#endif /* INSIDE_GDK_X11 */
+#endif /* GDK_COMPILATION */
GdkVisual* gdk_x11_screen_lookup_visual (GdkScreen *screen,
VisualID xvisualid);
@@ -172,22 +172,27 @@ G_CONST_RETURN gchar *gdk_x11_get_xatom_name (Atom xatom);
void gdk_x11_display_grab (GdkDisplay *display);
void gdk_x11_display_ungrab (GdkDisplay *display);
+#if !defined(GDK_DISABLE_DEPRECATED) || defined(GDK_COMPILATION)
+
+gpointer gdk_x11_font_get_xfont (GdkFont *font);
+#define GDK_FONT_XFONT(font) (gdk_x11_font_get_xfont (font))
+
+#define gdk_font_lookup_for_display(display, xid) ((GdkFont*) gdk_xid_table_lookup_for_display (display, xid))
+
+#endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
+
#ifndef GDK_DISABLE_DEPRECATED
Display * gdk_x11_font_get_xdisplay (GdkFont *font);
-gpointer gdk_x11_font_get_xfont (GdkFont *font);
G_CONST_RETURN char *gdk_x11_font_get_name (GdkFont *font);
#define GDK_FONT_XDISPLAY(font) (gdk_x11_font_get_xdisplay (font))
-#define GDK_FONT_XFONT(font) (gdk_x11_font_get_xfont (font))
#ifndef GDK_MULTIHEAD_SAFE
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
#endif /* GDK_MULTIHEAD_SAFE */
-#define gdk_font_lookup_for_display(display, xid) ((GdkFont*) gdk_xid_table_lookup_for_display (display, xid))
-
#endif /* GDK_DISABLE_DEPRECATED */
G_END_DECLS