summaryrefslogtreecommitdiffstats
path: root/kio/kio/tdelficon.h
blob: 7a962bdaa5b0ee33f64f098588ae36380852409a (plain)
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
45
46
47
48
49
50
51
52
53
54
#include <alloca.h>
#include <stdint.h>
#include <cstdlib>

#include <tqdict.h>
#include <tqvalidator.h>
#include <tqcstring.h>
#include <tqfile.h>
#include <tqdatetime.h>

extern "C" {
  #include <libr-icons.h>

  // BEGIN HACK
  // libr does not export these structures and defines,
  // but we need access to them to make the UI behave sanely
  // Keep them in sync with libr and all should be OK

  // Valid for libr version 0.6.0
  // See libr detection code in ConfigureChecks.cmake

  typedef uint32_t ID8;
  typedef uint16_t ID4;
  typedef struct {uint64_t p:48;} __attribute__((__packed__)) ID12;

  typedef struct {
    ID8  g1;
    ID4  g2;
    ID4  g3;
    ID4  g4;
    ID12 g5;
  } __attribute__((__packed__)) UUID;

  typedef struct {
    char *name;
    size_t offset;
    size_t entry_size;
    libr_icontype_t type;
    unsigned int icon_size;
  } iconentry;

  typedef struct{
    size_t size;
    char *buffer;
    iconentry entry;
  } iconlist;

  #define ICON_SECTION     ".icon"
  // END HACK
}

int get_iconlist(libr_file *file_handle, iconlist *icons);
iconentry *get_nexticon(iconlist *icons, iconentry *last_entry);
TQString elf_get_resource(libr_file *handle, char *section_name);