gok-button.c.diff0100644000175000017500000000207107561764277014114 0ustar srbakersrbakerIndex: gok-button.c =================================================================== RCS file: /cvs/gnome/gok/gok/gok-button.c,v retrieving revision 1.16 diff -r1.16 gok-button.c 126a127,156 > * gok_button_new_with_image: > * @pFilename: Filename for the button's image. > * > * Creates a new GOK button with an image. > * > * Returns: A pointer to the new button, NULL if it could not be created. > **/ > GtkWidget* > gok_button_new_with_image (const gchar* pFilename) > { > GtkWidget* pNewButton; > > /* create a new GOK button */ > pNewButton = GTK_WIDGET (gtk_type_new (gok_button_get_type ())); > > if (pNewButton == NULL) > { > gok_log_x ("Error: Can't create new GOK button '%s' in gok_button_new_with_image!\n", pFilename); > return NULL; > } > > /* add the image to it */ > ((GokButton*)pNewButton)->pLabel = gtk_image_new_from_file (pFilename); > gtk_widget_show (((GokButton*)pNewButton)->pLabel); > gtk_container_add (GTK_CONTAINER (pNewButton), ((GokButton*)pNewButton)->pLabel); > > return pNewButton; > } > > /** gok-button.h.diff0100644000175000017500000000042507561764307014114 0ustar srbakersrbakerIndex: gok-button.h =================================================================== RCS file: /cvs/gnome/gok/gok/gok-button.h,v retrieving revision 1.9 diff -r1.9 gok-button.h 42c42 < GtkWidget* pLabel; --- > GtkWidget* pLabel; /* this name doesn't fit anymore */ gok-key.c.diff0100644000175000017500000000473407561764326013374 0ustar srbakersrbakerIndex: gok-key.c =================================================================== RCS file: /cvs/gnome/gok/gok/gok-key.c,v retrieving revision 1.31 diff -r1.31 gok-key.c 78a79 > pgok_key_new->pImage = NULL; 126a128,130 > GokKeyImage* pImage; > GokKeyImage* pImageTemp; > 163a168,176 > /* delete all the key's images */ > pImage = pKey->pImage; > while (pImage != NULL) > { > pImageTemp = pImage; > pImage = pImage->pImageNext; > gok_keyimage_delete (pImageTemp); > } > 353a367,372 > /* key image */ > if (xmlStrcmp (pNodeKeyChild->name, (const xmlChar *)"image") == 0) > { > gok_keyimage_new (pKey, xmlNodeGetContent (pNodeKeyChild)); > } > 687a707,783 > } > > /** > * gok_keyimage_new > * @pKey: Pointer to the key that gets the new image. > * @pFilename: Filename containing the image. > * > * Allocates memory for a new key image and initialises the > * GokKeyImage structure. Returns a pointer to the new key image, > * NULL if it can't be created. Add this image to a key so it will be > * deleted when the key is deleted. > * > * returns: A pointer to the new key image, NULL if it wasn't created. > **/ > GokKeyImage* > gok_keyimage_new (GokKey* pKey, gchar* pFilename) > { > GokKeyImage* pNewImage; > GokKeyImage* pKeyImage; > > pNewImage = (GokKeyImage*) g_malloc (sizeof (GokKeyImage)); > > pNewImage->Filename = NULL; > pNewImage->pImageNext = NULL; > > if (pFilename != NULL) > { > pNewImage->Filename = (gchar*) g_malloc (strlen (pFilename) + 1); > strcpy (pNewImage->Filename, pFilename); > } > > if (pKey != NULL) > { > pKeyImage = pKey->pImage; > if (pKeyImage == NULL) > { > pKey->pImage = pNewImage; > } > else > { > while (pKeyImage->pImageNext != NULL) > { > pKeyImage = pKeyImage->pImageNext; > } > pKeyImage->pImageNext = pNewImage; > } > pKey->ImageCode = KEYDISPLAY_IMAGE; > } > > return pNewImage; > } > > /** > * gok_keyimage_delete > * @pKeyImage: Pointer to the key image that will be deleted. > **/ > void > gok_keyimage_delete (GokKeyImage* pKeyImage) > { > if (pKeyImage != NULL) > { > if (pKeyImage->Filename != NULL) > { > g_free (pKeyImage->Filename); > } > g_free (pKeyImage); > } > } > > gchar* > gok_key_get_image_filename (GokKey* pKey) > { > g_assert (pKey != NULL); > > /* this needs to get the filename for the normal modifier key */ > > return pKey->pImage->Filename; gok-key.h.diff0100644000175000017500000000112007561764336013364 0ustar srbakersrbakerIndex: gok-key.h =================================================================== RCS file: /cvs/gnome/gok/gok/gok-key.h,v retrieving revision 1.26 diff -r1.26 gok-key.h 104a105,111 > /* a key image */ > /* if you add data members to this structure, initialize them in gok_keyimage_new */ > typedef struct GokKeyImage { > gchar* Filename; > struct GokKeyImage* pImageNext; > } GokKeyImage; > 107d113 < 109a116 > GokKeyImage* pImage; 160a168,169 > GokKeyImage* gok_keyimage_new (GokKey *pKey, gchar* Filename); > void gok_keyimage_delete (GokKeyImage* pKeyImage); gok-keyboard.c.diff0100644000175000017500000000122207561764353014371 0ustar srbakersrbakerIndex: gok-keyboard.c =================================================================== RCS file: /cvs/gnome/gok/gok/gok-keyboard.c,v retrieving revision 1.53 diff -r1.53 gok-keyboard.c 872,873c872,881 < /* create a new GOK button */ < pNewButton = gok_button_new_with_label (gok_key_get_label (pKey)); --- > /* create a new GOK button */ > if (pKey->ImageCode == KEYDISPLAY_TEXT) > { > pNewButton = gok_button_new_with_label (gok_key_get_label (pKey)); > } > else if (pKey->ImageCode == KEYDISPLAY_IMAGE) > { > pNewButton = gok_button_new_with_image (gok_key_get_image_filename (pKey)); > } >