-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtils.h
118 lines (85 loc) · 3.03 KB
/
Utils.h
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* Utils.h
*
* Created on: 20.11.2012
* Author: roma
*/
#ifndef UTILS_H_
#define UTILS_H_
#include "Basic.h"
#include "Func.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <cmath>
struct Color
{
int red;
int green;
int blue;
};
struct Status
{
Func * work_func;
Func * main_func;
Detals detal;
int size;
int ent;
int ext;
Equation ** equations;
int equa_size;
Color color;
Basic * elem;
Func * function;
Point * start_point;
Point * finish_point;
Pos start_pos;
Pos mouse_pos;
int width;
int hight;
bool st_sp;
bool * imp;
int el_ent;
int el_ext;
bool on_func;
GtkWidget * wind;
GtkWidget ** entry;
};
void delete_element(Func * func, int num_el);
void destroy(GtkWidget*, gpointer);
void draw(GtkWidget* drawarea, GdkEventExpose* event, gpointer data);
void draw_basic(cairo_t * cr, Basic * el, int size, Color * color, bool st_sp);
void draw_line(cairo_t * cr, Line * line, int size, Color * color, bool st_sp);
void draw_func_line(cairo_t * cr, Func * func, int size, Color * color, int width, int height, bool st_sp);
void draw_func(cairo_t * cr, Func * func, int size, Color * color, bool st_sp);
void click_button_not(GtkWidget* widget, gpointer data);
void click_button_func(GtkWidget* widget, gpointer data);
void click_button_and(GtkWidget* widget, gpointer data);
void click_button_or(GtkWidget* widget, gpointer data);
void click_button_line(GtkWidget* widget, gpointer data);
void click_button_del(GtkWidget* widget, gpointer data);
void click_button_st_sp(GtkWidget* widget, gpointer data);
void click_button_back(GtkWidget* widget, gpointer data);
void click_button_ent(GtkWidget* widget, gpointer data);
void click_on_func(GtkWidget* widget, gpointer data);
void click_on_empty(GtkWidget* widget, gpointer data);
void enter_changed(GtkWidget* widget, gpointer data);
void exits_changed(GtkWidget* widget, gpointer data);
void size_changed(GtkWidget* widget, gpointer data);
void main_enter_changed(GtkWidget* widget, gpointer data);
void main_exit_changed(GtkWidget* widget, gpointer data);
void window_change_size(GtkWidget* widget, GtkAllocation *allocation, gpointer data);
gboolean delete_event(GtkWidget * widget, GdkEvent * event, gpointer data);
void destroy(GtkWidget * widget, gpointer data);
gboolean delete_event_question(GtkWidget * widget, GdkEvent * event, gpointer data);
void destroy_question(GtkWidget * widget, gpointer data);
gboolean time_handler(GtkWidget* widget);
gboolean move(GtkWidget * widget, GdkEventMotion * event, gpointer data);
bool IsFree(Func * func, Pos * pos, int size);
int FindEl(Func * func, Pos * pos, int size);
Point * FindLine(Func * func, Pos * pos, int size, Pos * point);
int FindStartPoint(Func * func, Pos * pos, int size, int width, int hight );
int FindFunc(Func * func, Pos * pos, int size);
gboolean click(GtkWidget * widget, GdkEventButton * event, gpointer data);
gboolean click_release(GtkWidget * widget, GdkEventButton * event, gpointer data);
bool text_to_equation(const gchar * text, Equation * equt, int enters);
#endif /* UTILS_H_ */