00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028 #ifndef __SERVER_H
00029 #define __SERVER_H
00030
00031
00032 #include "protocol.h"
00033
00034 typedef struct widget_header ntwWidget;
00035 typedef int (*func_ptr)(void *, void *);
00036
00037 #include <stdlib.h>
00038 #include <stdio.h>
00039 #include <stdarg.h>
00040 #include <string.h>
00041 #include <unistd.h>
00042 #include <assert.h>
00043
00044 #include "lookup.h"
00045
00046 #ifdef _WIN_32
00047 #include "wnetwork.h"
00048 #else
00049 #include "network.h"
00050 #endif
00051
00052 #include "data_send.h"
00053 #include "variables.h"
00054 #include "container.h"
00055 #include "window.h"
00056 #include "dialog.h"
00057 #include "grid.h"
00058 #include "button.h"
00059 #include "check_button.h"
00060 #include "label.h"
00061 #include "image.h"
00062 #include "entry.h"
00063 #include "menu_bar.h"
00064 #include "menu.h"
00065 #include "menu_item.h"
00066 #include "tool_bar.h"
00067 #include "tool_item.h"
00068 #include "tool_button.h"
00069 #include "tool_menu_button.h"
00070 #include "radio_group.h"
00071 #include "radio_button.h"
00072 #include "notebook.h"
00073 #include "notebook_page.h"
00074 #include "scrollpane.h"
00075 #include "list_model.h"
00076 #include "tree_model.h"
00077 #include "table.h"
00078 #include "table_column.h"
00079 #include "frame.h"
00080 #include "split_pane.h"
00081 #include "combo_box.h"
00082 #include "combo_box_entry.h"
00083 #include "image_buffer.h"
00084 #include "cached_image.h"
00085 #include "status_bar.h"
00086 #include "spin_button.h"
00087 #include "slider.h"
00088 #include "progress_bar.h"
00089 #include "text_editor.h"
00090 #include "persist.h"
00091 #include "timer.h"
00092
00093 #define FALSE 0
00094 #define TRUE 1
00095
00096 #define NTW_WIDGET_SET_FLAG(x, y) x->flags = x->flags | htonl(y)
00097 #define NTW_WIDGET_CLEAR_FLAG(x, y) x->flags = x->flags & htonl(0xffffffff ^ y)
00098 #define NTW_WIDGET_TOGGLE_FLAG(x, y) x->flags = x->flags ^ htonl(y)
00099 #define NTW_WIDGET_GET_FLAG(x, y) ((x->flags & htonl(y)) > 0)
00100 #define NTW_INIT_CALLBACK(x) ntw_init_callback(#x, &x);
00101
00102
00103 struct ntw_event_data{
00104 int32 id;
00105 int32 event;
00106 int32 synchronized;
00107 char data[];
00108 };
00109
00110 struct ntw_data_stack{
00111 struct ntw_data_stack *next;
00112 int32 data_len;
00113 void *data;
00114 char op;
00115 };
00116
00117
00123 void
00124 ntw_print_error(char *function_name, char *error);
00125
00133 struct widget_data *
00134 ntw_initialize_widget(int32 type, int32 length);
00135
00145 struct ntw_event_table *
00146 ntw_initialize_event_handler(int32 event_count);
00147
00156 int
00157 ntw_widget_remove_default_event_handler(ntwWidget *widget);
00158
00163 int
00164 ntw_widget_show(ntwWidget *widget);
00165
00170 int
00171 ntw_widget_hide(ntwWidget *widget);
00172
00181 int
00182 ntw_widget_destroy(ntwWidget *widget);
00183
00191 int
00192 ntw_init(int argc, char **argv);
00193
00199 void
00200 ntw_main();
00201
00206 void
00207 ntw_main_quit();
00208
00220 int
00221 ntw_add_callback(ntwWidget *widget, int32 event, func_ptr callback, ntwWidget *user_data, int32 synchronized);
00222
00223
00224 #endif