Commit 4994722e authored by Elliot Lee's avatar Elliot Lee Committed by Elliot Lee

Add request_progress_change notification



1999-12-21  Elliot Lee  <sopwith@redhat.com>

* idl/nautilus.idl, libnautilus/ntl-view-client.[ch], src/ntl-window*.[ch],
src/ntl-view-frame-svr.c: Add request_progress_change notification

* src/ntl-view-*: Fix/finish various mjs changes: Do the component type abstraction
properly, lose ntl-view-frame-svr.h, add ntl-view-private.h, add various component type
implementations.

* src/ntl-view-frame-svr.h: Add 'extern' so everyone doesn't get their own vepv
variable.
parent 11a469a4
1999-12-21 Elliot Lee <sopwith@redhat.com>
* idl/nautilus.idl, libnautilus/ntl-view-client.[ch], src/ntl-window*.[ch], src/ntl-view-frame-svr.c:
Add request_progress_change notification
* src/ntl-view-*: Fix/finish various mjs changes: Do the component type abstraction properly,
lose ntl-view-frame-svr.h, add ntl-view-private.h, add various component type implementations.
* src/ntl-view-frame-svr.h: Add 'extern' so everyone doesn't get their
own vepv variable.
......
......@@ -30,6 +30,12 @@ module Nautilus {
string status_string;
};
enum ProgressType { PROGRESS_DONE_OK, PROGRESS_DONE_ERROR, PROGRESS_UNDERWAY };
struct ProgressRequestInfo {
ProgressType type;
double amount;
};
interface View : ::GNOME::Unknown {
void save_state(in string config_path);
void load_state(in string config_path);
......@@ -53,6 +59,7 @@ module Nautilus {
oneway void request_status_change(in StatusRequestInfo statinfo);
oneway void request_location_change(in NavigationRequestInfo navinfo);
oneway void request_selection_change(in SelectionRequestInfo selinfo);
oneway void request_progress_change(in ProgressRequestInfo proginfo);
};
interface MetaViewFrame : ViewFrame {
......
......@@ -403,6 +403,34 @@ nautilus_view_client_request_status_change (NautilusViewClient *view,
CORBA_exception_free(&ev);
}
void
nautilus_view_client_request_progress_change(NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc)
{
CORBA_Environment ev;
g_return_if_fail (view != NULL);
g_return_if_fail (NAUTILUS_IS_VIEW_CLIENT (view));
CORBA_exception_init(&ev);
if(CORBA_Object_is_nil(view->view_frame, &ev))
view->view_frame = GNOME_Unknown_query_interface(gnome_control_get_control_frame(GNOME_CONTROL(view->control)),
"IDL:Nautilus/ViewFrame:1.0", &ev);
if(ev._major != CORBA_NO_EXCEPTION)
view->view_frame = CORBA_OBJECT_NIL;
if(CORBA_Object_is_nil(view->view_frame, &ev))
return;
Nautilus_ViewFrame_request_progress_change(view->view_frame, loc, &ev);
if(ev._major != CORBA_NO_EXCEPTION)
{
CORBA_Object_release(view->view_frame, &ev);
view->view_frame = CORBA_OBJECT_NIL;
}
CORBA_exception_free(&ev);
}
static void
nautilus_view_client_size_request (GtkWidget *widget,
GtkRequisition *requisition)
......
......@@ -78,6 +78,8 @@ void nautilus_view_client_request_selection_change (NautilusViewClient
Nautilus_SelectionRequestInfo *loc);
void nautilus_view_client_request_status_change (NautilusViewClient *view,
Nautilus_StatusRequestInfo *loc);
void nautilus_view_client_request_progress_change (NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc);
GnomeObject *nautilus_view_client_get_gnome_object (NautilusViewClient *view);
#ifdef __cplusplus
......
......@@ -403,6 +403,34 @@ nautilus_view_client_request_status_change (NautilusViewClient *view,
CORBA_exception_free(&ev);
}
void
nautilus_view_client_request_progress_change(NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc)
{
CORBA_Environment ev;
g_return_if_fail (view != NULL);
g_return_if_fail (NAUTILUS_IS_VIEW_CLIENT (view));
CORBA_exception_init(&ev);
if(CORBA_Object_is_nil(view->view_frame, &ev))
view->view_frame = GNOME_Unknown_query_interface(gnome_control_get_control_frame(GNOME_CONTROL(view->control)),
"IDL:Nautilus/ViewFrame:1.0", &ev);
if(ev._major != CORBA_NO_EXCEPTION)
view->view_frame = CORBA_OBJECT_NIL;
if(CORBA_Object_is_nil(view->view_frame, &ev))
return;
Nautilus_ViewFrame_request_progress_change(view->view_frame, loc, &ev);
if(ev._major != CORBA_NO_EXCEPTION)
{
CORBA_Object_release(view->view_frame, &ev);
view->view_frame = CORBA_OBJECT_NIL;
}
CORBA_exception_free(&ev);
}
static void
nautilus_view_client_size_request (GtkWidget *widget,
GtkRequisition *requisition)
......
......@@ -78,6 +78,8 @@ void nautilus_view_client_request_selection_change (NautilusViewClient
Nautilus_SelectionRequestInfo *loc);
void nautilus_view_client_request_status_change (NautilusViewClient *view,
Nautilus_StatusRequestInfo *loc);
void nautilus_view_client_request_progress_change (NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc);
GnomeObject *nautilus_view_client_get_gnome_object (NautilusViewClient *view);
#ifdef __cplusplus
......
......@@ -403,6 +403,34 @@ nautilus_view_client_request_status_change (NautilusViewClient *view,
CORBA_exception_free(&ev);
}
void
nautilus_view_client_request_progress_change(NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc)
{
CORBA_Environment ev;
g_return_if_fail (view != NULL);
g_return_if_fail (NAUTILUS_IS_VIEW_CLIENT (view));
CORBA_exception_init(&ev);
if(CORBA_Object_is_nil(view->view_frame, &ev))
view->view_frame = GNOME_Unknown_query_interface(gnome_control_get_control_frame(GNOME_CONTROL(view->control)),
"IDL:Nautilus/ViewFrame:1.0", &ev);
if(ev._major != CORBA_NO_EXCEPTION)
view->view_frame = CORBA_OBJECT_NIL;
if(CORBA_Object_is_nil(view->view_frame, &ev))
return;
Nautilus_ViewFrame_request_progress_change(view->view_frame, loc, &ev);
if(ev._major != CORBA_NO_EXCEPTION)
{
CORBA_Object_release(view->view_frame, &ev);
view->view_frame = CORBA_OBJECT_NIL;
}
CORBA_exception_free(&ev);
}
static void
nautilus_view_client_size_request (GtkWidget *widget,
GtkRequisition *requisition)
......
......@@ -78,6 +78,8 @@ void nautilus_view_client_request_selection_change (NautilusViewClient
Nautilus_SelectionRequestInfo *loc);
void nautilus_view_client_request_status_change (NautilusViewClient *view,
Nautilus_StatusRequestInfo *loc);
void nautilus_view_client_request_progress_change (NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc);
GnomeObject *nautilus_view_client_get_gnome_object (NautilusViewClient *view);
#ifdef __cplusplus
......
......@@ -403,6 +403,34 @@ nautilus_view_client_request_status_change (NautilusViewClient *view,
CORBA_exception_free(&ev);
}
void
nautilus_view_client_request_progress_change(NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc)
{
CORBA_Environment ev;
g_return_if_fail (view != NULL);
g_return_if_fail (NAUTILUS_IS_VIEW_CLIENT (view));
CORBA_exception_init(&ev);
if(CORBA_Object_is_nil(view->view_frame, &ev))
view->view_frame = GNOME_Unknown_query_interface(gnome_control_get_control_frame(GNOME_CONTROL(view->control)),
"IDL:Nautilus/ViewFrame:1.0", &ev);
if(ev._major != CORBA_NO_EXCEPTION)
view->view_frame = CORBA_OBJECT_NIL;
if(CORBA_Object_is_nil(view->view_frame, &ev))
return;
Nautilus_ViewFrame_request_progress_change(view->view_frame, loc, &ev);
if(ev._major != CORBA_NO_EXCEPTION)
{
CORBA_Object_release(view->view_frame, &ev);
view->view_frame = CORBA_OBJECT_NIL;
}
CORBA_exception_free(&ev);
}
static void
nautilus_view_client_size_request (GtkWidget *widget,
GtkRequisition *requisition)
......
......@@ -78,6 +78,8 @@ void nautilus_view_client_request_selection_change (NautilusViewClient
Nautilus_SelectionRequestInfo *loc);
void nautilus_view_client_request_status_change (NautilusViewClient *view,
Nautilus_StatusRequestInfo *loc);
void nautilus_view_client_request_progress_change (NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc);
GnomeObject *nautilus_view_client_get_gnome_object (NautilusViewClient *view);
#ifdef __cplusplus
......
......@@ -403,6 +403,34 @@ nautilus_view_client_request_status_change (NautilusViewClient *view,
CORBA_exception_free(&ev);
}
void
nautilus_view_client_request_progress_change(NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc)
{
CORBA_Environment ev;
g_return_if_fail (view != NULL);
g_return_if_fail (NAUTILUS_IS_VIEW_CLIENT (view));
CORBA_exception_init(&ev);
if(CORBA_Object_is_nil(view->view_frame, &ev))
view->view_frame = GNOME_Unknown_query_interface(gnome_control_get_control_frame(GNOME_CONTROL(view->control)),
"IDL:Nautilus/ViewFrame:1.0", &ev);
if(ev._major != CORBA_NO_EXCEPTION)
view->view_frame = CORBA_OBJECT_NIL;
if(CORBA_Object_is_nil(view->view_frame, &ev))
return;
Nautilus_ViewFrame_request_progress_change(view->view_frame, loc, &ev);
if(ev._major != CORBA_NO_EXCEPTION)
{
CORBA_Object_release(view->view_frame, &ev);
view->view_frame = CORBA_OBJECT_NIL;
}
CORBA_exception_free(&ev);
}
static void
nautilus_view_client_size_request (GtkWidget *widget,
GtkRequisition *requisition)
......
......@@ -78,6 +78,8 @@ void nautilus_view_client_request_selection_change (NautilusViewClient
Nautilus_SelectionRequestInfo *loc);
void nautilus_view_client_request_status_change (NautilusViewClient *view,
Nautilus_StatusRequestInfo *loc);
void nautilus_view_client_request_progress_change (NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc);
GnomeObject *nautilus_view_client_get_gnome_object (NautilusViewClient *view);
#ifdef __cplusplus
......
......@@ -403,6 +403,34 @@ nautilus_view_client_request_status_change (NautilusViewClient *view,
CORBA_exception_free(&ev);
}
void
nautilus_view_client_request_progress_change(NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc)
{
CORBA_Environment ev;
g_return_if_fail (view != NULL);
g_return_if_fail (NAUTILUS_IS_VIEW_CLIENT (view));
CORBA_exception_init(&ev);
if(CORBA_Object_is_nil(view->view_frame, &ev))
view->view_frame = GNOME_Unknown_query_interface(gnome_control_get_control_frame(GNOME_CONTROL(view->control)),
"IDL:Nautilus/ViewFrame:1.0", &ev);
if(ev._major != CORBA_NO_EXCEPTION)
view->view_frame = CORBA_OBJECT_NIL;
if(CORBA_Object_is_nil(view->view_frame, &ev))
return;
Nautilus_ViewFrame_request_progress_change(view->view_frame, loc, &ev);
if(ev._major != CORBA_NO_EXCEPTION)
{
CORBA_Object_release(view->view_frame, &ev);
view->view_frame = CORBA_OBJECT_NIL;
}
CORBA_exception_free(&ev);
}
static void
nautilus_view_client_size_request (GtkWidget *widget,
GtkRequisition *requisition)
......
......@@ -78,6 +78,8 @@ void nautilus_view_client_request_selection_change (NautilusViewClient
Nautilus_SelectionRequestInfo *loc);
void nautilus_view_client_request_status_change (NautilusViewClient *view,
Nautilus_StatusRequestInfo *loc);
void nautilus_view_client_request_progress_change (NautilusViewClient *view,
Nautilus_ProgressRequestInfo *loc);
GnomeObject *nautilus_view_client_get_gnome_object (NautilusViewClient *view);
#ifdef __cplusplus
......
......@@ -38,8 +38,11 @@ nautilus_SOURCES= \
ntl-uri-map.c \
ntl-view.h \
ntl-view.c \
ntl-view-frame-svr.h \
ntl-view-bonobo-control.c \
ntl-view-bonobo-subdoc.c \
ntl-view-frame-svr.c \
ntl-view-nautilus.c \
ntl-view-private.h \
ntl-window.h \
ntl-window.c \
ntl-window-msgs.c \
......
......@@ -35,7 +35,6 @@
static void nautilus_window_realize (GtkWidget *widget);
static int window_count = 0;
static GnomeAppClass *parent_class = NULL;
/* Stuff for handling the CORBA interface */
......@@ -322,6 +321,7 @@ nautilus_window_class_init (NautilusWindowClass *klass)
klass->request_location_change = nautilus_window_real_request_location_change;
klass->request_selection_change = nautilus_window_real_request_selection_change;
klass->request_status_change = nautilus_window_real_request_status_change;
klass->request_progress_change = nautilus_window_real_request_progress_change;
i = 0;
klass->window_signals[i++] = gtk_signal_new("request_location_change",
......@@ -342,6 +342,12 @@ nautilus_window_class_init (NautilusWindowClass *klass)
GTK_SIGNAL_OFFSET (NautilusWindowClass, request_status_change),
gtk_marshal_NONE__BOXED_OBJECT,
GTK_TYPE_NONE, 2, GTK_TYPE_BOXED, GTK_TYPE_OBJECT);
klass->window_signals[i++] = gtk_signal_new("request_progress_change",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusWindowClass, request_progress_change),
gtk_marshal_NONE__BOXED_OBJECT,
GTK_TYPE_NONE, 2, GTK_TYPE_BOXED, GTK_TYPE_OBJECT);
gtk_object_class_add_signals (object_class, klass->window_signals, i);
gtk_object_add_arg_type ("NautilusWindow::app_id",
......@@ -357,6 +363,11 @@ nautilus_window_class_init (NautilusWindowClass *klass)
widget_class->realize = nautilus_window_realize;
}
static void
nautilus_window_init (NautilusWindow *window)
{
}
static gboolean
nautilus_window_clear_status(NautilusWindow *window)
{
......@@ -597,14 +608,9 @@ nautilus_window_get_arg (GtkObject *object,
}
}
static void
nautilus_window_init (NautilusWindow *window)
{
window_count++;
}
static void nautilus_window_destroy (NautilusWindow *window)
{
NautilusWindowClass *klass = NAUTILUS_WINDOW_CLASS(GTK_OBJECT(window)->klass);
g_slist_free(window->meta_views);
CORBA_free(window->ni);
CORBA_free(window->si);
......@@ -616,10 +622,8 @@ static void nautilus_window_destroy (NautilusWindow *window)
if(window->statusbar_clear_id)
g_source_remove(window->statusbar_clear_id);
if(--window_count <= 0)
{
gtk_main_quit();
}
if(GTK_OBJECT_CLASS(klass->parent_class)->destroy)
GTK_OBJECT_CLASS(klass->parent_class)->destroy(GTK_OBJECT(window));
}
GtkWidget *
......
......@@ -53,8 +53,11 @@ typedef struct {
void (* request_status_change) (NautilusWindow *window,
Nautilus_StatusRequestInfo *loc,
NautilusView *requesting_view);
void (* request_progress_change) (NautilusWindow *window,
Nautilus_ProgressRequestInfo *loc,
NautilusView *requesting_view);
guint window_signals[3];
guint window_signals[4];
} NautilusWindowClass;
struct _NautilusWindow {
......@@ -97,6 +100,4 @@ void nautilus_window_allow_up (NautilusWindow *window, gboolean allow);
void nautilus_window_allow_reload (NautilusWindow *window, gboolean allow);
void nautilus_window_allow_stop (NautilusWindow *window, gboolean allow);
#endif
......@@ -35,7 +35,6 @@
static void nautilus_window_realize (GtkWidget *widget);
static int window_count = 0;
static GnomeAppClass *parent_class = NULL;
/* Stuff for handling the CORBA interface */
......@@ -322,6 +321,7 @@ nautilus_window_class_init (NautilusWindowClass *klass)
klass->request_location_change = nautilus_window_real_request_location_change;
klass->request_selection_change = nautilus_window_real_request_selection_change;
klass->request_status_change = nautilus_window_real_request_status_change;
klass->request_progress_change = nautilus_window_real_request_progress_change;
i = 0;
klass->window_signals[i++] = gtk_signal_new("request_location_change",
......@@ -342,6 +342,12 @@ nautilus_window_class_init (NautilusWindowClass *klass)
GTK_SIGNAL_OFFSET (NautilusWindowClass, request_status_change),
gtk_marshal_NONE__BOXED_OBJECT,
GTK_TYPE_NONE, 2, GTK_TYPE_BOXED, GTK_TYPE_OBJECT);
klass->window_signals[i++] = gtk_signal_new("request_progress_change",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusWindowClass, request_progress_change),
gtk_marshal_NONE__BOXED_OBJECT,
GTK_TYPE_NONE, 2, GTK_TYPE_BOXED, GTK_TYPE_OBJECT);
gtk_object_class_add_signals (object_class, klass->window_signals, i);
gtk_object_add_arg_type ("NautilusWindow::app_id",
......@@ -357,6 +363,11 @@ nautilus_window_class_init (NautilusWindowClass *klass)
widget_class->realize = nautilus_window_realize;
}
static void
nautilus_window_init (NautilusWindow *window)
{
}
static gboolean
nautilus_window_clear_status(NautilusWindow *window)
{
......@@ -597,14 +608,9 @@ nautilus_window_get_arg (GtkObject *object,
}
}
static void
nautilus_window_init (NautilusWindow *window)
{
window_count++;
}
static void nautilus_window_destroy (NautilusWindow *window)
{
NautilusWindowClass *klass = NAUTILUS_WINDOW_CLASS(GTK_OBJECT(window)->klass);
g_slist_free(window->meta_views);
CORBA_free(window->ni);
CORBA_free(window->si);
......@@ -616,10 +622,8 @@ static void nautilus_window_destroy (NautilusWindow *window)
if(window->statusbar_clear_id)
g_source_remove(window->statusbar_clear_id);
if(--window_count <= 0)
{
gtk_main_quit();
}
if(GTK_OBJECT_CLASS(klass->parent_class)->destroy)
GTK_OBJECT_CLASS(klass->parent_class)->destroy(GTK_OBJECT(window));
}
GtkWidget *
......
......@@ -53,8 +53,11 @@ typedef struct {
void (* request_status_change) (NautilusWindow *window,
Nautilus_StatusRequestInfo *loc,
NautilusView *requesting_view);
void (* request_progress_change) (NautilusWindow *window,
Nautilus_ProgressRequestInfo *loc,
NautilusView *requesting_view);
guint window_signals[3];
guint window_signals[4];
} NautilusWindowClass;
struct _NautilusWindow {
......@@ -97,6 +100,4 @@ void nautilus_window_allow_up (NautilusWindow *window, gboolean allow);
void nautilus_window_allow_reload (NautilusWindow *window, gboolean allow);
void nautilus_window_allow_stop (NautilusWindow *window, gboolean allow);
#endif
......@@ -35,7 +35,6 @@
static void nautilus_window_realize (GtkWidget *widget);
static int window_count = 0;
static GnomeAppClass *parent_class = NULL;
/* Stuff for handling the CORBA interface */
......@@ -322,6 +321,7 @@ nautilus_window_class_init (NautilusWindowClass *klass)
klass->request_location_change = nautilus_window_real_request_location_change;
klass->request_selection_change = nautilus_window_real_request_selection_change;
klass->request_status_change = nautilus_window_real_request_status_change;
klass->request_progress_change = nautilus_window_real_request_progress_change;
i = 0;
klass->window_signals[i++] = gtk_signal_new("request_location_change",
......@@ -342,6 +342,12 @@ nautilus_window_class_init (NautilusWindowClass *klass)
GTK_SIGNAL_OFFSET (NautilusWindowClass, request_status_change),
gtk_marshal_NONE__BOXED_OBJECT,
GTK_TYPE_NONE, 2, GTK_TYPE_BOXED, GTK_TYPE_OBJECT);
klass->window_signals[i++] = gtk_signal_new("request_progress_change",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (NautilusWindowClass, request_progress_change),
gtk_marshal_NONE__BOXED_OBJECT,
GTK_TYPE_NONE, 2, GTK_TYPE_BOXED, GTK_TYPE_OBJECT);
gtk_object_class_add_signals (object_class, klass->window_signals, i);
gtk_object_add_arg_type ("NautilusWindow::app_id",
......@@ -357,6 +363,11 @@ nautilus_window_class_init (NautilusWindowClass *klass)
widget_class->realize = nautilus_window_realize;
}
static void
nautilus_window_init (NautilusWindow *window)
{
}
static gboolean
nautilus_window_clear_status(NautilusWindow *window)
{
......@@ -597,14 +608,9 @@ nautilus_window_get_arg (GtkObject *object,
}
}
static void
nautilus_window_init (NautilusWindow *window)
{
window_count++;
}
static void nautilus_window_destroy (NautilusWindow *window)
{
NautilusWindowClass *klass = NAUTILUS_WINDOW_CLASS(GTK_OBJECT(window)->klass);
g_slist_free(window->meta_views);
CORBA_free(window->ni);
CORBA_free(window->si);
......@@ -616,10 +622,8 @@ static void nautilus_window_destroy (NautilusWindow *window)
if(window->statusbar_clear_id)
g_source_remove(window->statusbar_clear_id);
if(--window_count <= 0)
{
gtk_main_quit();
}
if(GTK_OBJECT_CLASS(klass->parent_class)->destroy)
GTK_OBJECT_CLASS(klass->parent_class)->destroy(GTK_OBJECT(window));
}
GtkWidget *
......
......@@ -53,8 +53,11 @@ typedef struct {
void (* request_status_change) (NautilusWindow *window,
Nautilus_StatusRequestInfo *loc,
NautilusView *requesting_view);
void (* request_progress_change) (NautilusWindow *window,
Nautilus_ProgressRequestInfo *loc,
NautilusView *requesting_view);
guint window_signals[3];
guint window_signals[4];
} NautilusWindowClass;
struct _NautilusWindow {
......@@ -97,6 +100,4 @@ void nautilus_window_allow_up (NautilusWindow *window, gboolean allow);
void nautilus_window_allow_reload (NautilusWindow *window, gboolean allow);
void nautilus_window_allow_stop (NautilusWindow *window, gboolean allow);
#endif
#include <config.h>
#include "nautilus.h"
#include "ntl-view-private.h"
typedef struct {
GnomeObject *control_frame;
} BonoboControlInfo;
static void
destroy_bonobo_control_view(NautilusView *view, CORBA_Environment *ev)
{
BonoboControlInfo *bci = view->