Commit 49dfa78e authored by Tim Janik's avatar Tim Janik Committed by Tim Janik
Browse files

use g_get_current_dir() instead of getcwd().

Tue Aug 18 17:54:40 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
        getcwd().

        * gdk/gdkprivate.h:
        * gdk/gdkglobals.c:
        * gdk/gdkwindow.c:
        * gdk/gdk.c:
        * gtk/gtkwindow.c:
        * gtk/gtkitemfactory.c:
        dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.

        * gtk/gtkselection.c:
        * gtk/gtkpreview.c:
        * gtk/gtkobject.c:
        * gtk/gtkmain.c:
        * gtk/gtktypeutils.c: indentation fixes due to g_message() use.

        * gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
parent 1575a19c
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
......@@ -35,8 +56,6 @@ Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkrgb.c: left this out currently.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
......
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
......@@ -35,8 +56,6 @@ Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkrgb.c: left this out currently.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
......
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
......@@ -35,8 +56,6 @@ Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkrgb.c: left this out currently.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
......
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
......@@ -35,8 +56,6 @@ Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkrgb.c: left this out currently.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
......
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
......@@ -35,8 +56,6 @@ Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkrgb.c: left this out currently.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
......
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
......@@ -35,8 +56,6 @@ Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkrgb.c: left this out currently.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
......
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
......@@ -35,8 +56,6 @@ Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkrgb.c: left this out currently.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
......
......@@ -328,9 +328,9 @@ gdk_init (int *argc,
d = strrchr((*argv)[0],'/');
if (d != NULL)
gdk_progname = g_strdup (d + 1);
g_set_prgname (d + 1);
else
gdk_progname = g_strdup ((*argv)[0]);
g_set_prgname ((*argv)[0]);
}
for (i = 1; i < *argc;)
......@@ -406,7 +406,7 @@ gdk_init (int *argc,
if ((i + 1) < *argc && (*argv)[i + 1])
{
(*argv)[i++] = NULL;
gdk_progname = (*argv)[i];
g_set_prgname ((*argv)[i]);
(*argv)[i] = NULL;
}
}
......@@ -494,10 +494,10 @@ gdk_init (int *argc,
}
else
{
gdk_progname = "<unknown>";
g_set_prgname ("<unknown>");
}
GDK_NOTE (MISC, g_message ("progname: \"%s\"", gdk_progname));
GDK_NOTE (MISC, g_message ("progname: \"%s\"", g_get_prgname ()));
gdk_display = XOpenDisplay (gdk_display_name);
if (!gdk_display)
......@@ -527,10 +527,10 @@ gdk_init (int *argc,
gdk_leader_window = XCreateSimpleWindow(gdk_display, gdk_root_window,
10, 10, 10, 10, 0, 0 , 0);
class_hint = XAllocClassHint();
class_hint->res_name = gdk_progname;
class_hint->res_name = g_get_prgname ();
if (gdk_progclass == NULL)
{
gdk_progclass = g_strdup (gdk_progname);
gdk_progclass = g_strdup (g_get_prgname ());
gdk_progclass[0] = toupper (gdk_progclass[0]);
}
class_hint->res_class = gdk_progclass;
......@@ -1824,10 +1824,14 @@ gdk_event_translate (GdkEvent *event,
if (window != NULL)
gdk_window_ref (window);
else if(gdk_null_window_warnings) /* Special purpose programs that
get events for other windows may
want to disable this */
g_warning ("%#lx -> NULL\n", xevent->xany.window);
else if (gdk_null_window_warnings)
{
/* Special purpose programs that
* get events for other windows may
* want to disable this
*/
g_warning ("xwindow(%#lx) lookup reveals NULL", xevent->xany.window);
}
/* Check for filters for this window */
......
......@@ -48,7 +48,6 @@ GdkDndGlobals gdk_dnd = {None,None,None,
{0,0},
{0,0}, {0,0},
{0,0,0,0}, NULL, None, 0};
gchar *gdk_progname = NULL;
gchar *gdk_progclass = NULL;
gint gdk_error_code;
gint gdk_error_warnings = TRUE;
......
......@@ -262,7 +262,6 @@ extern Atom gdk_wm_window_protocols[];
extern Atom gdk_selection_property;
extern GdkDndGlobals gdk_dnd;
extern GdkWindow *selection_owner[];
extern gchar *gdk_progname;
extern gchar *gdk_progclass;
extern gint gdk_error_code;
extern gint gdk_error_warnings;
......
This diff is collapsed.
......@@ -437,7 +437,7 @@ gdk_window_new (GdkWindow *parent,
if (attributes_mask & GDK_WA_TITLE)
title = attributes->title;
else
title = gdk_progname;
title = g_get_prgname ();
XmbSetWMProperties (private->xdisplay, private->xwindow,
title, title,
......
......@@ -48,7 +48,6 @@ GdkDndGlobals gdk_dnd = {None,None,None,
{0,0},
{0,0}, {0,0},
{0,0,0,0}, NULL, None, 0};
gchar *gdk_progname = NULL;
gchar *gdk_progclass = NULL;
gint gdk_error_code;
gint gdk_error_warnings = TRUE;
......
......@@ -328,9 +328,9 @@ gdk_init (int *argc,
d = strrchr((*argv)[0],'/');
if (d != NULL)
gdk_progname = g_strdup (d + 1);
g_set_prgname (d + 1);
else
gdk_progname = g_strdup ((*argv)[0]);
g_set_prgname ((*argv)[0]);
}
for (i = 1; i < *argc;)
......@@ -406,7 +406,7 @@ gdk_init (int *argc,
if ((i + 1) < *argc && (*argv)[i + 1])
{
(*argv)[i++] = NULL;
gdk_progname = (*argv)[i];
g_set_prgname ((*argv)[i]);
(*argv)[i] = NULL;
}
}
......@@ -494,10 +494,10 @@ gdk_init (int *argc,
}
else
{
gdk_progname = "<unknown>";
g_set_prgname ("<unknown>");
}
GDK_NOTE (MISC, g_message ("progname: \"%s\"", gdk_progname));
GDK_NOTE (MISC, g_message ("progname: \"%s\"", g_get_prgname ()));
gdk_display = XOpenDisplay (gdk_display_name);
if (!gdk_display)
......@@ -527,10 +527,10 @@ gdk_init (int *argc,
gdk_leader_window = XCreateSimpleWindow(gdk_display, gdk_root_window,
10, 10, 10, 10, 0, 0 , 0);
class_hint = XAllocClassHint();
class_hint->res_name = gdk_progname;
class_hint->res_name = g_get_prgname ();
if (gdk_progclass == NULL)
{
gdk_progclass = g_strdup (gdk_progname);
gdk_progclass = g_strdup (g_get_prgname ());
gdk_progclass[0] = toupper (gdk_progclass[0]);
}
class_hint->res_class = gdk_progclass;
......@@ -1824,10 +1824,14 @@ gdk_event_translate (GdkEvent *event,
if (window != NULL)
gdk_window_ref (window);
else if(gdk_null_window_warnings) /* Special purpose programs that
get events for other windows may
want to disable this */
g_warning ("%#lx -> NULL\n", xevent->xany.window);
else if (gdk_null_window_warnings)
{
/* Special purpose programs that
* get events for other windows may
* want to disable this
*/
g_warning ("xwindow(%#lx) lookup reveals NULL", xevent->xany.window);
}
/* Check for filters for this window */
......
......@@ -437,7 +437,7 @@ gdk_window_new (GdkWindow *parent,
if (attributes_mask & GDK_WA_TITLE)
title = attributes->title;
else
title = gdk_progname;
title = g_get_prgname ();
XmbSetWMProperties (private->xdisplay, private->xwindow,
title, title,
......
......@@ -29,7 +29,6 @@
#include "gtk/gtkcheckmenuitem.h"
#include "gtk/gtktearoffmenuitem.h"
#include "gtk/gtkaccellabel.h"
#include "gdk/gdkprivate.h" /* for gdk_progname */
#include "gdk/gdkkeysyms.h"
#include <string.h>
#include <sys/stat.h>
......@@ -785,8 +784,8 @@ gtk_item_factory_dump_rc (const gchar *file_name,
return;
fputs ("; ", f_out);
if (gdk_progname)
fputs (gdk_progname, f_out);
if (g_get_prgname ())
fputs (g_get_prgname (), f_out);
fputs (" GtkItemFactory rc-file -*- scheme -*-\n", f_out);
fputs ("; this file is an automated menu-path dump\n", f_out);
fputs (";\n", f_out);
......
......@@ -410,7 +410,7 @@ gtk_init (int *argc,
g_free (current_locale);
GTK_NOTE (MISC,
g_message ("%s multi-byte string functions.\n",
g_message ("%s multi-byte string functions.",
gtk_use_mb ? "Using" : "Not using"));
/* Initialize the default visual and colormap to be
......
......@@ -95,7 +95,7 @@ gtk_object_debug_foreach (gpointer key, gpointer value, gpointer user_data)
GtkObject *object;
object = (GtkObject*) value;
g_message ("[%p] %s\tref_count=%d%s%s\n",
g_message ("[%p] %s\tref_count=%d%s%s",
object,
gtk_type_name (GTK_OBJECT_TYPE (object)),
object->ref_count,
......@@ -107,7 +107,7 @@ gtk_object_debug (void)
{
g_hash_table_foreach (living_objs_ht, gtk_object_debug_foreach, NULL);
g_message ("living objects count = %d\n", obj_count);
g_message ("living objects count = %d", obj_count);
}
#endif /* G_ENABLE_DEBUG */
......
......@@ -1255,8 +1255,8 @@ gtk_trim_cmap (GtkPreviewClass *klass)
if ((nred < 2) || (ngreen < 2) || (nblue < 2) || (ngray < 2))
{
g_message ("Unable to allocate sufficient colormap entries.\n");
g_message ("Try exiting other color intensive applications.\n");
g_message ("Unable to allocate sufficient colormap entries.");
g_message ("Try exiting other color intensive applications.");
return;
}
......@@ -1266,8 +1266,8 @@ gtk_trim_cmap (GtkPreviewClass *klass)
(nblue != klass->info.nblue_shades) ||
(ngray != klass->info.ngray_shades))
{
g_message ("Not enough colors to satisfy requested color cube.\n");
g_message ("Reduced color cube shades from\n");
g_message ("Not enough colors to satisfy requested color cube.");
g_message ("Reduced color cube shades from");
g_message ("[%d of Red, %d of Green, %d of Blue, %d of Gray] ==> [%d of Red, %d of Green, %d of Blue, %d of Gray]\n",
klass->info.nred_shades, klass->info.ngreen_shades,
klass->info.nblue_shades, klass->info.ngray_shades,
......
......@@ -248,16 +248,12 @@ gtk_rc_parse_file (const gchar *filename, gboolean reload)
else
{
GString *str;
gchar buffer[MAXPATHLEN];
#if defined(sun) && !defined(__SVR4)
if(!getwd(buffer))
#else
if(!getcwd(buffer, MAXPATHLEN))
#endif
return;
str = g_string_new (buffer);
gchar *cwd;
cwd = g_get_current_dir ();
str = g_string_new (cwd);
g_free (cwd);
g_string_append_c (str, '/');
g_string_append (str, rc_file->name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment