summaryrefslogtreecommitdiffstats
path: root/ui/internal.h
blob: e0361ad1932d0da38f5a68249bd5d2baec17a17e (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
  LibRCC UI - internal data structures

  Copyright (C) 2005-2008 Suren A. Chilingaryan <csa@dside.dyndns.org>

  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License version 2.1 or later
  as published by the Free Software Foundation.

  This library is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License 
  for more details.

  You should have received a copy of the GNU Lesser General Public License 
  along with this program; if not, write to the Free Software Foundation, Inc.,
  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/

#ifndef _RCC_UI_INTERNAL_H
#define _RCC_UI_INTERNAL_H

#define RCC_UI_MAX_STRING_CHARS 1024

#include <librcc.h>

#include "rccmenu.h"

typedef unsigned int rcc_ui_id;

typedef void *rcc_ui_frame_internal;

enum rcc_ui_frame_type_t {
    RCC_UI_FRAME_LANGUAGE = 0,
    RCC_UI_FRAME_CHARSETS,
    RCC_UI_FRAME_ENGINE,
    RCC_UI_FRAME_MAX
};
typedef enum rcc_ui_frame_type_t rcc_ui_frame_type;

struct rcc_ui_frame_context_t {
    rcc_ui_frame frame;
    
    rcc_ui_context uictx;
    rcc_ui_frame_type type;
    
    rcc_ui_frame_internal internal;
};
typedef struct rcc_ui_frame_context_t rcc_ui_frame_context_s;
typedef struct rcc_ui_frame_context_t *rcc_ui_frame_context;


typedef void *rcc_ui_internal;

struct rcc_ui_context_t {
    rcc_context rccctx;

    int n_classes;    
    rcc_ui_menu_context language;
    rcc_ui_menu_context engine;
    rcc_ui_menu_context *charsets;
    rcc_ui_menu_context *options;

    rcc_ui_internal internal;
    
    rcc_name *language_names;
    rcc_name *charset_names;
    rcc_name *engine_names;
    rcc_option_name *option_names;
    unsigned char class_names;
    
    rcc_ui_frame_context language_frame;
    rcc_ui_frame_context charset_frame;
    rcc_ui_frame_context engine_frame;
    
    rcc_ui_page page;
};
typedef struct rcc_ui_context_t rcc_ui_contexts_s;


rcc_ui_internal rccUiCreateInternal(rcc_ui_context ctx);
void rccUiFreeInternal(rcc_ui_context ctx);

rcc_ui_widget rccUiMenuCreateWidget(rcc_ui_menu_context ctx);
void rccUiMenuFreeWidget(rcc_ui_menu_context ctx);
int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx);

rcc_ui_id rccUiMenuGet(rcc_ui_menu_context ctx);
int rccUiMenuSet(rcc_ui_menu_context ctx, rcc_ui_id id);

rcc_ui_box rccUiBoxCreate(rcc_ui_menu_context ctx, const char *title);

rcc_ui_frame rccUiFrameCreate(rcc_ui_frame_context ctx, const char *title);
void rccUiFrameFree(rcc_ui_frame_context ctx);
int rccUiFrameAdd(rcc_ui_frame_context ctx, rcc_ui_box box);

rcc_ui_page rccUiPageCreate(rcc_ui_context ctx, const char *title);
int rccUiPageAdd(rcc_ui_page page, rcc_ui_frame frame);

#endif /* _RCC_UI_INTERNAL_H */