[GnomeMeeting-devel-list] [PATCH] more private druid
- From: PUYDT Julien <julien puydt laposte net>
- To: GnomeMeeting Devel Liste <gnomemeeting-devel-list gnome org>
- Subject: [GnomeMeeting-devel-list] [PATCH] more private druid
- Date: Thu, 29 Apr 2004 14:19:34 +0200
Hi,
the following patch makes the druid a little more private (not as much
as I want yet, but it's a beginning).
May I commit?
Snark
diff -ur gnomemeeting/src/common.h gnomemeeting.patched/src/common.h
--- gnomemeeting/src/common.h 2004-04-14 20:24:02.000000000 +0200
+++ gnomemeeting.patched/src/common.h 2004-04-29 12:02:54.000000000 +0200
@@ -116,7 +116,6 @@
typedef struct _GmPrefWindow GmPrefWindow;
typedef struct _GmLdapWindow GmLdapWindow;
typedef struct _GmLdapWindowPage GmLdapWindowPage;
-typedef struct _GmDruidWindow GmDruidWindow;
typedef struct _GmRtpData GmRtpData;
@@ -247,29 +246,6 @@
};
-struct _GmDruidWindow
-{
- GnomeDruid *druid;
- GtkWidget *ils_register;
- GtkWidget *audio_test_button;
- GtkWidget *video_test_button;
- GtkWidget *enable_microtelco;
- GtkWidget *kind_of_net;
- GtkWidget *progress;
- GtkWidget *audio_manager;
- GtkWidget *video_manager;
- GtkWidget *audio_player;
- GtkWidget *audio_recorder;
- GtkWidget *video_device;
- GtkWidget *gk_alias;
- GtkWidget *gk_password;
- GtkWidget *name;
- GtkWidget *use_callto;
- GtkWidget *mail;
- GnomeDruidPageEdge *page_edge;
-};
-
-
struct _GmPrefWindow
{
GtkListStore *codecs_list_store;
diff -ur gnomemeeting/src/druid.cpp gnomemeeting.patched/src/druid.cpp
--- gnomemeeting/src/druid.cpp 2004-04-22 11:23:11.000000000 +0200
+++ gnomemeeting.patched/src/druid.cpp 2004-04-29 12:03:31.000000000 +0200
@@ -50,8 +50,9 @@
#include "stock-icons.h"
#include "gm_conf.h"
-
/* Declarations */
+static void destroy_internal_struct (gpointer);
+
static gint kind_of_net_hack (gpointer);
static void audio_test_button_clicked (GtkWidget *,
@@ -78,19 +79,27 @@
gpointer);
-static void gnomemeeting_init_druid_audio_manager_page (GnomeDruid *,
+static void gnomemeeting_init_druid_audio_manager_page (GmDruidWindow *,
int,
int);
-static void gnomemeeting_init_druid_audio_devices_page (GnomeDruid *,
+static void gnomemeeting_init_druid_audio_devices_page (GmDruidWindow *,
int,
int);
-static void gnomemeeting_init_druid_connection_type_page (GnomeDruid *,
+static void gnomemeeting_init_druid_connection_type_page (GmDruidWindow *,
int, int);
extern GtkWidget *gm;
+/* used to free the memory of the attached GmDruidWindow */
+static void
+destroy_internal_struct (gpointer ptr)
+{
+ GmDruidWindow *dw = (GmDruidWindow *)ptr;
+
+ delete (dw);
+}
/* GTK Callbacks */
static gint
@@ -172,7 +181,7 @@
GmDruidWindow *dw = NULL;
gw = GnomeMeeting::Process ()->GetMainWindow ();
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
+ dw = (GmDruidWindow *)g_object_get_data (G_OBJECT (GnomeMeeting::Process ()->GetDruidWindow ()), "GMObject");
gnome_druid_set_page (dw->druid, GNOME_DRUID_PAGE (dw->page_edge));
gnomemeeting_window_hide (gw->druid_window);
@@ -211,7 +220,7 @@
gchar *video_recorder = NULL;
gw = GnomeMeeting::Process ()->GetMainWindow ();
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
+ dw = (GmDruidWindow *)g_object_get_data (G_OBJECT (GnomeMeeting::Process ()->GetDruidWindow ()), "GMObject");
ep = GnomeMeeting::Process ()->Endpoint ();
@@ -365,7 +374,7 @@
BOOL error = TRUE;
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
+ dw = (GmDruidWindow *)g_object_get_data (G_OBJECT (GnomeMeeting::Process ()->GetDruidWindow ()), "GMObject");
if (page == 2) {
@@ -408,7 +417,7 @@
{
GmDruidWindow *dw = NULL;
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
+ dw = (GmDruidWindow *)g_object_get_data (G_OBJECT (GnomeMeeting::Process ()->GetDruidWindow ()), "GMObject");
gnomemeeting_druid_personal_data_check (dw->druid, GPOINTER_TO_INT (data));
}
@@ -426,7 +435,7 @@
{
GmDruidWindow *dw = NULL;
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
+ dw = (GmDruidWindow *)g_object_get_data (G_OBJECT (GnomeMeeting::Process ()->GetDruidWindow ()), "GMObject");
gnomemeeting_druid_personal_data_check (dw->druid, GPOINTER_TO_INT (data));
}
@@ -483,7 +492,7 @@
GtkWidget *child = NULL;
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
+ dw = (GmDruidWindow *)g_object_get_data (G_OBJECT (GnomeMeeting::Process ()->GetDruidWindow ()), "GMObject");
name = (gchar *) gtk_entry_get_text (GTK_ENTRY (dw->name));
mail = (gchar *) gtk_entry_get_text (GTK_ENTRY (dw->mail));
@@ -570,7 +579,7 @@
PStringArray devices;
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
+ dw = (GmDruidWindow *)g_object_get_data (G_OBJECT (GnomeMeeting::Process ()->GetDruidWindow ()), "GMObject");
gw = GnomeMeeting::Process ()->GetMainWindow ();
ep = GnomeMeeting::Process ()->Endpoint ();
@@ -758,7 +767,7 @@
* PRE : /
*/
static void
-gnomemeeting_init_druid_personal_data_page (GnomeDruid *druid, int p, int t)
+gnomemeeting_init_druid_personal_data_page (GmDruidWindow *dw, int p, int t)
{
GtkWidget *label = NULL;
GtkWidget *vbox = NULL;
@@ -766,11 +775,10 @@
gchar *title = NULL;
gchar *text = NULL;
- GmDruidWindow *dw = NULL;
+ GnomeDruid *druid = dw->druid;
GtkWidget *page = NULL;
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
page = gnome_druid_page_standard_new ();
title = g_strdup_printf (_("Personal Information - page %d/%d"), p, t);
@@ -821,7 +829,7 @@
* PRE : /
*/
static void
-gnomemeeting_init_druid_callto_page (GnomeDruid *druid, int p, int t)
+gnomemeeting_init_druid_callto_page (GmDruidWindow *dw, int p, int t)
{
GtkWidget *label = NULL;
GtkWidget *vbox = NULL;
@@ -830,11 +838,10 @@
gchar *title = NULL;
gchar *text = NULL;
- GmDruidWindow *dw = NULL;
+ GnomeDruid *druid = dw->druid;
GtkWidget *page = NULL;
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
page = gnome_druid_page_standard_new ();
title = g_strdup_printf (_("Callto URL - page %d/%d"), p, t);
@@ -893,14 +900,14 @@
* PRE : /
*/
static void
-gnomemeeting_init_druid_connection_type_page (GnomeDruid *druid,
+gnomemeeting_init_druid_connection_type_page (GmDruidWindow *dw,
int p,
int t)
{
GtkWidget *vbox = NULL;
GtkWidget *label = NULL;
- GmDruidWindow *dw = NULL;
+ GnomeDruid *druid = dw->druid;
GmWindow *gw = NULL;
gchar *title = NULL;
@@ -909,7 +916,6 @@
GnomeDruidPageStandard *page_standard = NULL;
/* Get data */
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
gw = GnomeMeeting::Process ()->GetMainWindow ();
page_standard =
@@ -952,15 +958,15 @@
* PRE : /
*/
static void
-gnomemeeting_init_druid_audio_manager_page (GnomeDruid *druid,
+gnomemeeting_init_druid_audio_manager_page (GmDruidWindow *dw,
int p,
int t)
{
GtkWidget *label = NULL;
GtkWidget *vbox = NULL;
- GmDruidWindow *dw = NULL;
GmWindow *gw = NULL;
+ GnomeDruid *druid = dw->druid;
gchar *title = NULL;
gchar *text = NULL;
@@ -968,7 +974,6 @@
GnomeDruidPageStandard *page_standard = NULL;
/* Get data */
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
gw = GnomeMeeting::Process ()->GetMainWindow ();
page_standard =
@@ -1012,7 +1017,7 @@
* PRE : /
*/
static void
-gnomemeeting_init_druid_audio_devices_page (GnomeDruid *druid,
+gnomemeeting_init_druid_audio_devices_page (GmDruidWindow *dw,
int p,
int t)
{
@@ -1020,7 +1025,7 @@
GtkWidget *vbox = NULL;
GtkWidget *label = NULL;
- GmDruidWindow *dw = NULL;
+ GnomeDruid *druid = dw->druid;
GmWindow *gw = NULL;
gchar *title = NULL;
@@ -1029,7 +1034,6 @@
GnomeDruidPageStandard *page_standard = NULL;
/* Get data */
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
gw = GnomeMeeting::Process ()->GetMainWindow ();
page_standard =
@@ -1110,14 +1114,14 @@
* PRE : /
*/
static void
-gnomemeeting_init_druid_video_manager_page (GnomeDruid *druid,
+gnomemeeting_init_druid_video_manager_page (GmDruidWindow *dw,
int p,
int t)
{
GtkWidget *label = NULL;
GtkWidget *vbox = NULL;
- GmDruidWindow *dw = NULL;
+ GnomeDruid *druid = dw->druid;
GmWindow *gw = NULL;
gchar *title = NULL;
@@ -1126,7 +1130,6 @@
GnomeDruidPageStandard *page_standard = NULL;
/* Get data */
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
gw = GnomeMeeting::Process ()->GetMainWindow ();
page_standard =
@@ -1169,7 +1172,7 @@
* PRE : /
*/
static void
-gnomemeeting_init_druid_video_devices_page (GnomeDruid *druid,
+gnomemeeting_init_druid_video_devices_page (GmDruidWindow *dw,
int p,
int t)
{
@@ -1177,7 +1180,7 @@
GtkWidget *vbox = NULL;
GtkWidget *label = NULL;
- GmDruidWindow *dw = NULL;
+ GnomeDruid *druid = dw->druid;
GmWindow *gw = NULL;
gchar *title = NULL;
@@ -1186,7 +1189,6 @@
GnomeDruidPageStandard *page_standard = NULL;
/* Get data */
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
gw = GnomeMeeting::Process ()->GetMainWindow ();
page_standard =
@@ -1242,13 +1244,13 @@
}
-
/* Functions */
GtkWidget *
-gnomemeeting_druid_window_new (GmDruidWindow *dw)
+gnomemeeting_druid_window_new ()
{
GtkWidget *window = NULL;
-
+ GmDruidWindow *dw = NULL;
+
gchar *title = NULL;
GnomeDruidPageEdge *page_final = NULL;
@@ -1260,6 +1262,11 @@
gtk_window_set_title (GTK_WINDOW (window),
_("First Time Configuration Druid"));
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
+
+ dw = new GmDruidWindow;
+ g_object_set_data_full (G_OBJECT (window), "GMObject",
+ (gpointer)dw, destroy_internal_struct);
+
dw->druid = GNOME_DRUID (gnome_druid_new ());
gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (dw->druid));
@@ -1292,13 +1299,13 @@
/* Create the different pages */
- gnomemeeting_init_druid_personal_data_page (dw->druid, 2, 9);
- gnomemeeting_init_druid_callto_page (dw->druid, 3, 9);
- gnomemeeting_init_druid_connection_type_page (dw->druid, 4, 9);
- gnomemeeting_init_druid_audio_manager_page (dw->druid, 5, 9);
- gnomemeeting_init_druid_audio_devices_page (dw->druid, 6, 9);
- gnomemeeting_init_druid_video_manager_page (dw->druid, 7, 9);
- gnomemeeting_init_druid_video_devices_page (dw->druid, 8, 9);
+ gnomemeeting_init_druid_personal_data_page (dw, 2, 9);
+ gnomemeeting_init_druid_callto_page (dw, 3, 9);
+ gnomemeeting_init_druid_connection_type_page (dw, 4, 9);
+ gnomemeeting_init_druid_audio_manager_page (dw, 5, 9);
+ gnomemeeting_init_druid_audio_devices_page (dw, 6, 9);
+ gnomemeeting_init_druid_video_manager_page (dw, 7, 9);
+ gnomemeeting_init_druid_video_devices_page (dw, 8, 9);
/*
gnomemeeting_init_druid_ixj_device_page (dw->druid, 6, 7);
diff -ur gnomemeeting/src/druid.h gnomemeeting.patched/src/druid.h
--- gnomemeeting/src/druid.h 2004-01-20 12:00:40.000000000 +0100
+++ gnomemeeting.patched/src/druid.h 2004-04-29 12:02:54.000000000 +0200
@@ -37,11 +37,34 @@
#include "common.h"
+typedef struct _GmDruidWindow GmDruidWindow;
+
+struct _GmDruidWindow
+{
+ GnomeDruid *druid;
+ GtkWidget *ils_register;
+ GtkWidget *audio_test_button;
+ GtkWidget *video_test_button;
+ GtkWidget *enable_microtelco;
+ GtkWidget *kind_of_net;
+ GtkWidget *progress;
+ GtkWidget *audio_manager;
+ GtkWidget *video_manager;
+ GtkWidget *audio_player;
+ GtkWidget *audio_recorder;
+ GtkWidget *video_device;
+ GtkWidget *gk_alias;
+ GtkWidget *gk_password;
+ GtkWidget *name;
+ GtkWidget *use_callto;
+ GtkWidget *mail;
+ GnomeDruidPageEdge *page_edge;
+};
/* DESCRIPTION : /
* BEHAVIOR : Builds the "First time configuration druid" and returns it.
* PRE : /
*/
GtkWidget *
-gnomemeeting_druid_window_new (GmDruidWindow *);
+gnomemeeting_druid_window_new ();
diff -ur gnomemeeting/src/gnomemeeting.cpp gnomemeeting.patched/src/gnomemeeting.cpp
--- gnomemeeting/src/gnomemeeting.cpp 2004-04-26 23:02:49.000000000 +0200
+++ gnomemeeting.patched/src/gnomemeeting.cpp 2004-04-29 12:02:54.000000000 +0200
@@ -112,7 +112,6 @@
gw = new GmWindow ();
pw = new GmPrefWindow ();
lw = new GmLdapWindow ();
- dw = new GmDruidWindow ();
rtp = new GmRtpData ();
memset ((void *) rtp, 0, sizeof (struct _GmRtpData));
@@ -161,7 +160,6 @@
delete (gw);
delete (pw);
delete (lw);
- delete (dw);
delete (rtp);
}
@@ -374,10 +372,10 @@
}
-GmDruidWindow *
+GtkWidget *
GnomeMeeting::GetDruidWindow ()
{
- return dw;
+ return gw->druid_window;
}
@@ -440,7 +438,7 @@
gw->addressbook_window = gm_addressbook_window_new ();
#endif
gw->ldap_window = gnomemeeting_ldap_window_new (lw);
- gw->druid_window = gnomemeeting_druid_window_new (dw);
+ gw->druid_window = gnomemeeting_druid_window_new ();
#ifndef WIN32
gw->docklet = gnomemeeting_tray_new ();
gw->tray_popup_menu = gnomemeeting_tray_init_menu (gw->docklet);
diff -ur gnomemeeting/src/gnomemeeting.h gnomemeeting.patched/src/gnomemeeting.h
--- gnomemeeting/src/gnomemeeting.h 2004-04-18 09:04:56.000000000 +0200
+++ gnomemeeting.patched/src/gnomemeeting.h 2004-04-29 12:02:54.000000000 +0200
@@ -128,11 +128,11 @@
/* DESCRIPTION : /
- * BEHAVIOR : Returns a pointer to the GmDruidWindow
+ * BEHAVIOR : Returns a pointer to the druid window
* structure of widgets.
* PRE : /
*/
- GmDruidWindow *GetDruidWindow ();
+ GtkWidget *GetDruidWindow ();
/* DESCRIPTION : /
@@ -196,7 +196,6 @@
GmWindow *gw;
GmLdapWindow *lw;
- GmDruidWindow *dw;
GmPrefWindow *pw;
GmRtpData *rtp;
diff -ur gnomemeeting/src/sound_handling.cpp gnomemeeting.patched/src/sound_handling.cpp
--- gnomemeeting/src/sound_handling.cpp 2004-04-18 20:21:49.000000000 +0200
+++ gnomemeeting.patched/src/sound_handling.cpp 2004-04-29 12:02:54.000000000 +0200
@@ -43,6 +43,7 @@
#include "endpoint.h"
#include "lid.h"
#include "misc.h"
+#include "druid.h"
#include "gtklevelmeter.h"
#include "dialog.h"
@@ -79,7 +80,7 @@
{
GmDruidWindow *dw = NULL;
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
+ dw = (GmDruidWindow *)g_object_get_data (G_OBJECT (GnomeMeeting::Process ()->GetDruidWindow ()), "GMObject");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dw->audio_test_button),
false);
diff -ur gnomemeeting/src/videograbber.cpp gnomemeeting.patched/src/videograbber.cpp
--- gnomemeeting/src/videograbber.cpp 2004-04-12 14:50:36.000000000 +0200
+++ gnomemeeting.patched/src/videograbber.cpp 2004-04-29 12:02:54.000000000 +0200
@@ -44,6 +44,7 @@
#include "menu.h"
#include "misc.h"
#include "log_window.h"
+#include "druid.h"
#include "dialog.h"
#include "gm_conf.h"
@@ -563,8 +564,8 @@
gchar *tmp = NULL;
gw = GnomeMeeting::Process ()->GetMainWindow ();
- dw = GnomeMeeting::Process ()->GetDruidWindow ();
-
+ dw = (GmDruidWindow *)g_object_get_data (G_OBJECT (GnomeMeeting::Process ()->GetDruidWindow ()), "GMObject");
+
PWaitAndSignal m(quit_mutex);
thread_sync_point.Signal ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]