Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/gtk3' into gtk3
Browse files Browse the repository at this point in the history
  • Loading branch information
pemsley committed Feb 5, 2022
2 parents 7ca58cc + 18202fe commit 050e7dd
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 42 deletions.
5 changes: 2 additions & 3 deletions geometry/dict-utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,6 @@ coot::dictionary_residue_restraints_t::make_graph(bool use_hydrogens) const {
// This contains the atom indices of of atom_info (0-indexed). An
// mmdb graph is 1-indexed.
//
int vertex_indexing[atom_info.size()];

mmdb::math::Graph *graph = new mmdb::math::Graph;
int i_atom = 0;
Expand All @@ -981,11 +980,11 @@ coot::dictionary_residue_restraints_t::make_graph(bool use_hydrogens) const {

if (it_1 == name_map.end()) {
if (use_hydrogens || !is_hydrogen(br.atom_id_1_4c()))
std::cout << "Not found in name map atom 1 :" << br.atom_id_1() << ":" << std::endl;
std::cout << "WARNING:: Not found in name map atom 1 :" << br.atom_id_1() << ":" << std::endl;
} else {
if (it_2 == name_map.end()) {
if (use_hydrogens || !is_hydrogen(br.atom_id_2_4c()))
std::cout << "Not found in name map atom 2 :" << br.atom_id_2() << ":" << std::endl;
std::cout << "WARNING:: Not found in name map atom 2 :" << br.atom_id_2() << ":" << std::endl;
} else {

if (use_hydrogens || (!is_hydrogen(br.atom_id_1_4c()) &&
Expand Down
2 changes: 1 addition & 1 deletion python/coot_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5795,7 +5795,7 @@ def pukka_puckers_qm(imol):
import types

residue_list = []
crit_d = 3.0 # Richardson's grup value to partition C2'-endo from C3'-endo
crit_d = 3.0 # Richardson's group value to partition C2'-endo from C3'-endo

def add_questionable(r):
residue_list.append(r)
Expand Down
2 changes: 0 additions & 2 deletions src/c-interface-gui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3222,7 +3222,6 @@ GtkWidget *wrapped_create_model_fit_refine_dialog() {
void
update_model_fit_refine_dialog_menu(GtkWidget *dialog) {

#if (GTK_MAJOR_VERSION > 1)
GtkWidget *menu_item;
// update the menu for the rot/trans menu
if (graphics_info_t::rot_trans_object_type == ROT_TRANS_TYPE_CHAIN) {
Expand All @@ -3237,7 +3236,6 @@ update_model_fit_refine_dialog_menu(GtkWidget *dialog) {
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_item), TRUE);
}
}
#endif
}

// function to update button labels (currently rot/trans only)
Expand Down
6 changes: 0 additions & 6 deletions src/c-interface-pisa-gui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
void
coot::pisa_interfaces_gui(const std::vector<coot::pisa_interface_t> &gui_info) {

#if (GTK_MAJOR_VERSION > 1)
if (graphics_info_t::use_graphics_interface_flag) {
GtkWidget *w = create_pisa_interfaces_dialog();
gtk_widget_show(w);
Expand Down Expand Up @@ -95,10 +94,8 @@ coot::pisa_interfaces_gui(const std::vector<coot::pisa_interface_t> &gui_info) {
gui_info_copy);
}

#endif
}

#if (GTK_MAJOR_VERSION > 1)
void
coot::add_pisa_interfaces_cell_renderer(GtkTreeView *tree_view,
const std::string &column_title,
Expand All @@ -114,11 +111,9 @@ coot::add_pisa_interfaces_cell_renderer(GtkTreeView *tree_view,
gtk_tree_view_column_set_sort_column_id(column, pos);
g_object_set_data (G_OBJECT (cell_renderer), "column", GINT_TO_POINTER (pos));
}
#endif



#if (GTK_MAJOR_VERSION > 1)
void
coot::on_pisa_interfaces_seletion_changed(GtkTreeSelection *treeselection,
gpointer user_data) {
Expand Down Expand Up @@ -167,4 +162,3 @@ coot::on_pisa_interfaces_seletion_changed(GtkTreeSelection *treeselection,

}
}
#endif
4 changes: 0 additions & 4 deletions src/graphics-info-defines.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,7 @@ graphics_info_t::model_fit_refine_button_name_list() {
std::vector<std::string> names;
names.push_back("model_refine_dialog_refine_params_button");
names.push_back("model_refine_dialog_map_select_button");
#if (GTK_MAJOR_VERSION >1)
names.push_back("model_refine_dialog_fixed_atoms_button");
#else
names.push_back("model_refine_dialog_fix_atoms_button");
#endif
// names.push_back("model_refine_dialog_find_waters_button");
names.push_back("model_refine_dialog_add_alt_conf_button");
names.push_back("model_refine_dialog_pointer_atom_button");
Expand Down
8 changes: 7 additions & 1 deletion src/graphics-info-draw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3728,6 +3728,10 @@ void
graphics_info_t::reset_frame_buffers(int width, int height) {

if (use_framebuffers) {


// 20220108-PE note to self. Try using the framebuffer::reset() function instead

unsigned int sf = framebuffer_scale;
unsigned int index_offset = 0;

Expand Down Expand Up @@ -5005,6 +5009,7 @@ graphics_info_t::fullscreen() {
//static
void
graphics_info_t::unfullscreen() {

GtkWidget *window = widget_from_builder("main_window");
if (GTK_IS_WINDOW(window)) {
gtk_window_unfullscreen(GTK_WINDOW(window));
Expand All @@ -5016,7 +5021,8 @@ graphics_info_t::unfullscreen() {
GtkWidget *status_bar = widget_from_builder("main_window_statusbar");
GtkWidget *tool_bar = widget_from_builder("main_window_toolbar");
GtkWidget *menu_bar = widget_from_builder("main_window_menubar");
#if 0

#if (GTK_MAJOR_VERSION > 3)
gtk_overlay_remove_overlay(GTK_OVERLAY(overlay), tool_bar);
gtk_container_add(GTK_CONTAINER(vbox), tool_bar);

Expand Down
6 changes: 0 additions & 6 deletions src/graphics-info-refmac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1116,14 +1116,8 @@ graphics_info_t::update_refmac_column_labels_frame(GtkWidget *map_optionmenu,
// if given mtz file: get the parameters from coot::refmac::saved_refmac_parameters
std::string file_mtz_filename;
GtkWidget *twin_mtz_label = lookup_widget(map_optionmenu, "run_refmac_mtz_file_label");
#if (GTK_MAJOR_VERSION > 1)
const gchar *mtz_filename = gtk_label_get_text(GTK_LABEL(twin_mtz_label));
file_mtz_filename = mtz_filename;
#else
gchar **mtz_filename = 0;
gtk_label_get(GTK_LABEL(twin_mtz_label), mtz_filename);
file_mtz_filename = (char *)mtz_filename;
#endif // GTK
std::string tmp_mtz;
for (int i=0; i<n_molecules(); i++) {
if (molecules[i].Refmac_file_mtz_filename().size() > 0) {
Expand Down
6 changes: 2 additions & 4 deletions src/lbg-interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
#endif

#include "compat/coot-sysdep.h"
#define ENABLE_NLS // 20220126-PE Charles says this is needed to fix dcgettext() problems
// when including libintl.h - move it up above graphics-info.h
#include "graphics-info.h"


#include <cstring>
#define ENABLE_NLS // fix dcgettext() header problems on including
// libintl.h (via RDKitBase.h etc (including boost
// stuff).

#ifdef MAKE_ENHANCED_LIGAND_TOOLS
#include "lidia-core/rdkit-interface.hh"
Expand Down
2 changes: 2 additions & 0 deletions src/model-as-mesh.shader
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#version 330 core

// this is for an instanced Mesh.

layout(location = 0) in vec3 position;
layout(location = 1) in vec3 normal;
layout(location = 2) in vec4 colour; // instanced. For instanced objects, the colour is set
Expand Down
8 changes: 4 additions & 4 deletions src/molecular-mesh-generator-mol-tris.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ molecular_mesh_generator_t::get_molecular_triangles_mesh(mmdb::Manager *mol,

if (colour_scheme == "colorRampChainsScheme" || colour_scheme == "Ramp") {

std::cout << "here with colorRampChainsScheme" << std::endl;
std::cout << "debug:: in get_molecular_triangles_mesh() with colorRampChainsScheme" << std::endl;
for(int imod = 1; imod<=mol->GetNumberOfModels(); imod++) {
mmdb::Model *model_inner_p = mol->GetModel(imod);
if (model_p) {
Expand Down Expand Up @@ -244,7 +244,7 @@ molecular_mesh_generator_t::get_molecular_triangles_mesh(mmdb::Manager *mol,
r->redraw();
std::vector<std::shared_ptr<DisplayPrimitive> > vdp = r->getDisplayPrimitives();
auto displayPrimitiveIter = vdp.begin();
int i=0;
// int i=0;
std::vector<s_generic_vertex> vertices;
std::vector<g_triangle> triangles;

Expand All @@ -270,7 +270,7 @@ molecular_mesh_generator_t::get_molecular_triangles_mesh(mmdb::Manager *mol,
#endif

unsigned int idx = 0;
for (displayPrimitiveIter=vdp.begin(); displayPrimitiveIter != vdp.end(); displayPrimitiveIter++, idx++) {
for (displayPrimitiveIter=vdp.begin(); displayPrimitiveIter != vdp.end(); displayPrimitiveIter++, ++idx) {

molecular_triangles_mesh_t current_primitives;

Expand Down Expand Up @@ -300,7 +300,7 @@ molecular_mesh_generator_t::get_molecular_triangles_mesh(mmdb::Manager *mol,
// BoxSectionPrimitive have not had their colours scaled for some reason.
if (displayPrimitive.type() == DisplayPrimitive::PrimitiveType::BoxSectionPrimitive) {
// std::cout << "vertex iVertex " << iVertex << " " << glm::to_string(gv.color) << std::endl;
for (int i=0; i<3; i++) gv.color[i] /= 255.0;
for (int ii=0; ii<3; ii++) gv.color[ii] /= 255.0;
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/molecule-class-info.h
Original file line number Diff line number Diff line change
Expand Up @@ -3425,9 +3425,7 @@ class molecule_class_info_t {


#ifdef USE_MOLECULES_TO_TRIANGLES
#ifdef HAVE_CXX11
std::vector<std::shared_ptr<MolecularRepresentationInstance> > molrepinsts;
#endif
#endif // USE_MOLECULES_TO_TRIANGLES

// return the index in the molrepinsts vector (can be negative for failure)
Expand Down
1 change: 1 addition & 0 deletions src/moleculestotriangles.shader
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void main() {
specular_strength = 0.0;
dp = clamp(dp, 0.1, 1.0); // no negative dot products for diffuse

// why don't I use the light source?
vec4 lsa = vec4(0.4, 0.4, 0.4, 1.0);
vec4 lsd = vec4(0.6, 0.6, 0.6, 1.0);
vec4 ambient = colour_transfer * lsa * 0.1;
Expand Down
7 changes: 2 additions & 5 deletions src/restraints-editor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
#include <string.h> // strcpy
#include <gtk/gtk.h>

#if (GTK_MAJOR_VERSION > 1)

#include "interface.h"
#include "support.h"

Expand Down Expand Up @@ -228,8 +226,8 @@ coot::restraints_editor::get_column_type(int tree_type, int column_number, int m
break;
default:
r = G_TYPE_STRING;
}
}
}
}
if (tree_type == coot::restraints_editor::TREE_TYPE_CHIRALS) {
switch(column_number) {
case(5):
Expand Down Expand Up @@ -1470,4 +1468,3 @@ coot::restraints_editor::get_tree_view_by_notebook_page(gint current_page_index)
return tree_view;
}

#endif // (GTK_MAJOR_VERSION > 1)
6 changes: 2 additions & 4 deletions src/sdf-interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

// We need this high so that dcgettext() so we don't get expected unqualified-id before 'const'
// errors when we read libintl from rdkit-interface.hh
#define ENABLE_NLS // 20220126-PE Charles says this is needed to fix dcgettext() problems
// when including libintl.h - hmm!
#include "graphics-info.h"
#ifdef MAKE_ENHANCED_LIGAND_TOOLS
#include <libintl.h>
Expand All @@ -34,10 +36,6 @@

#include <cstring>

#define ENABLE_NLS // fix dcgettext() header problems on including
// libintl.h (via RDKitBase.h etc (including boost
// stuff).

#include <iostream> // for istream?
#include <istream> // for istream?

Expand Down

0 comments on commit 050e7dd

Please sign in to comment.