Commit 18eba7b5 authored by Mark McLoughlin's avatar Mark McLoughlin Committed by Mark McLoughlin
Browse files

gen cflags/libs/makefiles for mailcheck and clock and not gen_util.

2003-01-27  Mark McLoughlin  <mark@skynet.ie>

        * configure.in: gen cflags/libs/makefiles for mailcheck
        and clock and not gen_util.

2003-01-27  Mark McLoughlin  <mark@skynet.ie>

        * Makefile.am: build clock and mailcheck instead
        of gen_util. Also remove any gen_util .server files
        which were previously installed.

2003-01-27  Mark McLoughlin  <mark@skynet.ie>

        * GNOME_ClockApplet_Factory.server.in.in,
          Makefile.am: copy from gen_util and tweak.

        * clock.c: don't include clock.h.
        (clock_factory): add factory code to make this
        a shlib factory.

2003-01-27  Mark McLoughlin  <mark@skynet.ie>

        * GNOME_MailcheckApplet_Factory.server.in.in,
          Makefile.am: Copy from gen_util and tweak.

        * mailcheck.c: don't include mailcheck.h.
        (mailcheck_factory): add the code to make it
        an oop factory.
parent 7a1d79fe
2003-01-27 Mark McLoughlin <mark@skynet.ie>
* configure.in: gen cflags/libs/makefiles for mailcheck
and clock and not gen_util.
2003-01-24 Christian Rose <menthos@menthos.com>
* configure.in: Added "mn" to ALL_LINGUAS.
......
2003-01-27 Mark McLoughlin <mark@skynet.ie>
* Makefile.am: build clock and mailcheck instead
of gen_util. Also remove any gen_util .server files
which were previously installed.
2003-01-26 Alex Duggan <aldug@astrolinux.com>
* wncklet/window-list.c:
......
SUBDIRS = \
gen_util \
clock \
mailcheck \
fish \
notification_area \
wncklet
# Remove any old gen_util .server files lying around.
gen_util_server = $(libdir)/bonobo/servers/GNOME_GenUtilApplet_Factory.server
install-data-local:
if test -f $(DESTDIR)$(gen_util_server); then \
rm -f $(DESTDIR)$(gen_util_server); \
fi
......@@ -4,9 +4,6 @@ Makefile
.libs
*.lo
*.la
GNOME_GenUtilApplet_Factory.server
GNOME_GenUtilApplet_Factory.server.in
mailcheck.soundlist
mailcheck.schemas
GNOME_ClockApplet_Factory.server
GNOME_ClockApplet_Factory.server.in
clock.schemas
*.gladep
2003-01-27 Mark McLoughlin <mark@skynet.ie>
* GNOME_ClockApplet_Factory.server.in.in,
Makefile.am: copy from gen_util and tweak.
* clock.c: don't include clock.h.
(clock_factory): add factory code to make this
a shlib factory.
2003-01-23 Satyajit Kanungo <satyajit.kanungo@wipro.com>
* mailcheck.c : Replaced g_spawn_command_line_async with
......
<oaf_info>
<oaf_server iid="OAFIID:GNOME_GenUtilApplet_Factory"
<oaf_server iid="OAFIID:GNOME_ClockApplet_Factory"
type="shlib"
location="@APPLET_LIBDIR@/libgen_util_applet-2.so">
location="@APPLET_LIBDIR@/libclock-applet-2.so">
<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="GenUtil Applet Factory"/>
<oaf_attribute name="description" type="string" _value="factory for creating some general applets"/>
<oaf_attribute name="name" type="string" _value="Clock Applet Factory"/>
<oaf_attribute name="description" type="string" _value="Factory for creating clock applets."/>
</oaf_server>
<oaf_server iid="OAFIID:GNOME_ClockApplet"
type="factory"
location="OAFIID:GNOME_GenUtilApplet_Factory">
location="OAFIID:GNOME_ClockApplet_Factory">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
......@@ -28,20 +28,4 @@
<oaf_attribute name="panel:category" type="string" _value="Accessories"/>
</oaf_server>
<oaf_server iid="OAFIID:GNOME_MailcheckApplet"
type="factory"
location="OAFIID:GNOME_GenUtilApplet_Factory">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Vertigo/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="Inbox Monitor"/>
<oaf_attribute name="description" type="string" _value="Alert you when new mail arrives"/>
<oaf_attribute name="panel:icon" type="string" value="gnome-mailcheck.png"/>
<oaf_attribute name="panel:category" type="string" _value="Internet"/>
</oaf_server>
</oaf_info>
......@@ -4,12 +4,11 @@ INCLUDES = \
$(DISABLE_DEPRECATED_CFLAGS) \
$(GNOME_INCLUDEDIR) \
$(WARN_CFLAGS) \
$(GEN_UTIL_CFLAGS) \
$(CLOCK_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DPREFIX=\""$(prefix)"\" \
-DGNOME_ICONDIR=\""$(datadir)/pixmaps\"" \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
DISABLE_DEPRECATED_CFLAGS = \
......@@ -27,55 +26,33 @@ EGGFILES = \
egg-screen-url.h \
egg-screen-url.c
libgen_util_applet_2_la_SOURCES = \
main.c \
libclock_applet_2_la_SOURCES = \
clock.c \
clock.h \
mailcheck.c \
mailcheck.h \
popcheck.c \
popcheck.h \
remote-helper.c \
remote-helper.h \
$(EGGFILES)
libgen_util_applet_2_la_LDFLAGS = -module -avoid-version
libgen_util_applet_2_la_LIBADD = \
libclock_applet_2_la_LDFLAGS = -module -avoid-version
libclock_applet_2_la_LIBADD = \
../../libpanel-applet/libpanel-applet-2.la \
$(GEN_UTIL_LIBS)
$(CLOCK_LIBS)
appletdir = $(libdir)
applet_LTLIBRARIES = libgen_util_applet-2.la
applet_LTLIBRARIES = libclock-applet-2.la
GNOME_GenUtilApplet_Factory.server.in: GNOME_GenUtilApplet_Factory.server.in.in
GNOME_ClockApplet_Factory.server.in: GNOME_ClockApplet_Factory.server.in.in
sed -e "s|\@APPLET_LIBDIR\@|$(appletdir)|" $< > $@
MAILCHECK_BITMAPS = email.png email-e.png tux-anim.png email-eclouds.png \
email-tiny.png eclouds.png
mailcheckbitmapsdir = $(datadir)/pixmaps/mailcheck
mailcheckbitmaps_DATA = $(MAILCHECK_BITMAPS)
soundlistdir = $(sysconfdir)/sound/events
soundlist_in_files = mailcheck.soundlist.in
soundlist_DATA = $(soundlist_in_files:.soundlist.in=.soundlist)
@INTLTOOL_SOUNDLIST_RULE@
uidir = $(datadir)/gnome-2.0/ui
ui_DATA = \
GNOME_ClockApplet.xml \
GNOME_MailCheckApplet.xml
uidir = $(datadir)/gnome-2.0/ui
ui_DATA = GNOME_ClockApplet.xml
serverdir = $(libdir)/bonobo/servers
server_in_files = GNOME_GenUtilApplet_Factory.server.in
server_in_files = GNOME_ClockApplet_Factory.server.in
server_DATA = $(server_in_files:.server.in=.server)
@INTLTOOL_SERVER_RULE@
schemasdir = $(sysconfdir)/gconf/schemas
schemas_in_files = mailcheck.schemas.in \
clock.schemas.in
schemas_in_files = clock.schemas.in
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
@INTLTOOL_SCHEMAS_RULE@
......@@ -84,13 +61,12 @@ schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
install-data-local:
if test -z "$(DESTDIR)" ; then \
for p in $(schemas_DATA) ; do \
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/applets/gen_util/$$p ; \
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/applets/clock/$$p ; \
done \
fi
EXTRA_DIST = GNOME_GenUtilApplet_Factory.server.in.in \
$(MAILCHECK_BITMAPS) \
$(soundlist_in_files) \
EXTRA_DIST = \
GNOME_ClockApplet_Factory.server.in.in \
$(schemas_in_files) \
$(ui_DATA)
......
......@@ -25,8 +25,6 @@
#include <libgnome/libgnome.h>
#include <gconf/gconf-client.h>
#include "clock.h"
#include "egg-screen-help.h"
#define INTERNETSECOND (864)
......@@ -724,8 +722,8 @@ setup_gconf (ClockData *clock)
g_free (key);
}
gboolean
fill_clock_applet(PanelApplet *applet)
static gboolean
fill_clock_applet (PanelApplet *applet)
{
ClockData *cd;
GError *error;
......@@ -1223,3 +1221,22 @@ display_about_dialog (BonoboUIComponent *uic,
gtk_widget_show (about);
}
static gboolean
clock_factory (PanelApplet *applet,
const char *iid,
gpointer data)
{
gboolean retval = FALSE;
if (!strcmp (iid, "OAFIID:GNOME_ClockApplet"))
retval = fill_clock_applet (applet);
return retval;
}
PANEL_APPLET_BONOBO_SHLIB_FACTORY ("OAFIID:GNOME_ClockApplet_Factory",
PANEL_TYPE_APPLET,
"Clock Applet factory",
clock_factory, NULL);
/* egg-screen-exec.c
*
* Copyright (C) 2002 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*
* Authors: Mark McLoughlin <mark@skynet.ie>
*/
#include <config.h>
#include "egg-screen-exec.h"
#include <string.h>
#include <libgnome/gnome-exec.h>
#ifndef HAVE_GTK_MULTIHEAD
#include <gdk/gdkx.h>
#endif
extern char **environ;
/**
* egg_screen_exec_display_string:
* @screen: A #GdkScreen
*
* Description: Returns a string that when passed to XOpenDisplay()
* would cause @screen to be the default screen on the newly opened
* X display. This string is suitable for setting $DISPLAY when
* launching an application which should appear on @screen.
*
* Returns: a newly allocated string or %NULL on error.
**/
char *
egg_screen_exec_display_string (GdkScreen *screen)
{
#ifdef HAVE_GTK_MULTIHEAD
GString *str;
const char *old_display;
char *retval;
char *p;
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
if (gdk_screen_get_default () == screen)
return g_strdup_printf ("DISPLAY=%s",
gdk_display_get_name (
gdk_screen_get_display (screen)));
old_display = gdk_display_get_name (gdk_screen_get_display (screen));
str = g_string_new ("DISPLAY=");
g_string_append (str, old_display);
p = strrchr (str->str, '.');
if (p && p > strchr (str->str, ':'))
g_string_truncate (str, p - str->str);
g_string_append_printf (str, ".%d", gdk_screen_get_number (screen));
retval = str->str;
g_string_free (str, FALSE);
return retval;
#else
return g_strdup (DisplayString (GDK_DISPLAY ()));
#endif
}
/**
* egg_screen_exec_environment:
* @screen: A #GdkScreen
*
* Description: Modifies the current program environment to
* ensure that $DISPLAY is set such that a launched application
* inheriting this environment would appear on @screen.
*
* Returns: a newly-allocated %NULL-terminated array of strings or
* %NULL on error. Use g_strfreev() to free it.
**/
char **
egg_screen_exec_environment (GdkScreen *screen)
{
char **retval = NULL;
int i, env_len;
#ifdef HAVE_GTK_MULTIHEAD
int display_index = -1;
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
for (env_len = 0; environ [env_len]; env_len++)
if (!strncmp (environ [env_len], "DISPLAY", 7))
display_index = env_len;
if (display_index == -1)
display_index = env_len++;
#else
for (env_len = 0; environ [env_len]; env_len++);
#endif
retval = g_new (char *, env_len + 1);
retval [env_len] = NULL;
for (i = 0; i < env_len; i++)
#ifdef HAVE_GTK_MULTIHEAD
if (i == display_index)
retval [i] = egg_screen_exec_display_string (screen);
else
#endif
retval [i] = g_strdup (environ [i]);
g_assert (i == env_len);
return retval;
}
/**
* egg_screen_execute_async:
* @screen: A #GdkScreen
* @dir: Directory in which child should be executed, or %NULL for current
* directory
* @argc: Number of arguments
* @argv: Argument vector to exec child
*
* Description: Like gnome_execute_async(), but ensures that the child
* is launched in an environment such that if it calls XOpenDisplay()
* the resulting display would have @screen as the default screen.
*
* Returns: process id of child, or %-1 on error.
**/
int
egg_screen_execute_async (GdkScreen *screen,
const char *dir,
int argc,
char * const argv [])
{
#ifdef HAVE_GTK_MULTIHEAD
char **envp = NULL;
int envc = 0;
int retval;
g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
if (gdk_screen_get_default () != screen) {
envc = 1;
envp = g_new0 (char *, 2);
envp [0] = egg_screen_exec_display_string (screen);
}
retval = gnome_execute_async_with_env (dir, argc, argv, envc, envp);
g_strfreev (envp);
return retval;
#else
return gnome_execute_async (dir, argc, argv);
#endif
}
/**
* egg_screen_execute_shell:
* @screen: A #GdkScreen.
* @dir: Directory in which child should be executed, or %NULL for current
* directory
* @commandline: Shell command to execute
*
* Description: Like gnome_execute_shell(), but ensures that the child
* is launched in an environment such that if it calls XOpenDisplay()
* the resulting display would have @screen as the default screen.
*
* Returns: process id of shell, or %-1 on error.
**/
int
egg_screen_execute_shell (GdkScreen *screen,
const char *dir,
const char *command)
{
#ifdef HAVE_GTK_MULTIHEAD
int retval = -1;
g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
if (gdk_screen_get_default () == screen)
retval = gnome_execute_shell (dir, command);
else {
char *exec;
char *display;
display = egg_screen_exec_display_string (screen);
exec = g_strconcat (display, " ", command, NULL);
retval = gnome_execute_shell (dir, exec);
g_free (display);
g_free (exec);
}
return retval;
#else
return gnome_execute_shell (dir, command);
#endif
}
/**
* egg_screen_execute_command_line_async:
* @screen: A #GdkScreen.
* @command_line: a command line
* @error: return location for errors
*
* Description: Like g_spawn_command_line_async(), but ensures that
* the child is launched in an environment such that if it calls
* XOpenDisplay() the resulting display would have @screen as the
* default screen.
*
* Returns: %TRUE on success, %FALSE if error is set.
**/
gboolean
egg_screen_execute_command_line_async (GdkScreen *screen,
const char *command,
GError **error)
{
#ifdef HAVE_GTK_MULTIHEAD
gboolean retval;
char **argv = NULL;
char **envp = NULL;
g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
g_return_val_if_fail (command != NULL, FALSE);
if (!g_shell_parse_argv (command, NULL, &argv, error))
return FALSE;
if (gdk_screen_get_default () != screen)
envp = egg_screen_exec_environment (screen);
retval = g_spawn_async (g_get_home_dir (),
argv, envp, G_SPAWN_SEARCH_PATH,
NULL, NULL, NULL, error);
g_strfreev (argv);
g_strfreev (envp);
return retval;
#else
return g_spawn_command_line_async (command, error);
#endif
}
/* egg-screen-exec.h
*
* Copyright (C) 2002 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library 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.
*
* Authors: Mark McLoughlin <mark@skynet.ie>
*/
#ifndef __EGG_SCREEN_EXEC_H__
#define __EGG_SCREEN_EXEC_H__
#include <gdk/gdk.h>
G_BEGIN_DECLS
char *egg_screen_exec_display_string (GdkScreen *screen);
char **egg_screen_exec_environment (GdkScreen *screen);
int egg_screen_execute_async (GdkScreen *screen,
const char *dir,
int argc,
char * const argv []);
int egg_screen_execute_shell (GdkScreen *screen,
const char *dir,
const char *command);
gboolean egg_screen_execute_command_line_async (GdkScreen *screen,
const char *command,
GError **error);
G_END_DECLS
#endif /* __EGG_SCREEN_EXEC_H__ */
/* egg-screen-help.c
* Copyright (C) 2001 Sid Vicious
* Copyright (C) 2001 Jonathan Blandford <jrb@alum.mit.edu>
* Copyright (C) 2002 Sun Microsystems Inc.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, MA 02139, USA.
*
* Authors: Mark McLoughlin <mark@skynet.ie>
*/
#include <config.h>
#include "egg-screen-help.h"
#include <libgnome/gnome-help.h>
#include "egg-screen-exec.h"
/**
* egg_help_display_on_screen:
* @file_name: The name of the help document to display.
* @link_id: Can be %NULL. If set, refers to an anchor or section id within the
* requested document.
* @screen: a #GdkScreen.
* @error: A #GError instance that will hold the specifics of any error which
* occurs during processing, or %NULL
*
* Description: Like gnome_help_display(), but ensures that the help viewer
* application appears on @screen.
*
* Returns: %TRUE on success, %FALSE otherwise (in which case @error will
* contain the actual error).
**/
gboolean
egg_help_display_on_screen (const char *file_name,
const char *link_id,
GdkScreen *screen,
GError **error)
{
return egg_help_display_with_doc_id_on_screen (
NULL, NULL, file_name, link_id, screen, error);
}
/**
* egg_help_display_with_doc_id_on_screen:
* @program: The current application object, or %NULL for the default one.
* @doc_id: The document identifier, or %NULL to default to the application ID
* (app_id) of the specified @program.
* @file_name: The name of the help document to display.
* @link_id: Can be %NULL. If set, refers to an anchor or section id within the
* requested document.
* @screen: a #GdkScreen.
* @error: A #GError instance that will hold the specifics of any error which
* occurs during processing, or %NULL
*