Commit c809d3a8 authored by Mark McLoughlin's avatar Mark McLoughlin Committed by Mark McLoughlin

Move from $(top_srcdir)/panel.

2001-11-27  Mark McLoughlin  <mark@skynet.ie>

        * *.*: Move from $(top_srcdir)/panel.

2001-11-27  Mark McLoughlin  <mark@skynet.ie>

        * configure.in: generate libpanel-applet/Makefile and
          libpanel-applet/libpanelapplet-2.0.pc

        * Makefile.am (SUBDIRS): add libpanel-applet.

2001-11-27  Mark McLoughlin  <mark@skynet.ie>

        * Makefile.am: remove building of libpanel-applet-2.0.

        * GNOME_Panel_TestApplet.server.in, libpanelapplet-2.0.pc.in:
          panel-applet-private.h, panel-applet-shell.c,
          panel-applet-shell.h, panel-applet.c,
          panel-applet.h, test-bonobo-applet.c: move to
        ../libpanel-applet, preservin history.

2001-11-27  Mark McLoughlin  <mark@skynet.ie>

        * gen_util/Makefile.am: build against ../../libpanel-applet.

2001-11-27  Mark McLoughlin  <mark@skynet.ie>

        * Makefile.am: build against ../../libpanel-applet.
parent 5f69299e
2001-11-27 Mark McLoughlin <mark@skynet.ie>
* configure.in: generate libpanel-applet/Makefile and
libpanel-applet/libpanelapplet-2.0.pc
* Makefile.am (SUBDIRS): add libpanel-applet.
2001-11-27 Gediminas Paulauskas <menesis@delfi.lt>
* all files containing main(): always get translated messages in
......
2001-11-27 Mark McLoughlin <mark@skynet.ie>
* configure.in: generate libpanel-applet/Makefile and
libpanel-applet/libpanelapplet-2.0.pc
* Makefile.am (SUBDIRS): add libpanel-applet.
2001-11-27 Gediminas Paulauskas <menesis@delfi.lt>
* all files containing main(): always get translated messages in
......
......@@ -6,6 +6,7 @@ SUBDIRS = \
gnome-about \
gsm \
panel \
libpanel-applet \
smproxy \
pixmaps \
applets \
......
2001-11-27 Mark McLoughlin <mark@skynet.ie>
* gen_util/Makefile.am: build against ../../libpanel-applet.
2001-11-26 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: add desk-guide to SUBDIRS.
......
2001-11-27 Mark McLoughlin <mark@skynet.ie>
* gen_util/Makefile.am: build against ../../libpanel-applet.
2001-11-26 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: add desk-guide to SUBDIRS.
......
......@@ -3,8 +3,8 @@
INCLUDES = -I. -I$(srcdir) \
-I$(top_srcdir)/intl \
-I$(top_builddir)/intl \
-I$(srcdir)/../../panel \
-I$(top_builddir)/panel \
-I$(srcdir)/../../libpanel-applet \
-I$(top_builddir)/libpanel-applet \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(includedir) \
$(GNOME_INCLUDEDIR) \
......@@ -26,8 +26,8 @@ libgen_util_applet_2_la_SOURCES = \
# remote-helper.c \
# remote-helper.h \
libgen_util_applet_2_la_LIBADD = \
../../panel/libpanel-applet-2.la \
libgen_util_applet_2_la_LIBADD = \
../../libpanel-applet/libpanel-applet-2.la \
$(PANEL_LIBS)
appletdir = $(libdir)
......
2001-11-27 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: build against ../../libpanel-applet.
2001-11-23 Mark McLoughlin <mark@skynet.ie>
* GNOME_FishApplet_Factory.server.in: add "panel:icon" and
......
......@@ -2,8 +2,8 @@ INCLUDES = \
-I$(srcdir) \
-I$(top_srcdir)/intl \
-I$(top_builddir)/intl \
-I$(srcdir)/../../panel \
-I$(top_builddir)/panel \
-I$(srcdir)/../../libpanel-applet \
-I$(top_builddir)/libpanel-applet \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
$(GNOME_INCLUDEDIR) \
$(WARN_CFLAGS) \
......@@ -17,8 +17,8 @@ bin_PROGRAMS = fish-applet-2
fish_applet_2_SOURCES = fish.c
fish_applet_2_LDADD = \
../../panel/libpanel-applet-2.la \
fish_applet_2_LDADD = \
../../libpanel-applet/libpanel-applet-2.la \
$(PANEL_LIBS)
FISH_BITMAPS = \
......
2001-11-27 Mark McLoughlin <mark@skynet.ie>
* gen_util/Makefile.am: build against ../../libpanel-applet.
2001-11-26 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: add desk-guide to SUBDIRS.
......
......@@ -3,8 +3,8 @@
INCLUDES = -I. -I$(srcdir) \
-I$(top_srcdir)/intl \
-I$(top_builddir)/intl \
-I$(srcdir)/../../panel \
-I$(top_builddir)/panel \
-I$(srcdir)/../../libpanel-applet \
-I$(top_builddir)/libpanel-applet \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(includedir) \
$(GNOME_INCLUDEDIR) \
......@@ -26,8 +26,8 @@ libgen_util_applet_2_la_SOURCES = \
# remote-helper.c \
# remote-helper.h \
libgen_util_applet_2_la_LIBADD = \
../../panel/libpanel-applet-2.la \
libgen_util_applet_2_la_LIBADD = \
../../libpanel-applet/libpanel-applet-2.la \
$(PANEL_LIBS)
appletdir = $(libdir)
......
2001-11-27 Mark McLoughlin <mark@skynet.ie>
* gen_util/Makefile.am: build against ../../libpanel-applet.
2001-11-26 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: add desk-guide to SUBDIRS.
......
......@@ -3,8 +3,8 @@
INCLUDES = -I. -I$(srcdir) \
-I$(top_srcdir)/intl \
-I$(top_builddir)/intl \
-I$(srcdir)/../../panel \
-I$(top_builddir)/panel \
-I$(srcdir)/../../libpanel-applet \
-I$(top_builddir)/libpanel-applet \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(includedir) \
$(GNOME_INCLUDEDIR) \
......@@ -26,8 +26,8 @@ libgen_util_applet_2_la_SOURCES = \
# remote-helper.c \
# remote-helper.h \
libgen_util_applet_2_la_LIBADD = \
../../panel/libpanel-applet-2.la \
libgen_util_applet_2_la_LIBADD = \
../../libpanel-applet/libpanel-applet-2.la \
$(PANEL_LIBS)
appletdir = $(libdir)
......
2001-11-27 Mark McLoughlin <mark@skynet.ie>
* gen_util/Makefile.am: build against ../../libpanel-applet.
2001-11-26 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: add desk-guide to SUBDIRS.
......
......@@ -402,7 +402,8 @@ gsm/default.session.5
gsm/gnome-session.1
idl/Makefile
panel/Makefile
panel/libpanelapplet-2.0.pc
libpanel-applet/libpanelapplet-2.0.pc
libpanel-applet/Makefile
po/Makefile.in
smproxy/Makefile
pixmaps/Makefile
......
2001-11-27 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: remove building of libpanel-applet-2.0.
* GNOME_Panel_TestApplet.server.in, libpanelapplet-2.0.pc.in:
panel-applet-private.h, panel-applet-shell.c,
panel-applet-shell.h, panel-applet.c,
panel-applet.h, test-bonobo-applet.c: move to
../libpanel-applet, preservin history.
2001-11-27 Mark McLoughlin <mark@skynet.ie>
* launcher.c: include quick-desktop-reader.h.
......
<oaf_info>
<!--
Old Type Applet.
-->
<oaf_server iid="OAFIID:GNOME_Panel_TestApplet_Factory"
type="exe"
location="test-applet">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/GenericFactory:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Test Applet Factory"/>
<oaf_attribute name="description" type="string" value="Test Applet Factory"/>
</oaf_server>
<oaf_server iid="OAFIID:GNOME_Panel_TestApplet"
type="factory"
location="OAFIID:GNOME_Panel_TestApplet_Factory">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Applet2:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Test Applet"/>
<oaf_attribute name="description" type="string" value="A simple applet for testing the GNOME-2.0 panel"/>
</oaf_server>
<!--
New Type Applet.
-->
<oaf_server iid="OAFIID:GNOME_Panel_TestBonoboApplet_Factory"
type="exe"
location="test-bonobo-applet">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/GenericFactory:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Test Bonobo Applet Factory"/>
<oaf_attribute name="description" type="string" value="Test Bonobo Applet Factory"/>
</oaf_server>
<oaf_server iid="OAFIID:GNOME_Panel_TestBonoboApplet"
type="factory"
location="OAFIID:GNOME_Panel_TestBonoboApplet_Factory">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/PanelAppletShell:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Test Bonobo Applet"/>
<oaf_attribute name="description" type="string" value="A simple applet for testing the GNOME-2.0 panel"/>
<oaf_attribute name="panel:category" type="string" value="Temp"/>
<oaf_attribute name="panel:pixmap" type="string" value=""/>
</oaf_server>
</oaf_info>
......@@ -7,12 +7,6 @@ NULL =
EXTRA_SUBDIRS = config help
serverdir = $(libdir)/bonobo/servers
server_in_files = GNOME_Panel.server.in GNOME_Panel_TestApplet.server.in
server_DATA = $(server_in_files:.server.in=.server)
@INTLTOOL_SERVER_RULE@
INCLUDES = \
-I. \
-I$(srcdir) \
......@@ -34,63 +28,7 @@ INCLUDES = \
$(WARN_CFLAGS) \
$(NULL)
bin_PROGRAMS = \
panel-2 \
test-bonobo-applet \
$(NULL)
lib_LTLIBRARIES = \
libpanel-applet-2.la \
$(NULL)
test_bonobo_applet_SOURCES = \
test-bonobo-applet.c \
$(CORBA_SRCLIST) \
$(NULL)
test_bonobo_applet_LDADD = \
$(PANEL_LIBS) \
libpanel-applet-2.la \
$(NULL)
libpanel_applet_2_la_SOURCES = \
panel-applet.h \
panel-applet.c \
panel-applet-shell.c \
panel-applet-shell.h \
panel-applet-private.h \
panel-marshal-main.c \
panel-typebuiltins.c \
panel-typebuiltins.h \
$(CORBA_SRCLIST) \
$(NULL)
libpanel_applet_2_la_LDFLAGS = -version-info 0:0:0
libpanel_applet_2_la_LIBADD = $(PANEL_LIBS) -lm
libpanel_appletincludedir = $(includedir)/panel-2.0
libpanel_appletinclude_HEADERS = \
panel-applet.h \
GNOME_Panel.h
# test_applet_SOURCES = \
# test-applet.c \
# $(NULL)
#
# test_applet_LDADD = \
# $(PANEL_LIBS) \
# $(top_builddir)/panel/libpanel-applet-2.la \
# $(NULL)
#
# libpanel_applet_2_la_SOURCES = \
# applet-widget.c \
# applet-object.c \
# applet-init.c \
# applet-private.h \
# $(CORBA_SRCLIST) \
# $(NULL)
bin_PROGRAMS = panel-2
CORBA_SRCLIST = \
GNOME_Panel-stubs.c \
......@@ -234,7 +172,6 @@ panel_2_LDFLAGS=-export-dynamic
EXTRA_DIST = \
APPLET_WRITING \
GNOME_Panel.server.in \
GNOME_Panel_TestApplet.server.in \
panel.hints \
gnome-panel-properties.desktop \
nothing.cP \
......@@ -242,8 +179,7 @@ EXTRA_DIST = \
gnome-panel-screenshot.glade \
gnome-panel-screenshot.glade.h \
$(schema_DATA) \
panel-marshal.list \
libpanelapplet-2.0.pc.in
panel-marshal.list
gladedir = $(datadir)/gnome/panel
glade_DATA =gnome-panel-screenshot.glade
......@@ -265,7 +201,6 @@ panel_enum_headers = \
basep-widget.h \
aligned-widget.h \
sliding-widget.h \
panel-applet.h \
GNOME_Panel.h
$(srcdir)/panel-marshal.h: panel-marshal.list
......@@ -314,9 +249,6 @@ $(srcdir)/panel-typebuiltins.h: @REBUILD@ Makefile.am $(panel_enum_headers)
&& cp xgen-gth $(@F) \
&& rm -f xgen-gth
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libpanelapplet-2.0.pc
schemadir = $(sysconfdir)/gconf/schemas
schema_DATA = panelglobalconfig.schema
......
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libpanel-applet-2
Description: libpanel-applet-2
Requires: gdk-2.0 gtk+-2.0 libgnomeui-2.0 libbonobo-2.0
Version: @VERSION@
Libs: -L${libdir} -lpanel-applet-2
Cflags: -I${includedir}/gnome-2.0/panel
/*
* panel-applet-private.h:
*
* Authors:
* Mark McLoughlin <mark@skynet.ie>
*
* Copyright 2001 Sun Microsystems, Inc.
*/
#ifndef __PANEL_APPLET_PRIVATE_H__
#define __PANEL_APPLET_PRIVATE_H__
#include "panel-applet.h"
G_BEGIN_DECLS
G_END_DECLS
#endif /* __PANEL_APPLET_PRIVATE_H__ */
/*
* panel-applet-shell.c:
*
* Authors:
* Mark McLoughlin <mark@skynet.ie>
*
* Copyright 2001 Sun Microsystems, Inc.
*/
#include <config.h>
#include "panel-applet-shell.h"
#include "panel-applet.h"
#include "panel-applet-private.h"
struct _PanelAppletShellPrivate {
PanelApplet *applet;
};
static GObjectClass *parent_class = NULL;
static void
panel_applet_shell_finalize (GObject *object)
{
PanelAppletShell *shell = PANEL_APPLET_SHELL (object);
if (shell->priv) {
g_free (shell->priv);
shell->priv = NULL;
}
parent_class->finalize (object);
}
static void
panel_applet_shell_class_init (PanelAppletShellClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
klass->epv.dummy = NULL;
object_class->finalize = panel_applet_shell_finalize;
parent_class = g_type_class_peek_parent (klass);
}
static void
panel_applet_shell_init (PanelAppletShell *shell)
{
shell->priv = g_new0 (PanelAppletShellPrivate, 1);
shell->priv->applet = NULL;
}
BONOBO_TYPE_FUNC_FULL (PanelAppletShell,
GNOME_PanelAppletShell,
BONOBO_OBJECT_TYPE,
panel_applet_shell);
void
panel_applet_shell_construct (PanelAppletShell *shell,
PanelApplet *applet)
{
shell->priv->applet = applet;
}
PanelAppletShell *
panel_applet_shell_new (PanelApplet *applet)
{
PanelAppletShell *shell;
shell = g_object_new (PANEL_APPLET_SHELL_TYPE, NULL);
panel_applet_shell_construct (shell, applet);
return shell;
}
/*
* panel-applet-shell.h:
*
* Authors:
* Mark McLoughlin <mark@skynet.ie>
*
* Copyright 2001 Sun Microsystems, Inc.
*/
#ifndef __PANEL_APPLET_SHELL_H__
#define __PANEL_APPLET_SHELL_H__
#include <bonobo/bonobo-object.h>
#include "panel-applet.h"
#include "GNOME_Panel.h"
#define PANEL_APPLET_SHELL_TYPE (panel_applet_shell_get_type ())
#define PANEL_APPLET_SHELL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PANEL_APPLET_SHELL_TYPE, PanelAppletShell))
#define PANEL_APPLET_SHELL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), PANEL_APPLET_SHELL_TYPE, PanelAppletShellClass))
#define PANEL_IS_APPLET_SHELL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PANEL_APPLET_SHELL_TYPE))
#define PANEL_IS_APPLET_SHELL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PANEL_APPLET_SHELL_TYPE))
typedef struct _PanelAppletShellPrivate PanelAppletShellPrivate;
typedef struct {
BonoboObject base;
PanelAppletShellPrivate *priv;
} PanelAppletShell;
typedef struct {
BonoboObjectClass base_class;
POA_GNOME_PanelAppletShell__epv epv;
} PanelAppletShellClass;
GType panel_applet_shell_get_type (void) G_GNUC_CONST;
void panel_applet_shell_construct (PanelAppletShell *shell,
PanelApplet *applet);
PanelAppletShell *panel_applet_shell_new (PanelApplet *applet);
#endif /* PANEL_APPLET_SHELL_H */
/*
* panel-applet.c:
*
* Authors:
* Mark McLoughlin <mark@skynet.ie>
*
* Copyright 2001 Sun Microsystems, Inc.
*/
#include <unistd.h>
#include <string.h>
#include <bonobo/bonobo-ui-util.h>
#include <bonobo/bonobo-property-bag.h>
#include <libgnome/gnome-program.h>
#include <libgnomeui/gnome-ui-init.h>
#include "panel-applet.h"
#include "panel-applet-private.h"
#include "panel-applet-shell.h"
#include "panel-marshal.h"
#include "panel-typebuiltins.h"
struct _PanelAppletPrivate {
PanelAppletShell *shell;
BonoboControl *control;
PanelAppletOrient orient;
guint size;
gchar *background;
};
static GObjectClass *parent_class;
enum {
CHANGE_ORIENT,
CHANGE_SIZE,
CHANGE_BACKGROUND,
LAST_SIGNAL
};
static guint panel_applet_signals [LAST_SIGNAL];
#define PROPERTY_ORIENT "panel-applet-orient"
#define PROPERTY_SIZE "panel-applet-size"
#define PROPERTY_BACKGROUND "panel-applet-background"
enum {
PROPERTY_ORIENT_IDX,
PROPERTY_SIZE_IDX,
PROPERTY_BACKGROUND_IDX
};
/**
* panel_applet_setup_menu:
* @applet: A #PanelApplet.
* @xml: The xml character string describing the popup menu.
* @verb_list: The list of #BonoboUIVerbs for the menu.
* @user_data: The user data pointer for the menu.
*
* Sets up a popup menu for @applet described by the xml
* string, @xml. See <link linkend="applet-writing">Applet Writing
* </link> section for a description of the format of the xml.
*/
void
panel_applet_setup_menu (PanelApplet *applet,
const gchar *xml,
const BonoboUIVerb *verb_list,
gpointer user_data)
{
BonoboUIComponent *popup_component;
g_return_if_fail (applet && xml && verb_list);
popup_component = panel_applet_get_popup_component (applet);
bonobo_ui_component_set (popup_component, "/", "<popups/>", NULL);
bonobo_ui_component_set_translate (popup_component, "/popups", xml, NULL);
bonobo_ui_component_add_verb_list_with_data (popup_component, verb_list, user_data);
}
/**
* panel_applet_setup_menu_from_file:
* @applet: A #PanelApplet.
* @opt_datadir: The data directory - i.e. ${prefix}/share (optional).
* @file: The file's name.
* @opt_app_name: The application's name (optional).
* @verb_list: The list of #BonoboUIVerbs for the menu.
* @user_data: The user data pointer for the menu.
*
* Sets up a popup menu for @applet described by the xml
* file, @file. See &applet-writing for a description of
* the format of the xml.
*/
void
panel_applet_setup_menu_from_file (PanelApplet *applet,
const gchar *opt_datadir,
const gchar *file,
const gchar *opt_app_name,
const BonoboUIVerb *verb_list,
gpointer user_data)
{
BonoboUIComponent *popup_component;
gchar *app_name = NULL;
g_return_if_fail (applet && file && verb_list);
if (!opt_datadir)
opt_datadir = GNOME_DATADIR;
if (!opt_app_name)
opt_app_name = app_name = g_strdup_printf ("%d", getpid ());
popup_component = panel_applet_get_popup_component (applet);
bonobo_ui_util_set_ui (popup_component, opt_datadir, file, opt_app_name, NULL);
bonobo_ui_component_add_verb_list_with_data (popup_component, verb_list, user_data);
if (app_name)
g_free (app_name);
}
/**
* panel_applet_get_control:
* @applet: A #PanelApplet.
*
* Retrieves the #BonoboControl associated with @applet.
*
* Return value: A #BonobControl on success, %NULL on failure.
*/
BonoboControl *
panel_applet_get_control (PanelApplet *applet)
{
g_return_val_if_fail (applet && PANEL_IS_APPLET (applet), NULL);
return applet->priv->control;
}
/**
* panel_applet_get_popup_component:
* @applet: A #PanelApplet.
*
* Retrieves the #BonoboUIComponent used for popup menus associated
* with @applet.
*
* Return value: A #BonoboUIComponent on success, or %NULL on failure.
*/
BonoboUIComponent *
panel_applet_get_popup_component (PanelApplet *applet)
{
g_return_val_if_fail (applet && PANEL_IS_APPLET (applet), NULL);
return bonobo_control_get_popup_ui_component (applet->priv->control);
}
static void
panel_applet_finalize (GObject *object)
{
PanelApplet *applet = PANEL_APPLET (object);
g_free (applet->priv);
applet->priv = NULL;
parent_class->finalize (object);
}
static gboolean
panel_applet_button_press (GtkWidget *widget,
GdkEventButton *event)
{
PanelApplet *applet = PANEL_APPLET (widget);
if (event->button == 3)
bonobo_control_do_popup (applet->priv->control,
event->button,
event->time);
return FALSE;
}
static gboolean
panel_applet_parse_color (const gchar *color_str,
GdkColor *color)
{
int r, g, b;
g_assert (color_str && color);
if (color_str [0] != '#')
return FALSE;
if (sscanf (color_str + 1, "%2x%2x%2x", &r, &g, &b) != 3)
return FALSE;
color->red = r;
color->green = g;
color->blue = b;
return TRUE;
}
static void
panel_applet_get_prop (BonoboPropertyBag *sack,
BonoboArg *arg,
guint arg_id,
CORBA_Environment *ev,
gpointer user_data)
{
PanelApplet *applet = PANEL_APPLET (user_data);
switch (arg_id) {
case PROPERTY_ORIENT_IDX:
BONOBO_ARG_SET_SHORT (arg, applet->priv->orient);
break;
case PROPERTY_SIZE_IDX:
BONOBO_ARG_SET_SHORT (arg, applet->priv->size);
break;
case PROPERTY_BACKGROUND_IDX: