Back to index

lshw  02.16
Defines | Functions
stock.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define LSHW_ICON_SIZE_LOGO   "lshw-icon-size-logo"
 For getting the icon size for the logo.
Stock images
#define LSHW_STOCK_AMD   "lshw-amd"
#define LSHW_STOCK_AUDIO   "lshw-audio"
#define LSHW_STOCK_BATTERY   "lshw-battery"
#define LSHW_STOCK_BLUETOOTH   "lshw-bluetooth"
#define LSHW_STOCK_BOARD   "lshw-board"
#define LSHW_STOCK_CHIP   "lshw-chip"
#define LSHW_STOCK_CPU   "lshw-cpu"
#define LSHW_STOCK_DESKTOPCOMPUTER   "lshw-desktopcomputer"
#define LSHW_STOCK_DISABLED   "lshw-disabled"
#define LSHW_STOCK_DISPLAY   "lshw-display"
#define LSHW_STOCK_CD   "lshw-cd"
#define LSHW_STOCK_DISC   "lshw-disc"
#define LSHW_STOCK_FIREWIRE   "lshw-firewire"
#define LSHW_STOCK_INTEL   "lshw-intel"
#define LSHW_STOCK_LAPTOP   "lshw-laptop"
#define LSHW_STOCK_LOGO   "lshw-logo"
#define LSHW_STOCK_MEMORY   "lshw-memory"
#define LSHW_STOCK_MINI   "lshw-mini"
#define LSHW_STOCK_MODEM   "lshw-modem"
#define LSHW_STOCK_MOTHERBOARD   "lshw-motherboard"
#define LSHW_STOCK_NETWORK   "lshw-network"
#define LSHW_STOCK_PARALLEL   "lshw-parallel"
#define LSHW_STOCK_POWERMAC   "lshw-powermac"
#define LSHW_STOCK_POWERMACG5   "lshw-powermacg5"
#define LSHW_STOCK_POWERPC   "lshw-powerpc"
#define LSHW_STOCK_PRINTER   "lshw-printer"
#define LSHW_STOCK_RADIO   "lshw-radio"
#define LSHW_STOCK_MD   "lshw-md"
#define LSHW_STOCK_SCSI   "lshw-scsi"
#define LSHW_STOCK_SERIAL   "lshw-serial"
#define LSHW_STOCK_TOWERCOMPUTER   "lshw-towercomputer"
#define LSHW_STOCK_USB   "lshw-usb"
#define LSHW_STOCK_WIFI   "lshw-wifi"


void lshw_gtk_stock_init (void)
void lshw_ui_init (void)

Define Documentation


Definition at line 47 of file stock.h.

#define LSHW_ICON_SIZE_LOGO   "lshw-icon-size-logo"

For getting the icon size for the logo.

Definition at line 46 of file stock.h.

#define LSHW_STOCK_AMD   "lshw-amd"

Definition at line 8 of file stock.h.

#define LSHW_STOCK_AUDIO   "lshw-audio"

Definition at line 9 of file stock.h.

#define LSHW_STOCK_BATTERY   "lshw-battery"

Definition at line 10 of file stock.h.

#define LSHW_STOCK_BLUETOOTH   "lshw-bluetooth"

Definition at line 11 of file stock.h.

#define LSHW_STOCK_BOARD   "lshw-board"

Definition at line 12 of file stock.h.

#define LSHW_STOCK_CD   "lshw-cd"

Definition at line 18 of file stock.h.

#define LSHW_STOCK_CHIP   "lshw-chip"

Definition at line 13 of file stock.h.

#define LSHW_STOCK_CPU   "lshw-cpu"

Definition at line 14 of file stock.h.

#define LSHW_STOCK_DESKTOPCOMPUTER   "lshw-desktopcomputer"

Definition at line 15 of file stock.h.

#define LSHW_STOCK_DISABLED   "lshw-disabled"

Definition at line 16 of file stock.h.

#define LSHW_STOCK_DISC   "lshw-disc"

Definition at line 19 of file stock.h.

#define LSHW_STOCK_DISPLAY   "lshw-display"

Definition at line 17 of file stock.h.

#define LSHW_STOCK_FIREWIRE   "lshw-firewire"

Definition at line 20 of file stock.h.

#define LSHW_STOCK_INTEL   "lshw-intel"

Definition at line 21 of file stock.h.

#define LSHW_STOCK_LAPTOP   "lshw-laptop"

Definition at line 22 of file stock.h.

#define LSHW_STOCK_LOGO   "lshw-logo"

Definition at line 23 of file stock.h.

#define LSHW_STOCK_MD   "lshw-md"

Definition at line 35 of file stock.h.

#define LSHW_STOCK_MEMORY   "lshw-memory"

Definition at line 24 of file stock.h.

#define LSHW_STOCK_MINI   "lshw-mini"

Definition at line 25 of file stock.h.

#define LSHW_STOCK_MODEM   "lshw-modem"

Definition at line 26 of file stock.h.

#define LSHW_STOCK_MOTHERBOARD   "lshw-motherboard"

Definition at line 27 of file stock.h.

#define LSHW_STOCK_NETWORK   "lshw-network"

Definition at line 28 of file stock.h.

#define LSHW_STOCK_PARALLEL   "lshw-parallel"

Definition at line 29 of file stock.h.

#define LSHW_STOCK_POWERMAC   "lshw-powermac"

Definition at line 30 of file stock.h.

#define LSHW_STOCK_POWERMACG5   "lshw-powermacg5"

Definition at line 31 of file stock.h.

#define LSHW_STOCK_POWERPC   "lshw-powerpc"

Definition at line 32 of file stock.h.

#define LSHW_STOCK_PRINTER   "lshw-printer"

Definition at line 33 of file stock.h.

#define LSHW_STOCK_RADIO   "lshw-radio"

Definition at line 34 of file stock.h.

#define LSHW_STOCK_SCSI   "lshw-scsi"

Definition at line 36 of file stock.h.

#define LSHW_STOCK_SERIAL   "lshw-serial"

Definition at line 37 of file stock.h.

#define LSHW_STOCK_TOWERCOMPUTER   "lshw-towercomputer"

Definition at line 38 of file stock.h.

#define LSHW_STOCK_USB   "lshw-usb"

Definition at line 39 of file stock.h.

#define LSHW_STOCK_WIFI   "lshw-wifi"

Definition at line 40 of file stock.h.

Function Documentation

void lshw_gtk_stock_init ( void  )

Definition at line 87 of file stock.c.

  static int stock_initted = 0;
  GtkIconFactory *icon_factory;
  int i;
  GtkWidget *win;

  if (stock_initted)

  stock_initted = 1;

/* Setup the icon factory. */
  icon_factory = gtk_icon_factory_new();


/* Er, yeah, a hack, but it works. :) */
  win = gtk_window_new(GTK_WINDOW_TOPLEVEL);

  for (i = 0; i < G_N_ELEMENTS(stock_icons); i++)
    GdkPixbuf *pixbuf;
    GtkIconSet *iconset;
    gchar *filename;

      filename = find_file(stock_icons[i].filename, "artwork");

      if (filename == NULL)

      pixbuf = gdk_pixbuf_new_from_file(filename, NULL);

      if(pixbuf)     /* we managed to load something */
        iconset = gtk_icon_set_new_from_pixbuf(pixbuf);
        gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset);


/* register logo icon size */


  (void) &id;                                     /* avoid "id defined but not used" warning */

Here is the call graph for this function:

Here is the caller graph for this function:

void lshw_ui_init ( void  )

Definition at line 141 of file stock.c.

  GError *error = NULL;
  GtkBuilder *builder = NULL;
  GdkPixbuf *icon = NULL;
  gchar *uiname = NULL;

  mainwindow = NULL;

  builder = gtk_builder_new();
  uiname = find_file(UIFILE, "ui");
    g_critical( "Could not find UI file: %s", UIFILE );
  if(!gtk_builder_add_from_file(builder, uiname, &error))
    g_critical( "Could not create UI: %s", error->message );
    g_free( error );
    g_object_unref( G_OBJECT( builder ) );

  mainwindow = GTK_WIDGET( gtk_builder_get_object( builder, "mainwindow" ) );
  about = GTK_WIDGET( gtk_builder_get_object( builder, "aboutlshw" ) );
  list1 = GTK_WIDGET(gtk_builder_get_object( builder, "treeview1"));
  list2 = GTK_WIDGET(gtk_builder_get_object( builder, "treeview2"));
  list3 = GTK_WIDGET(gtk_builder_get_object( builder, "treeview3"));
  description = GTK_WIDGET(gtk_builder_get_object( builder, "description"));
  go_up_button = GTK_WIDGET(gtk_builder_get_object( builder, "upbutton"));
  save_button = GTK_WIDGET(gtk_builder_get_object( builder, "savebutton"));
  statusbar = GTK_WIDGET(gtk_builder_get_object( builder, "statusbar"));
  gtk_builder_connect_signals( builder, mainwindow );
  g_object_unref( G_OBJECT( builder ) );

  icon = gtk_widget_render_icon(GTK_WIDGET(mainwindow),
    gtk_window_set_icon(GTK_WINDOW(mainwindow), icon);

Here is the call graph for this function:

Here is the caller graph for this function: