Commit 4870eae8 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

implement the size hints and correct the bind events function name in the

Thu May 27 19:25:00 1999  George Lebl  <jirka@5z.com>

        * applet-widget.[ch]: implement the size hints and correct the bind
          events function name in the header, as well as reformat the file
          with the correct indenting style.

        * {panel,basep,snapped,corner,drawer}-widget.[ch],menu.c,drawer.c,
          session.c,button-widget.c,panel.c: start of implementing the
          panel sizes, currently doesn't work and so the property dialog
          is disabled.
parent 51f9dfcb
Thu May 27 19:25:00 1999 George Lebl <jirka@5z.com>
* applet-widget.[ch]: implement the size hints and correct the bind
events function name in the header, as well as reformat the file
with the correct indenting style.
* {panel,basep,snapped,corner,drawer}-widget.[ch],menu.c,drawer.c,
session.c,button-widget.c,panel.c: start of implementing the
panel sizes, currently doesn't work and so the property dialog
is disabled.
Wed May 26 23:27:11 1999 George Lebl <jirka@5z.com>
* menu.c: applied patch from Jacob Berkman <jberk+@cmu.edu>, to
......
Thu May 27 19:25:00 1999 George Lebl <jirka@5z.com>
* applet-widget.[ch]: implement the size hints and correct the bind
events function name in the header, as well as reformat the file
with the correct indenting style.
* {panel,basep,snapped,corner,drawer}-widget.[ch],menu.c,drawer.c,
session.c,button-widget.c,panel.c: start of implementing the
panel sizes, currently doesn't work and so the property dialog
is disabled.
Wed May 26 23:27:11 1999 George Lebl <jirka@5z.com>
* menu.c: applied patch from Jacob Berkman <jberk+@cmu.edu>, to
......
This diff is collapsed.
......@@ -15,6 +15,7 @@
#define HAVE_SAVE_SESSION_SIGNAL 1
#define HAVE_APPLET_BIND_EVENTS 1
#define HAVE_PANEL_SIZE 1
BEGIN_GNOME_DECLS
......@@ -59,6 +60,9 @@ struct _AppletWidgetClass
that you can update your orientation properly */
void (* change_orient) (AppletWidget *applet,
GNOME_Panel_OrientType orient);
/* when the panel size changes, semantics are the same as above */
void (* change_size) (AppletWidget *applet,
GNOME_Panel_SizeType size);
/* the panel background changes, the pixmap handeling is likely
to change */
void (* back_change) (AppletWidget *applet,
......@@ -116,7 +120,7 @@ void applet_widget_add_full (AppletWidget *applet,
/* bind the events for button2 and button3 on a widget, this is useful
when you are added a new widget and want the right click menu and middle
button move events to work on it*/
void applet_bind_events (AppletWidget *applet,
void applet_widget_bind_events (AppletWidget *applet,
GtkWidget *widget);
/* remove the plug from the panel, this will destroy the applet */
......
......@@ -514,6 +514,7 @@ register_toy(GtkWidget *applet,
applet_drag_types, 1);*/
orientation_change(info,panel);
size_change(info,panel);
back_change(info,panel);
return TRUE;
......
......@@ -548,6 +548,7 @@ basep_widget_construct (BasePWidget *basep,
int packed,
int reverse_arrows,
PanelOrientation orient,
PanelSizeType sz,
int hidebuttons_enabled,
int hidebutton_pixmaps_enabled,
PanelBackType back_type,
......@@ -557,6 +558,7 @@ basep_widget_construct (BasePWidget *basep,
{
basep->panel = panel_widget_new(packed,
orient,
sz,
back_type,
back_pixmap,
fit_pixmap_bg,
......@@ -624,6 +626,7 @@ basep_widget_construct (BasePWidget *basep,
void
basep_widget_change_params(BasePWidget *basep,
PanelOrientation orient,
PanelSizeType sz,
int hidebuttons_enabled,
int hidebutton_pixmaps_enabled,
PanelBackType back_type,
......@@ -639,6 +642,7 @@ basep_widget_change_params(BasePWidget *basep,
panel_widget_change_params(PANEL_WIDGET(basep->panel),
orient,
sz,
back_type,
pixmap_name,
fit_pixmap_bg,
......
......@@ -53,6 +53,7 @@ GtkWidget* basep_widget_construct (BasePWidget *basep,
int packed,
int reverse_arrows,
PanelOrientation orient,
PanelSizeType sz,
int hidebuttons_enabled,
int hidebutton_pixmaps_enabled,
PanelBackType back_type,
......@@ -63,6 +64,7 @@ GtkWidget* basep_widget_construct (BasePWidget *basep,
/* changing parameters */
void basep_widget_change_params (BasePWidget *basep,
PanelOrientation orient,
PanelSizeType sz,
int hidebuttons_enabled,
int hidebutton_pixmaps_enabled,
PanelBackType back_type,
......
......@@ -442,7 +442,9 @@ button_widget_draw(ButtonWidget *button, GdkPixmap *pixmap, int offx, int offy)
static void
button_widget_size_request(GtkWidget *widget, GtkRequisition *requisition)
{
requisition->width = requisition->height = BIG_ICON_SIZE;
PanelWidget *panel = PANEL_WIDGET(widget->parent);
requisition->width = requisition->height =
panel_widget_get_pixel_size(panel);
}
static void
button_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
......@@ -653,7 +655,7 @@ button_widget_new(GdkPixmap *pixmap,
}
static void
loadup_file(GdkPixmap **pixmap, GdkBitmap **mask, char *file)
loadup_file(GdkPixmap **pixmap, GdkBitmap **mask, char *file, int size)
{
GdkImlibImage *im = NULL;
int w,h;
......@@ -682,14 +684,14 @@ loadup_file(GdkPixmap **pixmap, GdkBitmap **mask, char *file)
w = im->rgb_width;
h = im->rgb_height;
if(w>h) {
if(w>BIG_ICON_SIZE) {
h = h*((double)BIG_ICON_SIZE/w);
w = BIG_ICON_SIZE;
if(w>size) {
h = h*((double)size/w);
w = size;
}
} else {
if(h>BIG_ICON_SIZE) {
w = w*((double)BIG_ICON_SIZE/h);
h = BIG_ICON_SIZE;
if(h>size) {
w = w*((double)size/h);
h = size;
}
}
w = w>0?w:1;
......@@ -712,7 +714,7 @@ button_widget_new_from_file(char *pixmap,
GdkPixmap *_pixmap;
GdkBitmap *mask;
loadup_file(&_pixmap,&mask,pixmap);
loadup_file(&_pixmap,&mask,pixmap,BIG_ICON_SIZE);
return button_widget_new(_pixmap,mask,tile,arrow,orient,text);
}
......@@ -740,7 +742,7 @@ button_widget_set_pixmap_from_file(ButtonWidget *button, char *pixmap)
GdkPixmap *_pixmap;
GdkBitmap *mask;
loadup_file(&_pixmap,&mask,pixmap);
loadup_file(&_pixmap,&mask,pixmap,BIG_ICON_SIZE);
button_widget_set_pixmap(button,_pixmap,mask);
if(!_pixmap)
......@@ -793,8 +795,8 @@ button_widget_load_tile(int tile, char *tile_up, char *tile_down,
gdk_bitmap_unref(tiles_down_mask[tile]);
tiles_down_mask[tile] = NULL;
loadup_file(&tiles_up[tile],&tiles_up_mask[tile],tile_up);
loadup_file(&tiles_down[tile],&tiles_down_mask[tile],tile_down);
loadup_file(&tiles_up[tile],&tiles_up_mask[tile],tile_up,BIG_ICON_SIZE);
loadup_file(&tiles_down[tile],&tiles_down_mask[tile],tile_down,BIG_ICON_SIZE);
tile_border[tile] = border;
tile_depth[tile] = depth;
......
......@@ -879,6 +879,7 @@ corner_widget_new (CornerPos pos,
PanelOrientation orient,
CornerMode mode,
CornerState state,
PanelSizeType sz,
int hidebuttons_enabled,
int hidebutton_pixmaps_enabled,
PanelBackType back_type,
......@@ -897,6 +898,7 @@ corner_widget_new (CornerPos pos,
TRUE,
FALSE,
orient,
sz,
hidebuttons_enabled,
hidebutton_pixmaps_enabled,
back_type,
......@@ -951,6 +953,7 @@ corner_widget_change_params(CornerWidget *corner,
PanelOrientation orient,
CornerMode mode,
CornerState state,
PanelSizeType sz,
int hidebuttons_enabled,
int hidebutton_pixmaps_enabled,
PanelBackType back_type,
......@@ -972,6 +975,7 @@ corner_widget_change_params(CornerWidget *corner,
basep_widget_change_params(BASEP_WIDGET(corner),
orient,
sz,
hidebuttons_enabled,
hidebutton_pixmaps_enabled,
back_type,
......@@ -1040,6 +1044,7 @@ corner_widget_change_pos_orient(CornerWidget *corner,
orient,
corner->mode,
corner->state,
panel->sz,
basep->hidebuttons_enabled,
basep->hidebutton_pixmaps_enabled,
panel->back_type,
......
......@@ -67,6 +67,7 @@ GtkWidget* corner_widget_new (CornerPos pos,
PanelOrientation orient,
CornerMode mode,
CornerState state,
PanelSizeType sz,
int hidebuttons_enabled,
int hidebutton_pixmaps_enabled,
PanelBackType back_type,
......@@ -80,6 +81,7 @@ void corner_widget_change_params (CornerWidget *corner,
CornerPos pos,
CornerMode mode,
CornerState state,
PanelSizeType sz,
int hidebuttons_enabled,
int hidebutton_pixmaps_enabled,
PanelBackType back_type,
......
......@@ -498,6 +498,7 @@ drawer_widget_init (DrawerWidget *drawer)
GtkWidget*
drawer_widget_new (PanelOrientType orient,
DrawerState state,
PanelSizeType sz,
PanelBackType back_type,
char *back_pixmap,
int fit_pixmap_bg,
......@@ -527,6 +528,7 @@ drawer_widget_new (PanelOrientType orient,
TRUE,
TRUE,
porient,
sz,
hidebutton_enabled,
hidebutton_pixmap_enabled,
back_type,
......@@ -563,6 +565,7 @@ void
drawer_widget_change_params(DrawerWidget *drawer,
PanelOrientType orient,
DrawerState state,
PanelSizeType sz,
PanelBackType back_type,
char *pixmap,
int fit_pixmap_bg,
......@@ -600,6 +603,7 @@ drawer_widget_change_params(DrawerWidget *drawer,
basep_widget_change_params(BASEP_WIDGET(drawer),
porient,
sz,
hidebutton_enabled,
hidebutton_pixmap_enabled,
back_type,
......@@ -622,6 +626,7 @@ drawer_widget_change_orient(DrawerWidget *drawer,
drawer_widget_change_params(drawer,
orient,
drawer->state,
panel->sz,
panel->back_type,
panel->back_pixmap,
panel->fit_pixmap_bg,
......
......@@ -46,6 +46,7 @@ struct _DrawerWidgetClass
guint drawer_widget_get_type (void);
GtkWidget* drawer_widget_new (PanelOrientType orient,
DrawerState state,
PanelSizeType sz,
PanelBackType back_type,
char *back_pixmap,
int fit_pixmap_bg,
......@@ -61,6 +62,7 @@ void drawer_widget_close_drawer (DrawerWidget *panel);
void drawer_widget_change_params (DrawerWidget *drawer,
PanelOrientType orient,
DrawerState state,
PanelSizeType sz,
PanelBackType back_type,
char *pixmap_name,
int fit_pixmap_bg,
......
......@@ -265,6 +265,7 @@ create_empty_drawer_applet(char *tooltip, char *pixmap,
{
GtkWidget *dw = drawer_widget_new(orient,
DRAWER_SHOWN,
SIZE_STANDARD,
PANEL_BACK_NONE, NULL,
TRUE, NULL, TRUE, TRUE);
return create_drawer_applet(dw, tooltip,pixmap,orient);
......
......@@ -581,6 +581,7 @@ s_panelspot_register_us(POA_GNOME_PanelSpot *servant,
ext->info->type = APPLET_EXTERN;
orientation_change(ext->info,panel);
size_change(ext->info,panel);
back_change(ext->info,panel);
GNOME_Applet_set_tooltips_state(ext->applet,
......
......@@ -2141,6 +2141,7 @@ create_new_panel(GtkWidget *w,gpointer data)
panel = snapped_widget_new(find_empty_spos(),
SNAPPED_EXPLICIT_HIDE,
SNAPPED_SHOWN,
SIZE_STANDARD,
TRUE,
TRUE,
PANEL_BACK_NONE,
......@@ -2156,6 +2157,7 @@ create_new_panel(GtkWidget *w,gpointer data)
cori,
CORNER_EXPLICIT_HIDE,
CORNER_SHOWN,
SIZE_STANDARD,
TRUE,
TRUE,
PANEL_BACK_NONE,
......@@ -2427,6 +2429,7 @@ convert_to_panel(GtkWidget *w, gpointer data)
SNAPPED_EXPLICIT_HIDE:
SNAPPED_AUTO_HIDE,
SNAPPED_SHOWN,
current_panel->sz,
BASEP_WIDGET(cw)->hidebuttons_enabled,
BASEP_WIDGET(cw)->hidebutton_pixmaps_enabled,
current_panel->back_type,
......@@ -2451,6 +2454,7 @@ convert_to_panel(GtkWidget *w, gpointer data)
CORNER_EXPLICIT_HIDE:
CORNER_AUTO_HIDE,
CORNER_SHOWN,
current_panel->sz,
BASEP_WIDGET(sw)->hidebuttons_enabled,
BASEP_WIDGET(sw)->hidebutton_pixmaps_enabled,
current_panel->back_type,
......
......@@ -74,6 +74,34 @@ update_config_orient(GtkWidget *panel)
}
}
void
update_config_size(GtkWidget *panel)
{
PerPanelConfig *ppc = get_config_struct(panel);
PanelWidget *p;
if(!ppc)
return;
p = PANEL_WIDGET(BASEP_WIDGET(panel)->panel);
switch(p->sz) {
case SIZE_TINY:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->s_tiny),
TRUE);
break;
case SIZE_STANDARD:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->s_std),
TRUE);
break;
case SIZE_LARGE:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->s_large),
TRUE);
break;
case SIZE_HUGE:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->s_huge),
TRUE);
break;
}
}
void
update_config_back(PanelWidget *pw)
{
......@@ -131,6 +159,7 @@ config_apply (GtkWidget *widget, int page, gpointer data)
ppc->snapped_pos,
ppc->snapped_mode,
SNAPPED_WIDGET(ppc->panel)->state,
ppc->sz,
ppc->hidebuttons,
ppc->hidebutton_pixmaps,
ppc->back_type,
......@@ -143,6 +172,7 @@ config_apply (GtkWidget *widget, int page, gpointer data)
ppc->corner_orient,
ppc->corner_mode,
CORNER_WIDGET(ppc->panel)->state,
ppc->sz,
ppc->hidebuttons,
ppc->hidebutton_pixmaps,
ppc->back_type,
......@@ -154,6 +184,7 @@ config_apply (GtkWidget *widget, int page, gpointer data)
drawer_widget_change_params(dw,
dw->orient,
dw->state,
ppc->sz,
ppc->back_type,
ppc->back_pixmap,
ppc->fit_pixmap_bg,
......@@ -336,15 +367,15 @@ snapped_notebook_page(PerPanelConfig *ppc)
switch(ppc->snapped_pos) {
case SNAPPED_TOP:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->t_button),
TRUE);
TRUE);
break;
case SNAPPED_BOTTOM:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->b_button),
TRUE);
TRUE);
break;
case SNAPPED_LEFT:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->l_button),
TRUE);
TRUE);
break;
case SNAPPED_RIGHT:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->r_button),
......@@ -399,7 +430,116 @@ snapped_notebook_page(PerPanelConfig *ppc)
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
return (vbox);
return vbox;
}
static void
size_set_size (GtkWidget *widget, gpointer data)
{
PanelSizeType sz = (PanelSizeType) data;
PerPanelConfig *ppc = gtk_object_get_user_data(GTK_OBJECT(widget));
if(!(GTK_TOGGLE_BUTTON(widget)->active))
return;
ppc->sz = sz;
if (ppc->register_changes)
gnome_property_box_changed (GNOME_PROPERTY_BOX (ppc->config_window));
}
static GtkWidget *
size_notebook_page(PerPanelConfig *ppc)
{
GtkWidget *frame;
GtkWidget *button;
GtkWidget *box;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *w;
/* main vbox */
vbox = gtk_vbox_new (FALSE, 0);
/* main hbox */
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
gtk_container_set_border_width(GTK_CONTAINER (hbox), GNOME_PAD_SMALL);
/* Position frame */
frame = gtk_frame_new (_("Panel size"));
gtk_container_set_border_width(GTK_CONTAINER (frame), GNOME_PAD_SMALL);
gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE,0);
/* box for radio buttons */
box = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_box_pack_start (GTK_BOX (box),
gtk_label_new(_("Note: The panel will size itself to the\n"
"largest applet. The applets get notified of\n"
"the size, but they may choose not to follow it.\n"
"All standard panel icons follow this size.")),
FALSE, FALSE,0);
/* Tiny Size */
ppc->s_tiny = gtk_radio_button_new_with_label (NULL, _("Tiny (24 pixels)"));
gtk_object_set_user_data(GTK_OBJECT(ppc->s_tiny),ppc);
gtk_signal_connect (GTK_OBJECT (ppc->s_tiny), "toggled",
GTK_SIGNAL_FUNC (size_set_size),
(gpointer)SIZE_TINY);
gtk_box_pack_start (GTK_BOX (box), ppc->s_tiny, FALSE, FALSE,0);
/* Standard Size */
ppc->s_std = gtk_radio_button_new_with_label (
gtk_radio_button_group (GTK_RADIO_BUTTON (ppc->s_tiny)),
_("Standard (48 pixels)"));
gtk_object_set_user_data(GTK_OBJECT(ppc->s_std),ppc);
gtk_signal_connect (GTK_OBJECT (ppc->s_std), "toggled",
GTK_SIGNAL_FUNC (size_set_size),
(gpointer)SIZE_STANDARD);
gtk_box_pack_start (GTK_BOX (box), ppc->s_std, FALSE, FALSE,0);
/* Large Size */
ppc->s_large = gtk_radio_button_new_with_label (
gtk_radio_button_group (GTK_RADIO_BUTTON (ppc->s_tiny)),
_("Large (64 pixels)"));
gtk_object_set_user_data(GTK_OBJECT(ppc->s_large),ppc);
gtk_signal_connect (GTK_OBJECT (ppc->s_large), "toggled",
GTK_SIGNAL_FUNC (size_set_size),
(gpointer)SIZE_LARGE);
gtk_box_pack_start (GTK_BOX (box), ppc->s_large, FALSE, FALSE,0);
/* Huge Size */
ppc->s_huge = gtk_radio_button_new_with_label (
gtk_radio_button_group (GTK_RADIO_BUTTON (ppc->s_tiny)),
_("Huge (80 pixels)"));
gtk_object_set_user_data(GTK_OBJECT(ppc->s_huge),ppc);
gtk_signal_connect (GTK_OBJECT (ppc->s_huge), "toggled",
GTK_SIGNAL_FUNC (size_set_size),
(gpointer)SIZE_HUGE);
gtk_box_pack_start (GTK_BOX (box), ppc->s_huge, FALSE, FALSE,0);
switch(ppc->sz) {
case SIZE_TINY:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->s_tiny),
TRUE);
break;
case SIZE_STANDARD:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->s_std),
TRUE);
break;
case SIZE_LARGE:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->s_large),
TRUE);
break;
case SIZE_HUGE:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ppc->s_huge),
TRUE);
break;
}
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
return vbox;
}
static void
......@@ -902,6 +1042,12 @@ panel_config(GtkWidget *panel)
add_drawer_properties_page(ppc, info->data);
}
#if 0
/* Size configuration */
page = size_notebook_page (ppc);
gtk_notebook_append_page (GTK_NOTEBOOK(prop_nbook),
page, gtk_label_new (_("Size")));
#endif
/* Backing configuration */
page = background_page (ppc);
......
......@@ -23,6 +23,7 @@ struct _PerPanelConfig {
CornerMode corner_mode;
/*panel types*/
PanelSizeType sz;
int fit_pixmap_bg;
PanelBackType back_type;
char *back_pixmap;
......@@ -37,6 +38,10 @@ struct _PerPanelConfig {
GtkWidget *l_button; /*nw*/
GtkWidget *t_button; /*ne*/
GtkWidget *b_button; /*sw*/
GtkWidget *s_tiny;
GtkWidget *s_std;
GtkWidget *s_large;
GtkWidget *s_huge;
GtkWidget *non;
GtkWidget *pix;
GtkWidget *col;
......@@ -45,6 +50,7 @@ struct _PerPanelConfig {
void panel_config(GtkWidget *panel);
void update_config_orient(GtkWidget *panel);
void update_config_size(GtkWidget *panel);
void update_config_back(PanelWidget *panel);
void kill_config_dialog(GtkWidget *panel);
#endif /* PANEL_CONFIG_H */
......@@ -3,12 +3,19 @@
#define PANEL_TYPES_H
typedef enum {
ORIENT_UP,
ORIENT_UP=0,
ORIENT_DOWN,
ORIENT_LEFT,
ORIENT_RIGHT
} PanelOrientType;
typedef enum {
SIZE_TINY=0,
SIZE_STANDARD,
SIZE_LARGE,
SIZE_HUGE
} PanelSizeType;
typedef enum {
LAUNCHER_TILE=0,
DRAWER_TILE,
......
......@@ -57,20 +57,12 @@ int pw_applet_padding = 3;
GDK_POINTER_MOTION_MASK | \
GDK_POINTER_MOTION_HINT_MASK)
typedef void (*OrientSignal) (GtkObject * object,
PanelOrientation orient,
gpointer data);
typedef void (*BackSignal) (GtkObject * object,
PanelBackType type,
char *pixmap,
GdkColor *color,
gpointer data);
typedef void (*AppletSignal) (GtkObject * object,
GtkWidget * applet,
gpointer data);
/************************
debugging
************************/
......@@ -125,6 +117,7 @@ panel_widget_get_type ()
enum {
ORIENT_CHANGE_SIGNAL,
SIZE_CHANGE_SIGNAL,
APPLET_MOVE_SIGNAL,
APPLET_ADDED_SIGNAL,
APPLET_REMOVED_SIGNAL,
......@@ -136,34 +129,6 @@ static int panel_widget_signals[LAST_SIGNAL] = {0,0,0,0,0};
static GtkFixedClass *parent_class = NULL;
static void
marshal_signal_orient (GtkObject * object,
GtkSignalFunc func,
gpointer func_data,
GtkArg * args)
{
OrientSignal rfunc;
rfunc = (OrientSignal) func;
(*rfunc) (object, GTK_VALUE_ENUM (args[0]),
func_data);
}
static void
marshal_signal_applet (GtkObject * object,
GtkSignalFunc func,
gpointer func_data,
GtkArg * args)
{
AppletSignal rfunc;
rfunc = (AppletSignal) func;
(*rfunc) (object, GTK_VALUE_POINTER (args[0]),
func_data);
}
static void
marshal_signal_back (GtkObject * object,
GtkSignalFunc func,
......@@ -195,7 +160,17 @@ panel_widget_class_init (PanelWidgetClass *class)
object_class->type,
GTK_SIGNAL_OFFSET(PanelWidgetClass,
orient_change),
marshal_signal_orient,
gtk_marshal_NONE__ENUM,
GTK_TYPE_NONE,
1,
GTK_TYPE_ENUM);
panel_widget_signals[SIZE_CHANGE_SIGNAL] =
gtk_signal_new("size_change",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET(PanelWidgetClass,
size_change),
gtk_marshal_NONE__ENUM,
GTK_TYPE_NONE,
1,
GTK_TYPE_ENUM);
......@@ -205,7 +180,7 @@ panel_widget_class_init (PanelWidgetClass *class)
object_class->type,
GTK_SIGNAL_OFFSET(PanelWidgetClass,
applet_move),
marshal_signal_applet,
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE,
1,
GTK_TYPE_POINTER);
......@@ -215,7 +190,7 @@ panel_widget_class_init (PanelWidgetClass *class)
object_class->type,
GTK_SIGNAL_OFFSET(PanelWidgetClass,
applet_added),
marshal_signal_applet,
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE,
1,
GTK_TYPE_POINTER);
......@@ -225,7 +200,7 @@ panel_widget_class_init (PanelWidgetClass *class)
object_class->type,
GTK_SIGNAL_OFFSET(PanelWidgetClass,
applet_removed),
marshal_signal_applet,
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE,
1,
GTK_TYPE_POINTER);
......@@ -245,6 +220,7 @@ panel_widget_class_init (PanelWidgetClass *class)
LAST_SIGNAL);
class->orient_change = NULL;
class->size_change = NULL;
class->applet_move = NULL;
class->applet_added = NULL;
class->applet_removed = NULL;
......@@ -699,10 +675,10 @@ panel_widget_size_request(GtkWidget *widget, GtkRequisition *requisition)
if(panel->orient == PANEL_HORIZONTAL) {
requisition->width = pw_applet_padding;
requisition->height = PANEL_MINIMUM_WIDTH;
requisition->height = panel_widget_get_pixel_size(panel);
} else {
requisition->height = pw_applet_padding;
requisition->width = PANEL_MINIMUM_WIDTH;
requisition->width = panel_widget_get_pixel_size(panel);
}
for(list = panel->applet_list; list!=NULL; list = g_list_next(list)) {
......@@ -1419,6 +1395,7 @@ panel_widget_init (PanelWidget *panel)
GtkWidget *
panel_widget_new (int packed,
PanelOrientation orient,
PanelSizeType sz,
PanelBackType back_type,
char *back_pixmap,
int fit_pixmap_bg,
......@@ -1452,6 +1429,7 @@ panel_widget_new (int packed,
}
panel->orient = orient;
panel->sz = sz;
panel->packed = packed;
if(packed)
......@@ -1471,8 +1449,8 @@ static void
_panel_widget_applet_drag_start_no_grab(PanelWidget *panel, GtkWidget *applet)
{
#ifdef PANEL_DEBUG
g_message("Starting drag on a %s at %p\n",
gtk_type_name(GTK_OBJECT(applet)->klass->type), applet);
g_message("Starting drag on a %s at %p\n",
gtk_type_name(GTK_OBJECT(applet)->klass->type), applet);
#endif