~ubuntu-branches/debian/sid/geany-plugins/sid

« back to all changes in this revision

Viewing changes to debugger/src/tabs.c

  • Committer: Package Import Robot
  • Author(s): Evgeni Golov, Evgeni Golov
  • Date: 2011-11-17 20:03:24 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111117200324-8qmu6tuwjtfpv3n7
Tags: 0.21.1-1
[ Evgeni Golov ]
* [f4007f2] Imported Upstream version 0.21.1
* [5ff622d] install plugins from/to /usr/lib/<arch-triplet>/geany
* [75411d7] bump build-dep to geany 0.21
* [db92155] depend on the virtual geany-abi-XX package
* [dd84769] switch to 3.0 (quilt)
* [3ab76d7] drop readme.source
* [233d44c] refresh patch against 0.21.1
* [030bec1] add lintian override for
            documentation-package-not-architecture-independent
* [aba43d7] use debhelper compat level 9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 *              tabs.c
 
4
 *      
 
5
 *      Copyright 2010 Alexander Petukhov <devel(at)apetukhov.ru>
 
6
 *      
 
7
 *      This program is free software; you can redistribute it and/or modify
 
8
 *      it under the terms of the GNU General Public License as published by
 
9
 *      the Free Software Foundation; either version 2 of the License, or
 
10
 *      (at your option) any later version.
 
11
 *      
 
12
 *      This program is distributed in the hope that it will be useful,
 
13
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *      GNU General Public License for more details.
 
16
 *      
 
17
 *      You should have received a copy of the GNU General Public License
 
18
 *      along with this program; if not, write to the Free Software
 
19
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
20
 *      MA 02110-1301, USA.
 
21
 */
 
22
 
 
23
/*
 
24
 *              tabs widgets
 
25
 */
 
26
 
 
27
#ifdef HAVE_CONFIG_H
 
28
        #include "config.h"
 
29
#endif
 
30
#include <geanyplugin.h>
 
31
 
 
32
extern GeanyFunctions   *geany_functions;
 
33
extern GeanyData                *geany_data;
 
34
 
 
35
#include "tabs.h"
 
36
 
 
37
/* tab widgets */
 
38
GtkWidget *tab_target = NULL;
 
39
GtkWidget *tab_breaks = NULL;
 
40
GtkWidget *tab_watch = NULL;
 
41
GtkWidget *tab_autos = NULL;
 
42
GtkWidget *tab_call_stack = NULL;
 
43
GtkWidget *tab_terminal = NULL;
 
44
GtkWidget *tab_messages = NULL;
 
45
 
 
46
/*
 
47
 *      searches ID for a given widget
 
48
 *      arguments:
 
49
 *              tab - widget to search an id for        
 
50
 */
 
51
tab_id tabs_get_tab_id(GtkWidget* tab)
 
52
{
 
53
        tab_id id = TID_TARGET;
 
54
        if (tab_target == tab)
 
55
        {
 
56
                id = TID_TARGET;
 
57
        }
 
58
        else if (tab_breaks == tab)
 
59
        {
 
60
                id = TID_BREAKS;
 
61
        }
 
62
        else if (tab_watch == tab)
 
63
        {
 
64
                id = TID_WATCH;
 
65
        }
 
66
        else if (tab_autos == tab)
 
67
        {
 
68
                id = TID_AUTOS;
 
69
        }
 
70
        else if (tab_call_stack == tab)
 
71
        {
 
72
                id = TID_STACK;
 
73
        }
 
74
        else if (tab_terminal == tab)
 
75
        {
 
76
                id = TID_TERMINAL;
 
77
        }
 
78
        else if (tab_messages == tab)
 
79
        {
 
80
                id = TID_MESSAGES;
 
81
        }
 
82
 
 
83
        return id;
 
84
}
 
85
 
 
86
/*
 
87
 *      searches a widget for a given ID
 
88
 *      arguments:
 
89
 *              id - ID to search a widget for  
 
90
 */
 
91
GtkWidget* tabs_get_tab(tab_id id)
 
92
{
 
93
        GtkWidget *tab = NULL;
 
94
        switch(id)
 
95
        {
 
96
                case TID_TARGET:
 
97
                        tab = tab_target;
 
98
                        break;
 
99
                case TID_BREAKS:
 
100
                        tab = tab_breaks;
 
101
                        break;
 
102
                case TID_WATCH:
 
103
                        tab = tab_watch;
 
104
                        break;
 
105
                case TID_AUTOS:
 
106
                        tab = tab_autos;
 
107
                        break;
 
108
                case TID_STACK:
 
109
                        tab = tab_call_stack;
 
110
                        break;
 
111
                case TID_TERMINAL:
 
112
                        tab = tab_terminal;
 
113
                        break;
 
114
                case TID_MESSAGES:
 
115
                        tab = tab_messages;
 
116
                        break;
 
117
        }
 
118
        return tab;
 
119
}
 
120
 
 
121
/*
 
122
 *      searches a label for a given ID
 
123
 *      arguments:
 
124
 *              id - ID to search a label for   
 
125
 */
 
126
const gchar* tabs_get_label(tab_id id)
 
127
{
 
128
        const gchar *label = NULL;
 
129
        switch(id)
 
130
        {
 
131
                case TID_TARGET:
 
132
                        label = _("Target");
 
133
                        break;
 
134
                case TID_BREAKS:
 
135
                        label = _("Breakpoints");
 
136
                        break;
 
137
                case TID_WATCH:
 
138
                        label = _("Watch");
 
139
                        break;
 
140
                case TID_AUTOS:
 
141
                        label = _("Autos");
 
142
                        break;
 
143
                case TID_STACK:
 
144
                        label = _("Call Stack");
 
145
                        break;
 
146
                case TID_TERMINAL:
 
147
                        label = _("Debug Terminal");
 
148
                        break;
 
149
                case TID_MESSAGES:
 
150
                        label = _("Debugger Messages");
 
151
                        break;
 
152
        }
 
153
        return label;
 
154
}