Commit 28c2b0a3 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Renames:

Thu Jun 20 19:41:09 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkdisplay.h gdk/gdkscreen.h gdk/**.c gtk/*.c
        tests/*.c: Renames:

         gdk_get_default_display => gdk_display_get_default
         gdk_get_default_screen  => gdk_screen_get_default
         gdk_open_display        => gdk_display_open
parent 5830bf89
Thu Jun 20 19:41:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h gdk/gdkscreen.h gdk/**.c gtk/*.c
tests/*.c: Renames:
gdk_get_default_display => gdk_display_get_default
gdk_get_default_screen => gdk_screen_get_default
gdk_open_display => gdk_display_open
Thu Jun 20 16:49:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplaymanager.[ch] gdk/gdk.[ch] gdk/gdkdisplay.c
......
Thu Jun 20 19:41:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h gdk/gdkscreen.h gdk/**.c gtk/*.c
tests/*.c: Renames:
gdk_get_default_display => gdk_display_get_default
gdk_get_default_screen => gdk_screen_get_default
gdk_open_display => gdk_display_open
Thu Jun 20 16:49:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplaymanager.[ch] gdk/gdk.[ch] gdk/gdkdisplay.c
......
Thu Jun 20 19:41:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h gdk/gdkscreen.h gdk/**.c gtk/*.c
tests/*.c: Renames:
gdk_get_default_display => gdk_display_get_default
gdk_get_default_screen => gdk_screen_get_default
gdk_open_display => gdk_display_open
Thu Jun 20 16:49:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplaymanager.[ch] gdk/gdk.[ch] gdk/gdkdisplay.c
......
Thu Jun 20 19:41:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h gdk/gdkscreen.h gdk/**.c gtk/*.c
tests/*.c: Renames:
gdk_get_default_display => gdk_display_get_default
gdk_get_default_screen => gdk_screen_get_default
gdk_open_display => gdk_display_open
Thu Jun 20 16:49:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplaymanager.[ch] gdk/gdk.[ch] gdk/gdkdisplay.c
......
Thu Jun 20 19:41:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h gdk/gdkscreen.h gdk/**.c gtk/*.c
tests/*.c: Renames:
gdk_get_default_display => gdk_display_get_default
gdk_get_default_screen => gdk_screen_get_default
gdk_open_display => gdk_display_open
Thu Jun 20 16:49:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplaymanager.[ch] gdk/gdk.[ch] gdk/gdkdisplay.c
......
Thu Jun 20 19:41:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h gdk/gdkscreen.h gdk/**.c gtk/*.c
tests/*.c: Renames:
gdk_get_default_display => gdk_display_get_default
gdk_get_default_screen => gdk_screen_get_default
gdk_open_display => gdk_display_open
Thu Jun 20 16:49:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplaymanager.[ch] gdk/gdk.[ch] gdk/gdkdisplay.c
......
......@@ -116,7 +116,8 @@ gdk_wm_function_get_type
<FILE>gdkdisplay</FILE>
<TITLE>GdkDisplay</TITLE>
GdkDisplay
gdk_open_display
gdk_display_open
gdk_display_get_default
gdk_display_get_name
gdk_display_get_n_screens
gdk_display_get_screen
......@@ -134,8 +135,6 @@ gdk_display_put_event
gdk_display_add_client_message_filter
gdk_display_set_double_click_time
gdk_display_set_sm_client_id
gdk_set_default_display
gdk_get_default_display
<SUBSECTION Standard>
GDK_DISPLAY_OBJECT
GDK_IS_DISPLAY
......@@ -150,6 +149,7 @@ GDK_DISPLAY_GET_CLASS
<FILE>gdkscreen</FILE>
<TITLE>GdkScreen</TITLE>
GdkScreen
gdk_screen_get_default
gdk_screen_get_default_colormap
gdk_screen_set_default_colormap
gdk_screen_get_system_colormap
......@@ -172,7 +172,6 @@ gdk_screen_get_monitor_geometry
gdk_screen_get_monitor_at_point
gdk_screen_get_monitor_at_window
gdk_screen_broadcast_client_message
gdk_get_default_screen
gdk_screen_get_setting
<SUBSECTION Standard>
GDK_SCREEN
......
......@@ -52,7 +52,7 @@ GdkDisplay *display;
gtk_init (&amp;argc, &amp;argv);
display = gdk_get_default_display ();
display = gdk_display_get_default ();
num_screen = gdk_display_get_n_screens (display);
displayname = gdk_display_get_name (display);
if (num_screen &lt;= 1)
......
......@@ -605,6 +605,20 @@ status information, so the application does not need to do anything.
@win:
@Returns:
<!-- ##### FUNCTION gdk_get_default_display ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gdk_get_default_screen ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gdk_ic_attr_destroy ##### -->
<para>
Destroys the given #GdkICAttr struct, freeing the allocated memory.
......@@ -848,6 +862,14 @@ they will be ignored.
</para>
<!-- ##### FUNCTION gdk_open_display ##### -->
<para>
</para>
@display_name:
@Returns:
<!-- ##### VARIABLE gdk_progclass ##### -->
<para>
......@@ -874,3 +896,10 @@ they will be ignored.
</para>
<!-- ##### FUNCTION gdk_set_default_display ##### -->
<para>
</para>
@display:
......@@ -35,7 +35,7 @@ of an X display. All its fields are private and should not be accessed directly.
</para>
<!-- ##### FUNCTION gdk_open_display ##### -->
<!-- ##### FUNCTION gdk_display_open ##### -->
<para>
</para>
......@@ -44,6 +44,14 @@ of an X display. All its fields are private and should not be accessed directly.
@Returns:
<!-- ##### FUNCTION gdk_display_get_default ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gdk_display_get_name ##### -->
<para>
......@@ -197,19 +205,3 @@ of an X display. All its fields are private and should not be accessed directly.
@sm_client_id:
<!-- ##### FUNCTION gdk_set_default_display ##### -->
<para>
</para>
@display:
<!-- ##### FUNCTION gdk_get_default_display ##### -->
<para>
</para>
@Returns:
......@@ -30,6 +30,14 @@ when GDK gets multihead support.
</para>
<!-- ##### FUNCTION gdk_screen_get_default ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gdk_screen_get_default_colormap ##### -->
<para>
......@@ -237,14 +245,6 @@ when GDK gets multihead support.
@event:
<!-- ##### FUNCTION gdk_get_default_screen ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gdk_screen_get_setting ##### -->
<para>
......
......@@ -271,7 +271,7 @@ _gdk_get_command_line_args (int *argc,
* @argv: the array of command line arguments.
*
* Parse command line arguments, and store for future
* use by calls to gdk_open_display().
* use by calls to gdk_display_open().
*
* Any arguments used by GDK are removed from the array and @argc and @argv are
* updated accordingly.
......@@ -392,10 +392,10 @@ gdk_init_check (int *argc,
gdk_parse_args (argc, argv);
if (gdk_get_default_display ())
if (gdk_display_get_default ())
return TRUE;
display = gdk_open_display (_gdk_display_name);
display = gdk_display_open (_gdk_display_name);
if (display)
{
......
......@@ -273,6 +273,6 @@ gdk_color_parse (const gchar *spec,
GdkColormap*
gdk_colormap_get_system (void)
{
return gdk_screen_get_system_colormap (gdk_get_default_screen ());
return gdk_screen_get_system_colormap (gdk_screen_get_default ());
}
......@@ -94,5 +94,5 @@ gdk_cursor_unref (GdkCursor *cursor)
GdkCursor*
gdk_cursor_new (GdkCursorType cursor_type)
{
return gdk_cursor_new_for_display (gdk_get_default_display(), cursor_type);
return gdk_cursor_new_for_display (gdk_display_get_default(), cursor_type);
}
......@@ -88,7 +88,7 @@ gdk_display_finalize (GObject *object)
_gdk_displays = g_slist_remove (_gdk_displays, display);
if (gdk_get_default_display() == display)
if (gdk_display_get_default() == display)
gdk_display_manager_set_default_display (gdk_display_manager_get(),
NULL);
......@@ -182,7 +182,7 @@ gdk_display_put_event (GdkDisplay *display,
void
gdk_pointer_ungrab (guint32 time)
{
gdk_display_pointer_ungrab (gdk_get_default_display (), time);
gdk_display_pointer_ungrab (gdk_display_get_default (), time);
}
/**
......@@ -198,7 +198,7 @@ gdk_pointer_ungrab (guint32 time)
gboolean
gdk_pointer_is_grabbed (void)
{
return gdk_display_pointer_is_grabbed (gdk_get_default_display ());
return gdk_display_pointer_is_grabbed (gdk_display_get_default ());
}
/**
......@@ -211,7 +211,7 @@ gdk_pointer_is_grabbed (void)
void
gdk_keyboard_ungrab (guint32 time)
{
gdk_display_keyboard_ungrab (gdk_get_default_display (), time);
gdk_display_keyboard_ungrab (gdk_display_get_default (), time);
}
/**
......@@ -222,7 +222,7 @@ gdk_keyboard_ungrab (guint32 time)
void
gdk_beep (void)
{
gdk_display_beep (gdk_get_default_display ());
gdk_display_beep (gdk_display_get_default ());
}
/**
......@@ -242,7 +242,7 @@ gdk_event_send_client_message (GdkEvent *event, guint32 xid)
{
g_return_val_if_fail (event != NULL, FALSE);
return gdk_event_send_client_message_for_display (gdk_get_default_display (),
return gdk_event_send_client_message_for_display (gdk_display_get_default (),
event, xid);
}
......@@ -263,7 +263,7 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
{
g_return_if_fail (event != NULL);
gdk_screen_broadcast_client_message (gdk_get_default_screen (), event);
gdk_screen_broadcast_client_message (gdk_screen_get_default (), event);
}
/**
......@@ -277,7 +277,7 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
GdkDevice *
gdk_device_get_core_pointer (void)
{
return gdk_display_get_core_pointer (gdk_get_default_display ());
return gdk_display_get_core_pointer (gdk_display_get_default ());
}
/**
......
......@@ -72,7 +72,7 @@ struct _GdkDisplayClass
};
GType gdk_display_get_type (void);
GdkDisplay *gdk_open_display (const gchar *display_name);
GdkDisplay *gdk_display_open (const gchar *display_name);
G_CONST_RETURN gchar * gdk_display_get_name (GdkDisplay *display);
......@@ -107,7 +107,7 @@ void gdk_display_set_sm_client_id (GdkDisplay *display,
const gchar *sm_client_id);
void gdk_set_default_display (GdkDisplay *display);
GdkDisplay *gdk_get_default_display (void);
GdkDisplay *gdk_display_get_default (void);
GdkDevice *gdk_display_get_core_pointer (GdkDisplay *display);
......
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2000 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include <config.h>
#include "gdkdisplay.h"
#include "gdkdisplaymanager.h"
#include "gdkinternals.h"
#include "gdkmarshalers.h"
#include "gdkintl.h"
struct _GdkDisplayManager
{
GObject parent_instance;
};
enum {
PROP_0,
PROP_DEFAULT_DISPLAY
};
enum {
DISPLAY_OPENED,
LAST_SIGNAL
};
static void gdk_display_manager_class_init (GdkDisplayManagerClass *klass);
static void gdk_display_manager_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gdk_display_manager_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static guint signals[LAST_SIGNAL] = { 0 };
GdkDisplay *default_display = NULL;
GType
gdk_display_manager_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
static const GTypeInfo object_info =
{
sizeof (GdkDisplayManagerClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gdk_display_manager_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkDisplayManager),
0, /* n_preallocs */
(GInstanceInitFunc) NULL,
};
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkDisplayManager",
&object_info, 0);
}
return object_type;
}
static void
gdk_display_manager_class_init (GdkDisplayManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->set_property = gdk_display_manager_set_property;
object_class->get_property = gdk_display_manager_get_property;
signals[DISPLAY_OPENED] =
g_signal_new ("display_opened",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkDisplayManagerClass, display_opened),
NULL, NULL,
gdk_marshal_VOID__OBJECT,
G_TYPE_NONE,
1,
GDK_TYPE_DISPLAY);
g_object_class_install_property (object_class,
PROP_DEFAULT_DISPLAY,
g_param_spec_object ("default-display",
_("Default Display"),
_("The default display for GDK"),
GDK_TYPE_DISPLAY,
G_PARAM_READWRITE));
}
static void
gdk_display_manager_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_DEFAULT_DISPLAY:
default_display = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gdk_display_manager_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_DEFAULT_DISPLAY:
g_value_set_object (value, default_display);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
/**
* gdk_display_manager_get:
* @returns: the singleton #GdkDisplayManager object.
*
* Returns the global #GdkDisplayManager singleton; gdk_parse_pargs(),
* gdk_init(), or gdk_init_check() must have been called first.
**/
GdkDisplayManager*
gdk_display_manager_get (void)
{
static GdkDisplayManager *display_manager = NULL;
if (!display_manager)
display_manager = g_object_new (GDK_TYPE_DISPLAY_MANAGER, NULL);
return display_manager;
}
/**
* gdk_display_manager_get_default_display:
*
* Gets the default #GdkDisplay. This is a convenience
* function for:
* <programlisting>
* gdk_display_manager_get_default_display (gdk_display_manager_get ())
* </programlisting>
*
* Returns: a #GdkDisplay, or %NULL if there is no default
* display.
*/
GdkDisplay *
gdk_display_manager_get_default_display (GdkDisplayManager *display_manager)
{
return default_display;
}
/**
* gdk_display_get_default:
*
* Gets the default #GdkDisplay. This is a convenience
* function for:
* <programlisting>
* gdk_display_manager_get_default_display (gdk_display_manager_get ())
* </programlisting>
*
* Returns: a #GdkDisplay, or %NULL if there is no default
* display.
*/
GdkDisplay *
gdk_display_get_default (void)
{
return default_display;
}
/**
* gdk_screen_get_default:
*
* Gets the default screen for the default display. (See
* gdk_display_get_default ()).
*
* Returns: a #GdkScreen.
*/
GdkScreen *
gdk_screen_get_default (void)
{
return gdk_display_get_default_screen (default_display);
}
/**
* gdk_display_manager_set_default_display:
* @display: a #GdkDisplay
*
* Sets @display as the default display.
**/
void
gdk_display_manager_set_default_display (GdkDisplayManager *display_manager,
GdkDisplay *display)
{
default_display = display;
_gdk_windowing_set_default_display (display);
g_object_notify (G_OBJECT (display_manager), "default_display");
}
/**
* gdk_display_manager_list_displays:
*
* List all currently open displays.
*
* Return value: a newly allocated #GSList of #GdkDisplay objects.
* Free this list with g_slist_free() when you are done with it.
**/
GSList *
gdk_display_manager_list_displays (GdkDisplayManager *display_manager)
{
return g_slist_copy (_gdk_displays);
}
/* GDK - The GIMP Drawing Kit
* Copyright (C) 2000 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_DISPLAY_MANAGER_H__
#define __GDK_DISPLAY_MANAGER_H__
#include <gdk/gdktypes.h>
#include <gdk/gdkdisplay.h>
G_BEGIN_DECLS
typedef struct _GdkDisplayManager GdkDisplayManager;
typedef struct _GdkDisplayManagerClass GdkDisplayManagerClass;
#define GDK_TYPE_DISPLAY_MANAGER (gdk_display_manager_get_type ())
#define GDK_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY_MANAGER, GdkDisplayManager))
#define GDK_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DISPLAY_MANAGER, GdkDisplayManagerClass))
#define GDK_IS_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY_MANAGER))
#define GDK_IS_DISPLAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY_MANAGER))
#define GDK_DISPLAY_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY_MANAGER, GdkDisplayManagerClass))
struct _GdkDisplayManagerClass
{
GObjectClass parent_class;
void (*display_opened) (GdkDisplayManager *display_manager,
GdkDisplay *display);
};
GType gdk_display_manager_get_type (void) G_GNUC_CONST;
GdkDisplayManager *gdk_display_manager_get (void);
GdkDisplay * gdk_display_manager_get_default_display (GdkDisplayManager *display_manager);
void gdk_display_manager_set_default_display (GdkDisplayManager *display_manager,
GdkDisplay *display);
GSList * gdk_display_manager_list_displays (GdkDisplayManager *display_manager);
G_END_DECLS
#endif /* __GDK_DISPLAY_MANAGER_H__ */
......@@ -264,7 +264,7 @@ gdk_event_put (GdkEvent *event)
{
GDK_NOTE (MULTIHEAD,
g_message ("Falling back to default display for gdk_event_put()"));
display = gdk_get_default_display ();
display = gdk_display_get_default ();
}
gdk_display_put_event (display, event);
......@@ -1004,7 +1004,7 @@ gdk_display_set_double_click_time (GdkDisplay *display,
void
gdk_set_double_click_time (guint msec)
{
gdk_display_set_double_click_time (gdk_get_default_display (), msec);
gdk_display_set_double_click_time (gdk_display_get_default (), msec);
}
GType
......@@ -1034,5 +1034,5 @@ gboolean
gdk_setting_get (const gchar *name,
GValue *value)
{
return gdk_screen_get_setting (gdk_get_default_screen (), name, value);
return gdk_screen_get_setting (gdk_screen_get_default (), name, value);
}
......@@ -192,11 +192,11 @@ gdk_char_height (GdkFont *font,
GdkFont*
gdk_font_from_description (PangoFontDescription *font_desc)
{
return gdk_font_from_description_for_display (gdk_get_default_display (),font_desc);
return gdk_font_from_description_for_display (gdk_display_get_default (),font_desc);
}
GdkFont*
gdk_font_load (const gchar *font_name)
{
return gdk_font_load_for_display (gdk_get_default_display(), font_name);
return gdk_font_load_for_display (gdk_display_get_default(), font_name);
}
......@@ -282,5 +282,5 @@ gdk_keyval_is_lower (guint keyval)
GdkKeymap*
gdk_keymap_get_default (void)
{
return gdk_keymap_get_for_display (gdk_get_default_display ());
return gdk_keymap_get_for_display (gdk_display_get_default ());
}
......@@ -841,5 +841,5 @@ gdk_pango_layout_get_clip_region (PangoLayout *layout,
PangoContext *
gdk_pango_context_get (void)
{
return gdk_pango_context_get_for_screen (gdk_get_default_screen ());
return gdk_pango_context_get_for_screen (gdk_screen_get_default ());
}