atomes 1.2.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
m_back.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2025 by CNRS and University of Strasbourg */
15
22/*
23* This file: 'm_back.c'
24*
25* Contains:
26*
27
28 - The function to create the background color menu item
29
30*
31* List of functions:
32
33 GtkWidget * menu_back (glwin * view);
34
35 GMenu * menu_back (glwin * view, int popm);
36
37*/
38
39#include "global.h"
40#include "color_box.h"
41#include "glwindow.h"
42
43extern G_MODULE_EXPORT void gradient_advanced (GtkWidget * widg, gpointer data);
44
45#ifdef GTK4
55G_MODULE_EXPORT void to_gradient_advanced (GSimpleAction * action, GVariant * parameter, gpointer data)
56{
57 gradient_advanced (NULL, data);
58}
59#endif
60
61#ifdef GTK3
69GtkWidget * menu_back (glwin * view)
70{
71 GtkWidget * menub = gtk_menu_new ();
72 GtkWidget * bc = create_menu_item (FALSE, "Color");
73 gtk_menu_shell_append ((GtkMenuShell *)menub, bc);
74 gtk_menu_item_set_submenu ((GtkMenuItem *)bc, color_box(view, -2, 0, 0));
75 GtkWidget * gc = create_menu_item (FALSE, "Gradient color");
76 g_signal_connect (G_OBJECT (gc), "activate", G_CALLBACK(gradient_advanced), view);
77 gtk_menu_shell_append ((GtkMenuShell *)menub, gc);
78 return menub;
79}
80#else
89GMenu * menu_back (glwin * view, int popm)
90{
91 GMenu * menu = g_menu_new ();
92 append_opengl_item (view, menu, "back-color", "back-color", popm, popm, NULL, IMG_NONE, NULL, TRUE, NULL, NULL, FALSE, FALSE, FALSE, FALSE);
93 append_opengl_item (view, menu, "More colors ...", "back-color", popm, popm, NULL, IMG_NONE, NULL, FALSE, G_CALLBACK(to_run_back_color_window), view, FALSE, FALSE, FALSE, TRUE);
94 append_opengl_item (view, menu, "Gradient colors", "back-gradient", popm, popm, NULL, IMG_NONE, NULL, FALSE, G_CALLBACK(to_gradient_advanced), view, FALSE, FALSE, FALSE, TRUE);
95 return menu;
96}
97#endif
GtkWidget * color_box(glwin *view, int ideo, int spec, int geo)
create the color palette pointers and menus GTK3 version
Definition color_box.c:259
Structure definitions for color management Function declarations for color management.
G_MODULE_EXPORT void to_run_back_color_window(GtkWidget *widg, gpointer data)
to run background color selection window callback GTK3
Definition w_colors.c:223
Global variable declarations Global convenience function declarations Global data structure defin...
@ IMG_NONE
Definition global.h:262
GtkWidget * create_menu_item(gboolean add_mnemo, gchar *action)
action
Definition glview.h:198
Function declarations for the creation of the OpenGL window.
void append_opengl_item(glwin *view, GMenu *menu, const gchar *name, gchar *key, int mpop, int item_id, gchar *accel, int image_format, gpointer icon, gboolean custom, GCallback handler, gpointer data, gboolean check, gboolean status, gboolean radio, gboolean sensitive)
G_MODULE_EXPORT void gradient_advanced(GtkWidget *widg, gpointer data)
Background configuration window.
Definition w_colors.c:434
GMenu * menu_back(glwin *view, int popm)
create the background color menu item GTK4
Definition m_back.c:89
Definition glwin.h:965