Commit b1d3c95f authored by Raja R Harinath's avatar Raja R Harinath

Move gnome-panel.idl and applet-{lib,widget}.* to libapplet.

* clock/Makefile.am (clock_applet_LDADD): Link in `libapplet.a'.
* cdplayer/Makefile.am (cdplayer_applet_LDADD): Likewise.

* Makefile.am (SUBDIRS): Add `libapplet'.

- Hari
parent 4e6f271d
1998-03-04 Raja R Harinath <harinath@cs.umn.edu>
Move gnome-panel.idl and applet-{lib,widget}.* to libapplet.
* clock/Makefile.am (clock_applet_LDADD): Link in `libapplet.a'.
* cdplayer/Makefile.am (cdplayer_applet_LDADD): Likewise.
* Makefile.am (SUBDIRS): Add `libapplet'.
1998-03-03 Raja R Harinath <harinath@cs.umn.edu>
* cdplayer/cdplayer.c (main): Get it to compile.
* panel.c (add_main_menu): Use /* */ comment.
Sun Mar 1 00:58:11 1998 Tom Tromey <tromey@cygnus.com>
......
1998-03-04 Raja R Harinath <harinath@cs.umn.edu>
Move gnome-panel.idl and applet-{lib,widget}.* to libapplet.
* clock/Makefile.am (clock_applet_LDADD): Link in `libapplet.a'.
* cdplayer/Makefile.am (cdplayer_applet_LDADD): Likewise.
* Makefile.am (SUBDIRS): Add `libapplet'.
1998-03-03 Raja R Harinath <harinath@cs.umn.edu>
* cdplayer/cdplayer.c (main): Get it to compile.
* panel.c (add_main_menu): Use /* */ comment.
Sun Mar 1 00:58:11 1998 Tom Tromey <tromey@cygnus.com>
......
......@@ -5,10 +5,7 @@ test:
#SUBDIRS = menu mailcheck clock launcher batmon netwatch logout \
# @PROGRAMS_PANEL_CDPLAYER@
SUBDIRS = clock @PROGRAMS_PANEL_CDPLAYER@
CXX = mico-c++
CXXCOMPILE = $(CXX) -g $(INCLUDES)
SUBDIRS = libapplet clock @PROGRAMS_PANEL_CDPLAYER@
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
......@@ -16,18 +13,6 @@ INCLUDES = \
bin_PROGRAMS = panel
CORBA_SOURCES = \
gnome-panel.cc \
gnome-panel.h
BUILT_SOURCES = $(CORBA_SOURCES)
gnome-panel.cc: gnome-panel.idl
## `idl' version 2.0.3 lamely fails to strip the path part of the file
## name when computing the name of the output file, so we prod it a
## little.
idl --name gnome-panel $(srcdir)/gnome-panel.idl
panel_SOURCES = \
drawer.c \
drawer.h \
......@@ -45,13 +30,15 @@ panel_SOURCES = \
panel_config_global.c \
panel_config_global.h \
panel-widget.c \
panel-widget.h \
$(CORBA_SOURCES)
panel-widget.h
# $(CORBA_SOURCES)
MICO_VERS = 2.0.3
MICO_LIBS = -lmicocoss$(MICO_VERS) -lmicoaux$(MICO_VERS) -lmico$(MICO_VERS)
panel_LDADD = $(GNOME_LIBDIR) $(MICO_LIBS) -lXt $(GNOMEUI_LIBS) $(INTLLIBS)
panel_LDADD = libapplet/libapplet.a \
$(GNOME_LIBDIR) $(MICO_LIBS) -lXt \
$(GNOMEUI_LIBS) $(INTLLIBS)
data_DATA = panelrc
......
#include <gtk/gtk.h>
#include <gnome.h>
#include "applet-widget.h"
static void applet_widget_class_init (AppletWidgetClass *klass);
static void applet_widget_init (AppletWidget *applet_widget);
static GdkCursor *fleur_cursor;
guint
applet_widget_get_type ()
{
static guint applet_widget_type = 0;
if (!applet_widget_type) {
GtkTypeInfo applet_widget_info = {
"AppletWidget",
sizeof (AppletWidget),
sizeof (AppletWidgetClass),
(GtkClassInitFunc) applet_widget_class_init,
(GtkObjectInitFunc) applet_widget_init,
(GtkArgSetFunc) NULL,
(GtkArgGetFunc) NULL,
};
applet_widget_type = gtk_type_unique (gtk_window_get_type (),
&applet_widget_info);
}
return applet_widget_type;
}
static void
applet_widget_class_init (AppletWidgetClass *class)
{
}
static void
applet_widget_init (AppletWidget *applet_widget)
{
applet_widget->eb = gtk_event_box_new();
gtk_widget_show(applet_widget->eb);
GTK_WINDOW(applet_widget)->type = GTK_WINDOW_POPUP;
gtk_container_add(GTK_CONTAINER(applet_widget),applet_widget->eb);
gtk_window_set_policy (GTK_WINDOW (applet_widget), 1, 1, 1);
if(!fleur_cursor)
fleur_cursor = gdk_cursor_new(GDK_FLEUR);
}
GtkWidget*
applet_widget_new (void)
{
AppletWidget *applet;
applet = gtk_type_new(applet_widget_get_type());
return GTK_WIDGET(applet);
}
void
applet_widget_add (AppletWidget *applet, GtkWidget *widget)
{
g_return_if_fail(applet != NULL);
g_return_if_fail(widget != NULL);
gtk_container_add(GTK_CONTAINER(applet->eb),widget);
}
void
applet_widget_remove (AppletWidget *applet, GtkWidget *widget)
{
g_return_if_fail(applet != NULL);
g_return_if_fail(widget != NULL);
gtk_container_remove(GTK_CONTAINER(applet->eb),widget);
}
#define APPLET_EVENT_MASK (GDK_BUTTON_PRESS_MASK | \
GDK_BUTTON_RELEASE_MASK | \
GDK_POINTER_MOTION_MASK | \
GDK_POINTER_MOTION_HINT_MASK)
void
applet_widget_move_grab_add (AppletWidget *applet)
{
gtk_grab_add(GTK_WIDGET(applet));
gdk_pointer_grab(GTK_WIDGET(applet)->window,
TRUE,
APPLET_EVENT_MASK,
NULL,
fleur_cursor,
GDK_CURRENT_TIME);
}
void
applet_widget_move_grab_remove (AppletWidget *applet)
{
gdk_pointer_ungrab(GDK_CURRENT_TIME);
gtk_grab_remove(GTK_WIDGET(applet));
}
#ifndef __APPLET_WIDGET_H__
#define __APPLET_WIDGET_H__
#include <gtk/gtk.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define APPLET_WIDGET(obj) GTK_CHECK_CAST (obj, applet_widget_get_type (), AppletWidget)
#define APPLET_WIDGET_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, applet_widget_get_type (), AppletWidgetClass)
#define IS_APPLET_WIDGET(obj) GTK_CHECK_TYPE (obj, applet_widget_get_type ())
typedef struct _AppletWidget AppletWidget;
typedef struct _AppletWidgetClass AppletWidgetClass;
struct _AppletWidget
{
GtkWindow window;
GtkWidget *eb;
};
struct _AppletWidgetClass
{
GtkWindowClass parent_class;
};
guint applet_widget_get_type (void);
GtkWidget* applet_widget_new (void);
/*add a widget to the applet*/
void applet_widget_add (AppletWidget *applet,
GtkWidget *widget);
/*remove a widget from the applet*/
void applet_widget_remove (AppletWidget *applet,
GtkWidget *widget);
void applet_widget_move_grab_add (AppletWidget *applet);
void applet_widget_move_grab_remove (AppletWidget *applet);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __APPLET_WIDGET_H__ */
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