mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 12:30:07 +01:00
* panel-applet/menu-info.c (nm_menu_wired_class_init): update look
and feel. We should be back to working, and have a good, clean
look.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@183 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
153 lines
3.7 KiB
C
153 lines
3.7 KiB
C
/* NetworkManager Wireless Applet -- Display wireless access points and allow user control
|
|
*
|
|
* Dan Williams <dcbw@redhat.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program 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 General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*
|
|
* (C) Copyright 2004 Red Hat, Inc.
|
|
*/
|
|
|
|
#ifndef NM_WIRELESS_APPLET_H
|
|
#define NM_WIRELESS_APPLET_H
|
|
#include "config.h"
|
|
#include <gnome.h>
|
|
#include <gconf/gconf-client.h>
|
|
#include <glade/glade.h>
|
|
#include <dbus/dbus.h>
|
|
#include <dbus/dbus-glib.h>
|
|
#ifndef BUILD_NOTIFICATION_ICON
|
|
#include <panel-applet.h>
|
|
#include <panel-applet-gconf.h>
|
|
#else
|
|
#include "eggtrayicon.h"
|
|
#endif
|
|
|
|
typedef enum
|
|
{
|
|
PIX_NO_NETWORKMANAGER,
|
|
PIX_WIRED,
|
|
PIX_WIRELESS_NO_LINK,
|
|
PIX_WIRELESS_SIGNAL_1,
|
|
PIX_WIRELESS_SIGNAL_2,
|
|
PIX_WIRELESS_SIGNAL_3,
|
|
PIX_WIRELESS_SIGNAL_4,
|
|
PIX_WIRELESS_CONNECT_0,
|
|
PIX_WIRELESS_CONNECT_1,
|
|
PIX_WIRELESS_CONNECT_2,
|
|
PIX_WIRELESS_CONNECT_3,
|
|
PIX_NUMBER
|
|
} PixmapState;
|
|
|
|
|
|
typedef enum
|
|
{
|
|
APPLET_STATE_NO_NM,
|
|
APPLET_STATE_NO_CONNECTION,
|
|
APPLET_STATE_WIRED,
|
|
APPLET_STATE_WIRED_CONNECTING,
|
|
APPLET_STATE_WIRELESS,
|
|
APPLET_STATE_WIRELESS_CONNECTING,
|
|
APPLET_STATE_IGNORE
|
|
} AppletState;
|
|
|
|
|
|
/*
|
|
* Representation of a wireless network
|
|
*
|
|
*/
|
|
typedef struct
|
|
{
|
|
int refcount;
|
|
char *nm_name;
|
|
char *essid;
|
|
gboolean encrypted;
|
|
gboolean active;
|
|
gint8 strength;
|
|
} WirelessNetwork;
|
|
|
|
/*
|
|
* Representation of network device
|
|
*
|
|
*/
|
|
typedef struct
|
|
{
|
|
int refcount;
|
|
char *nm_device;
|
|
int type;
|
|
char *nm_name;
|
|
char *hal_name;
|
|
char *udi;
|
|
gint strength;
|
|
GSList *networks;
|
|
} NetworkDevice;
|
|
|
|
|
|
|
|
#ifdef BUILD_NOTIFICATION_ICON
|
|
|
|
#define NM_TYPE_WIRELESS_APPLET (nmwa_get_type())
|
|
#define NM_WIRELESS_APPLET(object) (G_TYPE_CHECK_INSTANCE_CAST((object), NM_TYPE_WIRELESS_APPLET, NMWirelessApplet))
|
|
#define NM_WIRELESS_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_WIRELESS_APPLET, NMWirelessAppletClass))
|
|
#define NM_IS_WIRELESS_APPLET(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), NM_TYPE_WIRELESS_APPLET))
|
|
#define NM_IS_WIRELESS_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_WIRELESS_APPLET))
|
|
#define NM_WIRELESS_APPLET_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), NM_TYPE_WIRELESS_APPLET, NMWirelessAppletClass))
|
|
|
|
typedef struct
|
|
{
|
|
EggTrayIconClass parent_class;
|
|
} NMWirelessAppletClass;
|
|
#endif
|
|
|
|
/*
|
|
* Applet instance data
|
|
*
|
|
*/
|
|
typedef struct
|
|
{
|
|
EggTrayIcon parent;
|
|
|
|
DBusConnection *connection;
|
|
GConfClient *gconf_client;
|
|
GladeXML *ui_resources;
|
|
guint redraw_timeout_id;
|
|
GThread *dbus_thread;
|
|
GMainContext *thread_context;
|
|
|
|
PixmapState pix_state; // Index into pixmaps array
|
|
GdkPixbuf *pixmaps[PIX_NUMBER];
|
|
GdkPixbuf *current_pixbuf;
|
|
GdkPixbuf *key_pixbuf;
|
|
GdkPixbuf *wired_icon;
|
|
GdkPixbuf *wireless_icon;
|
|
|
|
/* Data model elements */
|
|
GMutex *data_mutex;
|
|
GSList *devices;
|
|
NetworkDevice *active_device;
|
|
AppletState applet_state;
|
|
|
|
/* Direct UI elements */
|
|
GtkWidget *pixmap;
|
|
GtkWidget *box;
|
|
GtkWidget *about_dialog;
|
|
GtkWidget *menu;
|
|
GtkWidget *toplevel_menu;
|
|
GtkSizeGroup *encryption_size_group;
|
|
} NMWirelessApplet;
|
|
|
|
|
|
NetworkDevice *nmwa_get_device_for_nm_device (NMWirelessApplet *applet, const char *nm_dev);
|
|
NMWirelessApplet *nmwa_new ();
|
|
#endif
|