Commit 932f2dc1 authored by Mark McLoughlin's avatar Mark McLoughlin Committed by Mark McLoughlin

kill old goad factory stuff.

2001-10-31  Mark McLoughlin  <mark@skynet.ie>

        * applet-widget.c: kill old goad factory stuff.

        * applet.c, applet.h, extern.c, panel-widget.c:
        move various definitions of APPLET_EVENT_MASK to
        applet.h.
parent fefb0462
2001-10-31 Mark McLoughlin <mark@skynet.ie>
* applet-widget.c: kill old goad factory stuff.
* applet.c, applet.h, extern.c, panel-widget.c:
move various definitions of APPLET_EVENT_MASK to
applet.h.
2001-10-26 Mark McLoughlin <mark@skynet.ie>
* GNOME_Panel_TestApplet.server.in: s/TestApplet/Panel_TestApplet/g
......
......@@ -985,121 +985,3 @@ applet_widget_thaw_changes (AppletWidget *widget)
widget->priv->frozen_position_y);
}
}
#ifdef FIXME
typedef struct {
POA_GNOME_GenericFactory servant;
AppletFactoryActivator afunc;
AppletFactoryQuerier qfunc;
CORBA_Object fobj;
PortableServer_ObjectId *objid;
} AppletFactory;
static CORBA_boolean
server_applet_factory_supports (PortableServer_Servant servant,
const CORBA_char *iid,
CORBA_Environment *ev)
{
AppletFactory *factory_servant = (AppletFactory *)servant;
if (factory_servant->qfunc)
return factory_servant->qfunc (iid);
g_message ("No AppletFactoryQuerier to check on %s in panel applet", iid);
return CORBA_FALSE;
}
static CORBA_Object
server_applet_factory_create_object (PortableServer_Servant servant,
const CORBA_char *iid,
const GNOME_stringlist *params,
CORBA_Environment *ev)
{
AppletFactory *factory_servant = (AppletFactory *)_servant;
GtkWidget *applet;
applet = servant->afunc (iid, params->_buffer, params->_length);
if (!applet) {
g_warning (_("Activator failed to create an object."));
return CORBA_OBJECT_NIL;
}
if (!IS_APPLET_WIDGET (applet)) {
g_warning (_("Activator failed to create an AppletWidget."));
gtk_widget_destroy (applet);
return CORBA_OBJECT_NIL;
}
return CORBA_Object_duplicate (CD(applet)->obj, ev);
}
static POA_GNOME_GenericFactory__epv applet_factory_epv = {
NULL,
server_applet_factory_supports,
server_applet_factory_create_object
};
static POA_GNOME_GenericFactory__vepv applet_factory_vepv = {
&base_epv,
&applet_factory_epv
};
/**
* applet_factory_new:
* @iid: the implementation id of the factory to be registered.
* @qfunc: #AppletFactoryQuerier to determine whether an applet with
* a specified GOAD ID can be created.
* @afunc: #AppletFactoryActivator to activate a specified GOAD ID.
*
* Description: create a new applet factory. It is used for applets
* that can run many applets from one process.
**/
void
applet_factory_new (const char *iid,
AppletFactoryQuerier qfunc,
AppletFactoryActivator afunc)
{
POA_GNOME_GenericFactory *factory;
AppletFactory *applet_factory;
CORBA_Environment env;
CORBA_Object obj;
g_return_if_fail (afunc);
CORBA_exception_init (&env);
poa = bonobo_poa ();
applet_factory = g_new0 (AppletFactory, 1);
factory = (POA_GNOME_GenericFactory *)applet_factory
factory->servant.vepv = &applet_factory_vepv;
POA_GNOME_GenericFactory__init (factory, &env);
obj = PortableServer_POA_servant_to_reference (bonobo_poa (),
factory, &env);
if (BONOBO_EX (&env)) {
CORBA_exception_free (&env);
g_free (applet_factory);
return;
}
applet_factory->afunc = afunc;
applet_factory->qfunc = qfunc;
applet_factory->fobj = obj;
bonobo_activation_active_server_register (iid, obj);
CORBA_Object_release (obj, &env);
CORBA_exception_free (&env);
}
#endif /* FIXME */
......@@ -28,11 +28,6 @@
#define SMALL_ICON_SIZE 20
#define APPLET_EVENT_MASK (GDK_BUTTON_PRESS_MASK | \
GDK_BUTTON_RELEASE_MASK | \
GDK_POINTER_MOTION_MASK | \
GDK_POINTER_MOTION_HINT_MASK)
extern GSList *panels;
GSList *applets = NULL;
......
......@@ -2,6 +2,7 @@
#define APPLET_H
#include <glib.h>
#include <gdk/gdktypes.h>
#include "panel-widget.h"
G_BEGIN_DECLS
......@@ -32,6 +33,12 @@ typedef enum {
APPLET_RUN
} AppletType;
#define APPLET_EVENT_MASK (GDK_BUTTON_PRESS_MASK | \
GDK_BUTTON_RELEASE_MASK | \
GDK_POINTER_MOTION_MASK | \
GDK_POINTER_MOTION_HINT_MASK)
typedef struct _AppletUserMenu AppletUserMenu;
typedef struct _AppletInfo AppletInfo;
......
......@@ -85,11 +85,6 @@ struct Extern_struct {
AppletInfo *info;
};
#define APPLET_EVENT_MASK (GDK_BUTTON_PRESS_MASK | \
GDK_BUTTON_RELEASE_MASK | \
GDK_POINTER_MOTION_MASK | \
GDK_POINTER_MOTION_HINT_MASK)
extern GSList *panels;
extern GSList *applets;
......@@ -1056,63 +1051,73 @@ socket_unset_loading (GtkWidget *socket)
}
}
/*note that type should be APPLET_EXTERN_RESERVED or APPLET_EXTERN_PENDING
only*/
/*
* note that type should be APPLET_EXTERN_RESERVED or
* APPLET_EXTERN_PENDING only
*/
static CORBA_unsigned_long
reserve_applet_spot (Extern ext, PanelWidget *panel, int pos,
AppletType type)
reserve_applet_spot (Extern ext,
PanelWidget *panel,
int pos,
AppletType type)
{
int size;
GtkWidget *socket;
gint events;
gint size;
ext->ebox = gtk_event_box_new();
gtk_widget_set_events(ext->ebox, (gtk_widget_get_events(ext->ebox) |
APPLET_EVENT_MASK) &
~( GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK));
ext->ebox = gtk_event_box_new ();
size = panel->sz < 14 ? panel->sz : 14;
events = gtk_widget_get_events (ext->ebox) | APPLET_EVENT_MASK;
events &= ~(GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK);
gtk_widget_set_events (ext->ebox, events);
size = CLAMP (panel->sz, 0, 14);
gtk_widget_set_usize (ext->ebox, size, size);
gtk_signal_connect_after (GTK_OBJECT (ext->ebox),"size_allocate",
gtk_signal_connect_after (GTK_OBJECT (ext->ebox),
"size_allocate",
GTK_SIGNAL_FUNC (ebox_size_allocate),
ext);
socket = gtk_socket_new();
socket = gtk_socket_new ();
if(!socket) {
g_warning("Can't create a socket");
return 0;
}
gtk_container_add(GTK_CONTAINER(ext->ebox), socket);
gtk_container_add (GTK_CONTAINER (ext->ebox), socket);
gtk_widget_show_all (ext->ebox);
/*we save the obj in the id field of the appletinfo and the
path in the path field */
/*
* we save the obj in the id field of the
* appletinfo and the path in the path field.
*/
ext->info = NULL;
if(!register_toy(ext->ebox,
ext, (GDestroyNotify)extern_clean,
panel, pos, ext->exactpos, type)) {
/* the ebox is destroyed in register_toy */
if (!register_toy (ext->ebox, ext, (GDestroyNotify)extern_clean,
panel, pos, ext->exactpos, type)) {
/*
* the ebox is destroyed in register_toy
*/
ext->ebox = NULL;
g_warning(_("Couldn't add applet"));
g_warning (_("Couldn't register applet."));
return 0;
}
ext->info = applets_last->data;
gtk_signal_connect(GTK_OBJECT (socket), "destroy",
GTK_SIGNAL_FUNC (extern_socket_destroy),
extern_ref (ext));
gtk_signal_connect (GTK_OBJECT (socket),
"destroy",
GTK_SIGNAL_FUNC (extern_socket_destroy),
extern_ref (ext));
if(!GTK_WIDGET_REALIZED(socket))
gtk_widget_realize(socket);
if (!GTK_WIDGET_REALIZED (socket))
gtk_widget_realize (socket);
socket_set_loading (socket, panel);
return GDK_WINDOW_XWINDOW(socket->window);
return GDK_WINDOW_XWINDOW (socket->window);
}
/* Note exactpos may NOT be changed */
......
......@@ -16,6 +16,7 @@
#include <libart_lgpl/art_affine.h>
#include <libart_lgpl/art_filterlevel.h>
#include "applet.h"
#include "panel-widget.h"
#include "button-widget.h"
#include "panel-util.h"
......@@ -64,11 +65,6 @@ int pw_maximize_delay = 0;
gboolean pw_disable_animations = FALSE;
PanelMovementType pw_movement_type = PANEL_SWITCH_MOVE;
#define APPLET_EVENT_MASK (GDK_BUTTON_PRESS_MASK | \
GDK_BUTTON_RELEASE_MASK | \
GDK_POINTER_MOTION_MASK | \
GDK_POINTER_MOTION_HINT_MASK)
typedef void (*BackSignal) (GtkObject * object,
PanelBackType type,
char *pixmap,
......
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