Glavna stranica | Popis datoteka | Članovi klasa u datoteci

Opis datoteke /home/srle/Projects/sisadmin/src/support.c

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include "support.h"

Izvorni kod

Funkcije

GtkWidget * lookup_widget (GtkWidget *widget, const gchar *widget_name)
void add_pixmap_directory (const gchar *directory)
gchar * find_pixmap_file (const gchar *filename)
GtkWidget * create_pixmap (GtkWidget *widget, const gchar *filename)
GdkPixbuf * create_pixbuf (const gchar *filename)
void glade_set_atk_action_description (AtkAction *action, const gchar *action_name, const gchar *description)

Varijable

GList * pixmaps_directories = NULL


Dokumentacije funkcija

void add_pixmap_directory const gchar *  directory  ) 
 

Definirano u liniji 70 datoteke support.c.

Reference pixmaps_directories.

Referencirano od main().

00071 {
00072   pixmaps_directories = g_list_prepend (pixmaps_directories,
00073                                         g_strdup (directory));
00074 }

GdkPixbuf* create_pixbuf const gchar *  filename  ) 
 

Definirano u liniji 122 datoteke support.c.

Reference _find_pixmap_file().

00123 {
00124   gchar *pathname = NULL;
00125   GdkPixbuf *pixbuf;
00126   GError *error = NULL;
00127 
00128   if (!filename || !filename[0])
00129       return NULL;
00130 
00131   pathname = find_pixmap_file (filename);
00132 
00133   if (!pathname)
00134     {
00135       g_warning (_("Couldn't find pixmap file: %s"), filename);
00136       return NULL;
00137     }
00138 
00139   pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
00140   if (!pixbuf)
00141     {
00142       fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
00143                pathname, error->message);
00144       g_error_free (error);
00145     }
00146   g_free (pathname);
00147   return pixbuf;
00148 }

GtkWidget* create_pixmap GtkWidget *  widget,
const gchar *  filename
 

Definirano u liniji 98 datoteke support.c.

Reference _find_pixmap_file().

00100 {
00101   gchar *pathname = NULL;
00102   GtkWidget *pixmap;
00103 
00104   if (!filename || !filename[0])
00105       return gtk_image_new ();
00106 
00107   pathname = find_pixmap_file (filename);
00108 
00109   if (!pathname)
00110     {
00111       g_warning (_("Couldn't find pixmap file: %s"), filename);
00112       return gtk_image_new ();
00113     }
00114 
00115   pixmap = gtk_image_new_from_file (pathname);
00116   g_free (pathname);
00117   return pixmap;
00118 }

gchar* find_pixmap_file const gchar *  filename  )  [static]
 

Definirano u liniji 78 datoteke support.c.

Reference pixmaps_directories.

Referencirano od create_pixbuf()create_pixmap().

00079 {
00080   GList *elem;
00081 
00082   /* We step through each of the pixmaps directory to find it. */
00083   elem = pixmaps_directories;
00084   while (elem)
00085     {
00086       gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
00087                                          G_DIR_SEPARATOR_S, filename);
00088       if (g_file_test (pathname, G_FILE_TEST_EXISTS))
00089         return pathname;
00090       g_free (pathname);
00091       elem = elem->next;
00092     }
00093   return NULL;
00094 }

void glade_set_atk_action_description AtkAction *  action,
const gchar *  action_name,
const gchar *  description
 

Definirano u liniji 152 datoteke support.c.

00155 {
00156   gint n_actions, i;
00157 
00158   n_actions = atk_action_get_n_actions (action);
00159   for (i = 0; i < n_actions; i++)
00160     {
00161       if (!strcmp (atk_action_get_name (action, i), action_name))
00162         atk_action_set_description (action, i, description);
00163     }
00164 }

GtkWidget* lookup_widget GtkWidget *  widget,
const gchar *  widget_name
 

Definirano u liniji 41 datoteke support.c.

Referencirano od on_bckButtonWin_clicked(), on_catChoseBtn_clicked(), on_catChoseDelBtn_clicked(), on_catChoseDelQuitBtn_clicked(), on_catChoseQuitBtn_clicked(), on_catDelOkBtn_clicked(), on_catDelQuitBtn_clicked(), on_catEditQuitBtn_clicked(), on_catEditSaveBtn_clicked(), on_catLinkChoseBtn_clicked(), on_catLinkChoseQuitBtn_clicked(), on_catLinkDelChoseBtn_clicked(), on_catLinkDelChoseQuitBtn_clicked(), on_catNewAddBtn_clicked(), on_catNewQuitBtn_clicked(), on_helpOkBtn_clicked(), on_infoButtonWin_clicked(), on_linkChoseBtn_clicked(), on_linkChoseQuitBtn_clicked(), on_linkDelChoseBtn_clicked(), on_linkDelChoseQuitBtn_clicked(), on_linkDelOkBtn_clicked(), on_linkDelQuitBtn_clicked(), on_linkEditQuitBtn_clicked(), on_linkEditSaveBtn_clicked(), on_linkNewAddBtn_clicked(), on_linkNewQuitBtn_clicked(), on_loginButton_clicked(), on_prefOkBtn_clicked(), on_prefQuitBtn_clicked(), on_restoreButtonWin_clicked(), on_sssChoseBtn_clicked(), on_sssChoseQuitBtn_clicked(), on_sssEditQuitBtn_clicked(), on_sssEditSaveBtn_clicked(), on_sssNewAddBtn_clicked()on_sssNewQuitBtn_clicked().

00043 {
00044   GtkWidget *parent, *found_widget;
00045 
00046   for (;;)
00047     {
00048       if (GTK_IS_MENU (widget))
00049         parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
00050       else
00051         parent = widget->parent;
00052       if (!parent)
00053         parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
00054       if (parent == NULL)
00055         break;
00056       widget = parent;
00057     }
00058 
00059   found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
00060                                                  widget_name);
00061   if (!found_widget)
00062     g_warning ("Widget not found: %s", widget_name);
00063   return found_widget;
00064 }


Dokumentacija varijable

GList* pixmaps_directories = NULL [static]
 

Definirano u liniji 66 datoteke support.c.

Referencirano od add_pixmap_directory()find_pixmap_file().


Generirano Thu Sep 16 17:26:23 2004 projekt: SiS.Admin generator: doxygen 1.3.2