File: gcin-icon.cpp

package info (click to toggle)
gcin 2.9.4%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,812 kB
  • sloc: cpp: 34,326; ansic: 9,319; makefile: 648; sh: 556
file content (44 lines) | stat: -rw-r--r-- 851 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "gcin.h"
#if WIN32
#include <io.h>
#endif

void sys_icon_fname(char *iconame, char fname[])
{
#if WIN32
  sprintf(fname, "%s\\icons\\%s",gcin_program_files_path, iconame);
#else
  sprintf(fname, GCIN_ICON_DIR"/%s", iconame);
#endif
}

void get_icon_path(char *iconame, char fname[])
{
  char uu[128];
#if UNIX
  sprintf(uu, "icons/%s", iconame);
#else
  sprintf(uu, "icons\\%s", iconame);
#endif
  get_gcin_user_fname(uu, fname);

#if UNIX
  if (access(fname, R_OK)) {
#else
  if (_access(fname, 04)) {
#endif
    sys_icon_fname(iconame, fname);
  }
}


void set_window_gcin_icon(GtkWidget *window)
{
#if WIN32
  char tt[128];
  sys_icon_fname("gcin.png", tt);
  gtk_window_set_icon_from_file(GTK_WINDOW(window), tt, NULL);
#else
  gtk_window_set_icon_from_file(GTK_WINDOW(window), SYS_ICON_DIR"/hicolor/64x64/apps/gcin.png", NULL);
#endif
}