define the version variables in config.h.

Sun Mar  8 03:00:17 1998  Tim Janik  <timj@gimp.org>

        * configure.in: define the version variables in config.h.

        * gtk/gtkmain.h:
        * gtk/gtkmain.c: added static version variables.

        * gdk/gdkpixmap.c: fixed memory leaks (gtk-gronlund-980307-1.patch.gz)
This commit is contained in:
Tim Janik 1998-03-08 02:04:26 +00:00 committed by Tim Janik
parent 2395ed0826
commit 76d01a826c
18 changed files with 150 additions and 26 deletions

View File

@ -1,3 +1,12 @@
Sun Mar 8 03:00:17 1998 Tim Janik <timj@gimp.org>
* configure.in: define the version variables in config.h.
* gtk/gtkmain.h:
* gtk/gtkmain.c: added static version variables.
* gdk/gdkpixmap.c: fixed memory leaks (gtk-gronlund-980307-1.patch.gz)
Sat Mar 7 18:46:57 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpreview.[ch]: Added a new function, gtk_preview_reset(),

View File

@ -1,3 +1,12 @@
Sun Mar 8 03:00:17 1998 Tim Janik <timj@gimp.org>
* configure.in: define the version variables in config.h.
* gtk/gtkmain.h:
* gtk/gtkmain.c: added static version variables.
* gdk/gdkpixmap.c: fixed memory leaks (gtk-gronlund-980307-1.patch.gz)
Sat Mar 7 18:46:57 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpreview.[ch]: Added a new function, gtk_preview_reset(),

View File

@ -1,3 +1,12 @@
Sun Mar 8 03:00:17 1998 Tim Janik <timj@gimp.org>
* configure.in: define the version variables in config.h.
* gtk/gtkmain.h:
* gtk/gtkmain.c: added static version variables.
* gdk/gdkpixmap.c: fixed memory leaks (gtk-gronlund-980307-1.patch.gz)
Sat Mar 7 18:46:57 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpreview.[ch]: Added a new function, gtk_preview_reset(),

View File

@ -1,3 +1,12 @@
Sun Mar 8 03:00:17 1998 Tim Janik <timj@gimp.org>
* configure.in: define the version variables in config.h.
* gtk/gtkmain.h:
* gtk/gtkmain.c: added static version variables.
* gdk/gdkpixmap.c: fixed memory leaks (gtk-gronlund-980307-1.patch.gz)
Sat Mar 7 18:46:57 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpreview.[ch]: Added a new function, gtk_preview_reset(),

View File

@ -1,3 +1,12 @@
Sun Mar 8 03:00:17 1998 Tim Janik <timj@gimp.org>
* configure.in: define the version variables in config.h.
* gtk/gtkmain.h:
* gtk/gtkmain.c: added static version variables.
* gdk/gdkpixmap.c: fixed memory leaks (gtk-gronlund-980307-1.patch.gz)
Sat Mar 7 18:46:57 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpreview.[ch]: Added a new function, gtk_preview_reset(),

View File

@ -1,3 +1,12 @@
Sun Mar 8 03:00:17 1998 Tim Janik <timj@gimp.org>
* configure.in: define the version variables in config.h.
* gtk/gtkmain.h:
* gtk/gtkmain.c: added static version variables.
* gdk/gdkpixmap.c: fixed memory leaks (gtk-gronlund-980307-1.patch.gz)
Sat Mar 7 18:46:57 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpreview.[ch]: Added a new function, gtk_preview_reset(),

View File

@ -1,3 +1,12 @@
Sun Mar 8 03:00:17 1998 Tim Janik <timj@gimp.org>
* configure.in: define the version variables in config.h.
* gtk/gtkmain.h:
* gtk/gtkmain.c: added static version variables.
* gdk/gdkpixmap.c: fixed memory leaks (gtk-gronlund-980307-1.patch.gz)
Sat Mar 7 18:46:57 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkpreview.[ch]: Added a new function, gtk_preview_reset(),

View File

@ -31,6 +31,11 @@
#undef XINPUT_GXI
#undef XINPUT_XFREE
#undef GTK_MAJOR_VERSION
#undef GTK_MINOR_VERSION
#undef GTK_MICRO_VERSION
#undef GTK_VERSION
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE

View File

@ -35,6 +35,11 @@
#undef XINPUT_GXI
#undef XINPUT_XFREE
#undef GTK_MAJOR_VERSION
#undef GTK_MINOR_VERSION
#undef GTK_MICRO_VERSION
#undef GTK_VERSION
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE

View File

@ -84,6 +84,11 @@ if test "x$enable_xim" = "xyes"; then
CFLAGS="$CFLAGS -DUSE_XIM"
fi
AC_DEFINE_UNQUOTED(GTK_MAJOR_VERSION, $GTK_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(GTK_MINOR_VERSION, $GTK_MINOR_VERSION)
AC_DEFINE_UNQUOTED(GTK_MICRO_VERSION, $GTK_MICRO_VERSION)
AC_DEFINE_UNQUOTED(GTK_VERSION, "$GTK_VERSION")
# Find the X11 include and library directories
AC_PATH_X
AC_PATH_XTRA

View File

@ -270,7 +270,7 @@ gdk_init (int *argc,
int argc_orig = *argc;
char **argv_orig;
argv_orig = malloc ((argc_orig + 1) * sizeof (char*));
argv_orig = g_malloc ((argc_orig + 1) * sizeof (char*));
for (i = 0; i < argc_orig; i++)
argv_orig[i] = g_strdup ((*argv)[i]);
argv_orig[argc_orig] = NULL;

View File

@ -320,8 +320,7 @@ gdk_pixmap_extract_color (gchar *buffer)
return NULL;
else if (ptr[0] == '#')
{
retcol = g_new(gchar, strlen (ptr) + 1);
strcpy (retcol, ptr);
retcol = g_strdup (ptr);
return retcol;
}
@ -346,8 +345,7 @@ gdk_pixmap_extract_color (gchar *buffer)
}
}
retcol = g_new(gchar, strlen (color) + 1);
strcpy (retcol, color);
retcol = g_strdup (color);
return retcol;
}
@ -366,7 +364,7 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkGC *gc;
GdkColor tmp_color;
gint width, height, num_cols, cpp, cnt, n, ns, xcnt, ycnt;
gchar *buffer = NULL, *color_name = NULL, pixel_str[32];
gchar *buffer = NULL, pixel_str[32];
guint buffer_size = 0;
_GdkPixmapColor *colors = NULL, *color = NULL;
gulong index;
@ -399,6 +397,8 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
for (cnt = 0; cnt < num_cols; cnt++)
{
gchar *color_name;
gdk_pixmap_seek_char (infile, '"');
fseek (infile, -1, SEEK_CUR);
gdk_pixmap_read_string (infile, &buffer, &buffer_size);
@ -409,9 +409,6 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
colors[cnt].color_string[n] = 0;
colors[cnt].transparent = FALSE;
if (color_name != NULL)
g_free (color_name);
color_name = gdk_pixmap_extract_color (&buffer[cpp]);
if (color_name != NULL)
@ -428,6 +425,8 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
colors[cnt].transparent = TRUE;
}
g_free (color_name);
gdk_color_alloc (colormap, &colors[cnt].color);
}
@ -527,7 +526,7 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
GdkGC *gc;
GdkColor tmp_color;
gint width, height, num_cols, cpp, cnt, n, ns, xcnt, ycnt, i;
gchar *buffer, *color_name = NULL, pixel_str[32];
gchar *buffer, pixel_str[32];
_GdkPixmapColor *colors = NULL, *color = NULL;
gulong index;
@ -550,6 +549,8 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
for (cnt = 0; cnt < num_cols; cnt++)
{
gchar *color_name;
buffer = data[i++];
colors[cnt].color_string = g_new(gchar, cpp + 1);
@ -558,9 +559,6 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
colors[cnt].color_string[n] = 0;
colors[cnt].transparent = FALSE;
if (color_name != NULL)
g_free (color_name);
color_name = gdk_pixmap_extract_color (&buffer[cpp]);
if (color_name != NULL)
@ -577,6 +575,8 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
colors[cnt].transparent = TRUE;
}
g_free (color_name);
gdk_color_alloc (colormap, &colors[cnt].color);
}

View File

@ -270,7 +270,7 @@ gdk_init (int *argc,
int argc_orig = *argc;
char **argv_orig;
argv_orig = malloc ((argc_orig + 1) * sizeof (char*));
argv_orig = g_malloc ((argc_orig + 1) * sizeof (char*));
for (i = 0; i < argc_orig; i++)
argv_orig[i] = g_strdup ((*argv)[i]);
argv_orig[argc_orig] = NULL;

View File

@ -320,8 +320,7 @@ gdk_pixmap_extract_color (gchar *buffer)
return NULL;
else if (ptr[0] == '#')
{
retcol = g_new(gchar, strlen (ptr) + 1);
strcpy (retcol, ptr);
retcol = g_strdup (ptr);
return retcol;
}
@ -346,8 +345,7 @@ gdk_pixmap_extract_color (gchar *buffer)
}
}
retcol = g_new(gchar, strlen (color) + 1);
strcpy (retcol, color);
retcol = g_strdup (color);
return retcol;
}
@ -366,7 +364,7 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkGC *gc;
GdkColor tmp_color;
gint width, height, num_cols, cpp, cnt, n, ns, xcnt, ycnt;
gchar *buffer = NULL, *color_name = NULL, pixel_str[32];
gchar *buffer = NULL, pixel_str[32];
guint buffer_size = 0;
_GdkPixmapColor *colors = NULL, *color = NULL;
gulong index;
@ -399,6 +397,8 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
for (cnt = 0; cnt < num_cols; cnt++)
{
gchar *color_name;
gdk_pixmap_seek_char (infile, '"');
fseek (infile, -1, SEEK_CUR);
gdk_pixmap_read_string (infile, &buffer, &buffer_size);
@ -409,9 +409,6 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
colors[cnt].color_string[n] = 0;
colors[cnt].transparent = FALSE;
if (color_name != NULL)
g_free (color_name);
color_name = gdk_pixmap_extract_color (&buffer[cpp]);
if (color_name != NULL)
@ -428,6 +425,8 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
colors[cnt].transparent = TRUE;
}
g_free (color_name);
gdk_color_alloc (colormap, &colors[cnt].color);
}
@ -527,7 +526,7 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
GdkGC *gc;
GdkColor tmp_color;
gint width, height, num_cols, cpp, cnt, n, ns, xcnt, ycnt, i;
gchar *buffer, *color_name = NULL, pixel_str[32];
gchar *buffer, pixel_str[32];
_GdkPixmapColor *colors = NULL, *color = NULL;
gulong index;
@ -550,6 +549,8 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
for (cnt = 0; cnt < num_cols; cnt++)
{
gchar *color_name;
buffer = data[i++];
colors[cnt].color_string = g_new(gchar, cpp + 1);
@ -558,9 +559,6 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
colors[cnt].color_string[n] = 0;
colors[cnt].transparent = FALSE;
if (color_name != NULL)
g_free (color_name);
color_name = gdk_pixmap_extract_color (&buffer[cpp]);
if (color_name != NULL)
@ -577,6 +575,8 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
colors[cnt].transparent = TRUE;
}
g_free (color_name);
gdk_color_alloc (colormap, &colors[cnt].color);
}

View File

@ -32,6 +32,7 @@
#include "gtkwidget.h"
#include "gtkwindow.h"
#include "gtkprivate.h"
#include "../config.h"
/* Private type definitions
@ -119,6 +120,10 @@ static gint gtk_idle_compare (gpointer a,
static gint gtk_timeout_compare (gpointer a,
gpointer b);
const guint gtk_major_version = GTK_MAJOR_VERSION;
const guint gtk_minor_version = GTK_MINOR_VERSION;
const guint gtk_micro_version = GTK_MICRO_VERSION;
static gboolean iteration_done = FALSE;
static guint main_level = 0;
static gint initialized = FALSE;

View File

@ -36,6 +36,11 @@ typedef gint (*GtkKeySnoopFunc) (GtkWidget *grab_widget,
GdkEventKey *event,
gpointer func_data);
/* Gtk version.
*/
extern const guint gtk_major_version;
extern const guint gtk_minor_version;
extern const guint gtk_micro_version;
/* Initialization, exit, mainloop and miscellaneous routines
*/

View File

@ -5267,6 +5267,8 @@ create_main_window ()
GtkWidget *box2;
GtkWidget *scrolled_window;
GtkWidget *button;
GtkWidget *label;
gchar buffer[64];
GtkWidget *separator;
int i;
@ -5286,6 +5288,22 @@ create_main_window ()
gtk_container_add (GTK_CONTAINER (window), box1);
gtk_widget_show (box1);
if (gtk_micro_version > 0)
sprintf (buffer,
"Gtk+ v%d.%d.%d",
gtk_major_version,
gtk_minor_version,
gtk_micro_version);
else
sprintf (buffer,
"Gtk+ v%d.%d",
gtk_major_version,
gtk_minor_version);
label = gtk_label_new (buffer);
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_container_border_width (GTK_CONTAINER (scrolled_window), 10);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),

View File

@ -5267,6 +5267,8 @@ create_main_window ()
GtkWidget *box2;
GtkWidget *scrolled_window;
GtkWidget *button;
GtkWidget *label;
gchar buffer[64];
GtkWidget *separator;
int i;
@ -5286,6 +5288,22 @@ create_main_window ()
gtk_container_add (GTK_CONTAINER (window), box1);
gtk_widget_show (box1);
if (gtk_micro_version > 0)
sprintf (buffer,
"Gtk+ v%d.%d.%d",
gtk_major_version,
gtk_minor_version,
gtk_micro_version);
else
sprintf (buffer,
"Gtk+ v%d.%d",
gtk_major_version,
gtk_minor_version);
label = gtk_label_new (buffer);
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_container_border_width (GTK_CONTAINER (scrolled_window), 10);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),