Commit 637a466d authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Started

Fri Oct  1 18:03:36 1999  Owen Taylor  <otaylor@redhat.com>

        * docs/Changes-1.4.txt: Started

	* gtk/Makefile.am (gdk_headers): Include all the new headers.

        * gdk/*.h gdk/*.c: Split gdk.h into lots of itty-bitty little pieces.

	* gdk/gdkprivate.h gdk/gdkcc.c: Moved GdkColorContext private
	into C file.

	* gdkinput.h gdkinputprivate.h - renamed the internal gdkinput
	header to gdkinputprivate.h.

	* gdk/gdk.h gdk/gdk.c: Removed gdk_time* functions which have been
	unused since before 1.2.
parent 74d88d87
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
* gtk/Makefile.am (gdk_headers): Include all the new headers.
* gdk/*.h gdk/*.c: Split gdk.h into lots of itty-bitty little pieces.
* gdk/gdkprivate.h gdk/gdkcc.c: Moved GdkColorContext private
into C file.
* gdkinput.h gdkinputprivate.h - renamed the internal gdkinput
header to gdkinputprivate.h.
* gdk/gdk.h gdk/gdk.c: Removed gdk_time* functions which have been
unused since before 1.2.
1999-09-30 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfontsel.c (gtk_font_selection_get_xlfd_field): On Win32,
......
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
* gtk/Makefile.am (gdk_headers): Include all the new headers.
* gdk/*.h gdk/*.c: Split gdk.h into lots of itty-bitty little pieces.
* gdk/gdkprivate.h gdk/gdkcc.c: Moved GdkColorContext private
into C file.
* gdkinput.h gdkinputprivate.h - renamed the internal gdkinput
header to gdkinputprivate.h.
* gdk/gdk.h gdk/gdk.c: Removed gdk_time* functions which have been
unused since before 1.2.
1999-09-30 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfontsel.c (gtk_font_selection_get_xlfd_field): On Win32,
......
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
* gtk/Makefile.am (gdk_headers): Include all the new headers.
* gdk/*.h gdk/*.c: Split gdk.h into lots of itty-bitty little pieces.
* gdk/gdkprivate.h gdk/gdkcc.c: Moved GdkColorContext private
into C file.
* gdkinput.h gdkinputprivate.h - renamed the internal gdkinput
header to gdkinputprivate.h.
* gdk/gdk.h gdk/gdk.c: Removed gdk_time* functions which have been
unused since before 1.2.
1999-09-30 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfontsel.c (gtk_font_selection_get_xlfd_field): On Win32,
......
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
* gtk/Makefile.am (gdk_headers): Include all the new headers.
* gdk/*.h gdk/*.c: Split gdk.h into lots of itty-bitty little pieces.
* gdk/gdkprivate.h gdk/gdkcc.c: Moved GdkColorContext private
into C file.
* gdkinput.h gdkinputprivate.h - renamed the internal gdkinput
header to gdkinputprivate.h.
* gdk/gdk.h gdk/gdk.c: Removed gdk_time* functions which have been
unused since before 1.2.
1999-09-30 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfontsel.c (gtk_font_selection_get_xlfd_field): On Win32,
......
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
* gtk/Makefile.am (gdk_headers): Include all the new headers.
* gdk/*.h gdk/*.c: Split gdk.h into lots of itty-bitty little pieces.
* gdk/gdkprivate.h gdk/gdkcc.c: Moved GdkColorContext private
into C file.
* gdkinput.h gdkinputprivate.h - renamed the internal gdkinput
header to gdkinputprivate.h.
* gdk/gdk.h gdk/gdk.c: Removed gdk_time* functions which have been
unused since before 1.2.
1999-09-30 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfontsel.c (gtk_font_selection_get_xlfd_field): On Win32,
......
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
* gtk/Makefile.am (gdk_headers): Include all the new headers.
* gdk/*.h gdk/*.c: Split gdk.h into lots of itty-bitty little pieces.
* gdk/gdkprivate.h gdk/gdkcc.c: Moved GdkColorContext private
into C file.
* gdkinput.h gdkinputprivate.h - renamed the internal gdkinput
header to gdkinputprivate.h.
* gdk/gdk.h gdk/gdk.c: Removed gdk_time* functions which have been
unused since before 1.2.
1999-09-30 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfontsel.c (gtk_font_selection_get_xlfd_field): On Win32,
......
Fri Oct 1 18:03:36 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.4.txt: Started
* gtk/Makefile.am (gdk_headers): Include all the new headers.
* gdk/*.h gdk/*.c: Split gdk.h into lots of itty-bitty little pieces.
* gdk/gdkprivate.h gdk/gdkcc.c: Moved GdkColorContext private
into C file.
* gdkinput.h gdkinputprivate.h - renamed the internal gdkinput
header to gdkinputprivate.h.
* gdk/gdk.h gdk/gdk.c: Removed gdk_time* functions which have been
unused since before 1.2.
1999-09-30 Tor Lillqvist <tml@iki.fi>
* gtk/gtkfontsel.c (gtk_font_selection_get_xlfd_field): On Win32,
......
......@@ -30,15 +30,36 @@ libgdk_la_LDFLAGS = @STRIP_BEGIN@ \
#
# setup source file variables
#
#
# GDK header files for public installation (non-generated)
#
# Note: files added here may need to be be propagated to gdk_headers in gtk/Makefile.am
#
gdk_public_h_sources = @STRIP_BEGIN@ \
gdk.h \
gdkcc.h \
gdkcolor.h \
gdkcursor.h \
gdkcursors.h \
gdkrgb.h \
gdki18n.h \
gdkdnd.h \
gdkdrawable.h \
gdkevents.h \
gdkfont.h \
gdkgc.h \
gdkkeysyms.h \
gdki18n.h \
gdkim.h \
gdkimage.h \
gdkinput.h \
gdkpixmap.h \
gdkprivate.h \
gdkproperty.h \
gdkregion.h \
gdkrgb.h \
gdkselection.h \
gdktypes.h \
gdkvisual.h \
gdkwindow.h \
gdkx.h \
@STRIP_END@
gdk_c_sources = @STRIP_BEGIN@ \
......
......@@ -44,17 +44,11 @@
#include <X11/Xutil.h>
#include <X11/Xmu/WinUtil.h>
#include <X11/cursorfont.h>
#include "gdk.h"
#include "gdkprivate.h"
#include "gdkinput.h"
#include "gdkx.h"
#include "gdki18n.h"
#include "gdkkeysyms.h"
#ifndef X_GETTIMEOFDAY
#define X_GETTIMEOFDAY(tv) gettimeofday (tv, NULL)
#endif /* X_GETTIMEOFDAY */
#include "gdk.h"
#include "gdkprivate.h"
#include "gdkinputprivate.h"
typedef struct _GdkPredicate GdkPredicate;
typedef struct _GdkErrorTrap GdkErrorTrap;
......@@ -97,23 +91,6 @@ static int gdk_initialized = 0; /* 1 if the library is initialized,
* 0 otherwise.
*/
static struct timeval start; /* The time at which the library was
* last initialized.
*/
static struct timeval timer; /* Timeout interval to use in the call
* to "select". This is used in
* conjunction with "timerp" to create
* a maximum time to wait for an event
* to arrive.
*/
static struct timeval *timerp; /* The actual timer passed to "select"
* This may be NULL, in which case
* "select" will block until an event
* arrives.
*/
static guint32 timer_val; /* The timeout length as specified by
* the user in milliseconds.
*/
static gint autorepeat;
static GSList *gdk_error_traps = NULL; /* List of error traps */
......@@ -181,8 +158,6 @@ gdk_init_check (int *argc,
argv_orig[argc_orig] = NULL;
}
X_GETTIMEOFDAY (&start);
gdk_display_name = NULL;
XSetErrorHandler (gdk_x_error);
......@@ -420,10 +395,6 @@ gdk_init_check (int *argc,
XGetKeyboardControl (gdk_display, &keyboard_state);
autorepeat = keyboard_state.global_auto_repeat;
timer.tv_sec = 0;
timer.tv_usec = 0;
timerp = NULL;
g_atexit (gdk_exit_func);
gdk_events_init ();
......@@ -491,112 +462,6 @@ gdk_get_use_xshm (void)
return gdk_use_xshm;
}
/*
*--------------------------------------------------------------
* gdk_time_get
*
* Get the number of milliseconds since the library was
* initialized.
*
* Arguments:
*
* Results:
* The time since the library was initialized is returned.
* This time value is accurate to milliseconds even though
* a more accurate time down to the microsecond could be
* returned.
*
* Side effects:
*
*--------------------------------------------------------------
*/
guint32
gdk_time_get (void)
{
struct timeval end;
struct timeval elapsed;
guint32 milliseconds;
X_GETTIMEOFDAY (&end);
if (start.tv_usec > end.tv_usec)
{
end.tv_usec += 1000000;
end.tv_sec--;
}
elapsed.tv_sec = end.tv_sec - start.tv_sec;
elapsed.tv_usec = end.tv_usec - start.tv_usec;
milliseconds = (elapsed.tv_sec * 1000) + (elapsed.tv_usec / 1000);
return milliseconds;
}
/*
*--------------------------------------------------------------
* gdk_timer_get
*
* Returns the current timer.
*
* Arguments:
*
* Results:
* Returns the current timer interval. This interval is
* in units of milliseconds.
*
* Side effects:
*
*--------------------------------------------------------------
*/
guint32
gdk_timer_get (void)
{
return timer_val;
}
/*
*--------------------------------------------------------------
* gdk_timer_set
*
* Sets the timer interval.
*
* Arguments:
* "milliseconds" is the new value for the timer.
*
* Results:
*
* Side effects:
* Calls to "gdk_event_get" will last for a maximum
* of time of "milliseconds". However, a value of 0
* milliseconds will cause "gdk_event_get" to block
* indefinately until an event is received.
*
*--------------------------------------------------------------
*/
void
gdk_timer_set (guint32 milliseconds)
{
timer_val = milliseconds;
timer.tv_sec = milliseconds / 1000;
timer.tv_usec = (milliseconds % 1000) * 1000;
}
void
gdk_timer_enable (void)
{
timerp = &timer;
}
void
gdk_timer_disable (void)
{
timerp = NULL;
}
/*
*--------------------------------------------------------------
* gdk_pointer_grab
......
This diff is collapsed.
......@@ -63,13 +63,21 @@
#include <X11/Xlib.h>
#include <stdlib.h>
#include <string.h>
#include "gdk.h"
#include "gdkprivate.h"
#include "gdkx.h"
#include "gdkcc.h"
#include "gdkcolor.h"
#include "gdkx.h"
#define MAX_IMAGE_COLORS 256
typedef struct _GdkColorContextPrivate GdkColorContextPrivate;
struct _GdkColorContextPrivate
{
GdkColorContext color_context;
Display *xdisplay;
XStandardColormap std_cmap;
};
static guint
hash_color (gconstpointer key)
......
#ifndef __GDK_CC_H__
#define __GDK_CC_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkColorContextDither GdkColorContextDither;
typedef struct _GdkColorContext GdkColorContext;
/* Color Context modes.
*
* GDK_CC_MODE_UNDEFINED - unknown
* GDK_CC_MODE_BW - default B/W
* GDK_CC_MODE_STD_CMAP - has a standard colormap
* GDK_CC_MODE_TRUE - is a TrueColor/DirectColor visual
* GDK_CC_MODE_MY_GRAY - my grayramp
* GDK_CC_MODE_PALETTE - has a pre-allocated palette
*/
typedef enum
{
GDK_CC_MODE_UNDEFINED,
GDK_CC_MODE_BW,
GDK_CC_MODE_STD_CMAP,
GDK_CC_MODE_TRUE,
GDK_CC_MODE_MY_GRAY,
GDK_CC_MODE_PALETTE
} GdkColorContextMode;
struct _GdkColorContextDither
{
gint fast_rgb[32][32][32]; /* quick look-up table for faster rendering */
gint fast_err[32][32][32]; /* internal RGB error information */
gint fast_erg[32][32][32];
gint fast_erb[32][32][32];
};
struct _GdkColorContext
{
GdkVisual *visual;
GdkColormap *colormap;
gint num_colors; /* available no. of colors in colormap */
gint max_colors; /* maximum no. of colors */
gint num_allocated; /* no. of allocated colors */
GdkColorContextMode mode;
gint need_to_free_colormap;
GdkAtom std_cmap_atom;
gulong *clut; /* color look-up table */
GdkColor *cmap; /* colormap */
GHashTable *color_hash; /* hash table of allocated colors */
GdkColor *palette; /* preallocated palette */
gint num_palette; /* size of palette */
GdkColorContextDither *fast_dither; /* fast dither matrix */
struct
{
gint red;
gint green;
gint blue;
} shifts;
struct
{
gulong red;
gulong green;
gulong blue;
} masks;
struct
{
gint red;
gint green;
gint blue;
} bits;
gulong max_entry;
gulong black_pixel;
gulong white_pixel;
};
GdkColorContext *gdk_color_context_new (GdkVisual *visual,
GdkColormap *colormap);
GdkColorContext *gdk_color_context_new_mono (GdkVisual *visual,
GdkColormap *colormap);
void gdk_color_context_free (GdkColorContext *cc);
gulong gdk_color_context_get_pixel (GdkColorContext *cc,
gushort red,
gushort green,
gushort blue,
gint *failed);
void gdk_color_context_get_pixels (GdkColorContext *cc,
gushort *reds,
gushort *greens,
gushort *blues,
gint ncolors,
gulong *colors,
gint *nallocated);
void gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
gushort *reds,
gushort *greens,
gushort *blues,
gint ncolors,
gint *used,
gulong *colors,
gint *nallocated);
gint gdk_color_context_query_color (GdkColorContext *cc,
GdkColor *color);
gint gdk_color_context_query_colors (GdkColorContext *cc,
GdkColor *colors,
gint num_colors);
gint gdk_color_context_add_palette (GdkColorContext *cc,
GdkColor *palette,
gint num_palette);
void gdk_color_context_init_dither (GdkColorContext *cc);
void gdk_color_context_free_dither (GdkColorContext *cc);
gulong gdk_color_context_get_pixel_from_palette (GdkColorContext *cc,
gushort *red,
gushort *green,
gushort *blue,
gint *failed);
guchar gdk_color_context_get_index_from_palette (GdkColorContext *cc,
gint *red,
gint *green,
gint *blue,
gint *failed);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_CC_H__ */
......@@ -26,9 +26,9 @@
#include <time.h>
#include <X11/Xlib.h>
#include "gdk.h"
#include "gdkcolor.h"
#include "gdkprivate.h"
#include "gdkx.h"
static gint gdk_colormap_match_color (GdkColormap *cmap,
......
#ifndef __GDK_COLOR_H__
#define __GDK_COLOR_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* The color type.
* A color consists of red, green and blue values in the
* range 0-65535 and a pixel value. The pixel value is highly
* dependent on the depth and colormap which this color will
* be used to draw into. Therefore, sharing colors between
* colormaps is a bad idea.
*/
struct _GdkColor
{
gulong pixel;
gushort red;
gushort green;
gushort blue;
};
/* The colormap type.
*/
struct _GdkColormap
{
gint size;
GdkColor *colors;
};
GdkColormap* gdk_colormap_new (GdkVisual *visual,
gint allocate);
GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
void gdk_colormap_unref (GdkColormap *cmap);
GdkColormap* gdk_colormap_get_system (void);
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);
GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
GdkColor *gdk_color_copy (GdkColor *color);
void gdk_color_free (GdkColor *color);
gint gdk_color_parse (const gchar *spec,
GdkColor *color);
guint gdk_color_hash (const GdkColor *colora);
gint gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
/* The following functions are deprecated */
void gdk_colors_store (GdkColormap *colormap,
GdkColor *colors,
gint ncolors);
gint gdk_colors_alloc (GdkColormap *colormap,
gint contiguous,
gulong *planes,
gint nplanes,
gulong *pixels,
gint npixels);
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);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_COLOR_H__ */
/* gdkconfig.h
*
* This is a generated file. Please modify `configure.in'
*/
#ifndef GDKCONFIG_H
#define GDKCONFIG_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GDK_WINDOWING_X11
#define GDK_HAVE_WCHAR_H 1
#define GDK_HAVE_WCTYPE_H 1
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GDKCONFIG_H */
......@@ -26,7 +26,8 @@
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#include "gdk.h"
#include "gdkcursor.h"
#include "gdkprivate.h"
......
#ifndef __GDK_CURSOR_H__
#define __GDK_CURSOR_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Cursor types.
*/
typedef enum
{
#include <gdk/gdkcursors.h>
GDK_LAST_CURSOR,
GDK_CURSOR_IS_PIXMAP = -1
} GdkCursorType;
struct _GdkCursor
{
GdkCursorType type;
};
/* Cursors
*/
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source,
GdkPixmap *mask,
GdkColor *fg,
GdkColor *bg,
gint x,
gint y);
void gdk_cursor_destroy (GdkCursor *cursor);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_CURSOR_H__ */
......@@ -27,9 +27,12 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <string.h>
#include "gdk.h" /* For gdk_flush() */
#include "gdkdnd.h"
#include "gdkproperty.h"
#include "gdkprivate.h"
#include "gdkx.h"
#include "gdk/gdkprivate.h"
#include "gdk.h"
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
......
#ifndef __GDK_DND_H__
#define __GDK_DND_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */