Commit 7679a279 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

general cleanup after a -Wall compilation

Fri Mar 20 01:09:35 1998  George Lebl  <jirka@5z.com>

        * *.c: general cleanup after a -Wall compilation
parent 8aa23722
Fri Mar 20 01:09:35 1998 George Lebl <jirka@5z.com>
* *.c: general cleanup after a -Wall compilation
Fri Mar 20 00:10:12 1998 George Lebl <jirka@5z.com>
* applet-lib.{cc,h}: implemented a way for applets
......
Fri Mar 20 01:09:35 1998 George Lebl <jirka@5z.com>
* *.c: general cleanup after a -Wall compilation
Fri Mar 20 00:10:12 1998 George Lebl <jirka@5z.com>
* applet-lib.{cc,h}: implemented a way for applets
......
......@@ -23,15 +23,13 @@
#define DRAWER_PANEL "drawer_panel"
static char *gnome_folder = NULL;
extern GlobalConfig global_config;
void
reposition_drawer(Drawer *drawer)
{
if(PANEL_WIDGET(drawer->drawer)->state == PANEL_SHOWN) {
gint x,y;
gint x=0,y=0;
gint wx, wy;
gdk_window_get_origin (drawer->button->window, &wx, &wy);
......@@ -88,7 +86,7 @@ create_drawer_applet(GtkWidget * drawer_panel, DrawerOrient orient)
GtkWidget *pixmap;
Drawer *drawer;
char *pixmap_name;
char *pixmap_name=NULL;
drawer = g_new(Drawer,1);
......@@ -147,7 +145,8 @@ create_drawer_applet(GtkWidget * drawer_panel, DrawerOrient orient)
Drawer *
create_empty_drawer_applet(DrawerOrient orient)
{
if(orient == DRAWER_UP)
switch(orient) {
case DRAWER_UP:
return create_drawer_applet(panel_widget_new(0,
PANEL_VERTICAL,
PANEL_DRAWER,
......@@ -157,7 +156,7 @@ create_empty_drawer_applet(DrawerOrient orient)
0, 0, 0, 0,
DROP_ZONE_LEFT),
orient);
else if(orient == DRAWER_DOWN)
case DRAWER_DOWN:
return create_drawer_applet(panel_widget_new(0,
PANEL_VERTICAL,
PANEL_DRAWER,
......@@ -167,7 +166,7 @@ create_empty_drawer_applet(DrawerOrient orient)
0, 0, 0, 0,
DROP_ZONE_RIGHT),
orient);
else if(orient == DRAWER_LEFT)
case DRAWER_LEFT:
return create_drawer_applet(panel_widget_new(0,
PANEL_HORIZONTAL,
PANEL_DRAWER,
......@@ -177,7 +176,7 @@ create_empty_drawer_applet(DrawerOrient orient)
0, 0, 0, 0,
DROP_ZONE_LEFT),
orient);
else if(orient == DRAWER_RIGHT)
case DRAWER_RIGHT:
return create_drawer_applet(panel_widget_new(0,
PANEL_HORIZONTAL,
PANEL_DRAWER,
......@@ -187,14 +186,15 @@ create_empty_drawer_applet(DrawerOrient orient)
0, 0, 0, 0,
DROP_ZONE_RIGHT),
orient);
}
return NULL;
}
void
set_drawer_applet_orient(Drawer *drawer, DrawerOrient orient)
{
GtkWidget *pixmap;
char *pixmap_name;
char *pixmap_name=NULL;
g_return_if_fail(drawer!=NULL);
......
......@@ -16,6 +16,7 @@
#include <string.h>
#include "gnome.h"
#include "panel.h"
#include "mico-parse.h"
#include "applet-lib.h"
#include "launcher-lib.h"
......@@ -439,9 +440,7 @@ start_new_launcher(const char *path)
{
GtkWidget *plug;
Launcher *launcher;
GnomeDesktopEntry *dentry;
GtkWidget *clock;
char *result;
char *cfgpath;
char *globcfgpath;
......
......@@ -42,7 +42,6 @@ load_applet(char *id, char *params, int pos, int panel, char *cfgpath)
{
if(strcmp(id,EXTERN_ID) == 0) {
gchar *command;
AppletInfo * info;
/*start nothing, applet is taking care of everything*/
if(params == NULL ||
......@@ -75,7 +74,7 @@ load_applet(char *id, char *params, int pos, int panel, char *cfgpath)
} else if(strcmp(id,DRAWER_ID) == 0) {
Drawer *drawer;
PanelWidget *parent;
DrawerOrient orient;
DrawerOrient orient=DRAWER_UP;
parent = PANEL_WIDGET(g_list_nth(panels,panel)->data);
......@@ -190,7 +189,7 @@ orientation_change(AppletInfo *info, PanelWidget *panel)
/*FIXME: call corba*/
} else if(info->type == APPLET_MENU) {
Menu *menu = info->data;
MenuOrient orient;
MenuOrient orient=MENU_UP;
printf("[orient:menu:%ld]\n",(long)menu);
......@@ -216,7 +215,7 @@ orientation_change(AppletInfo *info, PanelWidget *panel)
set_menu_applet_orient(menu,orient);
} else if(info->type == APPLET_DRAWER) {
Drawer *drawer = info->data;
DrawerOrient orient;
DrawerOrient orient = DRAWER_UP;
switch(panel->snapped) {
case PANEL_FREE:
......@@ -257,7 +256,7 @@ orient_change_foreach(gpointer data, gpointer user_data)
}
static int
static gint
panel_orient_change(GtkWidget *widget,
PanelOrientation orient,
PanelSnapped snapped,
......@@ -265,13 +264,13 @@ panel_orient_change(GtkWidget *widget,
{
panel_widget_foreach(PANEL_WIDGET(widget),orient_change_foreach,
(gpointer)widget);
return TRUE;
}
static void
state_restore_foreach(gpointer data, gpointer user_data)
{
AppletInfo *info = gtk_object_get_user_data(GTK_OBJECT(data));
PanelWidget *panel = user_data;
if(!info) return;
......@@ -280,7 +279,7 @@ state_restore_foreach(gpointer data, gpointer user_data)
panel_widget_restore_state(PANEL_WIDGET(info->assoc));
panel_widget_foreach(PANEL_WIDGET(info->assoc),
state_restore_foreach,
(gpointer)info->assoc);
NULL);
}
}
}
......@@ -289,7 +288,6 @@ static void
state_hide_foreach(gpointer data, gpointer user_data)
{
AppletInfo *info = gtk_object_get_user_data(GTK_OBJECT(data));
PanelWidget *panel = user_data;
if(!info) return;
......@@ -297,13 +295,13 @@ state_hide_foreach(gpointer data, gpointer user_data)
if(PANEL_WIDGET(info->assoc)->state == PANEL_SHOWN) {
gtk_widget_hide(info->assoc);
panel_widget_foreach(PANEL_WIDGET(info->assoc),
state_restore_foreach,
(gpointer)info->assoc);
state_hide_foreach,
NULL);
}
}
}
static int
static gint
panel_state_change(GtkWidget *widget,
PanelState state,
gpointer data)
......@@ -314,13 +312,14 @@ panel_state_change(GtkWidget *widget,
else
panel_widget_foreach(PANEL_WIDGET(widget),state_hide_foreach,
(gpointer)widget);
return TRUE;
}
static void
applet_move_foreach(gpointer data, gpointer user_data)
{
AppletInfo *info = gtk_object_get_user_data(GTK_OBJECT(data));
PanelWidget *panel = user_data;
if(!info) return;
......@@ -330,7 +329,7 @@ applet_move_foreach(gpointer data, gpointer user_data)
reposition_drawer(drawer);
panel_widget_foreach(PANEL_WIDGET(info->assoc),
state_restore_foreach,
(gpointer)info->assoc);
NULL);
}
}
}
......@@ -338,7 +337,7 @@ applet_move_foreach(gpointer data, gpointer user_data)
static void
panel_applet_move(GtkWidget *widget, GtkWidget *applet, gpointer data)
{
applet_move_foreach(applet,widget);
applet_move_foreach(applet,NULL);
}
static void
......@@ -514,7 +513,6 @@ call_launcher_timeout(gpointer data)
int
main(int argc, char **argv)
{
GtkWidget *base_panel;
char buf[256];
bindtextdomain(PACKAGE, GNOMELOCALEDIR);
......
......@@ -346,12 +346,6 @@ add_applet_to_panel_data(GtkWidget *widget, gpointer data)
add_to_panel((char *)data, NULL);
}
static void
add_applet_to_panel(GtkWidget *widget, gpointer data)
{
add_to_panel(gtk_object_get_user_data(GTK_OBJECT(widget)), NULL);
}
static GtkWidget *
create_applets_menu(void)
{
......@@ -463,7 +457,7 @@ create_panel_menu (char *menudir, int main_menu,
Menu *menu;
GtkWidget *app_menu;
char *pixmap_name;
char *pixmap_name = NULL;
menu = g_new(Menu,1);
......@@ -608,10 +602,10 @@ void
set_menu_applet_orient(Menu *menu, MenuOrient orient)
{
GtkWidget *pixmap;
char *pixmap_name;
char *pixmap_name = NULL;
g_return_if_fail(menu!=NULL);
//g_return_if_fail(menu->path!=NULL);
g_return_if_fail(menu->path!=NULL);
menu->orient = orient;
......
......@@ -1681,6 +1681,9 @@ panel_widget_change_params(PanelWidget *panel,
/*so that there are no shifts necessary before size_allocate*/
panel->snapped = snapped;
switch(panel->snapped) {
case PANEL_DRAWER:
/*fallthrough, so orient MUST be right, can we
assume that???*/
case PANEL_FREE:
panel->orient = orient;
break;
......
......@@ -13,6 +13,7 @@
#include "gdkextra.h"
#include "panel.h"
#include "menu.h"
#include "mico-glue.h"
#include "panel_config.h"
#include "panel_config_global.h"
#include <gdk/gdkx.h>
......@@ -38,7 +39,7 @@ extern GlobalConfig global_config;
extern char *panel_cfg_path;
static void
/*static void
get_applet_geometry(GtkWidget *applet, int *x, int *y, int *width, int *height)
{
if (x)
......@@ -52,7 +53,7 @@ get_applet_geometry(GtkWidget *applet, int *x, int *y, int *width, int *height)
if (height)
*height = applet->allocation.height;
}
}*/
static void
apply_global_config_to_panel(gpointer data, gpointer user_data)
......@@ -259,7 +260,6 @@ panel_session_save (GnomeClient *client,
gpointer client_data)
{
gint num;
gint drawernum;
char buf[256];
for(num=gnome_config_get_int("/panel/Config/applet_count=0");
......@@ -705,8 +705,6 @@ int
applet_request_id (const char *path, char **cfgpath,
char **globcfgpath, guint32 * winid)
{
GtkWidget *eb;
GdkWindow *win;
GList *list;
AppletInfo *info;
int i;
......@@ -762,8 +760,6 @@ reserve_applet_spot (const char *id, const char *path, int panel, int pos,
char *cfgpath, AppletType type)
{
GtkWidget *socket;
GdkWindow *win;
GList *list;
/*printf ("entering reserve spot\n");*/
......
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